GP-4482 Golang 1.16 + 1.15

This commit is contained in:
dev747368 2023-08-30 15:44:37 +00:00
parent db608a1a13
commit 560d5691a7
32 changed files with 851 additions and 374 deletions

View file

@ -18,11 +18,10 @@
// specified for the arch.
//@category Functions
//@menupath Tools.Fix Golang Function Param Storage
import java.util.List;
import ghidra.app.script.GhidraScript;
import ghidra.app.util.bin.format.golang.GoFunctionFixup;
import ghidra.app.util.bin.format.golang.GoVer;
import ghidra.app.util.bin.format.golang.rtti.GoRttiMapper;
import ghidra.program.model.listing.Function;
public class FixupGolangFuncParamStorageScript extends GhidraScript {
@ -34,10 +33,9 @@ public class FixupGolangFuncParamStorageScript extends GhidraScript {
return;
}
GoVer goVersion = GoVer.fromProgramProperties(currentProgram);
if ( goVersion == GoVer.UNKNOWN ) {
List<GoVer> versions = List.of(GoVer.values());
goVersion =
askChoice("Golang Version", "What is the golang version?", versions, GoVer.UNKNOWN);
if (goVersion == GoVer.INVALID) {
goVersion = askChoice("Golang Version", "What is the golang version?",
GoRttiMapper.getAllSupportedVersions(), GoVer.INVALID);
}
println("Fixing param storage for function %s@%s".formatted(func.getName(),
func.getEntryPoint()));