Raised This Month: $ Target: $400
 0% 

Orpheu help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-13-2011 , 06:42   Orpheu help
Reply With Quote #1

I was playing around with the func_tanks using orpheu.
The idea was to make like a cooldown for it.
I hooked CFunkTank::StartControl but when i use a func_tank, my game freezes.
I don't understand why this is happening, i only hooked the function.

I tried to print a msg at first but then commented it because of the crashes

Tested on map: am_gunattack_v3
PHP Code:
#include <amxmodx>
#include <orpheu>

#define VERSION     "1.0.0"


public plugin_init()
{
    
register_plugin("Func Tank"VERSION"Drekes");
    
    
OrpheuRegisterHook(OrpheuGetFunction("StartControl""CFuncTank"), "CFuncTankStartControl");
}


public 
CFuncTankStartControl(id)
{
    
// client_print(0, print_chat, "StartControl called");

Code:
{
    "name"        : "StartControl",
    "class"       : "CFuncTank",
    "library"     : "mod",
    "arguments" : 
    [
        {
            "type" : "CBasePlayer *"
        }
    ],
    "identifiers": 
    [
        {
            "os"    : "windows",
            "mod"    : "cstrike",
            "value"    : [0x74,0x07,0x5F,0x33,0xC0,0x5E,0xC2,0x04,0x00,0x8B,0x86,0x04,0x01,0x00,0x00,0x8B]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "StartControl__9CFuncTankP11CBasePlayer"
        }
    ]
}
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 05-13-2011 at 07:24.
drekes is offline
Send a message via MSN to drekes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-13-2011 , 06:49   Re: Orpheu help
Reply With Quote #2

StartControl returns a bool. It should be specified in the signature file.
__________________
Arkshine is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-13-2011 , 07:06   Re: Orpheu help
Reply With Quote #3

I updated the signature and it is validated when the server starts but it still crashes.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-13-2011 , 07:18   Re: Orpheu help
Reply With Quote #4

Why your signature doesn't start from the function start ?
__________________
Arkshine is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-13-2011 , 07:23   Re: Orpheu help
Reply With Quote #5

I don't understand what you mean

EDIT: fixed a typo in the function name, but it still crashes
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-13-2011 , 07:46   Re: Orpheu help
Reply With Quote #6

Code:
.text:10085BC0                               CFuncTank__StartControl proc near       ; CODE XREF: sub_10085F90+6Cp
.text:10085BC0
.text:10085BC0                               arg_0           = dword ptr  4
.text:10085BC0
.text:10085BC0 56                                            push    esi
.text:10085BC1 8B F1                                         mov     esi, ecx
.text:10085BC3 57                                            push    edi
.text:10085BC4 8B 86 88 00 00 00                             mov     eax, [esi+88h]
.text:10085BCA 85 C0                                         test    eax, eax        ; Logical Compare
.text:10085BCC 74 07                                         jz      short loc_10085BD5 ; Jump if Zero (ZF=1)
.text:10085BCE 5F                                            pop     edi
.text:10085BCF 33 C0                                         xor     eax, eax        ; Logical Exclusive OR
.text:10085BD1 5E                                            pop     esi
.text:10085BD2 C2 04 00                                      retn    4               ; Return Near from Procedure
.text:10085BD5                               ; ---------------------------------------------------------------------------
.text:10085BD5
.text:10085BD5                               loc_10085BD5:                           ; CODE XREF: CFuncTank__StartControl+Cj
.text:10085BD5 8B 86 04 01 00 00                             mov     eax, [esi+104h]
You don't start the signature from the start. (56)

By the way, are you testing under linux or windows ?
__________________

Last edited by Arkshine; 05-13-2011 at 07:54.
Arkshine is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-13-2011 , 07:57   Re: Orpheu help
Reply With Quote #7

O_O
Can't believe i did that.
It works like a charm now
Thanks
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 18:35.


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