You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
I can always reproduce the issue with the provided description below.
Environment
Operating System version:
Affected: Ubuntu 18.04.5 LTS/4.15.0-204-generic (x86_64)
Test comparison: Microsoft Windows Server 2012 Standard
Game (with version if applicable): Left4Dead2 v2.2.2.6
Current SourceMod version: 1.11.0.6931
Current SourceMod snapshot: 1.12.0.6982
Current Metamod: Source snapshot: 1.12.0-dev+1167
I have updated SourceMod to the latest version and it still happens.
I have updated SourceMod to the latest snapshot and it still happens.
I have updated SourceMM to the latest snapshot and it still happens.
Description
I used g_pVCR->Hook_recvfrom on windos to prevent dos query attacks, but the hook didn't work on linux.
I tried using detours to hook recvfrom on linux, but it crashed at once.
I did some output prompts and found that I was able to hook recvfrom the message I received, but when I called the original method, it crashed.
I looked at the files for asm and detours and I don't understand how it works and how to fix the problem.So hopefully the bigwigs can offer some help or fix this problem.
Problematic Code (or Steps to Reproduce)
When the hook is started, you will receive information, but then a call to DETOUR_STATIC_CALL(Detour_RecvFrom) will crash.
Old code and will not work, it takes a pointer to CSteamSocketMgr g_SteamSocketMgr from function NET_InitiateSteamConnection, but there is no such code in l4d2 and a pointer in this function. Also, if you are hooking function CSteamSocketMgr::recvfrom, you must use the DETOUR_CREATE_MEMBER and DETOUR_DECL_MEMBER6 and DETOUR_MEMBER_CALL macros, because this function is inside the class. Now I noticed that Linux uses the hook of another function recvfrom, which is inside function CSteamSocketMgr::recvfrom, the code looks for it using the global symbol recvfrom, and judging by the source code, the type of calling conventions there is not cdecl, it is specified as stdcall
The text was updated successfully, but these errors were encountered: