diff --git a/src/il2cpp_resolver.cpp b/src/il2cpp_resolver.cpp index 159f838..1c15485 100644 --- a/src/il2cpp_resolver.cpp +++ b/src/il2cpp_resolver.cpp @@ -198,15 +198,24 @@ ResolvedMethod Il2CppResolver::waitForPurchasedPet() { return resolve("SurvivalL void Il2CppResolver::dumpDiagnostics(){ #ifdef _WIN32 - // Also log via OutputDebugString for Wine debug OutputDebugStringA("[Diag] dumpDiagnostics enter\n"); try{ char exe[MAX_PATH]; GetModuleFileNameA(nullptr, exe, MAX_PATH); char* slash = strrchr(exe, '\\'); if(!slash) slash = strrchr(exe, '/'); std::string logPath = slash ? std::string(exe, slash - exe) + "\\DevourUnlocker.log" : "DevourUnlocker.log"; std::ofstream f(logPath, std::ios::app); - f << "[Diag] dumpDiagnostics ENTER\n"; f.flush(); + f << "[Diag] dumpDiagnostics ENTER (safe mode - minimal)\n"; f.flush(); auto il2cpp_domain_get = reinterpret_cast(getProc("il2cpp_domain_get")); + if(!il2cpp_domain_get){ f << "[Diag] no domain_get\n"; return; } + void* domain = il2cpp_domain_get(); + if(!domain){ f << "[Diag] domain null (IL2CPP not ready - retry later)\n"; return; } + // Minimal safe dump - do not enumerate all classes (caused strlen(null) crash) + f << "[Diag] domain=" << domain << " - skipping full enumeration to avoid crash\n"; + f << "[Diag] If hooks not found, IL2CPP may not be ready until lobby - retry thread will handle\n"; + f << "[Diag] dump done (safe)\n"; + return; +// DISABLED heavy enumeration that caused crash (strlen null at 0x8eb3) +#if 0 auto domain_get_assemblies = reinterpret_cast(getProc("il2cpp_domain_get_assemblies")); auto assembly_get_image = reinterpret_cast(getProc("il2cpp_assembly_get_image")); auto image_get_class_count = reinterpret_cast(getProc("il2cpp_image_get_class_count")); @@ -219,9 +228,9 @@ void Il2CppResolver::dumpDiagnostics(){ if(!il2cpp_domain_get || !domain_get_assemblies || !assembly_get_image || !image_get_class_count || !image_get_class) { f << "[Diag] missing IL2CPP exports for dump\n"; return; } - void* domain = il2cpp_domain_get(); - if(!domain){ f << "[Diag] domain null\n"; return; } - size_t nAssemblies=0; const void** assemblies = domain_get_assemblies(domain, &nAssemblies); + void* domain2 = il2cpp_domain_get(); + if(!domain2){ f << "[Diag] domain null\n"; return; } + size_t nAssemblies=0; const void** assemblies = domain_get_assemblies(domain2, &nAssemblies); f << "[Diag] assemblies=" << nAssemblies << "\n"; for(size_t ai=0; ai(reinterpret_cast(m) + 0x18); f << " ptr=" << ptr; auto method_get_name2 = reinterpret_cast(getProc("il2cpp_method_get_name")); - if(method_get_name2) f << " name=" << method_get_name2(m); + if(method_get_name2){ + const char* mn2 = method_get_name2(m); + f << " name=" << (mn2 ? mn2 : ""); + } } f << "\n"; } @@ -289,6 +301,7 @@ void Il2CppResolver::dumpDiagnostics(){ } } f << "[Diag] dump done\n"; +#endif // 0 }catch(...){} #endif } diff --git a/src/main_version.cpp b/src/main_version.cpp index 9f16a6f..358248d 100644 --- a/src/main_version.cpp +++ b/src/main_version.cpp @@ -9,10 +9,12 @@ static void logVer(const char* m){ std::string p = s? std::string(exe,s-exe)+"\\DevourUnlocker.log":"DevourUnlocker.log"; std::ofstream f(p,std::ios::app); f<