IDA: Fix idc.SetType elides leading underscores from parameter names (#78)

This commit is contained in:
lifeengines
2020-09-24 18:19:07 +08:00
committed by Katy Coe
parent 85ab34f569
commit a8c518b4c0

View File

@@ -29,6 +29,12 @@ def SetFunctionType(addr, sig):
SetType(addr, sig)
def SetType(addr, cppType):
if not cppType.endswith(';'):
cppType += ';'
tinfo = idc.parse_decl(cppType,idaapi.PT_RAWARGS)
if not(tinfo is None):
ret = idc.apply_type(addr,tinfo)
if ret is None:
ret = idc.SetType(addr, cppType)
if ret is None:
print('SetType(0x%x, %r) failed!' % (addr, cppType))