Class GoFunctionFixup
java.lang.Object
ghidra.app.util.bin.format.golang.GoFunctionFixup
Utility class to fix Golang function parameter storage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfixupFunction(Function func) Assigns custom storage for a function's parameters, using the function's current parameter list (formal info only) as starting information.static voidfixupFunction(Function func, GoVer goVersion) static booleanisGolangAbi0Func(Function func) static booleanisInLocalVarStorageArea(Function func, long stackOffset) static DataTypeReturns a Ghidra data type that represents a zero-length array, to be used as a replacement for a zero-length array parameter.static voidreverseNonStackStorageLocations(List<Varnode> varnodes) Invert the order of the any register storage locations to match the decompiler's logic for assigning storage to structs that varies on endianness.
-
Constructor Details
-
GoFunctionFixup
public GoFunctionFixup()
-
-
Method Details
-
fixupFunction
public static void fixupFunction(Function func) throws DuplicateNameException, InvalidInputException Assigns custom storage for a function's parameters, using the function's current parameter list (formal info only) as starting information.- Parameters:
func-- Throws:
DuplicateNameExceptionInvalidInputException
-
fixupFunction
public static void fixupFunction(Function func, GoVer goVersion) throws DuplicateNameException, InvalidInputException -
makeEmptyArrayDataType
Returns a Ghidra data type that represents a zero-length array, to be used as a replacement for a zero-length array parameter.- Parameters:
dt-- Returns:
-
isGolangAbi0Func
-
isInLocalVarStorageArea
-
reverseNonStackStorageLocations
Invert the order of the any register storage locations to match the decompiler's logic for assigning storage to structs that varies on endianness.Only valid for storage scheme that has all register storages listed first / contiguous.
- Parameters:
varnodes-
-