Results 1 to 8 of 8

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Grooguz
    Grooguz is offline
    BanHammer Holder
    Grooguz's Avatar
    Join Date
    2010 May
    Posts
    678
    Thanks Thanks Given 
    152
    Thanks Thanks Received 
    537
    Thanked in
    167 Posts
    Rep Power
    15

    Memory Hacking with C and CheatEngine, writing to Process Memory

    Learn to create a trainer (a program that writes to remote process memory) in C++ using a Calculator as an example. There are also references to cheat engine.


    Source Code
    #include <iostream>
    #include <windows.h>

    // FindWindow();
    // GetWindowThreadProcessId();
    // OpenProcess();

    // WriteProcessMemory();

    // CloseHandle();

    using namespace std;

    int main()
    {
    int newValue = 500;

    HWND hWnd = FindWindow(0, "Calculator");

    if (hWnd == 0) {
    cerr << "Cannot find window." << endl;
    } else {
    DWORD pId;
    GetWindowThreadProcessId(hWnd, &pId);
    HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);

    if (!hProc) {
    cerr << "Cannot open process." << endl;
    } else {
    int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x000AFCC4, &newValue, (DWORD)sizeof(newValue), NULL);

    if (isSuccessful > 0) {
    clog << "Process memory written." << endl;
    } else {
    cerr << "Cannot write process memory." << endl;
    }

    CloseHandle(hProc);
    }
    }

    return 0;
    }

    by Hero

  2. The Following 2 Users Say Thank You to Grooguz For This Useful Post:


Similar Threads

  1. Replies: 2
    Last Post: 2018-04-02, 04:48 PM
  2. [C#] How to Read and Write to the Process Memory
    By Grooguz in forum VB, .NET Framework
    Replies: 0
    Last Post: 2011-11-27, 05:27 AM
  3. Flash games memory hacking using MHS
    By Dwar in forum Game Researching Tutorials
    Replies: 3
    Last Post: 2011-08-01, 11:54 PM
  4. [C++] Memory-writing functions
    By Dwar in forum C/C++
    Replies: 0
    Last Post: 2010-11-29, 04:14 PM
  5. [Memory Scanner] Memory Hacking Software
    By Dwar in forum Files & Tools
    Replies: 3
    Last Post: 2010-11-29, 03:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •