- 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.
std::list & map in BF2?
12-27-2009, 09:31 PM
#1 A Legend Join Date: Nov 2008
Location: Sweden
Posts: 271
Reputation: 12592 Rep Power: 170
std::list & map in BF2?
Is the list of players at PlayerManager + 0x0010 an std::list?
when I try to use it as one game crashes, there's allso a type of map at ClassManager + 0x0034 (string, void*) but it allso crashes the game.
the list & map has iterators that works just like the ones in std namespace but the actuall list & map instance are different (size wice).
so do they use there own list & map or what?
Revolty is offline
12-27-2009, 09:41 PM
#2 Retired Admin Join Date: Sep 2006
Posts: 5,249
Reputation: 93628 Rep Power: 1106
you cannot use visual studio 2008 std::list afaik,
i got it to work with std::list in visual studio 2005,
but it cannot be compiled in debug as the size is different then...
learn_more is offline
12-27-2009, 09:57 PM
#3 A Legend
Threadstarter Join Date: Nov 2008
Location: Sweden
Posts: 271
Reputation: 12592 Rep Power: 170
aha thougt it was wierd that they'd use there own..
however i won't change compiler for that beeing the only reason.
there's 3 iterators in a node, do you know what the third points to, andalso, how to grab the tail/end.
ty.
Code:
template<class T, class Y>
class MAP
{
public :
class ITERATOR
{
public :
ITERATOR* iteratorPrevious;
ITERATOR* iteratorNext;
ITERATOR* iteratorUnknown; // whats this
public :
T fist;
Y secound;
public :
ITERATOR& operator--(int) { return iteratorPrevious; }
ITERATOR& operator++(int) { return iteratorNext; }
};
public :
inline ITERATOR* getHead(void) { return iterator->iteratorPrevious; }
inline ITERATOR* getTail(void) { return iterator; } // wrong
protected :
ITERATOR* iterator;
public :
unsigned int size;
};
Revolty is offline
12-27-2009, 10:12 PM
#4 Retired Admin Join Date: Sep 2006
Posts: 5,249
Reputation: 93628 Rep Power: 1106
if my memory serves me right the lists are double-linked, so u got a forward and backward?
pseudocode:
node* pEnd = mgr->players;
node* walk = mgr->players;
do {
drawstuff();
walk = walk->next;
} while( walk != pEnd );
learn_more is offline
12-27-2009, 10:19 PM
#5 A Legend
Threadstarter Join Date: Nov 2008
Location: Sweden
Posts: 271
Reputation: 12592 Rep Power: 170
ah sorry I ment the map, the list works like you describes but the map has 3 iterators and don't seem to work like the list (backward /forward//data) the 3:d in map points to a node but were it points make no sence to me.
Revolty is offline
12-27-2009, 10:21 PM
#6 Retired Admin Join Date: Sep 2006
Posts: 5,249
Reputation: 93628 Rep Power: 1106
don't know, you could compile a quick application in visual studio, using a map (in debug) and step into some std::map functions to see the code
(wild guess: it's some sorta hash)
learn_more is offline
12-28-2009, 04:25 AM
#7 Posting Well Join Date: Jan 2008
Posts: 33
Reputation: 187 Rep Power: 52
Credit to Sparten:
In vs2k8:
#define _SECURE_SCL 0
Before any STL headers, then compile in release mode.
string, list, map will have the same size as in 2k5.
dualamd is offline
12-28-2009, 03:39 PM
#8 A Legend
Threadstarter Join Date: Nov 2008
Location: Sweden
Posts: 271
Reputation: 12592 Rep Power: 170
ty, it's working now.
Checked Iterators
wacko, the size is over 90 but it wont irritate more then once..
Code:
std::map<string, void*>::iterator it;
for ( it = pClassManager->classList.begin();
it!= pClassManager->classList.end();
it++ ) {
MessageBoxA(0, (*it).first.c_str(), "", MB_OK);
}
class CClassManager
{
public:
virtual int addRef(); //
virtual int getRef(); //
virtual int dispose(); //
virtual void* queryInterface(int id); //
virtual void function4(); //
virtual void function5(); //
virtual void function6(); //
virtual void function7(); //
virtual void function8(); //
virtual void function9(); //
virtual void function10(); //
virtual void function11(); //
virtual void function12(); //
virtual void function13(); //
virtual void function14(); //
virtual void function15(); //
virtual void function16(); //
virtual void function17(); //
virtual void* getClassByName(const string* name); //
__int32 refCount; //0x0004
char unknown8[40]; //0x0008
map<string, void*> classList; //0x0030
};//Size=0x004C(76)
Last edited by Revolty; 12-28-2009 at 09:10 PM .
Revolty 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 07:41 AM .