Skip to content

Instantly share code, notes, and snippets.

@st4rk
Created October 27, 2016 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st4rk/6b9ea0e56485952ffb9ff537984e65d0 to your computer and use it in GitHub Desktop.
Save st4rk/6b9ea0e56485952ffb9ff537984e65d0 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
struct RE1_ROOM_ENTRY {
signed short enable;
signed short x;
signed short z;
char name[18];
};
int main(int argc, char **argv) {
FILE *elf = fopen ("SLPS_002.22", "rb");
unsigned char *file = NULL;
unsigned int fileSize = 0;
if (elf == NULL) {
std::cout << "file not found" << std::endl;
return 0;
}
fseek(elf, 0, SEEK_END);
fileSize = ftell(elf);
rewind(elf);
file = new unsigned char[fileSize];
fread(file, fileSize, 1, elf);
/* DUMP STAGE 1 */
RE1_ROOM_ENTRY node;
for (unsigned int i = 0; i <= 0x1C; i++) {
node = *(RE1_ROOM_ENTRY*)(file + 0x7F74C + i * sizeof(RE1_ROOM_ENTRY));
std::cout << "{" << node.x << ".0f, " << node.z << ".0f, \"" << node.name << "\"}," << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment