question (yes i know, very exciting title :P)

06/01/2011 19:53 Nomad's Knecht+ShaD's fan#1
hi there,
i've got a lil question, is it possible to add a call to a function from my project into a game?
and if yes, how?
something like this? :
Code:
void Functionname()
{
         MessageBoxA(0,"Wuii! :>","Adding Function Succeeded.",0);
}

__cdeclspec(naked) void AddFunction()
{
         __asm
         {
                call Functionname;
                call orig_Code;
         }
}

DetourFunc((BYTE*)0x0 /*address where i want to add my call @game*/, (BYTE*)AddFunction,7);
kind regards,
meeeeeeeh
06/02/2011 10:31 xNopex#2
You don't need asm for this. Just use function pointers. Therefor you only have to know the address of the function and its calling convention + parameters.

EDIT: It seems that I have misunderstood the question a little bit. But it is not completely false. Try installing a detour at the location where you want to call the functions. Then call the functions in your detour function with pointers.