Originally Posted by
Lovroman
Code:
int main()
{
HANDLE snapshot = CreateToolhelp32Snapshot ( TH32CS_SNAPPROCESS, NULL );
PROCESSENTRY32 entry;
entry.dwSize = sizeof(PROCESSENTRY32);
while ( Process32Next ( snapshot, &entry ) == TRUE )
{
if ( stricmp ( entry.szExeFile, "CoDWaW" ) == 0 )
{
HANDLE hProcess = OpenProcess ( PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, FALSE, entry.th32ProcessID );
address = 0x123456;
BYTE width = 123;
WriteProcessMemory ( hProcess, (LPVOID)address, &width, sizeof(width), NULL );
}
}
cin.get();
}
Try this.
still didnt, heres mine, some things in it are from what i was using for another game so its just a base for my stuff right now.
Code:
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#pragma comment(lib, "user32.lib")
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "gogogokitty199's TDL ammo modifier\n";
cout << " \n";
HWND hWnd = FindWindow(0, L"CoDWaW.exe");
if (hWnd == 0){
cout << "could not find TDL.exe . Please verify that your game is running!\n";
}
else {
cout << "Found TDL.exe \n";
DWORD proc_id;
GetWindowThreadProcessId(hWnd, &proc_id);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
if (!hProc) {
cout << "error could not find the process \n";
}
else {
cout << "Found Contagion.exe \n";
DWORD Pointer = 0x018EF124;
DWORD Pointed;
WORD Offset = 0x0;
int CurrentAmmo = 0;
int newValue;
ReadProcessMemory(hProc, (LPCVOID)(Pointer), &Pointed, 4, NULL);
ReadProcessMemory(hProc, (LPCVOID)(Pointer + Offset), &CurrentAmmo, 4, NULL);
cout << "enter your desired amount of ammo, max is 230 ";
cin >> newValue;
int Success = WriteProcessMemory(hProc, (LPVOID)(Pointed + Offset), &newValue, (DWORD) sizeof(newValue), NULL);
if (Success > 0){
ReadProcessMemory(hProc, (LPCVOID)(Pointer), &Pointed, 4, NULL);
ReadProcessMemory(hProc, (LPCVOID)(Pointer + Offset), &CurrentAmmo, 4, NULL);
cout << "your ammo has been loaded into your mag \n";
cin.get();
}
else{
cout << "Error could not write to process memory";
}
}
}
cin.get();
return 0;
}
also im very new to this stuff, i only have about 8 hours total of learning so far.