Raised This Month: $ Target: $400
 0% 

Invalid Index Data


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-18-2014 , 13:13   Invalid Index Data
Reply With Quote #1

So, I tried to hook CBasePlayer::HostageUse function and I get this error( oprheu config ):

Code:
Parsing folder "CBasePlayer" started
			Parsing file "HostageUse" started
				Invalid index data
				FAILED
My signature file looks like this:

Code:
{     "name" : "HostageUse",     "class" : "CBasePlayer",     "library" : "mod",         "indexes" :     [         {             "os" : "windows",             "mod" : "cstrike",             "value" : [0x56,0x8B,0xF1,0xF6,0x86,0x30,0x03,0x00,0x00,0x10,"*","*",0x8B,0x86,0xC8,0x01]         },         {             "os" : "linux",             "mod" : "cstrike",             "value" : "HostageUsed__11CBasePlayer"         }     ] }

Test plugin that I use:
Code:
#include < amxmodx > #include < orpheu > public plugin_init() {     OrpheuRegisterHook(OrpheuGetFunctionFromClass( "player", "HostageUse", "CBasePlayer" ),"OnHostageUse", OrpheuHookPre ) } public OrpheuHookReturn:OnHostageUse( id ) {     client_print( id, print_chat, "Used a hostage" ) }

What's wrong with the sign ?
__________________

Last edited by HamletEagle; 08-18-2014 at 13:20.
HamletEagle is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 08-18-2014 , 18:23   Re: Invalid Index Data
Reply With Quote #2

change the index to 0 on client_print and show the value of id using %d

maybe it isn't the player, you can know what parameter is viewing the HLSDK where you get the offset

Last edited by baneado; 08-18-2014 at 18:24.
baneado is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-18-2014 , 22:23   Re: Invalid Index Data
Reply With Quote #3

Quote:
Originally Posted by baneado View Post
change the index to 0 on client_print and show the value of id using %d
It's unrelated. The function derives from CBasePlayer therefore that's what the first argument will be.


@HamEagle I can't say for sure what the error means, but I'm assuming there is other errors present? Your signature looks outdated but I doubt that is the cause. Also FYI function is CBasePlayer::HostageUsed().
Anyway, your trying to incorrectly use a virtual function. That function is specific to CBasePlayer. So don't use OrpheuGetFunctionFromClass() instead just OrpheuGetFunction(). A signature of bytes is used to locate the function in the memory, wheras virtual functions don't require signatures as they are accessed using an offset.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-19-2014 , 07:54   Re: Invalid Index Data
Reply With Quote #4

I just created my signature yesterday, with latest server build. I firstly used OrpheuGetFunction but it was saying that CBasePlayer::HostageUsed not found, so I decided to try with OrpheuGetFunctionFromClass( bad ideea ).

I redo it and now it's not giving any errors:

PHP Code:
{
    
"name" "HostageUsed",
    
"class" "CBasePlayer",
    
"library" "mod",
    
    
"identifiers"
    [ 
        { 
            
"os" "windows"
            
"mod" "cstrike"
            
"value" 34
        
}, 
        { 
            
"os" "linux"
            
"mod" "cstrike"
            
"value" "HostageUsed__11CBasePlayer"
        

    ] 

I still have to replace the sign for linux with the offset.

Thx for showing me the typo

Now, I have another problem. I added a message into the function, when I'm using a hostage, it doesn't print any message( Code in the first post ).

When I look in ida at the function header is shows void( nothing, if i'm right ), but when pressing F5 I see that the hearder has an int argument. How is this possibile ?
__________________

Last edited by HamletEagle; 08-19-2014 at 07:56.
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 13:13.


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