zoukankan      html  css  js  c++  java
  • c++ 修改内存

        HWND hwnd = FindWindow(NULL, TEXT("Form1"));
    
        DWORD dwProcessId;
        (VOID)GetWindowThreadProcessId(hwnd, &dwProcessId);
        HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_VM_WRITE |
            PROCESS_VM_READ,
            FALSE, dwProcessId);
    
        DWORD numBytesRead;
        PVOID pDestination = (PVOID)0x02233C70;//内存地址
        BYTE MyData[4] = { 0 & 0x000000ff, (0 & 0x0000ff00) >> 8, (0 & 0x00ff0000) >> 16, (0 & 0xff000000) >> 24 };
        BOOL fSuccess = WriteProcessMemory(hProcess, pDestination, (PVOID)MyData, 4, NULL);
        while (1)
        {
            ReadProcessMemory(hProcess, (LPCVOID)(0x02233C70), &MyData, sizeof(DWORD), &numBytesRead);
            for (int i = 0; i < 4; i++)
                printf(" %.2x", MyData[i]);
            printf("
    ");
            Sleep(100);
        }
  • 相关阅读:
    SQL Server
    SQL Server
    SQL Server
    SQL Server
    SQL Server
    SQL Server
    SQL Server
    ssh保持连接不断开
    如何查看linux是否打开虚拟化
    dd命令详解
  • 原文地址:https://www.cnblogs.com/diose/p/5555769.html
Copyright © 2011-2022 走看看