Last active
January 4, 2016 01:09
-
-
Save n00neimp0rtant/8546721 to your computer and use it in GitHub Desktop.
this is untested and might not even compile. if that's the case tell me whats wrong with it and i'll fix
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
// declaring the function pointer | |
int *(*cool_function_pointer)(int, char, float); | |
// ^ ^ ^ ^ | |
// function's retval function parameters | |
// getting a pointer to the function | |
*(void **)(&cool_function_pointer) = dlsym(RTLD_DEFAULT, "cool_function_name"); | |
// ^ ^ ^ | |
// always void means "get func from hooked process" name of function in the binary (should appear as string in dasm) | |
// call the function | |
(*cool_function_pointer)(1234, 'a', 56.78f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment