Skip to content

Instantly share code, notes, and snippets.

@st4rk
Created Oct 27, 2016
Embed
What would you like to do?
#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