Skip to content

Instantly share code, notes, and snippets.

@minecraftmuse3
Created April 23, 2016 11:34
Show Gist options
  • Save minecraftmuse3/3800e870f60454f3692d87777ab1e849 to your computer and use it in GitHub Desktop.
Save minecraftmuse3/3800e870f60454f3692d87777ab1e849 to your computer and use it in GitHub Desktop.
#include <jni.h>
#include <dlfcn.h>
#include <android/log.h>
#include <stdlib.h>
#include <Substrate.h>
class Gui;
void (*_Gui$renderHearts)(Gui* self);
void Gui$renderHearts(Gui *self) {
}
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
void* handle = dlopen("libminecraftpe.so", RTLD_LAZY);
void* Gui$renderHearts_ = dlsym(handle, "_ZN3Gui12renderHeartsEv");
MSHookFunction(Gui$renderHearts_, (void*) &Gui$renderHearts, (void**) &_Gui$renderHearts);
return JNI_VERSION_1_2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment