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).
This commit is contained in:
KeybadeBlox 2026-03-20 23:25:19 -04:00
parent ac40f3e8cf
commit a2b777d666

View file

@ -178,6 +178,10 @@ public class EnhancedImport extends GhidraScript {
final Function f = Optional.ofNullable(getFunctionAt(addr)) final Function f = Optional.ofNullable(getFunctionAt(addr))
.orElse(createFunction(addr, parts[6])); .orElse(createFunction(addr, parts[6]));
// Thunks trip up the delinker extension by making it see
// duplicate symbol names
f.setThunkedFunction(null);
f.setReturnType( f.setReturnType(
makeType(parts[2], unknownTypes).orElse(Undefined4DataType.dataType), makeType(parts[2], unknownTypes).orElse(Undefined4DataType.dataType),
SourceType.USER_DEFINED SourceType.USER_DEFINED