diff --git a/Il2CppDumper/Program.cs b/Il2CppDumper/Program.cs index 5567084..3bf2cdc 100644 --- a/Il2CppDumper/Program.cs +++ b/Il2CppDumper/Program.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Windows.Forms; using System.Web.Script.Serialization; using static Il2CppDumper.DefineConstants; @@ -404,7 +405,7 @@ namespace Il2CppDumper { writer.Write("); // 0x{0:X}\n", methodPointer); //Script - method - var name = ToEscapedString(typeName + "$$" + methodName); + var name = ToEscapedString(Regex.Replace(typeName, @"`\d", "") + "$$" + methodName); scriptwriter.WriteLine($"SetMethod(0x{methodPointer:X}, '{name}')"); } else diff --git a/Il2CppDumper/Resource1.Designer.cs b/Il2CppDumper/Resource1.Designer.cs index 6731fce..47044b9 100644 --- a/Il2CppDumper/Resource1.Designer.cs +++ b/Il2CppDumper/Resource1.Designer.cs @@ -75,12 +75,13 @@ namespace Il2CppDumper { ///def SetMethod(addr, name): /// i = 0 /// ret = idc.MakeNameEx(addr, name, SN_NOWARN) - /// new_name = name + '_' + str(addr) - /// ret = idc.MakeNameEx(addr, str(new_name), SN_NOWARN) + /// if ret == 0: + /// new_name = name + '_' + str(addr) + /// ret = idc.MakeNameEx(addr, str(new_name), SN_NOWARN) /// ///def MakeFunction(start, end): /// if GetFunctionAttr(start, FUNCATTR_START) == 0xFFFFFFFF: - /// idc.MakeFunction(start, [字符串的其余部分被截断]"; 的本地化字符串。 + /// idc.Mak [字符串的其余部分被截断]"; 的本地化字符串。 /// internal static string ida { get { diff --git a/Il2CppDumper/Resource1.resx b/Il2CppDumper/Resource1.resx index 94c744b..e3f389d 100644 --- a/Il2CppDumper/Resource1.resx +++ b/Il2CppDumper/Resource1.resx @@ -132,8 +132,9 @@ def SetString(addr, comm): def SetMethod(addr, name): i = 0 ret = idc.MakeNameEx(addr, name, SN_NOWARN) - new_name = name + '_' + str(addr) - ret = idc.MakeNameEx(addr, str(new_name), SN_NOWARN) + if ret == 0: + new_name = name + '_' + str(addr) + ret = idc.MakeNameEx(addr, str(new_name), SN_NOWARN) def MakeFunction(start, end): if GetFunctionAttr(start, FUNCATTR_START) == 0xFFFFFFFF: