From a2b777d66649c8acae6d290a90fdff2a3e328330 Mon Sep 17 00:00:00 2001 From: KeybadeBlox Date: Fri, 20 Mar 2026 23:25:19 -0400 Subject: [PATCH] Disable function thunking when importing Thunked functions can confuse the delinker extension into thinking that multiple symbols have the same name and lead to delinking failures (with no diagnostic, conveniently). --- ghidra/ghidra_scripts/EnhancedImport.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghidra/ghidra_scripts/EnhancedImport.java b/ghidra/ghidra_scripts/EnhancedImport.java index a12c5ef..f7713d2 100644 --- a/ghidra/ghidra_scripts/EnhancedImport.java +++ b/ghidra/ghidra_scripts/EnhancedImport.java @@ -178,6 +178,10 @@ public class EnhancedImport extends GhidraScript { final Function f = Optional.ofNullable(getFunctionAt(addr)) .orElse(createFunction(addr, parts[6])); + // Thunks trip up the delinker extension by making it see + // duplicate symbol names + f.setThunkedFunction(null); + f.setReturnType( makeType(parts[2], unknownTypes).orElse(Undefined4DataType.dataType), SourceType.USER_DEFINED