Raised This Month: $ Target: $400
 0% 

[ORPHEU] Blocking function and sending new value


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 10-30-2011 , 17:27   [ORPHEU] Blocking function and sending new value
Reply With Quote #1

Is it possible to do something like this?
I want to hook _SV_CalcClientTime, i made a signature for linux
Code:
{
    "name"       : "SV_CalcClientTime",
    "arguments"  :
    [
        {
            "type" : "int"
        }
    ],
    "library"    : "engine",
    "identifiers":
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : 0
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "_SV_CalcClientTime"
        }
    ]
}
First i'm not sure is it good, because IDA shows function name as
"_SV_CalcClientTime", but when i open function i see "SV_CalcClientTime"
still not sure what to use.

And i don't know how to block function and send different value?
I tried something like this, but it doesn't block
Code:
#include <amxmodx>
#include <orpheu>

public plugin_init()
{
	new OrpheuFunction:CalcTime = OrpheuGetFunction("SV_CalcClientTime","CalcTime")
	OrpheuRegisterHook(CalcTime, "CalculatePlayedTime", OrpheuHookPre)
}

public OrpheuHookReturn:CalculatePlayedTime()
	return OrpheuSupercede;

Last edited by OvidiuS; 10-30-2011 at 17:32.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2011 , 17:56   Re: [ORPHEU] Blocking function and sending new value
Reply With Quote #2

You see well in IDA, or you can guess it returns a float. I don't see that in your config file.
You have another error where you have put '_' before for 'SV_CalcClientTime'. It's wrong.

Something like :
Code:
{
    "name"       : "SV_CalcClientTime",
    "library"    : "engine",
    "arguments"  :
    [
        {
            "type" : "int"
        }
    ],
    "return" :
    {
        "type" : "float"
    },
    "identifiers":
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,"*",0x83,"*","*",0xD9,"*","*","*","*","*",0x53,0x56,0x33,"*",0x57]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "SV_CalcClientTime"
        }
    ]
}


And the code would be :

Code:
#include <amxmodx> #include <orpheu> public plugin_init() {     OrpheuRegisterHook( OrpheuGetFunction("SV_CalcClientTime" ), "SV_CalcClientTime" ); } public OrpheuHookReturn:SV_CalcClientTime( const handle ) {     OrpheuSetReturn( YourNewFloatValue );     return OrpheuOverride; }
__________________
Arkshine is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 10-31-2011 , 12:35   Re: [ORPHEU] Blocking function and sending new value
Reply With Quote #3

i guess it's working, but it seems that i hooked wrong function xD
I wanted to modify bot time on server.
Thank you Arkshine.

Last edited by OvidiuS; 10-31-2011 at 12:35.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
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 14:22.


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