[C/C++] CoD5WaW Multiplayer Patch

Dieses Thema im Forum "Projekte / Codes" wurde erstellt von N0S, 23. Juli 2010 .

Schlagworte:
  1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen
  1. #1 23. Juli 2010
    CoD5WaW Multiplayer Patch

    Wer keinen Bock hat einen Online Account zu erstellen (z.b. weil er keinen legalen Key hat), aber trotzdem gerne auf Server zocken möchte, braucht so einen Patch....

    Einfach starten, dann Spiel starten, Server joinen und dann wieder mit F2 entfernen damit man nicht von PB gekickt wird...

    Die Offsets sind für Version 1.7

    Code:
    #define _CRT_SECURE_NO_WARNINGS
    #include <stdio.h>
    #include <string.h>
    #include <windows.h>
    #include <tlhelp32.h>
    
    #define PROCESS "CoDWaWmp.exe"
    
    /*
    CoDWaWmp.exe international v1.7
    
    0049E992 /75 2C JNZ SHORT CoDWaWmp.0049E9C0 <---
    0049E994 |E8 47C71700 CALL CoDWaWmp.0061B0E0
    0049E999 |83F8 04 CMP EAX,4
    0049E99C |74 22 JE SHORT CoDWaWmp.0049E9C0
    0049E99E |68 98EB8300 PUSH CoDWaWmp.0083EB98
    0049E9A3 |6A 40 PUSH 40
    0049E9A5 |B0 01 MOV AL,1
    0049E9A7 |BF 0C9E8500 MOV EDI,CoDWaWmp.00859E0C ; ASCII "dw_connectafterlogin"
    */
    #define PATCH_ADD_INT 0x0049E992
    #define PATCH_ADD_DE 0x0049E812
    #define MAGIC_BYTE 0x75
    
    
    
    DWORD getProcessByName(char * processName);
    bool patchMemory( DWORD pid, DWORD address, BYTE byteReplace );
    bool checkGameVersion(DWORD pid);
    
    int main(int argc, char *argv[])
    {
     bool unpatched = true;
     bool internationalVersion = false;
    
     printf("CoD 5 WaW Multiplayer Patch\n\n");
     while (1)
     {
     //patch
     if(unpatched || ((GetAsyncKeyState(VK_F1)&1)==1))
     {
     DWORD pid = getProcessByName(PROCESS);
     if (pid != 0) 
     {
     unpatched = false;
     if(checkGameVersion(pid))
     {
     internationalVersion = true;
     if(patchMemory(pid,PATCH_ADD_INT,0xEB))
     {
     printf("Patch successfull\n");
     } else {
     printf("Error patch\n");
     }
     } else {
     if(patchMemory(pid,PATCH_ADD_DE,0xEB))
     {
     printf("Patch successfull\n");
     unpatched = false;
     } else {
     printf("Error patch\n");
     }
     }
     }
     }
     //unpatch
     if ((GetAsyncKeyState(VK_F2)&1)==1)
     {
     DWORD pid = getProcessByName(PROCESS);
     if (pid != 0) 
     {
     if(internationalVersion)
     {
     if(patchMemory(pid,PATCH_ADD_INT,0x75))
     {
     printf("Patch removed\n");
     } else {
     printf("Error unpatch\n");
     }
     } else {
     if(patchMemory(pid,PATCH_ADD_DE,0x75))
     {
     printf("Patch removed\n");
     } else {
     printf("Error unpatch\n");
     }
     }
     }
     }
     //exit
     if ((GetAsyncKeyState(VK_F3)&1)==1)
     {
     break;
     }
     Sleep(200);
     }
    
     return 0;
    }
    
    bool patchMemory( DWORD pid, DWORD address, BYTE byteReplace ) 
    {
     DWORD rBuf = 0;
     HANDLE hProcess = OpenProcess(PROCESS_VM_WRITE|PROCESS_VM_OPERATION, NULL, pid);
     if(!hProcess) {
     printf("Error OpenProcess %u\n",GetLastError());
     return 0;
     }
     BOOL wpmRet = WriteProcessMemory(hProcess,(LPVOID)address,&byteReplace,1,&rBuf);
     if (!wpmRet) {
     printf("Error WriteProcessMemory %u\n",GetLastError());
     return 0;
     }
    
     CloseHandle(hProcess);
    
     if (rBuf == 1)
     {
     return true;
     } else {
     return false;
     }
    }
    
    bool checkGameVersion(DWORD pid)
    {
     DWORD rBuf = 0;
     DWORD buff = 0;
    
     HANDLE hProcess = OpenProcess(PROCESS_VM_READ, NULL, pid);
     if(!hProcess) {
     printf("Error OpenProcess %u\n",GetLastError());
     return 0;
     }
    
     BOOL rpmRet = ReadProcessMemory(hProcess,(LPCVOID)PATCH_ADD_INT,&buff,1,&rBuf);
     if (!rpmRet) {
     printf("Error ReadProcessMemory %u\n",GetLastError());
     return 0;
     }
     CloseHandle(hProcess);
    
     if (rBuf == 1)
     {
     if (buff == MAGIC_BYTE)
     {
     printf("Detected international version\n");
     return true;
     } else {
     printf("Detected german version\n");
     return false;
     }
     } else {
     return false;
     }
    }
    
    DWORD getProcessByName(char * processName)
    {
     HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
     PROCESSENTRY32 pe32;
     pe32.dwSize = sizeof(PROCESSENTRY32);
    
     if( !Process32First( hProcessSnap, &pe32 ) )
     {
     printf("Error getting Process\n");
     CloseHandle( hProcessSnap );
     return 0;
     }
    
     do
     {
     if(!_stricmp(pe32.szExeFile, processName)) 
     {
     CloseHandle(hProcessSnap);
     return pe32.th32ProcessID;
     }
     } while(Process32Next(hProcessSnap, &pe32));
    
     CloseHandle(hProcessSnap);
     return 0;
    }
     

  2. Anzeige

  3. Videos zum Thema
Die Seite wird geladen...