Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Hello and welcome to the "MW2_HACK.h" file that includes the following things:
- -Stats Addressesions
- -2 Memory Write Functions
- -1 Get Proccess Functions
- ETC, ETC, ETC*/
- //Declarations
- #ifndef MW2HACK_H
- #define MW2HACK_H
- #include <windows.h>
- #include <cstdlib>
- #include <iostream>
- #include <cstdio>
- #include <stdio.h>
- #include <string.h>
- #include <tlhelp32.h>
- using namespace std;
- #define Game_Process_Name "iw4mp" //Modern Warfare 2
- BYTE JMP[1] = {0xEB}; //JMP Byte
- BYTE Nop2[2] = {0x90, 0x90}; //Nop2 Bytes
- BYTE Nop6[6] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; //Nop6 Bytes
- //Stats Addresses Credits::DNA
- #define XP 0x01B2B81C
- #define SCORE 0x01B2B82C
- #define WINS 0x01B2B864
- #define LOSSES 0x01B2B868
- #define TIES 0x01B2B86C
- #define WSTREAK 0x01B2B870
- #define KILLS 0x01B2B830
- #define HEADSHOTS 0x01B2B844
- #define ASSISTS 0x01B2B840
- #define KSTREAK 0x01B2B834
- #define DEATHS 0x01B2B838
- #define TIMEPLAYED 0x01B2B850
- #define PRESTIGE 0x01B2B824
- //Perks Addresses Credits::DNA
- #define Marathon 0x01B2BF6B
- #define SteadyAim 0x01B2BF6C
- #define Ninja 0x01B2BF6D
- #define Scrambler 0x01B2BF6E
- #define SleightOfHand 0x01B2BF6F
- #define Bling 0x01B2BF70
- #define StoppingPower 0x01B2BF71
- #define Hardline 0x01B2BF72
- #define OneManArmy 0x01B2BF73
- #define ColdBlooded 0x01B2BF74
- #define LastStand 0x01B2BF75
- #define Scavenger 0x01B2BF76
- #define Commando 0x01B2BF77
- #define SitRep 0x01B2BF78
- #define LightWeight 0x01B2BF79
- #define DangerClose 0x01B2BF7A
- // === Main Functions.... ===
- void WriteMemory(DWORD Address, void* bytes, DWORD Size) { //Write Proccess Function 1 Credits::war3zdude92 a.k.a Archangel
- DWORD flOldProtect = 0;
- VirtualProtect((void*)Address, Size, PAGE_EXECUTE_READWRITE, &flOldProtect);
- memcpy((void*) Address, bytes, Size);
- VirtualProtect((void*)Address, Size, flOldProtect, &flOldProtect);
- }
- //Send Command To Console Function
- void (__cdecl *SendCommandToConsole)(int a1,int a2,char *cvar)=(void (__cdecl *)(int,int,char *))0x00000;
- //Other....Credits::jaBBa
- DWORD GetProcessPID(char* processName);
- BOOL PatchMemory(HANDLE processH, LPVOID address, BYTE* patch, DWORD size);
- BOOL PatchMemory(HANDLE processH, LPVOID address, BYTE* patch, DWORD size) //Write Memory Function 2 Cretis::jaBBa
- {
- DWORD rBuf = 0;
- DWORD dwOldProt;
- if (VirtualProtectEx(processH,address,size,PAGE_EXECUTE_READWRITE,&dwOldProt) == 0) { //Delete if you want, not necessary
- printf("\nError VirtualProtectEx %X",GetLastError());
- return FALSE;
- }
- WriteProcessMemory(processH,address,patch,size,&rBuf); //writeprocess
- if(rBuf == 0) {
- return FALSE;
- }
- printf("\nPatch Address: 0x%08X",address); //print out which adress was patched
- VirtualProtectEx(processH,address,size,dwOldProt,NULL); //delete if you want
- return TRUE;
- }
- #endif /*MW2HACK_H*/
Advertisement
Add Comment
Please, Sign In to add comment