btw... You were right DarkstaR.
They weren't using any of the STL containers. But it was pretty easy to figure out, once I found out the Tree Root.
I had something like this:
Code:
typedef struct Container_t {
DWORD index;
DWORD unknown1;
DWORD unknown2;
DWORD id;
char name[32];
DWORD maxCount;
DWORD itemCount;
DWORD unknown3; //was isOpen before... maybe PageID?
std::vector< Item::ITEM > items;
} CONTAINER, *PCONTAINER;
struct ContainerLeaf_t;
typedef struct ContainerLeaf_t {
ContainerLeaf_t* parent;
ContainerLeaf_t* left;
ContainerLeaf_t* right;
DWORD index;
PCONTAINER container;
} CONTAINERLEAF, *PCONTAINERLEAF;
typedef struct ContainerTree_t {
PCONTAINERLEAF root;
DWORD amountOfItems;
} CONTAINERTREE, *PCONTAINERTREE;
So, I would just make a pointer (PCONTAINERTREE) to the tree on the address 0x5E28D0 + BASEADDRESS, plus 8.
Not actually sure if the Container_t is right, I did it from what I remember, as I don't have the code in my screen right now. :P
Anyways, I gave away way too much... Now it's up to them to find the way to iterate through the containers... You just need to know the basic about trees.
EDIT: It won't work the way I did. Making an std::vector<ITEM> from the addresses we get. But the container items' structure works exactly like a vector in C++ Standard Library... So you can either make a simple C++ program to help you reverse and std::vector, so you can learn how it works. Or you can try to figure it out from Tibia itself. :P