Skip to content

Instantly share code, notes, and snippets.

@jackoalan
Last active January 9, 2018 01:19
Show Gist options
  • Save jackoalan/9a3e7e0c71f531686900 to your computer and use it in GitHub Desktop.
Save jackoalan/9a3e7e0c71f531686900 to your computer and use it in GitHub Desktop.
Generates a dolphin-emu compatible .map file from an IDA database
auto address = NextFunction(0);
auto filestr = AskFile(1, "*.map", "Dolphin MAP output file");
auto file = fopen(filestr, "w");
fprintf(file, ".text\n");
while (address != -1) {
auto name = GetFunctionName(address);
auto demangle_name = Demangle(name, GetLongPrm(INF_LONG_DN));
if (strlen(demangle_name) > 1)
name = demangle_name;
if (strlen(name) > 1) {
fprintf(file, "%08X %08X %08X %d %s\n",
address, GetFunctionAttr(address, FUNCATTR_END) - address,
address, 0, name);
}
address = NextFunction(address);
}
fclose(file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment