魔改C++x64超级HOOK源码针对send和recv进行HOOK
魔改C++x64超级HOOK源码针对send和recv进行HOOK
调用例子:
#include "SuperHook.h"
#include <Windows.h>
using namespace std;
void _fastcall MySend(SOCKET s, char* buf, int length, int flags) {
//参数都是直接可用的,在多线程下可能寄存器的值会被其他线程写入冲突,这里不建议读取寄存器的值
Register l_reg = g_SuperHook_x64.ReadAllRegister(g_HookDataRecv.ReturnRegisterAddress);
std::cout << "rax:" << l_reg.rax << std::endl;
std::cout << "rbx:" << l_reg.rbx << std::endl;
std::cout << "rdx:" << l_reg.rdx << std::endl;
std::cout << "rcx:" << l_reg.rcx << std::endl;
std::cout << "rsi:" << l_reg.rsi << std::endl;
std::cout << "rdi:" << l_reg.rdi << std::endl;
std::cout << "rsp:" << l_reg.rsp << std::endl;
std::cout << "rbp:" << l_reg.rbp << std::endl;
std::cout << "r8:" << l_reg.r8 << std::endl;
std::cout << "r9:" << l_reg.r9 << std::endl;
std::cout << "r10:" << l_reg.r10 << std::endl;
std::cout << "r11:" << l_reg.r11 << std::endl;
std::cout << "r12:" << l_reg.r12 << std::endl;
std::cout << "r13:" << l_reg.r13 << std::endl;
std::cout << "r14:" << l_reg.r14 << std::endl;
std::cout << "r15:" << l_reg.r15 << std::endl;
}
void _fastcall MyRecv(SOCKET s, char* buf, int length, int flags) {
//参数都是直接可用的,在多线程下可能寄存器的值会被其他线程写入冲突,这里不建议读取寄存器的值
Register l_reg = g_SuperHook_x64.ReadAllRegister(g_HookDataRecv.ReturnRegisterAddress);
std::cout << "rax:" << l_reg.rax << std::endl;
std::cout << "rbx:" << l_reg.rbx << std::endl;
std::cout << "rdx:" << l_reg.rdx << std::endl;
std::cout << "rcx:" << l_reg.rcx << std::endl;
std::cout << "rsi:" << l_reg.rsi << std::endl;
std::cout << "rdi:" << l_reg.rdi << std::endl;
std::cout << "rsp:" << l_reg.rsp << std::endl;
std::cout << "rbp:" << l_reg.rbp << std::endl;
std::cout << "r8:" << l_reg.r8 << std::endl;
std::cout << "r9:" << l_reg.r9 << std::endl;
std::cout << "r10:" << l_reg.r10 << std::endl;
std::cout << "r11:" << l_reg.r11 << std::endl;
std::cout << "r12:" << l_reg.r12 << std::endl;
std::cout << "r13:" << l_reg.r13 << std::endl;
std::cout << "r14:" << l_reg.r14 << std::endl;
std::cout << "r15:" << l_reg.r15 << std::endl;
}
SuperHook_x64 g_SuperHook_x64;
HookData g_HookDataSend;
HookData g_HookDataRecv;
void main() {
g_SuperHook_x64.HookSend(MySend, g_HookDataSend);
g_SuperHook_x64.HookRecv(MyRecv, g_HookDataRecv);
while (true) {
if (getchar() == 0x61) {
break;
}
}
g_SuperHook_x64.UnInstall();
}
回复下载源码:
**** Hidden Message *****
查看本帖隐藏 好好学习天天向上 好东西看看吧 好好学习天天向上
页:
[1]