能力值:
( LV2,RANK:10 )
|
-
-
2 楼
// 获取当前模块基址
DWORD ImageBase = (DWORD)GetModuleHandle(NULL);
// 获取DOS头
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hModule;
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
return -1;
}
// 获取NT头
PIMAGE_NT_HEADERS32 pNtHeader = (PIMAGE_NT_HEADERS32)((BYTE*)ImageBase + pDosHeader->e_lfanew);
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
return -1;
}
// 获取Optional头
PIMAGE_OPTIONAL_HEADER32 pOptHeader = &pNtHeader->OptionalHeader;
DWORD imageBase = pOptHeader->ImageBase; // 注意:实际基址可能因ASLR改变
// 获取节区表
PIMAGE_SECTION_HEADER pSectionHeader = IMAGE_FIRST_SECTION(pNtHeader);
WORD numSections = pNtHeader->FileHeader.NumberOfSections;
char* buff;
SIZE_T* Real_len;
DWORD textSize;
// 查找.text节
for (int i = 0; i < numSections; i++) {
if (memcmp(pSectionHeader[i].Name, ".text", 5) == 0) {
DWORD textVA = pSectionHeader[i].VirtualAddress;
textSize = pSectionHeader[i].Misc.VirtualSize;
//读取代码段
ReadProcessMemory(GetCurrentProcess(), imageBase + textVA , &buff, 0x0e6c, &Real_len);
VirtualAlloc(&buff, textSize, MEM_RESERVE, PAGE_READWRITE);
break;
}
}
//然后计算crc
DWORD CrcCode = DataCrc(&buff, 0x0e6c);
不知道这样行不行?请大佬指点
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
有用 不过大概率没用 你要检测的时候 等你远线程创建完 别人都已经改完了 所以你检测出来的永远是对的 而且你应该检测区段是否可执行吧 ?
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
许瑞
有用 不过大概率没用 你要检测的时候 等你远线程创建完 别人都已经改完了 所以你检测出来的永远是对的
而且你应该检测区段是否可执行吧 ?
如果我把数据传到远程呢? // 查找.text节 for (int i = 0; i < numSections; i++) { // if (memcmp(pSectionHeader[i].Name, ".text", 5) == 0) #define IMAGE_SIZEOF_SHORT_NAME 8 if (0 == memcmp(pSectionHeader[i].Name, ".text", min(strlen(".text"), IMAGE_SIZEOF_SHORT_NAME))) { DWORD textActualVA = (DWORD)hModule + pSectionHeader[i].VirtualAddress; DWORD textSize = pSectionHeader[i].Misc.VirtualSize; TracePrint("ZHTP: 打印 textVA:%d textSize:%d ", textActualVA, textSize); return crc32_calculate((BYTE*)textActualVA, textSize); } } 我直接这样验证crc
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
zhonghuayi
如果我把数据传到远程呢?
// 查找.text节
for (int i = 0; i < numSections; i++) {
// if (memcmp(pSectionHeade ...
我只能这么说除非你知道原本正确的CRC 要不然没用 基本上老游戏 如果已经被外挂盯上了 就是说外挂作者可以通过卖挂或者其他手段有足够收益 那么简单的反挂已经是不起作用了
|
|
|