|
地板
樓主 |
發(fā)表于 2021-5-8 18:39:40
|
只看該作者
本帖最后由 bs0303 于 2021-5-8 18:44 編輯
- Hook* hook2;
- struct {
- DWORD dwBase;
- DWORD dwLen;
- BYTE* strBuff;
- CString strRecv;
- CString strTempRecv;
- }recvPack;
- __declspec(naked) void recvHook(){
- __asm pushad
- //自己代碼
- __asm{
- mov recvPack.dwBase,ebx
- mov ecx,[edi]
- mov ecx,[ecx+0x8]
- mov edx,[edi]
- mov edx,[edx+0x4]
- sub ecx,edx
- add ecx,2
- mov recvPack.dwLen,ecx
- }
- recvPack.strBuff = new BYTE[recvPack.dwLen];
- ReadProcessMemory((HANDLE)-1,(LPCVOID)recvPack.dwBase,recvPack.strBuff,recvPack.dwLen,NULL);
- for(DWORD i=0; i<recvPack.dwLen; i++){
- recvPack.strTempRecv.Format(L"%02X ",recvPack.strBuff[i]);
- recvPack.strRecv+=recvPack.strTempRecv;
- }
- OutputDebug(L"包地址:0X%08X 包長(zhǎng):0X%02X===%08d 包內(nèi)容:%s",recvPack.dwBase,recvPack.dwLen,recvPack.dwLen,recvPack.strRecv);
- delete[] recvPack.strBuff;
- recvPack.strBuff = nullptr;
- recvPack.strRecv = "";
- __asm{
- popad
- mov ebp,dword ptr ds:[esi+0x2874]
- retn
- }
- }
- void CDLG::OnBnClickedButton10()
- {
- // TODO: 在此添加控件通知處理程序代碼
- hook2 = new Hook();
- hook2->onHook((DWORD)0x00B92931,(DWORD)recvHook,(BYTE)0xE8,6);
- }
- void CDLG::OnBnClickedButton11()
- {
- // TODO: 在此添加控件通知處理程序代碼
- hook2->unHook();
- delete hook2;
- hook2 = nullptr;
- }
復(fù)制代碼
傳的和視頻一樣的ebx |
|