[REQ] [C++] Basic Memory Read/Write Script

whoonga

Active member
Joined
Nov 6, 2014
Messages
52
Reaction score
0
Hello,
i request a C++ Console-Project, to start coding in C++.
It should includes the Basic Read/Write Memory functions.
:urtheman:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
If you wanna start coding shouldn't you learn how to make a basic console-project by yourself?
It's the very first and basic lesson in any c++ tutorial.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,488
Reaction score
231
Location
( ͡° ͜ʖ ͡°)
YNO TAKE A LOOK AT THE C++ section?


Code:
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <windows.h>
#include <tlhelp32.h>

using namespace std;

int main()
{
    SetConsoleTitle("FreezeRotation.eXe by Opcode.eXe");
    cout << "FreezeRotation - makes your car hard like 0x688 nipples!" << endl;
    cout << "Looking for GTA:SA:MP window." << endl;
    // MA VARIABLES
    DWORD pId;
    DWORD dwOldProtect = 0;
    HANDLE pHandle;
    HWND hWnd = 0;
    DWORD vpointer = 0;
    DWORD collflags;
    DWORD spin;
    BYTE inair;
    float zero = 0.0;
    while(hWnd == 0){
        hWnd = FindWindow(0, "GTA:SA:MP");
        Sleep(100);
    }
    cout << "Just found the window. FreezeRotation has been started." << endl;

    GetWindowThreadProcessId(hWnd, &pId);
    pHandle = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATION, TRUE, pId);

    while(true){
        ReadProcessMemory(pHandle, (LPCVOID)0xBA18FC, &vpointer, 4, 0);
        if(vpointer >= 1)
        {
            collflags = vpointer + 185;
            ReadProcessMemory(pHandle, (LPCVOID)collflags, &inair, 1, 0);
            if(inair == false){
                WriteProcessMemory(pHandle, (LPVOID)(vpointer + 0x50), (LPVOID)&zero, 4, NULL);
                WriteProcessMemory(pHandle, (LPVOID)(vpointer + 0x50 + 4), (LPVOID)&zero, 4, NULL);
                WriteProcessMemory(pHandle, (LPVOID)(vpointer + 0x50 + 8), (LPVOID)&zero, 4, NULL);
            }
        }
        Sleep(10);
    }
    CloseHandle(pHandle);
    return 0;
}
 
Top