AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Orpheu Signatures Path (https://forums.alliedmods.net/showthread.php?t=296309)

edon1337 04-17-2017 14:12

Orpheu Signatures Path
 
Hi, I can't find where the signatures should go... In some posts I see that they should go in orpheu/functions in the other one I see orpheu/virtualFunctions ... Thanks.

klippy 04-17-2017 14:34

Re: Orpheu Signatures Path
 
It depends on whether it's a virtual class method, which are identified by virtual table offsets instead of symbols or signatures.

edon1337 04-17-2017 16:21

Re: Orpheu Signatures Path
 
So how do I know where to put it ?

klippy 04-17-2017 16:31

Re: Orpheu Signatures Path
 
If it's a virtual method then in virtualFunctions, in a folder named same as the class containing the method. Every other goes in functions. If the function is a member of a class (not a plain C function) then you have to create a folder in "orpheu/functions" with the class name and put the JSON file in there.

It's all described in Orpheu main thread.

edon1337 04-17-2017 16:47

Re: Orpheu Signatures Path
 
I understood about the virtual functions, thanks.

What about this
Code:
{     "name"      : "CREATE_NAMED_ENTITY",     "library"   : "mod",     "arguments" :     [         {             "type" : "int",             "info" : "iszClass"         }     ],     "return" :     {         "type" : "edict_s *",         "info" : "pent"     },     "identifiers":     [         {             "os"    : "windows",             "mod"   : "cstrike",             "value" : [0x56,0x57,0x8B,"*","*","*",0x57,0xFF,"*","*","*","*","*",0x8B,"*",0x83,"*","*",0x85,"*",0x74,"*",0xA1]         },         {             "os"    : "linux",             "mod"   : "cstrike",             "value" : "CREATE_NAMED_ENTITY__FUi"         },         {             "os"    : "linux",             "mod"   : "cstrike",             "value" : "_Z19CREATE_NAMED_ENTITYj"         }     ] }

and this
Code:
{     "name" : "PrecacheGeneric",     "library" : "engine",     "arguments" :     [         {             "type" : "char *"         }     ],     "return" :     {         "type" : "int"     } }

klippy 04-17-2017 17:41

Re: Orpheu Signatures Path
 
Those are C functions, not a member of any class. They just go into orpheu/functions.

However, as far as I know, CREATE_NAMED_ENTITY is the wrong name and should be named CreateNamedEntity. The Linux signature should just be "CreateNamedEntity" as well.

Also looks like PrecacheGeneric should be "PF_precache_generic_I", as well as the Linux signature. What you are lacking in the second file is "identifiers" array - you've given no way for Orpheu to identify the function. I even think I posted PF_precache_generic_I somewhere on the forums before, can't quite remember.

Arkshine 04-18-2017 03:34

Re: Orpheu Signatures Path
 
- CREATE_NAMED_ENTITY is correct. in CS, there is a wrapper which calls pfnCreateNamedEntity and add the class to a hash table: https://github.com/s1lentq/ReGameDLL....cpp#L287-L296
- PrecacheGeneric is also correct. It's part of the engine API and you don't need to provide identifier, you have a native in Orpheu to deal with such functions. As you said above, it's all written in the Orpheu thread. :twisted:

klippy 04-18-2017 04:51

Re: Orpheu Signatures Path
 
Oh damn. :(

edon1337 04-18-2017 11:15

Re: Orpheu Signatures Path
 
Quote:

Originally Posted by KliPPy (Post 2513051)
If it's a virtual method then in virtualFunctions, in a folder named same as the class containing the method. Every other goes in functions. If the function is a member of a class (not a plain C function) then you have to create a folder in "orpheu/functions" with the class name and put the JSON file in there.

Klippy, how do you know that it's a virtual function ? And can you show me a signature that isn't a virtual function but is member of a class And what's the point of the 'library' ?

Thanks :)

HamletEagle 04-18-2017 11:29

Re: Orpheu Signatures Path
 
Quote:

Klippy, how do you know that it's a virtual function ?
Check the virtual table of that class in IDA. If you found the function there, it's virtual, else it's not.

Quote:

And can you show me a signature that isn't a virtual function but is member of a class
The SetNewPlayerModel function you asked for it's a member of CBasePlayer class and it's not virtual. Basically, any function that looks like X::Name it's member of X class(CBasePlayer, CWeaponbox, etc).
Quote:

And what's the point of the 'library' ?
library reffers to engine/mod. When hooking functions from game mod(mp.dll, cs.so) it's "mod", when hooking from engine(engine_i486.so, swds.dll) it's "engine".


All times are GMT -4. The time now is 17:52.

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