Native Helpers
These helpers are useful when a mod needs native addresses.
CampAPI::getLibBase
cpp
uintptr_t getLibBase(const char* libname = "libminecraftpe.so");Returns the base address of a loaded library.
Example
cpp
const auto base = CampAPI::getLibBase();
if (base != 0) {
// use base for native work
}CampAPI::slideAddress
cpp
uintptr_t slideAddress(uintptr_t offset, const char* libname = "libminecraftpe.so");Turns a library offset into a real address using the loaded base.
Example
cpp
const auto address = CampAPI::slideAddress(0x123456);CampAPI::findVtable
cpp
void** findVtable(const char* cls, const char* libname = "libminecraftpe.so");Returns the vtable pointer for a class when it can be found.
Example
cpp
const auto vtable = CampAPI::findVtable("14ClientInstance");CampAPI::getVtableClass
cpp
uintptr_t getVtableClass(const char* cls, int slot, const char* libname = "libminecraftpe.so");Returns the function address for a class vtable slot.
Example
cpp
const auto fn = CampAPI::getVtableClass("14ClientInstance", 25);
if (fn != 0) {
// cast and call if your hook expects this slot
}Macro.h
Macro.h contains the Android export and visibility macros used by the native layer.
Practical note
This header is Android-only, so keep it behind Android build guards.