2
« on: September 04, 2015, 12:58:54 AM »
You need an up-to-date GNU binutils set. Get this through Homebrew.
Download the GitHub repo scen/osxinj. This is vital as it contains items for inserting dynamic libraries into the Blockland executable, and a template for creating a custom dynamic library. The template is "testdylib".
You have FULL C++14 SUPPORT. You can use reinterpret_cast on memory locations of function calls. Here is an example:
#include <cstdio>
using executeFn = const char*(*)(int argc , const char* argv[]);
static executeFn execute;
void install(void) __attribute__ ((constructor));
void install()
{
execute = reinterpret_cast<executeFn>(0xDEADBEEF); //set this to the function address
//do stuff, don't need to return anything
}
I have no idea how to do a function jump.
Okay to strip the addresses you do this on the terminal
$ gnm -C ~/Library/Application\ Support/Steam/steamapps/common/Blockland/Blockland.app/Contents/MacOS/Blockland
if you're using Steam blockland.
That is how you do dynamic library insertion on OS X. Windows is a whole different story and it is more complex as the function names are not in the binary.
You can use MachOView to view the assembly.
You can not set a value outside of function execution. It has to be set inside a function that is called!
Anyways that's all I got to show you. I can't think of anymore things.