Help on a particular signature
Hi,
I'm trying to hook PF_WriteByte_I(). I've been able to hook successfully PF_MessageBegin_I() and PF_MessageEnd_I(), but I just cannot get WriteByte to work... ANd here why: it's a relatively short, in fact very short function. It's more a wrapper than anything else, and all the other PF_Write[Type]_I() are based on the same skeleton, so it's hard to make a sig for it, since I end up with many memory refs. My only option was to use a displacement. I've came to that sig: Code:
I don't really know what I'm doing wrong on the windows part. I've used a 18 bytes displacement so I could make the signature unique. But, absolutely not working. I'm posting the disasm here too. As you can see, it just returns the return value of a called func. Code:
.text:01D6ACAB loc_1D6ACAB: ; CODE XREF: sub_1D6AA40+33jI was wondering if anyone could help me making it work. Note it's a tricky one... There is something I'm probably missing. I wasnt sure about the arg type either. I know it's a WriteByte (hence it could be char), but I made an int there... I tried too with char in the sig, but not working better :( Thanks! Misery |
Re: Help on a particular signature
1. What do you want to do ? hook messages sent from plugins ? or what ?
|
Re: Help on a particular signature
Exactly Connor. More specifically to recover certains messages not hookable through register_event(). The best example I have being the TeamInfo sent by cs_set_user_team().
|
Re: Help on a particular signature
Have you tried with offset to see if same crash occurs ?
|
Re: Help on a particular signature
Misery, for pfn* functions, you don't need signatures. See the first post of Orpheu module thread.
|
Re: Help on a particular signature
Oh thanks Arkshine, works quite well now ^^
I have a question on the hook, and I thought it's not worth doing another topic with this... If I hook MessageBegin() and put a variable there to check the message. such as this Code:
public OnMessageBegin(msg_dest, msg_type, p1, p2)Not sure on that, I'm asking... Thanks, Misery |
Re: Help on a particular signature
Not sure to understand what you're asking (registry?), you're doing only checks, unless you supercede at some point, there is no problem. Your second question is vague, most of game events are related to the HUD on the client and not the internal datas (I mean calculating damage and updating client hud are 2 different things).
Anyway, be more precise/clear and I will try to make a more decent answer. |
Re: Help on a particular signature
Well, thanks for answering Arkshin. Indeed, I do only checks in the hooks, and only one check per functions. That means if the condition is not met it stops there.
My question was about regs... Have you ever heard people complaining about "regs" on a counter-strike server? Say Bob shoots on John, and Bob's aim is precisly, undoubtly on John's head, but the shot is not "registered" i.e. John does not get any damage, even if he was supposed to. Some servers have better "registry" than others, depending on the hardware they use... In a more technical view. Say Misery shoots on Arkshine. Does the data related to bullets fired and angles is sent to the server through messages (i.e. the data needed so the server can calculate the damage)? I just don't want to affect server performances... Thanks! Misery |
Re: Help on a particular signature
Quote:
|
Re: Help on a particular signature
Well, thanks Ovidius, but, no offense, you don't really answer my question.
I'm asking if hooking pfnMessageBegin and other message functions (assuming I only do checks there, and execute code if needed to) can, in a situation say where multiple players shoot at the same time, it can lead to damage not taken into account i.e. If it can affects regs. So yeah... I just want to know if messages are used for providing data necessary to damage calculations by the server. Is this technique (i.e. using Orpheu this way) differs much from AMXX's register_event() hook? Thanks Misery |
| All times are GMT -4. The time now is 06:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.