System.Reflection.MethodInfo对应的是Il2CppReflectionMethod,定义如下: typedef struct Il2CppReflectionMethod { Il2CppObject object; const MethodInfo *method; Il2CppString *name; Il2CppReflectionType *reftype; } Il2CppReflectionMethod; Type.GetMethod实际上是通过Il2CppReflectionType找到Il2CppClass,然后根据条件...
uint32 typeCount;TypeDefinitionIndex exportedTypeStart;uint32 exportedTypeCount;MethodIndex entryPointIndex;uint32 token;CustomAttributeIndex customAttributeStart;uint32 customAttributeCount;} Il2CppImageDefinition;#define PUBLIC_KEY_BYTE_LENGTH 8typedefstructIl2CppAssemblyNameDefinition{StringIndex nameIndex;...
//const MethodInfo*il2cpp_class_get_method_from_name(Il2CppClass*klass, const char*name,intargsCount) var il2cpp_class_get_method_from_name=new NativeFunction( Module.findExportByName(soName,"il2cpp_class_get_method_from_name"), 'pointer',['pointer','pointer','int']) var namespaze_t=M...
s_MethodInfoDefinitionTable = (const MethodInfo**)IL2CPP_CALLOC(s_GlobalMetadataHeader->methodsCount / sizeof(Il2CppMethodDefinition), sizeof(MethodInfo*)); s_GenericMethodTable = (const Il2CppGenericMethod**)IL2CPP_CALLOC(s_Il2CppMetadataRegistration->methodSpecsCount, sizeo...
auto assemblyLoad = il2cpp_class_get_method_from_name(assemblyClass, "Load", 1); ... 初始化一些常用的il2cpp函数,这些函数都是il2cpp在编译阶段打入到so内部的,好像代码是没有开源的 。 不过还好,根据方法名都可以知道具体的函数的含义 。部分函数如下 : 1 2 3 4 5 6 7 8 9 10 11 DO_API(con...
0x02 Get Flag 那么恢复了就很简单了,直接定位到关键函数。 发现只是个AES加密,密钥 IV直接交叉引用找赋值给 Check_TypeInfo 即可。 bool __fastcall Check__CheckFlag(Check_o *this, System_String_o *input, const MethodInfo *method) { Check_c *v4; // r0 System_String_o *v5; // r4 const Met...
搜索codeGenModule类型,找到Il2CppCodeRegistration结构体,通过模块名查找对应关系,定位到codeGenModules>methodPointers,完成方法符号的恢复。获得字段偏移地址:从il2cpp的API出发,利用Class::GetFieldFromName和相关函数解析字段信息。通过递归初始化类和父类的FieldInfo,找到MetadataCache::GetFieldOffset...
<app-name>_Data/il2cpp_data/Metadata/global-metadata.dat UnityPlayer.dll 随后放入 input 目录 点击该.dat即可 随后我们去 output 目录查看 dump.cs 这个文件会把 C# 的 dll 代码的类、方法、字段列出来 IL2cpp.h 生成的 cpp 头文件,从头文件里可以看到相关的数据结构 ...
il2cpp_codegen_raise_exception(il2cpp_codegen_get_not_supported_exception("Unableto find method for p/invoke: 'Increment'")); } } int32_t _return_value = _il2cpp_pinvoke_func(___value); return _return_value; } 首先,我们来一个typedef: ...
在IDA中File-Script file选择脚本运行即可,会重命名methodName和添加stringLiteral注释 关于config.json dumpmethod,dumpfield,dumpproperty,dumpattribute,dumpfieldOffset 控制程序是否在dump.cs输出相应的内容 forceil2cppversion,forceversion 当forceil2cppversion为true时,程序将根据forceversion指定的版本读取il2cpp的可...