From 709bbf9a5417bae6ddb83b7ffe11295f5364ac06 Mon Sep 17 00:00:00 2001 From: KeybadeBlox Date: Fri, 20 Mar 2026 23:26:20 -0400 Subject: [PATCH] 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. --- ghidra/ghidra_scripts/MSVC7Mangle.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ghidra/ghidra_scripts/MSVC7Mangle.java b/ghidra/ghidra_scripts/MSVC7Mangle.java index ca55321..317aba1 100644 --- a/ghidra/ghidra_scripts/MSVC7Mangle.java +++ b/ghidra/ghidra_scripts/MSVC7Mangle.java @@ -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 }; }