wgrzelak
03-03-2015, 05:58 PM
Well I have problem with hooking PrintFps function. I don't know how to catch all arguments like position X, also I can modify orginal fps but when I call more than one PrintText() is not working.
void MyPrintFps(int nY, int nFont, int nRed, int nGreen, int nBlue, char* lpText, int nSurface, int unk/* test next arg */) //10.76
{
typedef void _PrintText(int nY, int nFont, int nRed, int nGreen, int nBlue, char* lpText, int nSurface);
static _PrintText *PrintText = (_PrintText*)(PrintName + Addresses::GetProcessImageBase());
nY = 50;
//nFont = 3;
lpText = "Tpforums";
nRed = 60, nGreen = 226, nBlue = 34;
PrintText(nY, nFont, nRed, nGreen, nBlue, lpText, nSurface);
PrintText(0, 2, nRed, nGreen, nBlue, "Test", nSurface); //not working
Console::cout() << nY << Console::endl();
Console::cout() << nFont << Console::endl();
Console::cout() << nRed << Console::endl();
Console::cout() << nGreen << Console::endl();
Console::cout() << nBlue << Console::endl();
Console::cout() << lpText << Console::endl();
Console::cout() << nSurface << Console::endl();
Console::cout() << unk << Console::endl(); //checking next arg
Console::cout() << "------------------------" << Console::endl();
}
HookCall((DWORD)(PrintFps + Addresses::GetProcessImageBase()), (DWORD)&MyPrintFps);
Screen:
http://i58.tinypic.com/34hj4u0.png
there is unk = -923413 so I think so there is no more arguments.
void MyPrintFps(int nY, int nFont, int nRed, int nGreen, int nBlue, char* lpText, int nSurface, int unk/* test next arg */) //10.76
{
typedef void _PrintText(int nY, int nFont, int nRed, int nGreen, int nBlue, char* lpText, int nSurface);
static _PrintText *PrintText = (_PrintText*)(PrintName + Addresses::GetProcessImageBase());
nY = 50;
//nFont = 3;
lpText = "Tpforums";
nRed = 60, nGreen = 226, nBlue = 34;
PrintText(nY, nFont, nRed, nGreen, nBlue, lpText, nSurface);
PrintText(0, 2, nRed, nGreen, nBlue, "Test", nSurface); //not working
Console::cout() << nY << Console::endl();
Console::cout() << nFont << Console::endl();
Console::cout() << nRed << Console::endl();
Console::cout() << nGreen << Console::endl();
Console::cout() << nBlue << Console::endl();
Console::cout() << lpText << Console::endl();
Console::cout() << nSurface << Console::endl();
Console::cout() << unk << Console::endl(); //checking next arg
Console::cout() << "------------------------" << Console::endl();
}
HookCall((DWORD)(PrintFps + Addresses::GetProcessImageBase()), (DWORD)&MyPrintFps);
Screen:
http://i58.tinypic.com/34hj4u0.png
there is unk = -923413 so I think so there is no more arguments.