Created
April 23, 2016 11:34
-
-
Save minecraftmuse3/3800e870f60454f3692d87777ab1e849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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