If you want to know why I'm asking, it's because I'm working on a somewhat hacky/improper VM so to speak. Since WINE cannot run binaries that require a base address of 0x10000, it's not as simple as running WINE to get the results I need. Let me illustrate what I mean and what I am doing:
Code: Select all
void macbox_install_wrapper( void* function_addr, void* wrapper_addr )
{
uint8_t* func = (uint8_t*) function_addr;
*(uint8_t*) &func[0] = 0xE9; // JMP rel32 (quick and easy)
*(uint32_t*)&func[1] = (uint32_t) wrapper_addr - (uint32_t) function_addr;
}
I have tried changing the alignment settings in XCode (I forgot exactly what I did, it's been a few months) but that did not appear to work. I also tried defining CALLBACK myself this way:
Code: Select all
#define CALLBACK __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__)) __attribute__((aligned(4)))
Thanks,
Shogun