All pastes #732908 Raw Edit

Model Edit Fix v2.2.3

public cpp v1 · immutable
·published 2007-10-11 11:40 UTC
rendered paste body
#include <Windows.h>#include <cstdio>int main(int argc, const char* argv[]) {	DWORD dwOffset = 0x00621CD7;	BYTE bEnable = 0x01;	BYTE bDisable = 0x00;	bool Enabled = true;	STARTUPINFO sInfo;	PROCESS_INFORMATION pInfo;	ZeroMemory(&sInfo, sizeof(sInfo));	sInfo.cb = sizeof(sInfo);	ZeroMemory(&pInfo, sizeof(pInfo));	if (CreateProcess(NULL, "WoW.exe", NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &sInfo, &pInfo)) {		if (WriteProcessMemory(pInfo.hProcess, (LPVOID)dwOffset, &bEnable, sizeof(bEnable), NULL)){			puts("Press END on your keyboard to disable the fix when prompted and HOME to enable it.\r");			puts("Once WoW has finished loading fully please press END then log in.\r");			puts("Once logged in (before or after entering the actual realm) press HOME to renable the fix and all model edits.\r");			puts("Hopfeully this inconvenience is only temporary, a 'better' fix is being worked on right now.\r");			while (true) {				if (Enabled) {					while (true) {					if (GetAsyncKeyState(VK_END)&1) {						WriteProcessMemory(pInfo.hProcess, (LPVOID)dwOffset, &bDisable, sizeof(bDisable), NULL);						puts("Patch disabled");						Enabled = false;						break;					}					Sleep(1);				}				} else {					while (true) {					if (GetAsyncKeyState(VK_HOME)&1) {						WriteProcessMemory(pInfo.hProcess, (LPVOID)dwOffset, &bEnable, sizeof(bEnable), NULL);						puts("Patch enabled");						Enabled = true;						break;					}					Sleep(1);					}				}				Sleep(1);			}		}	}	CloseHandle(pInfo.hProcess);	CloseHandle(pInfo.hThread);}