- Sponsored Advertisement -
Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
Battlefield 2 hacks cheats tutorials source code
You are Unregistered, please register to gain Full access.
Adding Scoreboard to your hack
04-16-2010, 03:52 AM
#1 Supreme H4x0|2 Join Date: Feb 2010
Location: Chattanooga, TN
Posts: 654
Reputation: 36845 Rep Power: 406
Adding Scoreboard to your hack
First things first credit
Roverturbo P47R!CK Jugga Ultimate-Tester ReUnioN Haxing4Life You
will need the BF2 Classes for this to work.. Just do some searching
All it does is hook the DrawOverlay function in CRenderer , then you can draw all of your text/boxes with CDebugLineDrawer and CDebugTextWriter.
This is how I did my scoreboard for my public hack.
Main.cpp Code:
#include <Windows.h>
#include "CHacks.h"
bool bScoreBoard = false;
bool bLoaded = false;
typedef void(__stdcall *DrawOverlay_orig)(void);
DrawOverlay_orig oDrawOverlay = 0;
//Hooked DrawOverlay Function
void __stdcall MyDrawOverlay(void)
{
_asm pushad;
//HotKey to turn scoreboard on/off
if(GetAsyncKeyState(VK_F1)&1)
bScoreBoard = !bScoreBoard;
if(bScoreBoard)
cHacks.ScoreBoard();
_asm popad;
oDrawOverlay();
}
//Initialize
DWORD WINAPI Init(LPVOID lpArgs)
{
//Load your classes here
for (; bLoaded == false; Sleep(5000))
{
bLoaded = InitObjects();
}
//Hook DrawOverlay
oDrawOverlay = (DrawOverlay_orig)HookVTableFunction((DWORD**)cRenderer,(PBYTE)&MyDrawOverlay,51);
return 0;
}
//DllMain
bool WINAPI DllMain(HMODULE hModule, DWORD ReasonForCall, LPVOID lpReserved)
{
switch(ReasonForCall)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL,0,Init,NULL,0,NULL);
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
} CHacks.h Code:
#ifndef CHacks_H
#define CHacks_H
class CHacks {
public:
void ScoreBoard();
};
extern CHacks cHacks;
#endif CHacks.cpp Code:
#include "CHacks.h"
#include <iostream>
#include <sstream>
CHacks cHacks;
//Credits to ReUnioN
template<typename DefaultType>
string make_str_of_whatever( char cinput[], DefaultType input )
{
ostringstream buffer;
buffer << cinput;
buffer << input;
return buffer.str();
}
void CHacks::ScoreBoard()
{
//Get the local player
cLocal = cPlayerManager->GetLocalPlayer();
//If the local player is not valid return
if(!cLocal)
return;
DWORD Base = NULL;
int Kills;
int TotalScore;
int Deaths;
int TeamKills;
int TeamScore;
//Total Score
ReadProcessMemory(GetCurrentProcess(),(void*)0xA08F60,&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x60),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x108),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x00),&TotalScore,sizeof(Base),0);}}}
//Deaths
ReadProcessMemory(GetCurrentProcess(),(void*)0xA08F60,&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x60),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x108),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x10),&Deaths,sizeof(Base),0);}}}
//Kills
ReadProcessMemory(GetCurrentProcess(),(void*)0xA08F60,&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x60),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x108),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x14),&Kills,sizeof(Base),0);}}}
//TeamKills
ReadProcessMemory(GetCurrentProcess(),(void*)0xA08F60,&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x60),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x108),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x18),&TeamKills,sizeof(Base),0);}}}
//TeamScore
ReadProcessMemory(GetCurrentProcess(),(void*)0xA08F60,&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x60),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x108),&Base,sizeof(Base),0);
if(Base){ReadProcessMemory(GetCurrentProcess(),(void*)(Base + 0x04),&TeamScore,sizeof(Base),0);}}}
int ScoreBoardX = 200;
int ScoreBoardY = 400;
int ScoreBoardWidth = 120;
int ScoreBoardHeight = 90;
//ScoreBoard Box
cLineDrawer->fillrgba(ScoreBoardX,ScoreBoardY,ScoreBoardWidth,ScoreBoardHeight,0,0,0,80);
//Text
cTextWriter->DrawTextColoured(ScoreBoardX+30,ScoreBoardY+10,D3DCOLOR_XRGB(255,255,255),&make_str_of_whatever("TotalScore: ",TotalScore),0);
cTextWriter->DrawTextColoured(ScoreBoardX+30,ScoreBoardY+25,D3DCOLOR_XRGB(255,255,255),&make_str_of_whatever("Kills: ",Kills),0);
cTextWriter->DrawTextColoured(ScoreBoardX+30,ScoreBoardY+40,D3DCOLOR_XRGB(255,255,255),&make_str_of_whatever("Deaths: ",Deaths),0);
cTextWriter->DrawTextColoured(ScoreBoardX+30,ScoreBoardY+55,D3DCOLOR_XRGB(255,255,255),&make_str_of_whatever("TeamScore: ",TeamScore),0);
cTextWriter->DrawTextColoured(ScoreBoardX+30,ScoreBoardY+70,D3DCOLOR_XRGB(255,255,255),&make_str_of_whatever("TK's: ",TeamKills),0);
} Hope you like it
.
Crucial is online now
04-16-2010, 04:57 AM
#2 Join Date: Jan 2008
Posts: 1,228
Reputation: 46050 Rep Power: 534
nice post but i'm just wondering why not use the scoreboad class itself and save offsets and rpm?
PHP Code:
class CScoreBoard { public: __int32 totalscore ; //0000 __int32 teamworkscore ; //0004 char unknown0 [ 8 ]; __int32 deaths ; //0010 __int32 kills ; //0014 __int32 teamkills ; //0018 char unknown1 [ 4 ]; __int32 rank ; //0020 };
smoochy is online now
04-16-2010, 05:12 AM
#3 Broken Moderator
Join Date: Aug 2006
Location: United States
Posts: 760
Reputation: 33567 Rep Power: 418
Points: 23,105, Level: 21
Last Achievements was thinking the same thing, but I wasn't going to say anything..
kolbybrooks is online now
04-16-2010, 05:14 AM
#4 Supreme H4x0|2
Threadstarter Join Date: Feb 2010
Location: Chattanooga, TN
Posts: 654
Reputation: 36845 Rep Power: 406
Awhile back I tried using the Scoreboard class and it kept crashing when accessing it, so I guess my class was out of alignment or I was just accessing it wrong.
Crucial is online now
04-16-2010, 05:22 AM
#5 Join Date: Jan 2008
Posts: 1,228
Reputation: 46050 Rep Power: 534
Quote:
Originally Posted by
Crucial Awhile back I tried using the Scoreboard class and it kept crashing when accessing it, so I guess my class was out of alignment or I was just accessing it wrong.
CPlayer:
PHP Code:
CScoreBoard * scoreboard ; //0100
that where you have it?
smoochy is online now
04-21-2010, 01:17 PM
#6 Join Date: Apr 2010
Location: Sweden
Posts: 176
Reputation: -1581 Rep Power: 0
what do you mean with: You will need the BF2 Classes for this to work? :P
daavve is offline
04-22-2010, 04:15 PM
#7 Donator
Join Date: Nov 2007
Posts: 1,494
Reputation: 72055 Rep Power: 802
Quote:
Originally Posted by
daavve what do you mean with: You will need the BF2 Classes for this to work? :P
This means that you more than likely will have trouble getting this to work.
You don't need to readprocessmemory when your inside your target process
__________________
[22:22] monster64: yo dawg i heard u like chams so i put chams in your chams so you can see through shit while you see through shit
[09:07] Tally: grab your ak47 and put on your bomb jacket.... its gonna be a long morning
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
raiders is offline
05-01-2010, 01:33 PM
#8 Hax 101
Join Date: Jan 2008
Posts: 355
Reputation: 5711 Rep Power: 114
Last Achievements Quote:
Originally Posted by
raiders This means that you more than likely will have trouble getting this to work.
You don't need to readprocessmemory when your inside your target process
Yup , memcpy and VirtualProtect will do just as well
|KungFuPenguin| is offline
06-21-2011, 02:28 PM
#9 Join Date: May 2011
Location: UC-Forum-com
Posts: 51
Reputation: -441 Rep Power: 0
nice totoral thanks for sharing
__________________
"Porfect of UC"
"We Never Pawned" ThesuperHaxor
ThesuperHaxor is offline
06-21-2011, 09:53 PM
#10 Level 3
Join Date: Apr 2009
Posts: 1,605
Reputation: 27376 Rep Power: 340
Quote:
Originally Posted by
ThesuperHaxor nice totoral thanks for sharing
You are on a good roll to deserve a ban.Stop bumping threads with your stupid comments.If you want to thank him,we have reputation button here and you can write thanks there.
botex is offline
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 11:31 AM .