22.01.2019, 07:56
(
Last edited by dotSILENT; 22/01/2019 at 02:28 PM.
)
I know why it's not working when you put it after SKY.
It's because SKY uses the exact same GetPacketId hook (which I actually took from Whitetiger's sampACv2). But SKY hooks the function directly in Load(), which overwrites the first 5 bytes with a JMP instruction, causing my FindPattern to fail. That's why I don't install hooks until the first AmxLoad call, so other plugins can use FindPattern under Load(), but SKY is not doing that.
I'll have to workarounnd that somehow, probably increasing the FindPattern signature and ignoring the first 5 bytes, if that will be possible.
As for these sampgdk warnings I'll have to test it out.
Update
I made a small commit (here) which addresses the hook-conflict with SKY (and any other plugin that would hook GetPacketID under Load()). It falls back to an alternate, longer pattern prefixed with a JMP instruction so it should find the correct function even if it was hooked already. Tested it on both windows and linux and it seems to work properly.
Haven't made a release as it's just a tiny change and SKY plugin is also kinda outdated. If someone really needs this then you can compile it yourself, or just load the plugin before SKY as it also does the job.
It's because SKY uses the exact same GetPacketId hook (which I actually took from Whitetiger's sampACv2). But SKY hooks the function directly in Load(), which overwrites the first 5 bytes with a JMP instruction, causing my FindPattern to fail. That's why I don't install hooks until the first AmxLoad call, so other plugins can use FindPattern under Load(), but SKY is not doing that.
I'll have to workarounnd that somehow, probably increasing the FindPattern signature and ignoring the first 5 bytes, if that will be possible.
As for these sampgdk warnings I'll have to test it out.
Update
I made a small commit (here) which addresses the hook-conflict with SKY (and any other plugin that would hook GetPacketID under Load()). It falls back to an alternate, longer pattern prefixed with a JMP instruction so it should find the correct function even if it was hooked already. Tested it on both windows and linux and it seems to work properly.
Haven't made a release as it's just a tiny change and SKY plugin is also kinda outdated. If someone really needs this then you can compile it yourself, or just load the plugin before SKY as it also does the job.