autoklass =il2cpp_image_get_class(image, j); autotype =il2cpp_class_get_type(const_cast<Il2CppClass *>(klass)); //LOGD("type name : %s", il2cpp_type_get_name(type)); autoklassIndex = type->data.klassIndex; if(outPuts[klassIndex].empty()) { ...
//使用il2cpp_image_get_class for (int i = 0; i < size; ++i) { auto image = il2cpp_assembly_get_image(assemblies[i]); std::stringstream imageStr; imageStr << "\n// Dll : " << il2cpp_image_get_name(image); auto classCount = il2cpp_image_get_class_count(image); for (int...
关于Il2cpp的资料网上有很多,简而言之,Il2cpp就是unity用来代替原来的基于Mono虚拟机的一种新的打包方式,它先生成IL(中间语言),然后再转换成Cpp文件,提高运行效率的同时增加了安全性。原本基于Mono的打包方式极其容易被逆向,现在市面上的新游戏基本上都是用Il2cpp的方式打包的,当然Il2cpp的逆向教程也很多,但...
从il2cpp的API出发,利用Class::GetFieldFromName和相关函数解析字段信息。通过递归初始化类和父类的FieldInfo,找到MetadataCache::GetFieldOffsetFromIndexLocked函数,这个函数可以帮助获取到字段的偏移地址。总结:Il2Cpp恢复符号的过程是一个复杂但有序的过程,它涉及到对globalmetadata.dat文件的解析、对il2...
assembly->class->method 而unity 中有一些导出函数: DO_API(int, il2cpp_init, (const char* domain_name)); DO_API(const Il2CppImage*, il2cpp_get_corlib, ()); DO_API(void, il2cpp_add_internal_call, (const char* name, Il2CppMethodPointer method)); DO_API(Il2CppMethodPointer, il2cpp...
MethodInfo、Il2CppClass的结构也需要了解一下: structIl2CppClass{constIl2CppImage*image;void*gc_desc;constchar*name;constchar*namespaze;...}structMethodInfo{Il2CppMethodPointermethodPointer;InvokerMethodinvoker_method;constchar*name;Il2CppClass*declaring_type;constIl2CppType*return_type;constParameterInfo*pa...
//使用il2cpp_image_get_class for (int i = 0; i < size; ++i) { auto image = il2cpp_assembly_get_image(assemblies[i]); std::stringstream imageStr; imageStr << "\n// Dll : " << image->name; auto classCount = il2cpp_image_get_class_count(image); ...
sizeof(Il2CppImageGlobalMetadata));s_TypeInfoTable = (Il2CppClass**)IL2CPP_CALLOC(s_Il2CppMetadataRegistration->typesCount,sizeof(Il2CppClass*));s_TypeInfoDefinitionTable = (Il2CppClass**)IL2CPP_CALLOC(s_GlobalMetadataHeader->typeDefinitionsSize /sizeof(Il2CppTypeDefinition),sizeof(Il2CppClass...
os::Image::Initialize(); os::Thread::Init(); il2cpp::utils::RegisterRuntimeInitializeAndCleanup::ExecuteInitializations(); if (!MetadataCache::Initialize()) return false; Assembly::Initialize(); gc::GarbageCollector::Initialize(); Thread::Initialize(); ...
Il2CppNameToTypeDefinitionIndexHashTable*nameToClassHashTable; const Il2CppCodeGenModule*codeGenModule; uint32_t token; uint8_t dynamic; } Il2CppImage; typedef struct Il2CppImage { const char*name; const char*nameNoExt; Il2CppAssembly*assembly; ...