Merhaba Arkadaşlar Sizlere Yeni bir Wallhack Kodlarıyla Birlikteyim
Zaten Yeni Başladım Hemen Sizlere Aktarayım.
Kodlar c++ Dilinde Yazılmış Olup Pc nizde C++ Yüklü Olması Gerekmektedir. Hemen Sizlere Kodları Aktarmak İstiyorum.
Commands.cpp
#include <stdio.h>
#include <string>
#include <windows.h>
#include <iostream>
#include <sstream>
enum MessageTypes { mERROR=0, mDATA, mINFO, mTEST };
enum Colors { dblue=1, dgreen, dcyan, dred, dpurple, dyellow, bgrey, dgrey, bblue, bgreen, bcyan, bred, bpurple, byellow, bwhite };
void changevalue(int player, int type, int value, int add);
bool StringToInt(const std::string &s, int &i);
void calc();
void msgprocessor(char* message)
{
char *ptr = message;
char field[50];
std::string scan[10];
int n;
int f = 0;
while ( sscanf(ptr, "%31[^ ]%n", field, &n) == 1 )
{
printf("field = \"%s\"\n", field);
scan[f] = field;
ptr += n;
if ( *ptr != ' ' )
{
break;
}
++ptr;
f++;
//printf("field = \"%s\"\n", scan[f]);
}
int player;
int value;
StringToInt(scan[1],player);
StringToInt(scan[4],value);
if(scan[0] == "Player" || scan[0] == "player")
{
std::cout << "Player #" << player;
if(scan[2] == "add")
{
std::cout << " is adding " << value;
if(scan[3] == "gold")
{
std::cout << " gold." << std::endl;
changevalue(player, 0, value, 1);
}
if(scan[3] == "lumber")
{
std::cout << " lumber." << std::endl;
changevalue(player, 1, value, 1);
}
if(scan[3] == "food")
{
std::cout << " food." << std::endl;
changevalue(player, 3, value, 1);
}
if(scan[3] == "maxfood")
{
std::cout << " maxfood." << std::endl;
changevalue(player, 2, value, 1);
}
}
if(scan[2] == "sub")
{
std::cout << " is subtracting " << value;
if(scan[3] == "gold")
{
std::cout << " gold." << std::endl;
changevalue(player, 0, value, 0);
}
if(scan[3] == "lumber")
{
std::cout << " lumber." << std::endl;
changevalue(player, 1, value, 0);
}
if(scan[3] == "food")
{
std::cout << " food." << std::endl;
changevalue(player, 3, value, 0);
}
if(scan[3] == "maxfood")
{
std::cout << " maxfood." << std::endl;
changevalue(player, 2, value, 0);
}
}
}
if(scan[0] == "recalc")
{
calc();
}
}
void cc(int color, char* output, bool endl)
{
HANDLE handle= GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute( handle, color);
if(endl == 1)
{
std::cout<< output << std::endl;
} else {
std::cout<< output;
}
SetConsoleTextAttribute( handle, color);
}
void toscreen(char* message, int type, bool descript, bool endl)
{
switch(type)
{
default:
break;
case 0:
if(descript == 1)
{
cc(bred, "[Error]: ", 0);
}
cc(bgrey, message, endl);
break;
case 1:
if(descript == 1)
{
cc(bcyan, "[Data]: ", 0);
}
cc(bgrey, message, endl);
break;
case 2:
if(descript == 1)
{
cc(bwhite, "[Info]: ", 0);
}
cc(bgrey, message, endl);
break;
case 3:
cc(bgrey, "Performing color test. This message should be Bright Grey.", 1);
cc(bblue, "[Bright Blue]: ", 0);
cc(bgrey, message, 1);
cc(bgreen, "[Bright Green]: ", 0);
cc(bgrey, message, 1);
cc(bcyan, "[Bright Cyan]: ", 0);
cc(bgrey, message, 1);
cc(bred, "[Bright Red]: ", 0);
cc(bgrey, message, 1);
cc(bpurple, "[Bright Purple]: ", 0);
cc(bgrey, message, 1);
cc(byellow, "[Bright Yellow]: ", 0);
cc(bgrey, message, 1);
cc(bgrey, "[Bright Grey]: ", 0);
cc(bgrey, message, 1);
cc(dgrey, "[Dark Grey]: ", 0);
cc(bgrey, message, 1);
cc(dblue, "[Dark Blue]: ", 0);
cc(bgrey, message, 1);
cc(dgreen, "[Dark Green]: ", 0);
cc(bgrey, message, 1);
cc(dred, "[Dark Red]: ", 0);
cc(bgrey, message, 1);
cc(dpurple, "[Dark Purple]: ", 0);
cc(bgrey, message, 1);
cc(dyellow, "[Dark Yellow]: ", 0);
cc(bgrey, message, 1);
cc(bwhite, "[Bright White]: ", 0);
cc(bgrey, message, 1);
break;
}
}
bool StringToInt(const std::string &s, int &i)
{
std::istringstream myStream(s);
if (myStream>>i)
{
return true;
} else {
return false;
}
}
Networking.cpp
#include <iostream>
#include <winsock2.h>
#include <windows.h>
#include <process.h>
#include <string.h>
#pragma comment(lib,"ws2_32.lib")
#define WM_SOCKET
void setupserverconnection( void *);
void setupclientconnection( void *);
void acceptclients( void *);
void receivedata( void *);
void msgprocessor( char* message);
void listener( void *);
void consolewait();
void toscreen(char* message, int type, bool descript, bool endl);
const int nMaxClients = 20;
const int DefaultBufferLen = 1024;
const int PORT = 8888;
int nClient = 0;
SOCKET Socket = NULL;
SOCKET ClientSocket[nMaxClients - 1];
sockaddr sockAddrClient;
u_long iMode=1;
bool needterminate = 0;
using namespace std;
char inputip[16];
bool server;
void netinit()
{
char response;
cout << "Will this be a server?(Y/N)" << endl;
cout << ">";
cin >> response;
if(response == 'Y' || response == 'y')
{
toscreen("Server initalizing.", 2, 1, 1);
_beginthread(setupserverconnection,0,0);
consolewait();
} else if (response == 'N' || response == 'n')
{
toscreen("Please enter the ip address of the server.", 2, 1, 1);
cin >> inputip;
_beginthread(setupclientconnection,0,0);
consolewait();
}
}
void consolewait()
{
char buffer[DefaultBufferLen];
int i = 0;
int iresult;
while(true)
{
std::cin.getline(buffer,sizeof(buffer));
if(server == 0)
{
send(Socket, buffer, DefaultBufferLen, 0);
} else if (server == 1)
{
while(iresult != 0);
{
send(ClientSocket[i], buffer, DefaultBufferLen, 0);
i++;
if(i == nMaxClients)
{
iresult = 0;
}
}
}
msgprocessor(buffer);
}
}
void setupclientconnection(void *arg)
{
server = 0;
// Initialise Winsock
WSADATA WsaDat;
if(WSAStartup(MAKEWORD(2,2),&WsaDat)!=0)
{
toscreen("Winsock error - Winsock initialization failed", 0, 1, 1);
WSACleanup();
_endthread();
}
// Create our socket
Socket=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(Socket==INVALID_SOCKET)
{
toscreen("Winsock error - Socket creation Failed!", 0, 1, 1);
WSACleanup();
_endthread();
}
// Resolve IP address for hostname
struct hostent *host;
if((host=gethostbyname("CJ-PC"))==NULL)
{
toscreen("Failed to resolve hostname.", 0, 1, 1);
WSACleanup();
_endthread();
}
// Setup our socket address structure
SOCKADDR_IN SockAddr;
SockAddr.sin_port=htons(8888);
SockAddr.sin_family=AF_INET;
SockAddr.sin_addr.s_addr=inet_addr(inputip);
// Attempt to connect to server
if(connect(Socket,(SOCKADDR*)(&SockAddr),sizeof(SockAddr))!=0)
{
toscreen("Failed to establish connection with server", 0, 1, 1);
WSACleanup();
_endthread();
}
toscreen("Connection to the server has been established", 2, 1, 1);
_beginthread(listener,0,0);
}
void listener(void * arg)
{
int iResult;
while(true)
{
char buffer[DefaultBufferLen];
if(recv(Socket,buffer,DefaultBufferLen,0))
{
char tmp[10];
char tmp2[10];
itoa(strlen(buffer),tmp2,10);
toscreen("The message \"", 1, 1, 0);
toscreen(buffer, 1, 0, 0);
toscreen("\" was received from the server with a length of ", 1, 0, 0);
toscreen(tmp2, 1, 0, 0);
toscreen(".",1, 0, 1);
msgprocessor(buffer);
}
}
}
void setupserverconnection(void *arg)
{
server = 1;
WSADATA WsaDat;
if(WSAStartup(MAKEWORD(2,2),&WsaDat)!=0)
{
toscreen("WSA Initialization failed!",0, 1, 1);
WSACleanup();
_endthread();
} else {
toscreen("WSA initialized.", 2, 1, 1);
}
Socket=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(Socket==INVALID_SOCKET)
{
toscreen("Socket creation failed.",0, 1, 1);
WSACleanup();
_endthread();
} else {
toscreen("Socket created.", 2, 1, 1);
}
SOCKADDR_IN serverInf;
serverInf.sin_family=AF_INET;
serverInf.sin_addr.s_addr=INADDR_ANY;
serverInf.sin_port=htons(PORT);
toscreen("Binded socket.", 2, 1, 1);
if(bind(Socket,(SOCKADDR*)(&serverInf),sizeof(serverInf))==SOCKET_ERROR)
{
toscreen("Unable to bind socket!",0, 1, 1);
WSACleanup();
_endthread();
} else {
toscreen("Socket binded successfully.", 2, 1, 1);
}
if(listen(Socket,SOMAXCONN)==SOCKET_ERROR)
{
toscreen("Unable to listen.", 0, 1, 1);
_endthread();
} else {
toscreen("Current state is listening.", 2, 1, 1);
}
_beginthread(acceptclients,0,0);
_beginthread(receivedata,0,0);
//_endthread();
}
void closeserverconnection()
{
shutdown(Socket,SD_SEND); // Shutdown our socket
closesocket(Socket);// Close our socket entirely
WSACleanup(); // Cleanup Winsock
}
void acceptclients(void *arg)
{
while(true)
{
if(nClient<nMaxClients)
{
int size=sizeof(sockaddr);
ClientSocket[nClient]=accept(Socket, &sockAddrClient, &size);
if (ClientSocket[nClient]==INVALID_SOCKET)
{
int nret = WSAGetLastError();
WSACleanup();
} else {
ioctlsocket(ClientSocket[nClient],FIONBIO,&iMode);
char tmp[10];
itoa(nClient,tmp,10);
toscreen("Client \"", 2, 1, 0);
toscreen(tmp, 2, 0, 0);
toscreen("\" has connected.", 2, 0, 1);
nClient++;
}
} else {
toscreen("nMaxClients has been reached. To change, edit nMaxClients.", 0, 1, 1);
break;
}
}
}
void receivedata(void *arg)
{
int n=0;
while(n<nMaxClients)
{
char buffer[DefaultBufferLen];
if(recv(ClientSocket[n],buffer,DefaultBufferLen,0) != -1)
{
char tmp[10];
char tmp2[10];
itoa(n,tmp,10);
itoa(strlen(buffer),tmp2,10);
toscreen("The message \"", 1, 1, 0);
toscreen(buffer, 1, 0, 0);
toscreen("\" was received from client ", 1, 0, 0);
toscreen(tmp, 1, 0, 0);
toscreen(" with a length of ", 1, 0, 0);
toscreen(tmp2, 1, 0, 0);
toscreen(".",1, 0, 1);
msgprocessor(buffer);
}
n++;
if(n == nMaxClients)
{
n=0;
}
}
}
main.cpp
//NetworkingHackWc3for Warcraft 3 Patch 1.24.X...
#include <windows.h>
#include <Tlhelp32.h>
#include <iostream>
using namespace std;
DWORD GetPIDForProcess (char* process);
void EnableDebugPriv();
DWORD GetDLLBase(char* DllName, DWORD tPid);
void netinit();
void toscreen(char* message, int type, bool descript, bool endl);
void calc();
HANDLE hProc;
DWORD gamebase;
DWORD base;
DWORD modifier = 0xACE5E0;
BYTE original[4] = { 0xC, 0x8, 0x4, 0x78};
DWORD multiplier[10][5] = {{ 0x2, 0x3, 0x5, 0x6},{ 0x2A, 0x2B, 0x2C, 0x2D},{ 0x52, 0x53, 0x54, 0x55},{ 0x7A, 0x7B, 0x7C, 0x7D},{ 0xA2, 0xA3, 0xA4, 0xA5},{ 0xCA, 0xCB, 0xCC, 0xCD},{ 0xF2, 0xF3, 0xF4, 0xF5},{ 0x11A, 0x11B, 0x11C, 0x11D}};
DWORD addresses[10][5];
int values[10][5];
int main()
{
cout << "NetworkingHackWc3 v0.5 by Uzil loaded (for WC3 v1.24)!" << endl << endl;
cout << "Searching Wc3..." << endl;
if(GetPIDForProcess("WAR3.EXE") == 0)
{
cout << "Warcraft 3 was not found..." << endl;
system("Pause");
exit(0);
}
else
{
toscreen("Getting debug privileges...", 2, 1, 1);
EnableDebugPriv();
toscreen("Opening Warcraft 3 Process...", 2, 1, 1);
hProc = OpenProcess(PROCESS_ALL_ACCESS, false, GetPIDForProcess("WAR3.EXE"));
if(hProc)
{
toscreen("Process opened... Calculating Game.dll base.", 2, 1, 1);
gamebase = GetDLLBase("Game.dll",GetPIDForProcess("WAR3.EXE"));
base = gamebase + modifier;
toscreen("Game base: ", 2, 1, 0);
printf("0x%X\n",gamebase);
toscreen("Getting player staic: ", 2, 1, 0);
printf("0x%X",gamebase);
toscreen(" + ", 2, 0, 0);
printf("0x%X\n",modifier);
toscreen("Player Static: ", 2, 1, 0);
printf("0x%X\n",base);
toscreen("Players static is calculated, calculating individual player resources.", 2, 1, 1);
calc();
netinit();
}
else
{
toscreen("Warcraft 3 could not be opened...", 0, 1, 1);
}
}
system("Pause");
return 0;
}
void calc()
{
int r = 0;
int p = 0;
DWORD dsize = 0;
for(p;p < 4;p++)
{
while(r < 8)
{
DWORD tmpbase = base;
DWORD tmpvalue;
ReadProcessMemory(hProc, reinterpret_cast<LPVOID>(tmpbase), &tmpbase, sizeof(tmpbase), &dsize);
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" address:", 2, 0, 0);
printf("0x%X\n",tmpbase);
tmpbase += original[0];
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" address:", 2, 0, 0);
printf("0x%X\n",tmpbase);
ReadProcessMemory(hProc, reinterpret_cast<LPVOID>(tmpbase), &tmpbase, sizeof(tmpbase), &dsize);
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" address:", 2, 0, 0);
printf("0x%X\n",tmpbase);
tmpbase += (multiplier[p][r]*original[1]) + original[2];
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" address:", 2, 0, 0);
printf("0x%X\n",tmpbase);
ReadProcessMemory(hProc, reinterpret_cast<LPVOID>(tmpbase), &addresses[p][r], sizeof(addresses[p][r]), &dsize);
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" address:", 2, 0, 0);
printf("0x%X\n",addresses[p][r]);
addresses[p][r] += original[3];
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" address:", 2, 0, 0);
printf("0x%X\n",addresses[p][r]);
ReadProcessMemory(hProc, reinterpret_cast<LPVOID>(addresses[p][r]), &tmpvalue, sizeof(tmpvalue), &dsize);
values[p][r] = tmpvalue;
toscreen("Player ", 2, 1, 0);
cout << p + 1;
toscreen(" resource ", 2, 0, 0);
cout << r + 1;
toscreen(" value:", 2, 0, 0);
cout << values[p][r] << endl;
r++;
}
r=0;
if(dsize == 0)
{
toscreen("Failed.", 0, 1, 1);
break;
}
}
}
void changevalue(int player, int type, int value, int add)
{
DWORD dsize = 0;
int tmpvalue;
int newvalue;
player = player - 1;
if(addresses[player][type] != 0)
{
ReadProcessMemory(hProc, reinterpret_cast<LPVOID>(addresses[player][type]), &tmpvalue, sizeof(tmpvalue), &dsize);
if(add == 1)
{
newvalue = tmpvalue + value;
WriteProcessMemory(hProc,reinterpret_cast<LPVOID>(addresses[player][type]),&newvalue,sizeof(newvalue), &dsize);
}
if(add == 0)
{
newvalue = tmpvalue - value;
WriteProcessMemory(hProc,reinterpret_cast<LPVOID>(addresses[player][type]),&newvalue,sizeof(newvalue), &dsize);
}
} else if(addresses[player][type] == 0)
{
toscreen("Player address not available.", 0, 1, 1);
}
if(dsize == 0)
{
toscreen("Failed.", 0, 1, 1);
}
}
//Queries the ProcessId of a certain process
DWORD GetPIDForProcess (char* process)
{
BOOL working=0;
PROCESSENTRY32 lppe= {0};
DWORD targetPid=0;
HANDLE hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS ,0);
if (hSnapshot)
{
lppe.dwSize=sizeof(lppe);
working=Process32First(hSnapshot,&lppe);
while (working)
{
if(_stricmp(lppe.szExeFile,process)==0)
{
targetPid=lppe.th32ProcessID;
break;
}
working=Process32Next(hSnapshot,&lppe);
}
}
CloseHandle( hSnapshot );
return targetPid;
}
//Enables to open other processes
void EnableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if ( ! OpenProcessToken( GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
return;
if ( ! LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &sedebugnameValue ) ){
CloseHandle( hToken );
return;
}
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if ( ! AdjustTokenPrivileges( hToken, FALSE, &tkp, sizeof tkp, NULL, NULL ) )
CloseHandle( hToken );
}
//Gets the base of our dll
DWORD GetDLLBase(char* DllName, DWORD tPid)
{
HANDLE snapMod;
MODULEENTRY32 me32;
if (tPid == 0) return 0;
snapMod = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, tPid);
me32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(snapMod, &me32)){
do{
if (strcmp(DllName,me32.szModule) == 0){
CloseHandle(snapMod);
return (DWORD) me32.modBaseAddr;
}
}while(Module32Next(snapMod,&me32));
}
CloseHandle(snapMod);
return 0;
}
Güle Güle Kullanın.
Linkback: https://www.buyuknet.com/warcraft-3-oyunu-icin-duvar-hilesi-kodlari-indir-t39975.0.html