Namespaces | |
namespace | ClassesManagement |
Namespace with some advanced APIs of ClassesManagement. | |
namespace | Coroutine |
Namespace that has types to create Unity coroutines. | |
namespace | Defaults |
Namespace that helps to get references to primitives and common used C# and Unity types. | |
namespace | Loading |
Namespace with all methods for loading BNM. | |
namespace | Operators |
Namespace that holds operators which may help with methods, events, fields and properties. | |
namespace | Types |
Namespace that holds C# primitives. | |
namespace | UnityEngine |
Namespace that has types and helpers to work with Unity objects. | |
namespace | Utils |
BNM namespace with utils. | |
Classes | |
struct | Class |
Class for working with il2cpp classes. More... | |
struct | CompileTimeClass |
Stores class info at compile time. More... | |
struct | CompileTimeClassBuilder |
Struct for building CompileTimeClass. More... | |
struct | Delegate |
Typed wrapper of Il2CppDelegate. More... | |
struct | DelegateBase |
Wrapper of Il2CppDelegate. More... | |
struct | Event |
Typed class for working with il2cpp events. More... | |
struct | EventBase |
Class base for working with il2cpp events. More... | |
struct | Exception |
Wrapper of Il2CppException. More... | |
struct | Field |
Typed class for working with il2cpp fields. More... | |
struct | FieldBase |
Class base for working with il2cpp fields. More... | |
struct | Image |
Class for working with il2cpp images. More... | |
struct | Method |
Typed class for working with il2cpp methods. More... | |
struct | MethodBase |
Class base for working with il2cpp methods. More... | |
struct | MulticastDelegate |
Typed wrapper of Il2CppMulticastDelegate. More... | |
struct | MulticastDelegateBase |
Wrapper of Il2CppMulticastDelegate. More... | |
struct | Property |
Typed class for working with il2cpp properties. More... | |
struct | PropertyBase |
Class base for working with il2cpp properties. More... | |
Typedefs | |
typedef Class | LoadClass |
For people how love old BNM. | |
typedef IL2CPP::Il2CppReflectionType | MonoType |
Redefinition of Il2CppReflectionType for shorter code. | |
Functions | |
template<typename T, typename = std::enable_if<std::is_pointer<T>::value>> | |
bool | IsA (T object, IL2CPP::Il2CppClass *_class) |
Check if object is inherited from class. | |
template<> | |
bool | IsA< IL2CPP::Il2CppObject * > (IL2CPP::Il2CppObject *object, IL2CPP::Il2CppClass *_class) |
Check if Il2CppObject is inherited from class. | |
template<typename T, typename = std::enable_if<std::is_pointer<T>::value>> | |
bool | IsA (T object, Class _class) |
Check if object is inherited from class. | |
template<typename T, typename = std::enable_if<std::is_pointer<T>::value>> | |
bool | IsA (T object, IL2CPP::Il2CppObject *_object) |
Check if object is inherited from object's class. | |
template<typename T, typename = std::enable_if<std::is_pointer<T>::value>> | |
bool | IsA (T object, MonoType *_type) |
Check if object is inherited from object's class. | |
Exception | TryInvoke (const std::function< void()> &func) |
Helper function for catching il2cpp errors. | |
bool | InvokeHookImpl (IL2CPP::MethodInfo *info, void *newMet, void **oldMet) |
Hook method by changing MethodInfo. | |
template<typename T_NEW, typename T_OLD> | |
bool | InvokeHook (const BNM::MethodBase &targetMethod, T_NEW newMet, T_OLD &oldMet) |
Hook method by changing MethodInfo. | |
template<typename T_NEW, typename T_OLD> | |
bool | InvokeHook (const BNM::MethodBase &targetMethod, T_NEW newMet, T_OLD &&oldMet) |
Hook method by changing MethodInfo. | |
template<typename T_NEW, typename T_OLD> | |
bool | InvokeHook (IL2CPP::MethodInfo *info, T_NEW newMet, T_OLD &oldMet) |
Hook method by changing MethodInfo. | |
template<typename T_NEW, typename T_OLD> | |
bool | InvokeHook (IL2CPP::MethodInfo *info, T_NEW newMet, T_OLD &&oldMet) |
Hook method by changing MethodInfo. | |
bool | VirtualHookImpl (BNM::Class targetClass, IL2CPP::MethodInfo *info, void *newMet, void **oldMet) |
Hook method by changing class virtual table. | |
template<typename T_NEW, typename T_OLD> | |
bool | VirtualHook (BNM::Class targetClass, const BNM::MethodBase &targetMethod, T_NEW newMet, T_OLD &oldMet) |
Hook method by changing class virtual table. | |
template<typename T_NEW, typename T_OLD> | |
bool | VirtualHook (BNM::Class targetClass, const BNM::MethodBase &targetMethod, T_NEW newMet, T_OLD &&oldMet) |
Hook method by changing class virtual table. | |
template<typename T_NEW, typename T_OLD> | |
bool | VirtualHook (BNM::Class targetClass, IL2CPP::MethodInfo *info, T_NEW newMet, T_OLD &oldMet) |
Hook method by changing class virtual table. | |
template<typename T_NEW, typename T_OLD> | |
bool | VirtualHook (BNM::Class targetClass, IL2CPP::MethodInfo *info, T_NEW newMet, T_OLD &&oldMet) |
Hook method by changing class virtual table. | |
template<typename NEW_T, typename T_OLD> | |
void | BasicHook (const BNM::MethodBase &targetMethod, NEW_T newMethod, T_OLD &oldBytes) |
Hook method using hooking software. | |
template<typename NEW_T, typename T_OLD> | |
void | BasicHook (const BNM::MethodBase &targetMethod, NEW_T newMethod, T_OLD &&oldBytes) |
Hook method using hooking software. | |
template<typename T> | |
bool | CheckForNull (T obj) |
Macro function for checking pointer for null. Due to noinline attribute allows to check even this of objects. | |
template<typename T, typename = std::enable_if<std::is_pointer<T>::value>> | |
bool | IsAllocated (T x) |
Macro function for checking if pointer points to valid address. | |
Structures::Mono::String * | CreateMonoString (const std::string_view &str) |
Macro function for creating C# strings (BNM::Structures::Mono::String). | |
void * | GetExternMethod (const std::string_view &str) |
Macro function for getting external methods (icall). | |
bool | IsLoaded () |
Check if BNM and il2cpp are loaded. | |
void * | GetIl2CppLibraryHandle () |
Get handle of libil2cpp.so if it's used by BNM. | |
template<typename T> | |
T | UnboxObject (T obj) |
Unbox any object. | |
bool | AttachIl2Cpp () |
Attach current thread to il2cpp VM. | |
IL2CPP::Il2CppThread * | CurrentIl2CppThread () |
Get current thread attached to il2cpp VM. | |
void | DetachIl2Cpp () |
Detach current thread from il2cpp VM. | |
void * | Allocate (size_t size) |
Allocates memory that is registered in il2cpp's GC. | |
void | Free (void *) |
Frees memory that was allocated by il2cpp. | |
Main BNM namespace.
void * BNM::Allocate | ( | size_t | size | ) |
Allocates memory that is registered in il2cpp's GC.
bool BNM::AttachIl2Cpp | ( | ) |
Attach current thread to il2cpp VM.
void BNM::BasicHook | ( | const BNM::MethodBase & | targetMethod, |
NEW_T | newMethod, | ||
T_OLD && | oldBytes ) |
Hook method using hooking software.
Alias for BasicHook method
targetMethod | Virtual method info |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
void BNM::BasicHook | ( | const BNM::MethodBase & | targetMethod, |
NEW_T | newMethod, | ||
T_OLD & | oldBytes ) |
Hook method using hooking software.
Alias for BasicHook method
targetMethod | Virtual method info |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
Structures::Mono::String * BNM::CreateMonoString | ( | const std::string_view & | str | ) |
Macro function for creating C# strings (BNM::Structures::Mono::String).
IL2CPP::Il2CppThread * BNM::CurrentIl2CppThread | ( | ) |
Get current thread attached to il2cpp VM.
void * BNM::GetExternMethod | ( | const std::string_view & | str | ) |
Macro function for getting external methods (icall).
void * BNM::GetIl2CppLibraryHandle | ( | ) |
bool BNM::InvokeHook | ( | const BNM::MethodBase & | targetMethod, |
T_NEW | newMet, | ||
T_OLD && | oldMet ) |
Hook method by changing MethodInfo.
Alias for BNM::InvokeHookImpl
targetMethod | Target method |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::InvokeHook | ( | const BNM::MethodBase & | targetMethod, |
T_NEW | newMet, | ||
T_OLD & | oldMet ) |
Hook method by changing MethodInfo.
Alias for BNM::InvokeHookImpl
targetMethod | Target method |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::InvokeHook | ( | IL2CPP::MethodInfo * | info, |
T_NEW | newMet, | ||
T_OLD && | oldMet ) |
Hook method by changing MethodInfo.
Alias for BNM::InvokeHookImpl
info | Target method info |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::InvokeHook | ( | IL2CPP::MethodInfo * | info, |
T_NEW | newMet, | ||
T_OLD & | oldMet ) |
Hook method by changing MethodInfo.
Alias for BNM::InvokeHookImpl
info | Target method info |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::InvokeHookImpl | ( | IL2CPP::MethodInfo * | info, |
void * | newMet, | ||
void ** | oldMet ) |
Hook method by changing MethodInfo.
This way of hooking will work only if method called using il2cpp API. There are not many such methods in Unity: All unity messages (like Start, Update etc.), some of system actions. Primary usage is Unity messages, because this way of hooking don't add any overhead, that basic hooks do.
info | Target method info |
newMet | Pointer to replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::IsA | ( | T | object, |
Class | _class ) |
Check if object is inherited from class.
Class is specified using BNM::Class
object | Any pointer |
_class | BNM::Class |
T | Object type |
bool BNM::IsA | ( | T | object, |
IL2CPP::Il2CppClass * | _class ) |
Check if object is inherited from class.
Class is specified using Il2CppClass.
object | Any pointer |
_class | Il2CppClass pointer |
T | Object type |
bool BNM::IsA | ( | T | object, |
IL2CPP::Il2CppObject * | _object ) |
Check if object is inherited from object's class.
Class is specified using object of target class.
object | Any pointer |
_object | Il2CppObject pointer |
T | Object type |
bool BNM::IsA | ( | T | object, |
MonoType * | _type ) |
bool BNM::IsA< IL2CPP::Il2CppObject * > | ( | IL2CPP::Il2CppObject * | object, |
IL2CPP::Il2CppClass * | _class ) |
Check if Il2CppObject is inherited from class.
object | Il2CppObject pointer |
_class | Il2CppClass pointer |
|
inline |
Macro function for checking if pointer points to valid address.
bool BNM::IsLoaded | ( | ) |
Exception BNM::TryInvoke | ( | const std::function< void()> & | func | ) |
Helper function for catching il2cpp errors.
func | Function that can throw il2cpp exception |
|
inline |
Unbox any object.
bool BNM::VirtualHook | ( | BNM::Class | targetClass, |
const BNM::MethodBase & | targetMethod, | ||
T_NEW | newMet, | ||
T_OLD && | oldMet ) |
Hook method by changing class virtual table.
Alias for BNM::VirtualHookImpl
targetClass | Target class |
targetMethod | Virtual method |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::VirtualHook | ( | BNM::Class | targetClass, |
const BNM::MethodBase & | targetMethod, | ||
T_NEW | newMet, | ||
T_OLD & | oldMet ) |
Hook method by changing class virtual table.
Alias for BNM::VirtualHookImpl
targetClass | Target class |
targetMethod | Virtual method |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::VirtualHook | ( | BNM::Class | targetClass, |
IL2CPP::MethodInfo * | info, | ||
T_NEW | newMet, | ||
T_OLD && | oldMet ) |
Hook method by changing class virtual table.
Alias for BNM::VirtualHookImpl
targetClass | Target class |
info | Virtual method info |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::VirtualHook | ( | BNM::Class | targetClass, |
IL2CPP::MethodInfo * | info, | ||
T_NEW | newMet, | ||
T_OLD & | oldMet ) |
Hook method by changing class virtual table.
Alias for BNM::VirtualHookImpl
targetClass | Target class |
info | Virtual method info |
newMet | Replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |
bool BNM::VirtualHookImpl | ( | BNM::Class | targetClass, |
IL2CPP::MethodInfo * | info, | ||
void * | newMet, | ||
void ** | oldMet ) |
Hook method by changing class virtual table.
This way of hooking will work only if virtual method called from some method. This hook won't be triggered by overridden methods, because that methods call overridden method directly, without class virtual table.
targetClass | Target class |
info | Virtual method info |
newMet | Pointer to replacement method |
oldMet | Pointer where original method pointer will be stored. Can be null |