(Jun 26, 2012 11:55 AM)MatthewHodnick Wrote: Ok, so I can't get no recoil to work with my current code. Can anyone help? I don't know what value to set the address and I also don't know if the address is correct. This is fourDeltaOne by the way. Another problem I have is checking if the value is correct, there's an if statement on line 43. Here's the current code:
Code// MW2_NoRecoil.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
void pauseScreen(); // prototype
int _tmain(int argc, _TCHAR* argv[]) // main method
{
int recoilAmount = 0; // a variable to disable recoil, takes effect in WriteProcessMemory()
SetConsoleTitle(L"MW2 fourDeltaOne No Recoil - by LEGiiTxCHAOTiiC / Piggy"); // title of CMD window
HWND hWnd = FindWindow(NULL, TEXT("Modern Warfare 2")); // find the 4D1 window
if(hWnd == NULL) // if unable to find window
{
std::cerr << "\n\n\nERROR :: Cannot find fourDeltaOne window" << std::endl; // print error
}
else // if able to find window
{
std::cout << "Welcome to MW2 fourDeltaOne No Recoil!" << std::endl; // intro message
DWORD pId; // process id
GetWindowThreadProcessId(hWnd, &pId); // get the window's process id
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId); // open 4D1 process
if(!hProc) // if can't open 4D1 process
{
std::cerr << "\n\n\nERROR :: Cannot open process" << std::endl; // print error
}
else // if it works
{
// [iw4mp.exe+0x1AABE1]
WriteProcessMemory(hProc, (LPVOID)0xB35980, &recoilAmount, (DWORD)sizeof (recoilAmount), NULL); // this is where we write the memory to prevent recoil effect
if(recoilAmount == 0) // if success
{
std::clog << "\n\n\nSUCCESS :: Process memory written - Your stats should be changed" << std::endl; // print succes
}
else // if fail
{
std::cerr << "\n\n\nERROR :: Process write failure - Cannot change your stats" << std::endl; // print error
}
CloseHandle(hProc); // unhook from mw2
}
}
pauseScreen();
return 0;
}
void pauseScreen() // pause console to allow user to see output
{
std::cout << "\n\n\nPress <Enter> to continue..." << std::endl;
std::cin.clear();
std::cin.ignore();
}
[/CODE]
I have a great idea. Stop copy pasting you fucking piece of shit and go actually learn something. Stupid leecher.
