防止對特定的函數下CC斷點
下面是對GetDlgItemText下斷的檢測方法
DWORD WINAPI ThreadProc(LPVOID lpParam)
{
typedef UINT (__stdcall * pGetDlgItemText)(HWND, INT, LPTSTR, INT); //函數指針申明
PBYTE pByte = (PBYTE)(pGetDlgItemText)::GetDlgItemText;
for (int i = 0; i < 5; i ++)
{ //檢查前五字節
if (0 == (*pByte++^0xcc) )
{
//這裡只是簡單的異或處理,大家仁者見仁,智者見智咯!!!
MessageBox(NULL, "Find debuger!", NULL, MB_OK);
}
}
return 0;
}
void CAntiCCFuncsDlg::OnOK()
{
// TODO: Add extra validation here
CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL);
//CDialog::OnOK();
}