- Code: Select all
void On_OpenProcess(HANDLE hProcess, DWORD dwProcessId)
{
AttachDebugger();
wsock32_send = GetRemoteFuncAddress("WSOCK32.dll", "send");
wsock32_recv = GetRemoteFuncAddress("WSOCK32.dll", "recv");
ws2_32_send = GetRemoteFuncAddress("WS2_32.dll", "send");
ws2_32_recv = GetRemoteFuncAddress("WS2_32.dll", "recv");
LPSCRIPT_ADD_BP ws2_send_bp = {0};
ws2_send_bp->aAddress = ws2_32_send + 5;
ws2_send_bp->iType = SPBT_EXECUTE;
ws2_send_bp->iCallback = SYS_FUNCS_SCRIPT_FUNC;
ws2_send_bp->dwNewParms[1] = 2;
ws2_send_bp->bSet = true;
MessageBox(MBS_OK, "SLDKFJLS", "0x%08X\n0x%08X\n0x%08X\n0x%08X", wsock32_send, wsock32_recv, ws2_32_send, ws2_32_recv);
}
This crashes MHS. I can post the ASM address at which the exception occurs if you want me to. I don't even add the breakpoint, just populate the LPSCRIPT_ADD_BP, and it crashes. Seems odd to me.
Did some more testing, and if I leave the breakpoint struct unpopulated, it doesn't crash. As soon as I set ANY member of the structure to ANYTHING, it crashes. Even if I just set ->bSet = true; or ->bSet = 1;, it crashes.