Thread: No Recoil

Results 1 to 6 of 6
  1. #1
    LEGiiTxCHAOTiiC's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    Chicago
    Posts
    200
    Reputation
    39
    Thanks
    70

    No Recoil

    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();
    }
    Last edited by LEGiiTxCHAOTiiC; 06-26-2012 at 02:53 PM.

  2. #2
    intervention61's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    285
    Reputation
    10
    Thanks
    829
    My Mood
    Cool
    Code:
    // [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
    }
    hmm ? recoilAmount is the buffer which contains the data that will be written to the process & address you specify.
    WriteProcessMemory() returns zero if it failed else sucess. So to check whether it failed or succeeded you gotta check its return value.

    Quick example( keep debug privilages in mind aswell ):
    Code:
    void main()
    {
    	SetConsoleTitleA("Example");
    
    	HWND hWnd;
    	while( !( hWnd = FindWindow( "IW4", NULL ) ) )
    		Sleep( 100 );
    
    	printf( "MW2 Found\n" );
    
    	DWORD PID;
    	while( !( GetWindowThreadProcessId( hWnd, &PID ) ) )
    		Sleep( 100 );
    
    	printf( "Process ID Acquired\n" );
    
    	HANDLE hProcess;
    	while( !( hProcess = OpenProcess( PROCESS_ALL_ACCESS, 0, PID ) ) )
    		Sleep( 100 );
    
    	printf( "Handle Acquired\n" );
    
    	int Buffer = 0;
    	if( WriteProcessMemory( (HANDLE)hProcess, (PVOID)0xB35980, &Buffer, 4, 0 ) )
    	{
    		printf( "Success\n" );
    	}
    	else
    	{
    		LPVOID ErrorMessage;
    		FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), LANG_USER_DEFAULT, (LPSTR)&ErrorMessage, 0, NULL );
    		printf( "Error: %s\n", ErrorMessage );
    	}
    
    	CloseHandle( hProcess );
    }
    Last edited by intervention61; 06-26-2012 at 04:15 PM.
    "Joker: why the hakcer are steaklign us name it´s the greatest asshole and motherfucker and i fuck him or her mother"

  3. #3
    aIW|Convery's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    2,876
    Reputation
    124
    Thanks
    595
    My Mood
    Cynical
    Can't think of any OS where the base + offset would result in that address..

  4. #4
    LEGiiTxCHAOTiiC's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    Chicago
    Posts
    200
    Reputation
    39
    Thanks
    70
    Quote Originally Posted by aIW|Convery View Post
    Can't think of any OS where the base + offset would result in that address..
    How should it work then, without typing it out for me, explain? I'm a C#/Java/Python/Ruby programmer, I don't use C++ alot, only C when I need to.

  5. #5
    aIW|Convery's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    2,876
    Reputation
    124
    Thanks
    595
    My Mood
    Cynical
    Use C#/Java/Python/Ruby then..

  6. #6
    intervention61's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    285
    Reputation
    10
    Thanks
    829
    My Mood
    Cool
    Also the offset your patching is recoil angles, youd have to put in a loop and constantly overwrite 0 to get no recoil. Its probably detected aswell. There are easier ways to do no recoil, go analyse.
    "Joker: why the hakcer are steaklign us name it´s the greatest asshole and motherfucker and i fuck him or her mother"

Similar Threads

  1. How to find Recoil and Spread addresses?
    By V1olATor in forum WarRock - International Hacks
    Replies: 5
    Last Post: 04-20-2007, 10:50 AM
  2. No Recoil Hack
    By quin123 in forum CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    Replies: 9
    Last Post: 03-21-2007, 04:14 PM
  3. America's Army No Recoil/Reload LUA code.
    By MagikBullet in forum General Game Hacking
    Replies: 7
    Last Post: 02-25-2007, 11:11 AM
  4. No recoil hack????
    By max.here in forum WarRock - International Hacks
    Replies: 2
    Last Post: 02-21-2007, 06:52 AM
  5. No recoil/no spread addys?
    By IBEZ in forum WarRock - International Hacks
    Replies: 8
    Last Post: 01-14-2007, 09:39 PM

Tags for this Thread