Last active
January 9, 2018 01:19
-
-
Save jackoalan/9a3e7e0c71f531686900 to your computer and use it in GitHub Desktop.
Generates a dolphin-emu compatible .map file from an IDA database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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