[Orpheu] Retrieving player's IP address

Сообщения
96
Реакции
69
Помог
1 раз(а)
Hello,
I am trying to get connecting player's IP address while in SV_ConnectClient state in HLDS ( build 8684 - latest ).
Hook SV_ConnectClient ( signature works ) :
Код:
OrpheuRegisterHook(OrpheuGetFunction("SV_ConnectClient"), "SV_ConnectClient_Pre", OrpheuHookPre)
    OrpheuRegisterHook(OrpheuGetFunction("SV_ConnectClient"), "SV_ConnectClient_Post", OrpheuHookPost)
Signature:
Код:
{
    "name" : "SV_ConnectClient",
    "library" : "engine",
    "identifiers" :
    [
        {
            "os" : "windows",
            "value" : [0x55,0x8B,0xEC,0x81,"*","*","*","*","*",0x53,0x56,0x57,0xB9,0x05,0x00,0x00,0x00,0xBE,"*","*","*","*",0x8D,"*","*",0x33,0xDB,0x68,"*","*","*","*"]
        },
        {
            "os" : "linux",
            "value" : "SV_ConnectClient"
        }
    ]
}
Thinked about hooking the Net_AdrToString, but it don't works as intended:

Code:
Код:
// This hook is registered inside the SV_ConnectClient_Pre and unhooked in SV_ConnectClient_Post
OrpheuRegisterHook(OrpheuGetFunction("NET_AdrToString"), "NET_AdrToString_Post", OrpheuHookPost)


public NET_AdrToString_Post()
{
    new szTemp[19]
    OrpheuGetReturn(szTemp, charsmax(szTemp))
    server_print("temp: %s", szTemp)
}
Using this code I get the following result:
Код:
temp: 84d4c505:008b8c020
Signature ( working ):
Код:
{
    "name" : "NET_AdrToString",
    "library" : "engine",
    "return" : 
    {
        "type" : "char *"
    },
    "identifiers" :
    [
        {
            "os" : "windows",
            "value" : 0x58B00
        },
        {
            "os" : "linux",
            "value" : "NET_AdrToString"
        }
    ]
}
Next, I thinked about pfnConnectionlessPacket:

Signature:
Код:
{
    "name" : "pfnConnectionlessPacket",
    "library" : "engine",
    "arguments" :
    [
        {
            "type" : "netadr_s *"
        },
        {
            "type" : "char *"
        },
        {
            "type" : "char *"
        },
        {
            "type" : "int"
        },
    ]
}
Code:
Код:
g_hConnectionlessPacket = OrpheuGetDLLFunction("pfnConnectionlessPacket", "pfnConnectionlessPacket")
But I get this error:
Код:
[ORPHEU] Structure "DLL_FUNCTIONS *" doesn't have a member named "pfnConnectionlessPacket"
Any suggestions, what function should I hook?
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу