rentzsch / mach_star

code injection and function overriding for Mac OS X
254 stars 46 forks source link

Calling Real Function With Custom Variables Crash #20

Open ELCHILEN0 opened 12 years ago

ELCHILEN0 commented 12 years ago

I notice that when I try to call the originalFunctionReentryIsland from my override function (or any function) with any custom variables other than the true variables passed by the program my application crashes. For example: void (_real_function)(void arg1, float arg2, float arg3);

void _hook_function(void _arg1, float arg2, float arg3) { (__real_function)(arg1, arg2, arg3); // Doesn't crash here. (*_real_function)(arg1, 0.0, 0.0); // Crashes here. }

If anyone could help with a fix or at least confirm that this is an error that would be great. Thanks.

rentzsch commented 12 years ago

Should work. Reason you're referencing _real_function in the second attempt?