Default to __cdecl for name mangling

It's definitely ideal for everything to be declared explicitly, but it
would require either manual intervention or a new dedicated script to do
this for typedefs (that aren't methods), so we'll do this as the least
worst option.
This commit is contained in:
KeybadeBlox 2026-03-20 23:26:20 -04:00
parent a2b777d666
commit 709bbf9a54

View file

@ -168,10 +168,7 @@ public class MSVC7Mangle extends GhidraScript {
f.getName() +
"(): __thiscall not allowed for C symbols"
);
default -> throw new Exception(
f.getName() +
"(): Need to specify calling convention"
);
default -> "_" + f.getName(false); // Default to __cdecl
};
}
@ -400,10 +397,7 @@ public class MSVC7Mangle extends GhidraScript {
case "__thiscall" -> "E";
case "__fastcall" -> "I";
case "__stdcall" -> "G";
default -> throw new Exception(
f.getName() +
"(): Need to specify calling convention"
);
default -> "A"; // Default to __cdecl
};
}