void dialogHook(void* pDialog, uint16_t wID, uint8_t iStyle, const char* szCaption, const char* szText, const char* szButton1, const char* szButton2, BOOL bSend) {
AddMessageJumpQ("~r~Hello from blast.hk", 5000, 0, false);
}
void __declspec(naked) HOOK_Raw_Dialog(void) {
static void* pDialog;
static int wId;
static int iStyle;
static const char* szCaption;
static const char* szText;
static const char* szButton1;
static const char* szButton2;
static BOOL bSend;
__asm {
// Вытаскиваем все аргументы со стека
mov eax, [esp + -0x0C]
mov wId, eax
mov eax, [esp + -0x08]
mov iStyle, eax
mov eax, [esp + 0x04]
mov szCaption, eax
mov eax, [esp + 0x08]
mov szText, eax
mov eax, [esp + 0x0C]
mov szButton1, eax
mov eax, [esp + 0x10]
mov szButton2, eax
mov eax, [esp + 0x1C]
mov bSend, eax
pushad // Сохраняем все регистры
}
dialogHook(pDialog, wId, iStyle, szCaption, szText, szButton1, szButton2, bSend);
__asm {
popad // вытаскиваем сохраненные регистры
// Прыгаем в трамплин для продолжения исполнения. Если не нужно продолжать исполнение - нужно поставить опкод ret
jmp pOriginalFunction
}
}