Source:Warcraft3NameSpoofer
Contents |
A "namespoofer" for the PC game Warcraft 3 (version 1.22).
#include <windows.h>#include <psapi.h>#include <iostream>#include <Tlhelp32.h>#include <fstream>#include "colors.cpp"using namespace std;
// Debug Priviledges.void EnableDebugPriv( )
{HANDLE hToken;
LUID sedebugnameValue; TOKEN_PRIVILEGES tkp;OpenProcessToken( GetCurrentProcess( ), TOKEN_ADJUST_PRIVILEGES |TOKEN_QUERY, &hToken );
LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &sedebugnameValue );
tkp.PrivilegeCount = 1;tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges( hToken, false, &tkp, sizeof( tkp ), NULL, NULL );
CloseHandle( hToken );
} int main()
{SetConsoleTitle("GayPimp's Namespoofer for Warcraft III 1.22.");
SetColor(7);
cout <<" ||||||||||||||||||||||||||||||||||||||||||||||||||||\n";
SetColor(-20);
cout <<" ~GayPimp's ";
SetColor(-2);
cout <<"N";
SetColor(2);
cout <<"a";
SetColor(3);
cout <<"m";
SetColor(4);
cout <<"e";
SetColor(5);
cout <<"s";
SetColor(6);
cout <<"p";
SetColor(7);
cout <<"o";
SetColor(8);
cout <<"o";
SetColor(9);
cout <<"f";
SetColor(10);
cout <<"e";
SetColor(11);
cout <<"r";
SetColor(12);
cout <<" for Warcraft III 1.22.0.6328~\n";
SetColor(7);
cout <<" ||||||||||||||||||||||||||||||||||||||||||||||||||||\n" << endl;
SetColor(10);
cout <<" Do NOT use this program before playing a Battle.net Ladder game." << endl << endl;
SetColor(-2);
cout <<" Yellow: |CFFFFFF00 ";
SetColor(2);
cout <<"NinjaTurtleGreen: |CFF008000" << endl;
SetColor(3);
cout <<" Pale Blue: |CFF008080 ";
SetColor(4);
cout <<"Wine Red: |CFF800000" << endl;
SetColor(5);
cout <<" Purple: |CFF800080 ";
SetColor(6);
cout <<"Mustard: |CFF808000" << endl;
SetColor(7);
cout <<" Pale Grey: |CFFC0C0C0 ";
SetColor(8);
cout <<"Grey: |CFF808080" << endl;
SetColor(9);
cout <<" Blue: |CFF0000FF ";
SetColor(10);
cout <<"Green: |CFF00FF00" << endl;
SetColor(11);
cout <<" Cyan: |CFF00FFFF ";
SetColor(12);
cout <<"Red: |CFFFF0000" << endl;
SetColor(-3);
cout <<" Pink: |CFFFF0000 ";
SetColor(-1);
cout <<"White: |CFFFFFFFF" << endl;
SetColor(1);
cout <<" Teal: |CFF000080 ";
SetColor(-1);
cout <<"Black: |CFF000000 " << endl <<endl;
cout <<"Detecting Battle.net lobby... " << endl <<endl;
SetColor(11);
EnableDebugPriv();
TCHAR War3Name[32] = TEXT("Warcraft III");
HWND hWar3 = FindWindow(War3Name, NULL);
if(!hWar3)
{cout << "Warcraft 3 was not found. Please make sure the game is running." << endl;
system( "pause" );
return 1;
} DWORD pid;GetWindowThreadProcessId( hWar3, &pid );
HANDLE hOpen = OpenProcess( PROCESS_ALL_ACCESS, false, pid );
if( !hOpen )
{cout << "Can't open Warcraft III process." << endl;system( "pause" );
return 1;
} // Finding the name's address.DWORD Address = 764;
DWORD Buffer = 0;
DWORD WINAPI GetLastError(void);
SIZE_T BytesRead = 0;
for (;;)
{ReadProcessMemory(hOpen, (LPCVOID)Address, &Buffer, 4, &BytesRead);
if(Buffer == 1463898675)
{ // ROC (3RAW).Address -= 32;
break;
}else if
(Buffer == 1462982736)
{ // TFT (PX3W).Address-= 32;
break;
} else {Address += 65536;
} } // Couting out name.while(1)
{char Name[16];
Name[15] = 0;
DWORD Address2 = 111665304;
for( unsigned int i = 0; i < 15; i++ )
{ReadProcessMemory( hOpen, (LPVOID)( Address2 + i), &Buffer, 1, &BytesRead );
Name[i] = Buffer;
} //CloseHandle( hOpen ); SetColor(11);
cout << "Your current name is: ";
SetColor(-1);
cout << Name << endl << endl;
SetColor(-2);
cout << "Please type in a new name and press enter." << endl << endl;
SetColor(-1);
// Changing the name.SIZE_T BytesWritten = 0;
char NewName[16];
memset(NewName, 0, 16 );
cin.getline (NewName,16);
for( unsigned int j = 0; j < 15; j++ )
{WriteProcessMemory( hOpen, (LPVOID)(Address + j), (LPCVOID)(NewName+ j), 1, &BytesWritten );
} SetColor(11);
cout << "\n";
cout << "Your new name is: ";
SetColor(-1);
cout << NewName << endl << endl;
} }