ByNameModding / BNM-Android

Modding il2cpp games by classes, methods, field names on Android.
MIT License
196 stars 38 forks source link

Can load BNM Extenally using KittyMemory instead ? #30

Closed ArifRios1st closed 4 months ago

ArifRios1st commented 6 months ago

because KittyMemory have findSymbol like that, can i just use that instead ? what must be replace to load BNM Externally ?

ArifRios1st commented 6 months ago

after try it, i make custom SetupBNM void SetupBNMKittyMemory(ElfScanner il2cppScan) and have to replace all that use il2cppLibraryHandle using ElfScanner from KittyMemory example: (BNM_PTR) BNM_dlsym(il2cppLibraryHandle, OBFUSCATE_BNM("il2cpp_array_new_specific")) to (BNM_PTR) il2cppScan.findSymbol(OBFUSCATE_BNM("il2cpp_array_new_specific"))

then make external function to load void LoadKittyMemory(ElfScanner ilcppScan) { BNM_Internal::il2cppLibraryAbsolutePath = ilcppScan.filePath().c_str(); BNM_Internal::il2cppLibraryAbsoluteAddress = (BNM_PTR) ilcppScan.base(); BNM_Internal::SetupBNMKittyMemory(ilcppScan); bnmLoaded = true; }

and load it like this do { sleep(1); g_il2cppELF = ElfScanner::createWithPath("libil2cpp.so"); } while (!g_il2cppELF.isValid()); BNM::External::LoadKittyMemory(g_il2cppELF);

and all work properly !

ArifRios1st commented 6 months ago

1 more question @BNM-Dev for load BNM Externally, is that need to use BNM::AttachIl2Cpp(); and BNM::DetachIl2Cpp(); ?

BNM-Dev commented 6 months ago

AttachIl2Cpp and DetachIl2Cpp are deprecated. Just hook Start/Awake or any other method in game and setup/find all things in it.

About finding symbols, I think in BNM v2.0 I will create sth like system for finding them by user defined code.

solomode0001 commented 6 months ago

So, when will BNM v2.0 be released? I'm really excited and can't wait for it. Just to let you know, I check this page almost every day to see if BNM v2.0 has been released yet because I really love this library.

ArifRios1st commented 6 months ago

About finding symbols, I think in BNM v2.0 I will create sth like system for finding them by user defined code.

nice one, i can't wait for v2.0

BNM-Dev commented 6 months ago

So, when will BNM v2.0 be released? I'm really excited and can't wait for it. Just to let you know, I check this page almost every day to see if BNM v2.0 has been released yet because I really love this library.

I now just have no time to complete all things.

solomode0001 commented 6 months ago

So, when will BNM v2.0 be released? I'm really excited and can't wait for it. Just to let you know, I check this page almost every day to see if BNM v2.0 has been released yet because I really love this library.

I now just have no time to complete all things.

It's okay, sir, don't force yourself. Enjoy your time in the real world. When you're feeling up to it, we can resume our project. I'll be here waiting patiently. May God grant you a long life, abundant blessings, and prosperity.

chiteroman commented 5 months ago

I recommend using xDL to load il2cpp: https://github.com/hexhacking/xDL

Also @BNM-Dev take a look to shadowhook: https://github.com/bytedance/android-inline-hook I think is better than Dobby.

BNM-Dev commented 5 months ago

I recommend using xDL to load il2cpp: https://github.com/hexhacking/xDL

Also @BNM-Dev take a look to shadowhook: https://github.com/bytedance/android-inline-hook I think is better than Dobby.

BNM is very customizable.

BNM has defines like 'BNM_dlopen` (BNM_settings.h) so user can manually replace any dl function.

About hooks, user can change hooking software in settings too. And I prefer Dobby due to way how it can unhook code. I compared Dobby and shadowhook. Shadowhook was detected when Dobby not. Maybe this was not last version, but I have no issues with Dobby, so I use it.