The function is of class
Code: Select all
QPaninter
Code: Select all
drawText
Code: Select all
HookCode
Following is my code:
Code: Select all
void MyHook()
{
__try
{
hMod=(HMODULE)GetModuleHandleA("QtGui4.dll");
DWORD drawText = (DWORD)(((DWORD)hMod)+((DWORD)0x001207B0));//4.7.4:QPainter::drawText(class QRect const &,int,class QString const &,class QRect *) : 0x001207B0
HookCode((PVOID)drawText,NewdrawText ,(PVOID*) &UnhookdrawText);
}
__except(filter(GetExceptionCode(),GetExceptionInformation(),L"HK_API")) //catch(...)
{
;
}
}
Code: Select all
void (WINAPI * UnhookdrawText) ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect );
void WINAPI NewdrawText ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect = 0 )
{
__try
{
WriteLog_String(L"NewdrawText",L"Entered * * * *");
UnhookdrawText(rectangle,flags,text,boundingRect);
}
__except(filter(GetExceptionCode(),GetExceptionInformation(),L"DRTXT_API")) //catch(...)
{
;
}
}