吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 654|回复: 6
收起左侧

[求助] ReadProcessMemory读内存

[复制链接]
jzwyq 发表于 2025-4-16 20:58
ReadProcessMemory读其他进程内存返回ERROR_PARTIAL_COPY是程序有什么读写保护吗

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| jzwyq 发表于 2025-4-17 09:24
本帖最后由 jzwyq 于 2025-4-17 09:32 编辑

HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, targetProcessId);
if (hProcess == NULL) {
        cout << "Failed to open process. Error: " << GetLastError() << endl;
        system("pause");
        return 1;
}

// 自定义函数,用于获取所有符合条件的目标地址  
std::vector<DWORD> GetTargetAddresses(HANDLE hProcess) {
        // 地址范围  
        DWORD startAddress = 0x82650004; // 起始地址  
        DWORD endAddress = 0x827fffff;   // 结束地址  
        char mem[sizeof(int) * 16 * 6] = { 0 }; // 存储读取值  
        std::vector<DWORD> targetAddresses;    // 用于存储所有符合条件的地址  
       
        // 遍历地址范围  
        for (DWORD currentAddress = startAddress; currentAddress <= endAddress; currentAddress += 0x10) {

                // 读取指定内存  
                if (ReadProcessMemory(hProcess, (LPCVOID)currentAddress, &mem, sizeof(mem), NULL)) {
                        if (*(int*)(&mem[8]) == 0x01 &&
                                *(int*)(&mem[16]) == 0x0 &&
                                *(int*)(&mem[24]) == 0x0193 &&
                                *(long long*)(&mem[48]) == 0x0 &&
                                *(int*)(&mem[72]) == 0x01 &&
                                *(int*)(&mem[80]) == 0x0) {
                                targetAddresses.push_back(currentAddress);
                        }
                }
                else {
                        cout << "Failed to read memory!  Error:" << GetLastError() << endl;
                }
        }

        // 修改起始地址为另一个偏移  
        startAddress = 0x8265000c;
        for (DWORD currentAddress = startAddress; currentAddress <= endAddress; currentAddress += 0x10) {
                if (ReadProcessMemory(hProcess, (LPCVOID)currentAddress, &mem, sizeof(mem), NULL)) {
                        if (*(int*)(&mem[8]) == 0x01 &&
                                *(int*)(&mem[16]) == 0x0 &&
                                *(int*)(&mem[24]) == 0x0193 &&
                                *(long long*)(&mem[48]) == 0x0 &&
                                *(int*)(&mem[72]) == 0x01 &&
                                *(int*)(&mem[80]) == 0x0) {
                                targetAddresses.push_back(currentAddress);
                        }
                }
                else {
                        cout << "Failed to read memory!  Error:" << GetLastError() << endl;
                }
        }
        return targetAddresses;}这是我的代码,遇到这种问题一般要怎么排查的 如果是对方有保护的话还有办法吗
Eaglecad 发表于 2025-4-16 21:42
董督秀 发表于 2025-4-16 22:32
tanglikecuan 发表于 2025-4-17 08:11
这一句话无法分析是不是保护造成的,有权限、32/64不匹配、保护、内存动态变化、缓存不足都会造成这个问题。
 楼主| jzwyq 发表于 2025-4-17 09:13
遇到这种问题一般要怎么分析排查呢
你好,再见 发表于 2025-4-17 10:28
你用ce读一下看看能不能正常读出来?
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-5-29 11:01

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表