Raised This Month: $10 Target: $400
 2% 

Solved How to hook SetModel using Orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-21-2021 , 10:52   How to hook SetModel using Orpheu
Reply With Quote #1

As the title says how do i hook setting entity model or FM_SetModel through Orpheu i tried searching for the signature in cs.so but I've failed.
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-22-2021 at 07:32.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-21-2021 , 11:29   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #2

pfnSetModel is an engine function, not present in cs.so
Also, since this function is exported, you do not need a signature.

You can check how it is done here(https://forums.alliedmods.net/showthread.php?t=259880) to hook pfnPrecache* and do the same for pfnSetModel. This is the info you need to build the proper file: https://github.com/alliedmodders/hls.../eiface.h#L111
__________________

Last edited by HamletEagle; 10-21-2021 at 11:30.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-21-2021 , 12:04   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #3

Thanks alot i didn't know it was an engine function, doesn't engine functions require signatures?

Edit : oh nvm, now i see it needs only function arguments and return definitions


Code:
{
    "name" : "PrecacheModel",
    "library" : "engine",
    "arguments" :
    [
        {
            "type" : "char *"
        }
    ],
    "return" :
    {
        "type" : "int"
    }
}
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-21-2021 at 12:07.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-21-2021 , 13:56   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #4

Yes, they do not need signatures because they are exported for use. You only need the name(as stated in the link I sent you for eiface.h), arguments and return value.
__________________

Last edited by HamletEagle; 10-21-2021 at 13:57.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-21-2021 , 18:06   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Yes, they do not need signatures because they are exported for use. You only need the name(as stated in the link I sent you for eiface.h), arguments and return value.
A problem, argument edict_t is not defined in orpheu how i can define it?
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-21-2021 at 18:07.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-22-2021 , 04:00   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #6

edict_s
__________________
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-22-2021 , 05:03   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
edict_s
What is the difference?
__________________
@Jailbreak Main Mod v2.6.6 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
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-22-2021 , 07:12   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #8

No difference. edict means entity dictionary, it contains data about entities that are networked to the client.
"s" means structure so "entity dictionary structure". This struct is defined here: https://github.com/alliedmodders/hls...ne/edict.h#L19 (think of it like "enum" in pawn).

"t" in edict_t comes from "type". edict_t is an "alias" of "struct edict_s". https://github.com/dreamstalker/rehl...n/const.h#L786

In C, when you declare a structure and want to use it as a data type, you have to specify "struct struct_name" everywhere, which gets annoying. It is a common practice to define a type like "edict_t" which is a synonym of "struct edict_s". It is cleaner and shorter.

tl;dr
Code:
struct edict_s* my_var;
edict_t *my_other_var;
these are equivalent
__________________

Last edited by HamletEagle; 10-22-2021 at 07:13.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-22-2021 , 07:14   Re: How to hook CBaseEntity SetModel using Orpheu
Reply With Quote #9

You're amazing thanks for the explanation.
__________________
@Jailbreak Main Mod v2.6.6 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
Reply


Thread Tools
Display Modes

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 12:21.


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