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

orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 04-07-2022 , 07:05   orpheu
Reply With Quote #1

hello. i m using orpheu and i made my own signatures for functions.

so if i have this output is good
Code:
Parsing file "SV_GetIDString_internal" started
                                Argument type "pointer" validated
                                Return type "char *" validated
                                Searching for signature "[0x55][0x8b][0xec][0x83][*](...)" ... FOUND
                Parsing file "SV_GetIDString_internal" ended
but i have a problem with my plugin. i'm trying to output player steamid in server console but don t work.

Code:
char* EXT_FUNC SV_GetIDString_internal(USERID_t *id)
PHP Code:
#include <amxmodx>
#include <orpheu>


public plugin_precache()
{
    
OrpheuRegisterHook(OrpheuGetFunction("SV_GetIDString_internal"),"OnSV_GetIDString",OrpheuHookPost)
}

public 
OnSV_GetIDString(steamid[])
{
    
server_print("%s"steamid);

lexzor is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 04-07-2022 , 07:09   Re: orpheu
Reply With Quote #2

PHP Code:
public OnSV_GetIDString(steamid[])
{
    new 
szID[32]
    
OrpheuGetReturn(szIDcharsmax(szID))

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 04-07-2022 , 09:27   Re: orpheu
Reply With Quote #3

i get segmentation fault when the function is called

Code:
{
    "name"      : "SV_GetIDString",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "pointer"
        }
    ],
    "return" : 
    {
        "type" : "char *"
    },
    "identifiers":
    [
        {
            "os" : "windows",
            "value" : [0x55,0x8B,0xEC,0x83,0xEC,0x30,0x8B,0x4D,0x08,0xC6,"*","*","*","*","*","*",0x85,0xC9,0x0F,"*","*","*","*","*",0x8B,0x01,0x48,0x0F]
        },
        {
            "os" : "linux",
            "value" : 0x47C50  
        }
    ]
}
even if i output a debug message in console

debug file

Code:
Stack level 0, frame at 0xff063d39:
 eip = 0xf7489c5e in _Z14SV_GetIDStringP8USERID_s.; saved eip = 0x0
 called by frame at 0xff063d3d
 Arglist at 0xff063d31, args: 
 Locals at 0xff063d31, Previous frame's sp is 0xff063d39
 Saved registers:
  eip at 0xff063d35
End of crash report

Last edited by lexzor; 04-07-2022 at 09:31.
lexzor is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-07-2022 , 15:35   Re: orpheu
Reply With Quote #4

Are you using linux or windows ?

Function name and file name assumingly, they should be the same.

Argument type is a pointer and you're using a string ?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
lexzor
Veteran Member
Join Date: Nov 2020
Old 04-07-2022 , 16:34   Re: orpheu
Reply With Quote #5

i am using linux

Code:
char* SV_GetIDString(USERID_t *id)
{
	return g_RehldsHookchains.m_SV_GetIDString.callChain(SV_GetIDString_internal, id);
}
that's the function and i m using the same name in function file and amxx.
lexzor is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-07-2022 , 16:59   Re: orpheu
Reply With Quote #6

PHP Code:
public OnSV_GetIDString( const id )
{
    
server_print("%d"id );

thats how the function parameters should look like, where id is a player index assumingly ?


also thats linux function address is too short ( 0x47C50 ) try finding a longer address, this address can be invalid.

also here's the function that you're trying catch.

Code:
char* EXT_FUNC SV_GetIDString_internal(USERID_t *id)
{
	static char idstr[64];

	idstr[0] = 0;

	if (!id)
	{
		return idstr;
	}

	switch (id->idtype)
	{
	case AUTH_IDTYPE_STEAM:
		if (sv_lan.value != 0.0f)
		{
			Q_strncpy(idstr, "STEAM_ID_LAN", ARRAYSIZE(idstr) - 1);
		}
		else if (!id->m_SteamID)
		{
			Q_strncpy(idstr, "STEAM_ID_PENDING", ARRAYSIZE(idstr) - 1);
		}
		else
		{
			TSteamGlobalUserID steam2ID = Steam_Steam3IDtoSteam2(id->m_SteamID);
			Q_snprintf(idstr, ARRAYSIZE(idstr) - 1, "STEAM_%u:%u:%u", steam2ID.m_SteamInstanceID, steam2ID.m_SteamLocalUserID.Split.High32bits, steam2ID.m_SteamLocalUserID.Split.Low32bits);
		}
		break;
	case AUTH_IDTYPE_VALVE:
		if (sv_lan.value != 0.0f)
		{
			Q_strncpy(idstr, "VALVE_ID_LAN", ARRAYSIZE(idstr) - 1);
		}
		else if (!id->m_SteamID)
		{
			Q_strncpy(idstr, "VALVE_ID_PENDING", ARRAYSIZE(idstr) - 1);
		}
		else
		{
			TSteamGlobalUserID steam2ID = Steam_Steam3IDtoSteam2(id->m_SteamID);
			Q_snprintf(idstr, ARRAYSIZE(idstr) - 1, "VALVE_%u:%u:%u", steam2ID.m_SteamInstanceID, steam2ID.m_SteamLocalUserID.Split.High32bits, steam2ID.m_SteamLocalUserID.Split.Low32bits);
		}
		break;
	case AUTH_IDTYPE_LOCAL:
		Q_strncpy(idstr, "HLTV", ARRAYSIZE(idstr) - 1);
		break;
	default:
		Q_strncpy(idstr, "UNKNOWN", ARRAYSIZE(idstr) - 1);
		break;
	}
	// Don't be paranoid
	//idstr[ARRAYSIZE(idstr) - 1] = 0;

	return idstr;
}
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-07-2022 at 17:32.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
lexzor
Veteran Member
Join Date: Nov 2020
Old 04-08-2022 , 11:10   Re: orpheu
Reply With Quote #7

function:

Code:
{
    "name"      : "SV_GetIDString_internal",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "pointer"
        }
    ],
    "return" : 
    {
        "type" : "char *"
    },
    "identifiers":
    [
        {
            "os" : "linux",
            "value" : - [0x55,0x8b,0xEC,0x83,"*",0xF0,0x83,"*","*","*","*",0x08,0xC6,0x05]
        }
    ]
}
now i get segmentation fault when the server start

PHP Code:
#include <amxmodx>
#include <orpheu>


public plugin_precache()
{
    
OrpheuRegisterHook(OrpheuGetFunction("SV_GetIDString_internal"),"OnSV_GetIDString_internal",OrpheuHookPost)
}

public 
OnSV_GetIDString(x)
{
    new 
szSteamid[32]
    
OrpheuGetReturn(szSteamid31);
    
server_print("%s"szSteamid);

Code:
Parsing file "SV_GetIDString_internal" started
                                Function is updated
                Parsing file "SV_GetIDString_internal" ended
actually i don t get any output. that function shouldn t be called when the engine is formating player authid ?

Last edited by lexzor; 04-08-2022 at 11:19.
lexzor is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-08-2022 , 13:04   Re: orpheu
Reply With Quote #8

are you sure thats the correct signature for linux ?


Here's the signature for linux for ReHLDS version 3.11

Code:
{
    "name"      : "SV_GetIDString",
    "library"   : "engine",
    "arguments" : 
    [
        {
            "type" : "pointer"
        }
    ],
    "return" : 
    {
        "type" : "char *"
    },
    "identifiers":
    [
        {
            "os" : "windows",
            "value" : [0x55,0x8B,0xEC,0x83,0xEC,0x30,0x8B,0x4D,0x08,0xC6,"*","*","*","*","*","*",0x85,0xC9,0x0F,"*","*","*","*","*",0x8B,0x01,0x48,0x0F]
        },
        {
            "os" : "linux",
            "value" : "_Z23SV_GetIDString_internalP8USERID_s"
        }
    ]
}
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-08-2022 at 13:25.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
lexzor
Veteran Member
Join Date: Nov 2020
Old 04-08-2022 , 22:20   Re: orpheu
Reply With Quote #9

Code:
L 04/09/2022 - 05:15:39: [ORPHEU] Function "SV_GetIDString_internal" not found
still don't work. i m using the latest version from github for: rehlds, regamedll, metamod and orpheu.
should i add something else for a properly working of orpheu ?

edit: when i m using the last signature i posted, apparently orpheu find the function

Code:
Parsing file "SV_GetIDString_internal" started
                                Argument type "pointer" validated
                                Return type "char *" validated
                                Searching for signature "[0x55][0x8b][0xec][0x83][*](...)" ... FOUND
                Parsing file "SV_GetIDString_internal" ended
but somehow, the function is not called when a player connect


edit: when i'm using this signature
Code:
[0x55,0x8B,0xEC,"*","*","*",0x83,"*",0x20,"*","*","*","*",0x05,0xE0,0x9B]
i got segmentation fault when the server starts even if the hexadecimal signature matches with the right function
Code:
Searching down CASE-SENSITIVELY for binary pattern:
	55 8B EC ?? ?? ?? 83 ?? 20 ?? ?? ?? ?? 05 E0 9B
Search completed. Found at 00000000000396A0.
Code:
Stack level 0, frame at 0xffedd580:
 eip = 0xed1b2f12 in LibrariesManager::compareSignature(unsigned char*, unsigned char*, SignatureEntryType*, unsigned int); saved eip = 0xed1b3de3
 called by frame at 0xffedd5d0
 Arglist at 0xffedd578, args: 
 Locals at 0xffedd578, Previous frame's sp is 0xffedd580
 Saved registers:
  ebx at 0xffedd56c, ebp at 0xffedd578, esi at 0xffedd570, edi at 0xffedd574, eip at 0xffedd57c
End of crash report

Last edited by lexzor; 04-08-2022 at 22:55.
lexzor is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 04-10-2022 , 19:12   Re: orpheu
Reply With Quote #10

That hook already exists in the rehlds api, you can add that hook to reapi module and avoid orpheu
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
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 02:11.


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