# -*- coding: utf-8 -*-
import json
from ghidra.app.util.cparser.C import CParserUtils
from ghidra.app.cmd.function import ApplyFunctionSignatureCmd
processFields = [
"ScriptMethod",
"ScriptString",
"ScriptMetadata",
"ScriptMetadataMethod",
"Addresses",
]
functionManager = currentProgram.getFunctionManager()
baseAddress = currentProgram.getImageBase()
USER_DEFINED = ghidra.program.model.symbol.SourceType.USER_DEFINED
def get_addr(addr):
return baseAddress.add(addr)
def set_name(addr, name):
name = name.replace(' ', '-')
createLabel(addr, name, True, USER_DEFINED)
def set_type(addr, type):
# Requires types (il2cpp.h) to be imported first
newType = type.replace("*"," *").replace(" "," ").strip()
dataTypes = getDataTypes(newType)
addrType = None
if len(dataTypes) == 0:
if newType == newType[:-2] + " *":
baseType = newType[:-2]
dataTypes = getDataTypes(baseType)
if len(dataTypes) == 1:
dtm = currentProgram.getDataTypeManager()
pointerType = dtm.getPointer(dataTypes[0])
addrType = dtm.addDataType(pointerType, None)
elif len(dataTypes) > 1:
print("Conflicting data types found for type " + type + "(parsed as '" + newType + "')")
return
else:
addrType = dataTypes[0]
if addrType is None:
print("Could not identify type " + type + "(parsed as '" + newType + "')")
else:
createData(addr, addrType)
def make_function(start):
func = getFunctionAt(start)
if func is None:
createFunction(start, None)
def set_sig(addr, name, sig):
try:
typeSig = CParserUtils.parseSignature(None, currentProgram, sig, False)
except ghidra.app.util.cparser.C.ParseException:
print("Warning: Unable to parse")
print(sig)
print("Attempting to modify...")
# try to fix by renaming the parameters
try:
newSig = sig.replace(", ","ext, ").replace("\)","ext\)")
typeSig = CParserUtils.parseSignature(None, currentProgram, newSig, False)
except:
print("Warning: also unable to parse")
print(newSig)
print("Skipping.")
return
if typeSig is not None:
typeSig.setName(name)
ApplyFunctionSignatureCmd(addr, typeSig, USER_DEFINED, False, True).applyTo(currentProgram)
f = askFile("script.json from Il2cppdumper", "Open")
data = json.loads(open(f.absolutePath, 'rb').read().decode('utf-8'))
if "ScriptMethod" in data and "ScriptMethod" in processFields:
scriptMethods = data["ScriptMethod"]
monitor.initialize(len(scriptMethods))
monitor.setMessage("Methods")
for scriptMethod in scriptMethods:
addr = get_addr(scriptMethod["Address"])
name = scriptMethod["Name"].encode("utf-8")
set_name(addr, name)
monitor.incrementProgress(1)
if "ScriptString" in data and "ScriptString" in processFields:
index = 1
scriptStrings = data["ScriptString"]
monitor.initialize(len(scriptStrings))
monitor.setMessage("Strings")
for scriptString in scriptStrings:
addr = get_addr(scriptString["Address"])
value = scriptString["Value"].encode("utf-8")
name = "StringLiteral_" + str(index)
createLabel(addr, name, True, USER_DEFINED)
setEOLComment(addr, value)
index += 1
monitor.incrementProgress(1)
if "ScriptMetadata" in data and "ScriptMetadata" in processFields:
scriptMetadatas = data["ScriptMetadata"]
monitor.initialize(len(scriptMetadatas))
monitor.setMessage("Metadata")
for scriptMetadata in scriptMetadatas:
addr = get_addr(scriptMetadata["Address"])
name = scriptMetadata["Name"].encode("utf-8")
set_name(addr, name)
setEOLComment(addr, name)
monitor.incrementProgress(1)
if scriptMetadata["Signature"]:
set_type(addr, scriptMetadata["Signature"].encode("utf-8"))
if "ScriptMetadataMethod" in data and "ScriptMetadataMethod" in processFields:
scriptMetadataMethods = data["ScriptMetadataMethod"]
monitor.initialize(len(scriptMetadataMethods))
monitor.setMessage("Metadata Methods")
for scriptMetadataMethod in scriptMetadataMethods:
addr = get_addr(scriptMetadataMethod["Address"])
name = scriptMetadataMethod["Name"].encode("utf-8")
methodAddr = get_addr(scriptMetadataMethod["MethodAddress"])
set_name(addr, name)
setEOLComment(addr, name)
monitor.incrementProgress(1)
if "Addresses" in data and "Addresses" in processFields:
addresses = data["Addresses"]
monitor.initialize(len(addresses))
monitor.setMessage("Addresses")
for index in range(len(addresses) - 1):
start = get_addr(addresses[index])
make_function(start)
monitor.incrementProgress(1)
if "ScriptMethod" in data and "ScriptMethod" in processFields:
scriptMethods = data["ScriptMethod"]
for scriptMethod in scriptMethods:
addr = get_addr(scriptMethod["Address"])
sig = scriptMethod["Signature"][:-1].encode("utf-8")
name = scriptMethod["Name"].encode("utf-8")
set_sig(addr, name, sig)
print 'Script finished!'
没有合适的资源?快使用搜索试试~ 我知道了~
il2cpp一键dump-Mac
共204个文件
dll:171个
dylib:14个
a:6个
3星 · 超过75%的资源 8 下载量 58 浏览量
2022-11-21
15:20:19
上传
评论
收藏 29.91MB ZIP 举报
温馨提示
il2cpp一键dump-Mac
资源推荐
资源详情
资源评论
收起资源包目录
il2cpp一键dump-Mac (204个子文件)
System.IO.Compression.Native.a 2.78MB
System.Security.Cryptography.Native.OpenSsl.a 547KB
System.Native.a 346KB
System.Security.Cryptography.Native.Apple.a 311KB
System.Net.Http.Native.a 61KB
System.Net.Security.Native.a 27KB
System.Private.CoreLib.dll 8.74MB
System.Private.Xml.dll 8.19MB
System.Linq.Expressions.dll 5.09MB
System.Data.Common.dll 2.82MB
System.Private.DataContractSerialization.dll 1.99MB
System.Net.Http.dll 1.43MB
System.Linq.Parallel.dll 1.26MB
Microsoft.VisualBasic.Core.dll 1.14MB
System.Reflection.Metadata.dll 1.04MB
System.Text.Encoding.CodePages.dll 838KB
System.Text.Json.dll 825KB
Microsoft.CSharp.dll 791KB
System.Security.Cryptography.X509Certificates.dll 743KB
System.ComponentModel.TypeConverter.dll 697KB
Newtonsoft.Json.dll 677KB
System.Security.Cryptography.Algorithms.dll 651KB
System.Collections.Immutable.dll 647KB
System.Net.Security.dll 605KB
System.Net.Sockets.dll 581KB
System.Net.Mail.dll 481KB
System.Threading.Tasks.Dataflow.dll 471KB
System.Linq.dll 415KB
System.Text.RegularExpressions.dll 390KB
System.Private.Xml.Linq.dll 370KB
System.Transactions.Local.dll 342KB
System.Net.Requests.dll 340KB
Mono.Cecil.dll 336KB
System.Collections.dll 331KB
System.Runtime.Serialization.Formatters.dll 305KB
System.Net.HttpListener.dll 304KB
System.IO.Compression.dll 245KB
System.Private.Uri.dll 239KB
System.Net.Primitives.dll 221KB
System.IO.FileSystem.dll 214KB
System.Runtime.Extensions.dll 204KB
System.Diagnostics.Process.dll 198KB
System.Runtime.Numerics.dll 196KB
System.Security.Cryptography.OpenSsl.dll 193KB
System.Collections.Concurrent.dll 187KB
System.Console.dll 184KB
System.Memory.dll 184KB
System.Linq.Queryable.dll 178KB
System.ComponentModel.Annotations.dll 160KB
Il2CppDumper.dll 160KB
System.Net.WebClient.dll 157KB
System.Numerics.Vectors.dll 148KB
System.Net.WebSockets.dll 143KB
System.Net.NetworkInformation.dll 131KB
System.Security.Cryptography.Encoding.dll 129KB
System.Diagnostics.TraceSource.dll 123KB
System.Drawing.Primitives.dll 121KB
System.IO.Pipes.dll 115KB
System.Security.Cryptography.Csp.dll 112KB
netstandard.dll 112KB
System.Net.Ping.dll 111KB
System.Threading.Channels.dll 110KB
System.Threading.Tasks.Parallel.dll 106KB
System.Security.Cryptography.Primitives.dll 101KB
System.Text.Encodings.Web.dll 100KB
System.Diagnostics.DiagnosticSource.dll 98KB
System.Collections.NonGeneric.dll 96KB
System.IO.FileSystem.Watcher.dll 92KB
System.Collections.Specialized.dll 90KB
System.Security.Claims.dll 88KB
Mono.Cecil.Pdb.dll 87KB
System.ObjectModel.dll 87KB
System.Net.NameResolution.dll 79KB
System.IO.IsolatedStorage.dll 77KB
System.Threading.dll 76KB
System.Net.WebSockets.Client.dll 71KB
System.IO.FileSystem.DriveInfo.dll 71KB
System.IO.Compression.Brotli.dll 69KB
System.Reflection.DispatchProxy.dll 69KB
System.IO.MemoryMappedFiles.dll 67KB
System.Net.WebHeaderCollection.dll 66KB
System.Security.AccessControl.dll 65KB
System.Security.Cryptography.Cng.dll 62KB
Microsoft.Win32.Registry.dll 58KB
mscorlib.dll 56KB
System.Diagnostics.TextWriterTraceListener.dll 55KB
System.dll 53KB
System.ComponentModel.Primitives.dll 53KB
System.Runtime.InteropServices.dll 52KB
System.Runtime.dll 52KB
System.Runtime.WindowsRuntime.dll 50KB
System.Web.HttpUtility.dll 45KB
System.Runtime.WindowsRuntime.UI.Xaml.dll 42KB
System.Resources.Writer.dll 42KB
System.Security.Principal.Windows.dll 39KB
Mono.Cecil.Mdb.dll 39KB
System.Diagnostics.FileVersionInfo.dll 37KB
System.Diagnostics.StackTrace.dll 35KB
System.ComponentModel.EventBasedAsync.dll 34KB
System.IO.Compression.ZipFile.dll 34KB
共 204 条
- 1
- 2
- 3
资源评论
- yokapblc2023-11-03怎么使用啊
小黑猫成仙
- 粉丝: 65
- 资源: 103
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功