修复几个错误

This commit is contained in:
Perfare 2018-08-30 03:45:14 +08:00
parent 708c56acf0
commit eecc5b931c
3 changed files with 9 additions and 6 deletions

View file

@ -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

View file

@ -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 [字符串的其余部分被截断]"; 的本地化字符串。
/// </summary>
internal static string ida {
get {

View file

@ -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: