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

Help with Nametags
Old 12-28-2009, 11:30 PM   #1
n00bie

desmin88's Avatar

Join Date: Dec 2009
Posts: 6
Reputation: -32
Rep Power: 0
desmin88 is becoming a waste of our time
Help with Nametags

Following a BF2142 tutorial, and using Haxing4Lifes wonderful offsets, I have come up with code. Im not a c++ genius, so Im asking you guys for help.

I have about 7 errors that I cant understand, and my c++ partner is not available. Im using Visual C++ 2008.

Code:
 
#include <windows.h>
 
int main()
{
DWORD oNameTags;
DWORD hkGetTeam; 
PDWORD PlayerManager;
oNameTags = HookVTable(PlayerManager->LocalPlayer,hkGetTeam, 62);
return 0;
}
 
DWORD HookVTable ( PDWORD Class, DWORD function, int index )
{
DWORD oldRights, newRights, oldAddress;
if ( !IsBadReadPtr( Class, 4 ) ) 
{
DWORD* functionAddress = (DWORD*) ( (PDWORD) ( *Class + ( index * 4 ) ) );
if ( *functionAddress != function ) 
{
if (VirtualProtectEx(GetCurrentProcess(), functionAddress, 4, PAGE_EXECUTE_READWRITE, &oldRights)) 
{
oldAddress = *functionAddress;
*functionAddress = (DWORD) function;
}
VirtualProtectEx(GetCurrentProcess(), functionAddress, 4, oldRights, &newRights);
}
}
return oldAddress;
}
 
 
 
int hkGetTeam()
{
DWORD ReturnAddress =(DWORD)_ReturnAddress();
int RealTeam;
int FakeTeam;
_asm MOV EAX, [ECX+0xD8];
_asm MOV [RealTeam], EAX;
if( RealTeam == 1 )
FakeTeam = 2;
if( RealTeam == 2 )
FakeTeam = 1;
if( ReturnAddress == (DWORD)GetModuleHandle("RendDX9.dll") + 0x118BD5 ) 
{
return FakeTeam;
}
else {
return RealTeam;
}
}
When I compile I get these errors, and cant understand them.
Thanks!

Code:
 
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\testnametags\testnametags\main.cpp(8) : error C2227: left of '->LocalPlayer' must point to class/struct/union/generic type
1> type is 'PDWORD'
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\testnametags\testnametags\main.cpp(8) : error C3861: 'HookVTable': identifier not found
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\testnametags\testnametags\main.cpp(36) : error C3861: '_ReturnAddress': identifier not found
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\testnametags\testnametags\main.cpp(48) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [12]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

PS: Im looking for a tutorial of how to change crosshairs, such as reddot.

EDIT: Removed 3 errors.

Last edited by desmin88; 12-28-2009 at 11:48 PM.
desmin88 is offline

Reply With Quote


Old 12-28-2009, 11:46 PM   #2
Level Neo-Nazi

Big Dave's Avatar

Join Date: May 2007
Location: ˙sʇǝuɹǝʇuı ǝɥʇ
Posts: 1,122
Reputation: 44174
Rep Power: 522
Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!Big Dave has a huge epeen!
Recognitions:
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: 33,198, Level: 27
Points: 33,198, Level: 27 Points: 33,198, Level: 27 Points: 33,198, Level: 27
Activity: 1.1%
Activity: 1.1% Activity: 1.1% Activity: 1.1%
Last Achievements
Get a Playermanager class.
Define hkGetTeam and HookVTable.
Include the needed header for _ReturnAddress.
__________________
http://i49.tinypic.com/j993tj.png


CSS hax: 0% AAO hax: 0%
Gaying up my signature with pointless progress meters in a vain attempt to show off: 100%
Big Dave is offline

Reply With Quote

Old 12-29-2009, 12:09 AM   #3
The 0n3

Sfab1's Avatar

Join Date: Nov 2007
Location: Finland
Posts: 418
Reputation: 22105
Rep Power: 281
Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 16,124, Level: 16
Points: 16,124, Level: 16 Points: 16,124, Level: 16 Points: 16,124, Level: 16
Activity: 27.1%
Activity: 27.1% Activity: 27.1% Activity: 27.1%
Last Achievements
from quick view it seems someone gave u code and told to compile it

#include <intrin.h>

#pragma intrinsic(_ReturnAddress)

Code:
DWORD oNameTags;


Code:
PBYTE HookVTableFunction( PDWORD* dwVTable, PBYTE dwHook, INT Index )
{
    DWORD dwOld = 0;
    VirtualProtect((void*)((*dwVTable) + Index), 4, PAGE_EXECUTE_READWRITE, &dwOld);
    PBYTE pOrig = ((PBYTE)(*dwVTable)[Index]); 
    (*dwVTable)[Index] = (DWORD)dwHook;
    VirtualProtect((void*)((*dwVTable) + Index), 4, dwOld, &dwOld);
    return pOrig;
}
Code:
oNameTags =    HookVTableFunction( (DWORD**)PlayerManager, (PBYTE)&hkGetTeam, 62 );
and i would do it only once

Code:
if(PlayerManager)
    {
        static bool dononce = 0;
        if ( !doonce )
        {
           oNameTags =    HookVTableFunction( (DWORD**)PlayerManager, (PBYTE)&hkGetTeam, 62 );
            doonce = 1;
        }
    }
__________________

Sfab1 is online now

Reply With Quote

Old 12-29-2009, 12:18 AM   #4
n00bie

desmin88's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 6
Reputation: -32
Rep Power: 0
desmin88 is becoming a waste of our time
Thank you very much, Sfab1.

Im now getting two errors.

Code:
 
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\testnmtags\testnmtags\main.cpp(10) : error C3861: 'HookVTableFunction': identifier not found
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\testnmtags\testnmtags\main.cpp(39) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [12]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
With this code

Code:

#include<windows.h>
#include<intrin.h>
#pragmaintrinsic(_ReturnAddress)
int main()
{
DWORD oNameTags;
DWORD** PlayerManager;
PBYTE hkGetTeam;
oNameTags = HookVTableFunction(PlayerManager,&hkGetTeam, 62 );
return 0;
}
PBYTE HookVTableFunction( PDWORD* dwVTable, PBYTE dwHook, INT Index )
{
DWORD dwOld = 0;
VirtualProtect((void*)((*dwVTable) + Index), 4, PAGE_EXECUTE_READWRITE, &dwOld);
PBYTE pOrig = ((PBYTE)(*dwVTable)[Index]); 
(*dwVTable)[Index] = (DWORD)dwHook;
VirtualProtect((void*)((*dwVTable) + Index), 4, dwOld, &dwOld);
return pOrig;
}
int hkGetTeam()
{

DWORD ReturnAddress =(DWORD)_ReturnAddress();
int RealTeam;
int FakeTeam;
_asm MOV EAX, [ECX+0xD8];
_asm MOV [RealTeam], EAX;
if( RealTeam == 1 )
FakeTeam = 2;
if( RealTeam == 2 )
FakeTeam = 1;
if( ReturnAddress == (DWORD)GetModuleHandle("RendDX9.dll") + 0x118BD5 ) 
{
return FakeTeam;
}
else {
return RealTeam;
}
}
Now, I know im suppose to get playermanager class, but dont know how.
And the second error is probably because of that.
However, the first, I do not know why, probably a header.

Thanks and please help.
desmin88 is offline

Reply With Quote

Old 12-29-2009, 12:30 AM   #5
The 0n3

Sfab1's Avatar

Join Date: Nov 2007
Location: Finland
Posts: 418
Reputation: 22105
Rep Power: 281
Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 16,124, Level: 16
Points: 16,124, Level: 16 Points: 16,124, Level: 16 Points: 16,124, Level: 16
Activity: 27.1%
Activity: 27.1% Activity: 27.1% Activity: 27.1%
Last Achievements
well move that hookvtable function above ur int main ^^ ull fix the first error, for the rest u gotta look ur own sorry, cant really fix all ur errors, Playermanager class u can find publicly posted here at bf2 section or download some bf2 source and get it, or reclass the class
__________________

Sfab1 is online now

Reply With Quote

Old 12-29-2009, 12:51 AM   #6
n00bie

desmin88's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 6
Reputation: -32
Rep Power: 0
desmin88 is becoming a waste of our time
Ok, thanks. I have fixed all errors, except I havent gotten a playermanager class. Ill look for that, and get back to you. If you by any chance would know where, please tell me.

[Auto Merged - 1:06:12 UTC]

It seems that I cannot find the code to get the playermanager class code. So close, but yet so far. Is there anyone who can help?
desmin88 is offline

Reply With Quote

Old 12-29-2009, 10:13 AM   #7


ultimate-tester's Avatar

Join Date: Sep 2008
Location: The Netherlands
Posts: 1,752
Reputation: 9131
Rep Power: 0
ultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATS
Project -> Project Settings -> Configuration Properties -> General -> Character Set.

Use Multi-Byte character set.

Apply, OK, and ur done!
ultimate-tester is offline

Reply With Quote

Old 12-29-2009, 06:48 PM   #8
n00bie

desmin88's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 6
Reputation: -32
Rep Power: 0
desmin88 is becoming a waste of our time
I already fixed that,but thanks anyway. I just need to find the player manager. Any chance you know how?
desmin88 is offline

Reply With Quote

Old 12-29-2009, 08:10 PM   #9
Retired Admin

learn_more's Avatar

Join Date: Sep 2006
Posts: 5,249
Reputation: 93628
Rep Power: 1106
learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!learn_more has a huge epeen!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
sieg heil Nazi
Points: 70,490, Level: 39
Points: 70,490, Level: 39 Points: 70,490, Level: 39 Points: 70,490, Level: 39
Activity: 24.7%
Activity: 24.7% Activity: 24.7% Activity: 24.7%
Last Achievements
Award-Showcase
classmanager maybe?
__________________
learn_more is offline

Reply With Quote

Old 12-31-2009, 03:28 PM   #10
retired moderator

JoshRose's Avatar

Join Date: Nov 2007
Location: London
Posts: 1,360
Reputation: 10674
Rep Power: 185
JoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server space
Air Shooter Champion
Points: 14,708, Level: 15
Points: 14,708, Level: 15 Points: 14,708, Level: 15 Points: 14,708, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Mate, you have used my code without following the actual tutorial and then just tried to use some offsets you found on this forum.

You clearly do not understand what you are doing with the code or you could fix the error, in fact if you just read my tut rather than skipped it and just got the code, you could fix it. For instance:

Code:
if( ReturnAddress == (DWORD)GetModuleHandle("RendDX9.dll") + 0x118BD5 )
That will not apply to BF2 and you should know this.

No only that but you have not:

Quote:
I have come up with code
It is 100% Copy and pasted except the int main(){} part.

Congratulations!

-REP!
__________________
Regards and happy
Josh

__________________
JoshRose is offline

Reply With Quote

Old 12-31-2009, 08:59 PM   #11
n00bie

desmin88's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 6
Reputation: -32
Rep Power: 0
desmin88 is becoming a waste of our time
Yay! Infact I do know that offset will not work. I was putting that towards the end of the development. I was going to use the offsets Haxing4Life provided.

~Dont be a dick, just trying to learn. We all started somewhere.
desmin88 is offline

Reply With Quote

Old 12-31-2009, 09:13 PM   #12
retired moderator

JoshRose's Avatar

Join Date: Nov 2007
Location: London
Posts: 1,360
Reputation: 10674
Rep Power: 185
JoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server spaceJoshRose 's rep takes up 1 gig of server space
Air Shooter Champion
Points: 14,708, Level: 15
Points: 14,708, Level: 15 Points: 14,708, Level: 15 Points: 14,708, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Quote:
Originally Posted by desmin88 View Post
Yay! Infact I do know that offset will not work. I was putting that towards the end of the development. I was going to use the offsets Haxing4Life provided.

~Dont be a dick, just trying to learn. We all started somewhere.
Nor can you use the offset provided my Haxing4Life because if you had read my tutorial you would know that the address used as the return address is not the same as the NameTags Jump!

I'm not being a dick, i just dislike people that come here, post code they say they put together when they clearly did not, and just write rubbish. You even had a tutorial. You can't start without understanding it 100% and going through the tut step by step before rushing to the code at the end.

I'm all up for helping people and want people to learn, i wrote a TUT for goodness sake, just take a step back and learn it before you make a thread about it when you are not ready to.

PS: I'm not being a dick, so do not call me one.


Quote:
Originally Posted by Sfab1 View Post
Code:
oNameTags =    HookVTableFunction( (DWORD**)PlayerManager, (PBYTE)&hkGetTeam, 62 );
Code:
oNameTags = HookVTableFunction((PDWORD)PlayerManager->LocalPlayer, (PBYTE)hkGetTeam, (int)62);
It is PlayerManager->LocalPlayer because the real GetTeam Function Resides in the Player Class not the Player Manager Class. In my Player Manager class i have:

Code:
CPlayer* LocalPlayer
It could be called anything you want.

The way it works it that it intercepts the games GetTeam Check and gives an incorrect answer based on the return address.

You only apply the hook once as you said, once hooked it aint going to change unless you unhook it.
__________________
Regards and happy
Josh

__________________

Last edited by JoshRose; 12-31-2009 at 09:57 PM.
JoshRose is offline

Reply With Quote

Old 01-01-2010, 01:05 PM   #13


ultimate-tester's Avatar

Join Date: Sep 2008
Location: The Netherlands
Posts: 1,752
Reputation: 9131
Rep Power: 0
ultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATSultimate-tester DEFINES UNKNOWNCHEATS
I think you are learning the wrong way.
It's also wrong to call the "higher leveled" people a dick, because they only want to try to help you and make you learn.

You should listen to what people say. Go learn c++ and some basic debugging. If you've done that, you can come back any time. Knowledge is very welcome here.

~ Ultimate-Tester
ultimate-tester is offline

Reply With Quote

Old 01-02-2010, 12:02 AM   #14
n00bie

desmin88's Avatar

Threadstarter
Join Date: Dec 2009
Posts: 6
Reputation: -32
Rep Power: 0
desmin88 is becoming a waste of our time
Ive seen my wrong ways, and apoligize. Perhaps I should start over with something smaller.
I have searched the forums and internet for a tutorial on how to change the crosshair.
I have found nothing, so in light of that, i created a program to draw over bf2, but as expected if flickers. Does anyone know of a tutorial to change crosshairs?
desmin88 is offline

Reply With Quote

Old 01-03-2010, 10:31 PM   #15
[+]

E.Z.HAX0R's Avatar

Join Date: Jul 2007
Posts: 71
Reputation: 122
Rep Power: 58
E.Z.HAX0R is officially drafted by UCE.Z.HAX0R is officially drafted by UC
Points: 3,611, Level: 6
Points: 3,611, Level: 6 Points: 3,611, Level: 6 Points: 3,611, Level: 6
Activity: 1.1%
Activity: 1.1% Activity: 1.1% Activity: 1.1%
Last Achievements
Search up DMA Hack tutorials/source. I used DMA hacks for years and it was more than enough.
This is a very good place to start imo.

For example, crosshair DMA address (I believe) is [(0xB38400 + 0x130 ) + 0xA0] so you'd overwite this with your own values, such as 0x35 for "red dot".
E.Z.HAX0R 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
nametags
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 05:28 PM.