Raised This Month: $51 Target: $400
 12% 

ItemInfoArray


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-20-2015 , 12:19   Re: ItemInfoArray
Reply With Quote #21

Oooops, I must be blind
I have searched in all of functions it is used and found it at the top in WriteSigonMessages(sub_1009B0F0 for windows). I think that the array is actually offset dword_10175FE8 which has the bytes BF E8 5F 17 10

So I made this signature:
Code:
[0x53,0x56,0x57,0xBF,"*","*","*","*",0x8B,"*","*",0x85,"*",0x0F,"*","*","*","*","*",0x8B,"*",0x85,"*",0x75,"*",0xBE]
I don't understand exactly what you mean by adding displacement, should I tell orpheu to start reading the signature where the array bytes start ? So a displacement of 3 ?

Code:
[
	{
		"name"        : "ItemInfoArray",
		"library"     : "mod",
		"type"        : "byte",
		"memoryType"  : "data",
		"identifiers" : 
		[
			{
				"os"    : "windows",
				"mod"   : "cstrike",
				"value" : [0x53,0x56,0x57,0xBF,"*","*","*","*",0x8B,"*","*",0x85,"*",0x0F,"*","*","*","*","*",0x8B,"*",0x85,"*",0x75,"*",0xBE],
				"displacement" : 3
			},
			{
				"os"    : "linux",
				"mod"   : "cstrike",
				"value" : "_ZN15CBasePlayerItem13ItemInfoArrayE"
			}
		]
	}
]
Even with this orpheu says Address isn't contained in the library. Maybe you mean something else with displacement.
__________________

Last edited by HamletEagle; 08-20-2015 at 12:26.
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2015 , 12:38   Re: ItemInfoArray
Reply With Quote #22

An address is on 4 bytes. 0xBF is the instruction for "mov". What you want is the 4 next bytes.
So displacement should be +4.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-20-2015 , 12:56   Re: ItemInfoArray
Reply With Quote #23

Code:
L 08/20/2015 - 19:53:23: [ORPHEU] Address isn't contained in the library
PHP Code:
server_print("Debug: %i"OrpheuMemoryGetAtAddress(OrpheuMemoryGet("ItemInfoArray") + 36 CSW_AK47 44"int")) 
Code:
{
    "name"        : "int",
    "library"     : "mod",
    "type"        : "int",
    "memoryType"  : "data",
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : 0
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : 0
        }
    ]
}
Code:
[
	{
		"name"        : "ItemInfoArray",
		"library"     : "mod",
		"type"        : "byte",
		"memoryType"  : "data",
		"identifiers" : 
		[
			{
				"os"    : "windows",
				"mod"   : "cstrike",
				"value" : [0x53,0x56,0x57,0xBF,"*","*","*","*",0x8B,"*","*",0x85,"*",0x0F,"*","*","*","*","*",0x8B,"*",0x85,"*",0x75,"*",0xBE],
				"displacement" : 4
			},
			{
				"os"    : "linux",
				"mod"   : "cstrike",
				"value" : "_ZN15CBasePlayerItem13ItemInfoArrayE"
			}
		]
	}
]
Still the same error. I have no ideea what's wrong, it may be because the bits are ignored ?
__________________

Last edited by HamletEagle; 08-20-2015 at 12:58.
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2015 , 15:40   Re: ItemInfoArray
Reply With Quote #24

The signature is correct. What is not correct is the data type for ItemArrayInfo. You want to retrieve an address, so it should be "pointer" or "int".

Now you have a valid address, and you have figured out that the address doesn't start at the beginning of structure, you can dump the array.
Note: you need a similar file as "int" but for "string".

PHP Code:
    new baseAddress OrpheuMemoryGet("ItemInfoArray") - (is_linux_server() ? 24); // Not totally sure why, likely it's the address of .pszName. Don't know if the same for linux, looks like not.

    
const structureSize 44;
    const 
arrayElements 32;
    const 
memberSize    4;
    const 
membersCount  structureSize memberSize;
    const 
arraySize     arrayElements structureSize;
    
    
enum ItemInfo
    
{
        
IISlotIIPositionIIAmmo1IIMaxAmmo1IIAmmo2IIMaxAmmo2IINameIIMaxClipIIIdIIFlagsIIWeight
    
};
    
    new const 
ItemInfoIdentifiers[ItemInfo][] = 
    {
        
"slot""position""ammo1""maxammo1""ammo2""maxammo2""name""maxclip""id""flags""weight"
    
};

    new 
buffer[32];
    new 
value;
    
    for (new 
element 0element arrayElements; ++element)
    {
        if (
element == || element == || element == 31)
        {
            continue;
        }
        
        
server_print("Weapon ID %d"element);
        
        for (new 
ItemInfo:membermember membersCount; ++member)
        {
            
value OrpheuMemoryGetAtAddress(baseAddress + (element structureSize) + (any:member memberSize), "int");
            
            switch (
member)
            {
                case 
IIAmmo1IIAmmo2IIName:
                {
                    
value && OrpheuMemoryGetAtAddress(value"string"buffercharsmax(buffer));
                    
server_print("  %16s ^"%s^""ItemInfoIdentifiers[member], buffer);
                }
                default:
                {
                   
server_print("  %16s %d"ItemInfoIdentifiers[member], value);
                }
            }
        }
    } 
Feel free to adapt code now if you want to retrieve just a specific member.
__________________

Last edited by Arkshine; 08-20-2015 at 15:45.
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-20-2015 , 16:12   Re: ItemInfoArray
Reply With Quote #25

Thanks, after I changed in the sign from byte to pointer everything was ok. Also thanks for your code, time to experiment more Also it was a good learning about memory, data type, orpheu etc for me.
__________________

Last edited by HamletEagle; 08-20-2015 at 16:20.
HamletEagle is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 22:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode