Go Back   UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats > First-Person Shooters > Battlefield Series > Battlefield 2

- Sponsored Advertisement -
http://www.myfpscheats.com/

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.    
Reply
 
Thread Tools

Adding Scoreboard to your hack
Old 04-16-2010, 03:52 AM   #1
Supreme H4x0|2

Crucial's Avatar

Join Date: Feb 2010
Location: Chattanooga, TN
Posts: 654
Reputation: 36845
Rep Power: 406
Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (3)
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 22,946, Level: 21
Points: 22,946, Level: 21 Points: 22,946, Level: 21 Points: 22,946, Level: 21
Activity: 2.4%
Activity: 2.4% Activity: 2.4% Activity: 2.4%
Last Achievements
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

Reply With Quote


Old 04-16-2010, 04:57 AM   #2
UnKnoWnCheaTeR

smoochy's Avatar

Join Date: Jan 2008
Posts: 1,228
Reputation: 46050
Rep Power: 534
smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!
Points: 31,874, Level: 26
Points: 31,874, Level: 26 Points: 31,874, Level: 26 Points: 31,874, Level: 26
Activity: 9.2%
Activity: 9.2% Activity: 9.2% Activity: 9.2%
Last Achievements
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

Reply With Quote

Old 04-16-2010, 05:12 AM   #3
Broken Moderator

kolbybrooks's Avatar

Join Date: Aug 2006
Location: United States
Posts: 760
Reputation: 33567
Rep Power: 418
kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!kolbybrooks has a huge epeen!
Points: 23,105, Level: 21
Points: 23,105, Level: 21 Points: 23,105, Level: 21 Points: 23,105, Level: 21
Activity: 20.0%
Activity: 20.0% Activity: 20.0% Activity: 20.0%
Last Achievements
was thinking the same thing, but I wasn't going to say anything..
kolbybrooks is online now

Reply With Quote

Old 04-16-2010, 05:14 AM   #4
Supreme H4x0|2

Crucial's Avatar

Threadstarter
Join Date: Feb 2010
Location: Chattanooga, TN
Posts: 654
Reputation: 36845
Rep Power: 406
Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!Crucial has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (3)
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 22,946, Level: 21
Points: 22,946, Level: 21 Points: 22,946, Level: 21 Points: 22,946, Level: 21
Activity: 2.4%
Activity: 2.4% Activity: 2.4% Activity: 2.4%
Last Achievements
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

Reply With Quote

Old 04-16-2010, 05:22 AM   #5
UnKnoWnCheaTeR

smoochy's Avatar

Join Date: Jan 2008
Posts: 1,228
Reputation: 46050
Rep Power: 534
smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!smoochy has a huge epeen!
Points: 31,874, Level: 26
Points: 31,874, Level: 26 Points: 31,874, Level: 26 Points: 31,874, Level: 26
Activity: 9.2%
Activity: 9.2% Activity: 9.2% Activity: 9.2%
Last Achievements
Quote:
Originally Posted by Crucial View Post
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:
CScoreBoardscoreboard//0100 
that where you have it?
smoochy is online now

Reply With Quote

Old 04-21-2010, 01:17 PM   #6
A God

daavve's Avatar

Join Date: Apr 2010
Location: Sweden
Posts: 176
Reputation: -1581
Rep Power: 0
daavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these partsdaavve is infamous around these parts
what do you mean with: You will need the BF2 Classes for this to work? :P
daavve is offline

Reply With Quote

Old 04-22-2010, 04:15 PM   #7
Donator

raiders's Avatar

Join Date: Nov 2007
Posts: 1,494
Reputation: 72055
Rep Power: 802
raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!raiders has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (5)
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 44,627, Level: 32
Points: 44,627, Level: 32 Points: 44,627, Level: 32 Points: 44,627, Level: 32
Activity: 20.0%
Activity: 20.0% Activity: 20.0% Activity: 20.0%
Last Achievements
Quote:
Originally Posted by daavve View Post
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

Reply With Quote

Old 05-01-2010, 01:33 PM   #8
Hax 101

|KungFuPenguin|'s Avatar

Join Date: Jan 2008
Posts: 355
Reputation: 5711
Rep Power: 114
|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS|KungFuPenguin| DEFINES UNKNOWNCHEATS
Points: 6,680, Level: 9
Points: 6,680, Level: 9 Points: 6,680, Level: 9 Points: 6,680, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Quote:
Originally Posted by raiders View Post
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

Reply With Quote

Old 06-21-2011, 02:28 PM   #9
Junior Member

ThesuperHaxor's Avatar

Join Date: May 2011
Location: UC-Forum-com
Posts: 51
Reputation: -441
Rep Power: 0
ThesuperHaxor is stupid.ThesuperHaxor is stupid.ThesuperHaxor is stupid.ThesuperHaxor is stupid.ThesuperHaxor is stupid.
nice totoral thanks for sharing
__________________

"Porfect of UC"
"We Never Pawned"
ThesuperHaxor
ThesuperHaxor is offline

Reply With Quote

Old 06-21-2011, 09:53 PM   #10
Level 3

botex's Avatar

Join Date: Apr 2009
Posts: 1,605
Reputation: 27376
Rep Power: 340
botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!botex has reputation that takes up 2GB of server space!
Quote:
Originally Posted by ThesuperHaxor View Post
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

Reply With Quote
Reply  

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit



Tags
adding, hack, scoreboard
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 11:31 AM.