Tiny steps towards implementing C runtime

This commit is contained in:
KeybadeBlox 2026-02-14 12:34:28 -05:00
parent ccd2cd37a5
commit c38d9b5628
6 changed files with 65 additions and 14 deletions

View file

@ -140,11 +140,15 @@ public class MSVC7Mangle extends GhidraScript{
/* Generate a mangled name for a function */
final String nameRaw = f.getName(true);
// Special case for main()
if (nameRaw.equals("main")) return "_main";
// Internal symbols like intrinsics aren't mangled
if (nameRaw.startsWith("_")) return nameRaw;
// Special symbols like intrinsics aren't mangled
if (nameRaw.startsWith("__")) return nameRaw;
// Other special cases
switch (nameRaw) {
case "atexit": return "_atexit";
case "main" : return "_main" ;
default : {}
}
final ArrayList<String> dict = new ArrayList<>();