Namespace with all methods for loading BNM. More...
Typedefs | |
typedef void *(* | MethodFinder) (const char *name, void *userData) |
Functions | |
void | AllowLateInitHook () |
Allow BNM to load at any game state. | |
bool | TryLoadByJNI (JNIEnv *env, jobject context=nullptr) |
Try load BNM using JNI. | |
bool | TryLoadByDlfcnHandle (void *handle) |
Try load BNM using dlfcn handle. | |
void | SetMethodFinder (MethodFinder finderMethod, void *userData) |
Set custom method finder. | |
bool | TryLoadByUsersFinder () |
Try load BNM using custom method finder. | |
void | TrySetupByUsersFinder () |
Try setup BNM using custom method finder. | |
void | AddOnLoadedEvent (void(*event)()) |
Add event that will be called from il2cpp thread when il2cpp and BNM will be fully loaded. | |
void | ClearOnLoadedEvents () |
Remove all events. | |
Namespace with all methods for loading BNM.
void BNM::Loading::AllowLateInitHook | ( | ) |
Allow BNM to load at any game state.
Allow BNM to hook il2cpp::vm::Class::FromIl2CppType to load itself if loading starts too late. Should be called before attempting to load BNM. (Before TryLoadByJNI, TryLoadByDlfcnHandle, TryLoadByUsersFinder and TrySetupByUsersFinder).
void BNM::Loading::SetMethodFinder | ( | MethodFinder | finderMethod, |
void * | userData ) |
Set custom method finder.
You can use it for setting custom method finder if dlfcn or JNI don't work in current context.
finderMethod | Pointer to custom method finder |
userData | Data that will be passed with every custom method finder call |
bool BNM::Loading::TryLoadByDlfcnHandle | ( | void * | handle | ) |
Try load BNM using dlfcn handle.
Uses the library handle to hook methods for loading BNM from the il2cpp thread.
Example usage:
bool BNM::Loading::TryLoadByJNI | ( | JNIEnv * | env, |
jobject | context = nullptr ) |
Try load BNM using JNI.
Uses JNI and Context to find the full path to libil2cpp.so and then hook methods for loading BNM from the il2cpp thread.
env | Valid in current thread JNIEnv |
context | Target app's android.content.Context |
Example usage:
bool BNM::Loading::TryLoadByUsersFinder | ( | ) |
Try load BNM using custom method finder.
Uses custom method finder to hook methods for loading BNM from the il2cpp thread.
void BNM::Loading::TrySetupByUsersFinder | ( | ) |
Try setup BNM using custom method finder.
Uses custom method finder to load BNM from the current thread.