From 930202dfdd2c2fe5463720b28145c45b544b74a1 Mon Sep 17 00:00:00 2001 From: Robert Xiao Date: Mon, 20 Apr 2020 19:31:04 -0700 Subject: [PATCH] Handle idc.SetType return value correctly. Apparently, idc.SetType returns True if the type is set for the first time, False if the type is updated, and None if the type couldn't be set (rather differently from what the documentation says). --- Il2CppInspector.Common/Outputs/IDAPythonScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Outputs/IDAPythonScript.cs b/Il2CppInspector.Common/Outputs/IDAPythonScript.cs index dd420fb..bacf783 100644 --- a/Il2CppInspector.Common/Outputs/IDAPythonScript.cs +++ b/Il2CppInspector.Common/Outputs/IDAPythonScript.cs @@ -65,7 +65,7 @@ def MakeFunction(start): def SetType(addr, type): ret = idc.SetType(addr, type) - if ret == 0: + if ret is None: print('SetType(0x%x, %r) failed!' % (addr, type)) ");