Inventory Slot Number reading menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inventory Slot Number reading

    hi every body.

    I try for 2 days to read items and containers.
    I have a big problems with reading container slot number and I can't find why.

    here is what I do :

    Code:
    public enum ContainerFields : uint
            {
                CONTAINER_FIELD_NUM_SLOTS = 0x6,
                CONTAINER_ALIGN_PAD = 0x7,
                CONTAINER_FIELD_SLOT_1 = 0x8,
                TOTAL_CONTAINER_FIELDS = 0x3
            }
    object manager :
    Code:
    uint type = ReadUInt(curObj + (uint)MemEnums.ObjectFields.OBJECT_FIELD_TYPE); // curObj + 0x14
    
    switch (type)
                                {
                                    case (uint)MemEnums.ObjectType.ITEM:  // item
                                        ReadItem(curObj, type);
                                        break;
                                    case (uint)MemEnums.ObjectType.CONTAINER:
                                        ReadContainer(curObj, type);
                                        break; // container
                                    case (uint)MemEnums.ObjectType.NPC: // mob                           
                                        ReadMonster(curObj, type);
                                        break;
                                    case (uint)MemEnums.ObjectType.PLAYER: // player, possibly me
                                        ReadPlayer(curObj, type);
                                        break;
                                    case (uint)MemEnums.ObjectType.GAMEOBJECT: // stools, chairs, etc
                                        ReadGameObject(curObj, type);
                                        break;
                                }
    Container slot reading :
    Code:
    uint slot =(uint) ReadUint(curObj + (uint)MemEnums.ContainerFields.CONTAINER_FIELD_NUM_SLOTS *4 );
    In my case this should return 16, but it returns a very by number.



    If someone can help me I'll be glad.

    Inventory Slot Number reading
  2. #2
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The descriptor is wrong, you can find the correct slot count in DBItemCache.
    Reverse lua_GetContainerNumSlots.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #3
    rootguy's Avatar Member
    Reputation
    3
    Join Date
    Aug 2008
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i use these for containers:

    CONTAINER_FIELD_NUM_SLOTS = 0x40,
    CONTAINER_ALIGN_PAD = 0x41,
    CONTAINER_FIELD_SLOT_1 = 0x42,
    TOTAL_CONTAINER_FIELDS = 0x3

    also you can't just add the descriptor to the object pointer.
    Ofcourse i dont know how your ReadContainer function works.
    Oh the horror of not being inside the process. Why do it the hard way anyway.
    You really should learn and read a lot more though.
    Last edited by rootguy; 11-20-2009 at 07:58 PM.

  4. #4
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx these descriptors. I tried to reverse this lua function but I can't find the correct descriptor.

  5. #5
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by guizmows View Post
    thx these descriptors. I tried to reverse this lua function but I can't find the correct descriptor.
    It's not in the descriptors.
    Actually I found it's a virtual function. The virtual function accesses the DBItemCache to find the slot count.
    It's really simple to follow in the function.

    Code:
    push    eax
    call    GetBagAtIndex
    add     esp, 4
    push    edx             ; filter
    push    eax             ; guid
    call    ClntObjMgrObjectPtr
    add     esp, 14h
    test    eax, eax
    jz      short loc_55F5BF
    Obviously a check to see if it found the container in the object manager - if it doesn't jump, this is reached:
    Code:
    mov     edx, [eax]
    mov     ecx, eax
    mov     eax, [edx+24h]
    call    eax
    It doesn't get easier than this for you.
    Last edited by MaiN; 11-21-2009 at 10:26 AM.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  6. #6
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes thanks for this.

  7. #7
    rootguy's Avatar Member
    Reputation
    3
    Join Date
    Aug 2008
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it is in the descriptors.
    CONTAINER_FIELD_NUM_SLOTS gives me the nr of slots for a container object.
    I use it in my function to get the container and slot an item is in to autoequip it.

    Code:
    WOWContainer* WOWObjectManager::GetItemSlotAndBag(const char* item_name, unsigned long& bagslot) {
    	int item_id = GetItemIDByName(item_name);
    	if(!item_id)
    		return 0;
    	
    	if(!IsValid()) {
    		return 0;
    	}
    	
    	WOWObject* obj = FirstObject();
    	WOWLocalPlayer* me = GetLocalPlayer();
    	WOWObject* item = 0;
    	
    	while(obj && ((unsigned long)obj & 1) == 0) {
    		if(obj->Type() == WOWOBJECT_ITEM) {
    			if(obj->GetKnownField<unsigned long>(OBJECT_FIELD_ENTRY) == item_id) {
    				item = obj;
    				break;
    			}
    		}
    		
    		obj = obj->Next();
    	}
    	
    	if(item->IsValid()) {
    		// Is it in the main backpack?
    		unsigned long backpack_slots = 16;
    		unsigned long bslot = 0;
    		for(unsigned long i=0;i<backpack_slots;i++, bslot++)
    		{
    			u_int64_t iguid = me->GetKnownField<u_int64_t>(PLAYER_FIELD_PACK_SLOT_1 + (2*i));
    			if(iguid == item->Guid()) {
    				bagslot = bslot + EQUIP_NonEquipSlot;
    				return me->GetContainer();
    			}
    		}
    		// Loop through all other equipped bags
    		for(unsigned long i=0;i<4;i++)
    		{
    			WOWContainer* ibag = GetObjectByGUID(me->GetKnownField<u_int64_t>(PLAYER_FIELD_INV_SLOT_HEAD+((EQUIP_Bag1+i) *2)))->GetContainer();
    			if(ibag->IsValid()) {
    				bslot = 0;
    				for(unsigned long a = 0;a<ibag->GetKnownField<unsigned long>(CONTAINER_FIELD_NUM_SLOTS);a++, bslot++)
    				{
    					u_int64_t iguid = ibag->GetKnownField<u_int64_t>(CONTAINER_FIELD_SLOT_1 + (2*a));
    					if(iguid == item->Guid()) {
    						// Item and bag found!
    						bagslot = bslot;
    						return ibag;
    					}
    				}
    			}
    		}
    	}
    	
    	return 0;
    }

Similar Threads

  1. Reading players inventory / available bag slots left
    By Envoke in forum WoW Memory Editing
    Replies: 7
    Last Post: 05-26-2012, 05:14 PM
  2. Getting wrong number by Reading Level
    By CrimeTime in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 10-29-2010, 01:06 AM
  3. Reading Memory - Bag slots available?
    By Tanaris4 in forum WoW Memory Editing
    Replies: 7
    Last Post: 04-11-2010, 05:47 PM
  4. [Help]Reading bag slots used/remaining slots, gold
    By weber7655 in forum WoW Memory Editing
    Replies: 0
    Last Post: 09-21-2009, 06:09 PM
All times are GMT -5. The time now is 09:54 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search