Closed chiteroman closed 1 year ago
Solved, I made a mistake in code. Now it works.
namespace Zygisk {
[[maybe_unused]] void LoadBNM(void *dl) {
BNM_Internal::dlLib = dl;
void *init = DobbySymbolResolver(nullptr, "il2cpp_init");
Dl_info info;
BNM_dladdr(init, &info);
auto l = strlen(info.dli_fname) + 1;
auto s = new char[l];
memset((void *) s, 0, l);
strcpy(s, info.dli_fname);
BNM_Internal::LibAbsolutePath = s;
BNM_Internal::LibAbsoluteAddress = (BNM_PTR) info.dli_fbase;
HOOK(init, BNM_Internal::BNM_il2cpp_init, BNM_Internal::old_BNM_il2cpp_init);
}
}
I'm using BNM with a Zygisk module. It works in this BNM version: https://github.com/geokar2006/ByNameModding/tree/6583b7f238a14627a7306f6983534a88772fab9c
But in latest version when I call
AttachIl2Cpp()
the game crash. I'm using the latest version of Dobby (https://github.com/jmpews/Dobby/releases/tag/latest)I hook the dlopen using this:
And this is the hook logic:
strutil -> https://github.com/Shot511/strutil
Then I load that void* into a custom Load function in BNM:
In latest version I try to use
BNM::External::LoadBNM(void *)
but when the program reachAttachIl2Cpp()
the game crash. In the old version I told I can use BNM normally and everything works perfectly.Maybe are there something broken in the code?
This is my custom BNM version with a few code for work with Zygisk: https://anonfiles.com/Ed04o4Y1y5/ByNameModding_7z