2615 Commits

Author SHA1 Message Date
Kawe Mazidjatari
b7cca52067 Fix CVE-2021-22876
Merge: curl/curl@7214288898
Note: The 'CURLU' class does not exist in this particular version of curl, therefore, an alternative approach has been incorporated to mitigate the issue. Code has been tested, and the issue has been fixed.
2023-06-13 09:45:16 +02:00
Kawe Mazidjatari
d177ecdb0a Fix CVE-2020-8286
Merge: curl/curl@d9d0167278
2023-06-13 01:35:15 +02:00
Kawe Mazidjatari
c38a5f214f Fix CVE-2020-8285
Merge: curl/curl@69a358f218
Note: due to the many updates between the curl version this has been fixed in, and the one used in the SDK, the function was slightly different. The code has been tested however, after implementing the fix for this particular version of the library, the code appears to work perfectly with the vuln being fixed (tested on an FTP server with 10k files in the directory).
2023-06-13 00:38:35 +02:00
Kawe Mazidjatari
5a9711878b Fix CVE-2020-8284
Merge: curl/curl@ec9cc725d5
2023-06-12 22:26:53 +02:00
Kawe Mazidjatari
d10b544f74 Fix CVE-2020-8231
Merge: curl/curl@3c9e021f86
Note: Member order in 'connfind' has been left identical, except for that 'found' (now 'id_tofind') is a long. Code however, should pad it to a 4 byte boundary. Size of 'UrlState' has also remained unchanged, the 'connectdata' member has been renamed to 'lastconnect_id', and its type has been changed to 'long'. Additional padding has been incorporated to make sure the structure's size remains the same as that of the game, may we ever hook compiled code with ours.
2023-06-12 22:20:39 +02:00
Kawe Mazidjatari
0ac029e1c0 Fix CVE-2019-5481
Merge: curl/curl@9069838b30
2023-06-12 21:36:38 +02:00
Kawe Mazidjatari
0920fb834a Fix CVE-2019-5482
Merge: curl/curl@facb0e4662
2023-06-12 21:34:01 +02:00
Kawe Mazidjatari
5e68af6eb5 Fix CVE-2019-5436
Merge: curl/curl@2576003415
2023-06-12 21:22:22 +02:00
Kawe Mazidjatari
fa05fbd1aa Fix CVE-2018-16890
Merge: curl/curl@b780b30d13
2023-06-12 20:51:12 +02:00
Kawe Mazidjatari
52d8ef5719 Fix CVE-2019-3822
Merge: curl/curl@50c9484278
2023-06-12 20:48:21 +02:00
Kawe Mazidjatari
46f11218c6 Fix 'CVE-2019-3823'
Merge: curl/curl@39df4073e5
2023-06-12 20:44:02 +02:00
Kawe Mazidjatari
a022f81bc4 Fix 'CVE-2018-16839'
Merge: curl/curl@f3a24d7916
2023-06-12 20:37:57 +02:00
Kawe Mazidjatari
1e4843fda3 Fix 'CVE-2018-14618'
Merge: curl/curl@8c7b3737d2
2023-06-12 20:27:51 +02:00
Kawe Mazidjatari
6c34f8dc4e Fix 'CVE-2018-1000301'
Merge: curl/curl@8c7b3737d2
2023-06-12 20:17:01 +02:00
Kawe Mazidjatari
2aee31375f Fix 'CVE-2018-1000122'
Merge: curl/curl@d52dc4760f
2023-06-12 20:13:24 +02:00
Kawe Mazidjatari
6069e9f00b Fix 'CVE-2018-1000121'
Merge: curl/curl@9889db0433
2023-06-12 20:09:12 +02:00
Kawe Mazidjatari
2739ff3a7d Fix 'CVE-2018-1000120'
Merge: curl/curl@535432c0ad
2023-06-12 20:06:31 +02:00
Kawe Mazidjatari
f3b27f66bb Fix 'CVE-2018-1000007'
Merge: curl/curl@af32cd3859
2023-06-12 19:56:24 +02:00
Kawe Mazidjatari
2905bcad53 Fix 'CVE-2018-1000005'
Merge: curl/curl@fa3dbb9a14
2023-06-12 19:47:37 +02:00
Kawe Mazidjatari
d000c0c3b3 Fix 'CVE-2017-8817'
Merge: curl/curl@0b664ba968
2023-06-12 19:44:01 +02:00
Kawe Mazidjatari
e48b68e870 Fix 'CVE-2017-8816'
Merge: curl/curl@7f2a1df6f5
2023-06-12 19:36:18 +02:00
Kawe Mazidjatari
bc2a6ae586 Fix 'CVE-2017-1000257'
Merge: curl/curl@13c9a9ded3
2023-06-12 19:33:12 +02:00
Kawe Mazidjatari
c6ee89d1a4 Fix 'CVE-2017-1000254'
Merge: curl/curl@5ff2c5ff25
2023-06-12 19:30:53 +02:00
Kawe Mazidjatari
e6cb575586 Fix 'CVE-2017-9502'
Merge: curl/curl@5d7952f52e
2023-06-12 19:22:14 +02:00
Kawe Mazidjatari
4368210a5c Fix 'CVE-2017-1000100'
Merge: curl/curl@358b2b131a
2023-06-12 19:13:50 +02:00
Kawe Mazidjatari
975c40876a CModule and CMemory class improvements
This commit significantly reduces output code size, and a noticeable increase in performance. Changes are:
- Removed all extraneous std::string and std::vector copy constructions; use raw pointers instead to boost performance.
- Marked simple getters in CModule inline.
- Marked several functions in CModule const.
- Slightly reordered CModule class.
- 'CMemory::CheckOpCodes' and 'CMemory::Patch' now take a const reference.
2023-06-12 18:40:16 +02:00
Kawe Mazidjatari
c874b7c4d8 Implement 'SVC_UserMessage' print handler properly
Check if the actual message type is 'TextMsg' before printing, since other data is binary and could be read as 'HUD_PRINTCONSOLE', 'HUD_PRINTCENTER', etc.. resulting in printing binary data. This fix permanently solves that problem. The check has also been applied to the 'ShouldReplayMessage' function.
2023-06-12 02:02:29 +02:00
Kawe Mazidjatari
4290b08fd0 Fix desync in CUtlbuffer::ParseToken in assembled code
See commit 4969a840300bbafbc5a47f06fef41751a5620fc9, the same fix has been applied to the game executable.
2023-06-07 22:15:28 +02:00
Kawe Mazidjatari
4969a84030 Fix desync in CUtlbuffer::ParseToken
The if statement comparing 'nLen' with 'nMaxLen' increments 'nLen' first at all times, but the statement below that checks the delimiters seeks -1 from current pos, causing a desync. This could result in reading arbitrary memory on certain strings. This fix also fixes the useless need to 'snag' the delimiters from tokens.
2023-06-07 21:21:55 +02:00
Kawe Mazidjatari
a2468bb184 Normalize view angles in client's usercmd
Must be normalized, bad values (NAN or FLT_MAX) will crash the game. There is more that needs to be clamped, but before we can do this CUserCmd has to be reversed more.
2023-06-06 00:53:05 +02:00
Kawe Mazidjatari
70f89c1bd8 Fix incorrect ConVar string assignment in executable
This ConVar's name was set to its helpstring. This patch solves it by assigning the name field to an existing string that makes sense, and moving the helpstring into the actual helpstring field. An additional instruction has been inserted to load the NULL string address into RAX, which required light instruction shifting. After performing this patch, the ConVar now could be ser in the console.
2023-06-05 10:27:23 +02:00
Kawe Mazidjatari
2ae8a74ad9 Remove duplicate call to 'CNetChan::SetChoked()'
Should only be called if client is active.
2023-06-05 08:07:04 +02:00
Kawe Mazidjatari
8e1019a265 Make simple CNetAdr methods inline
Should be inline for their simplicity to improve performance.
2023-06-05 01:45:33 +02:00
Kawe Mazidjatari
4ed2e7a12a Mark as const
Mark as const.
2023-06-05 01:37:00 +02:00
Kawe Mazidjatari
11fd49efde Fix speed hack exploit
The frame time send from CL_Move is not sanitized on the server; clamp it to the same cvars the client is clamping them to so players busting out the clamps cannot speed hack. The values are replicated between the server and client, so if someone wants to tweak the values, it won't mess up on either the server or client.
2023-06-05 01:24:23 +02:00
Kawe Mazidjatari
9f2b1b1bb5 Improve CL_Move rebuild
Ported the logic from the more recent builds into the SDK rebuild. Note that this isn't all that has changed in the live builds, but were the only things worth porting back. Frame times are now properly clamped on the client. Some testing revealed that the movement now feels identical to the live version of the game, which was the target. This commit also fixes a bug in CL_Move were the datagram was not send, and the next cmd time wasn't set if the client was NOT active, while it should have.
2023-06-05 00:27:36 +02:00
Kawe Mazidjatari
671528cb2b Add max backup commands defines
In R5, its 4 bits for backup commands.
2023-06-04 22:00:15 +02:00
Kawe Mazidjatari
bba1cdd8b2 Fix dedicated server compile errors
These files should have been placed into the client only group.
2023-06-04 11:19:30 +02:00
Kawe Mazidjatari
1afa75fec3 Fix >190FPS input system/simulation problems
Function 'CL_Move' has been fully rebuild in the SDK. Originally, the game checked if the delta time exceeded an amount defined by an immediate value, and dropped usercmd's if that was the case. This logic has been replaced with a more dynamic solution, and the console variable regulating this ('fps_input_max') is set to 200.0 by default (the same as the fix applied in the Season 9.1 Genesis update). This function also has been slightly optimized by removing duplicate operations that were performed in the original function. A second fix has been applied to 'CInput::JoyStickApplyMovement' that was also found changed in the Season 9.1 Genesis executable. In that function, an extraneous clamp was performed on the frame time causing viewstick problems when usercmd's get dropped in CL_Move.
2023-06-03 21:20:23 +02:00
Kawe Mazidjatari
b567d8d74f Add 'CHLClient::CreateMove' to SDK 2023-06-03 18:21:13 +02:00
Kawe Mazidjatari
58f8bae127 Add CNetChan methods to SDK
Added 'CNetChan::CanPacket' and 'CNetChan::SendDatagram'.
2023-06-03 18:19:28 +02:00
Kawe Mazidjatari
693b378618 Remove left over function declaration
This function no longer exists.
2023-06-03 18:11:59 +02:00
Kawe Mazidjatari
cf3688a164 Add 'host_initialized' to SDK
Should had been part of commit '19df5a18'.
2023-06-03 18:11:20 +02:00
Kawe Mazidjatari
3d18be9ebb Add splitscreen types to SDK
R5 'MAX_SPLITSCREEN_CLIENTS' appears to be max 1.
2023-06-03 18:10:32 +02:00
Kawe Mazidjatari
3d80049ad4 Fix incorrect padding in CFrameSnapshot
'CFrameSnapshot::m_TickUpdate::m_nCommandTick' was at 0x44, the shifting was fixed by removing the extraneous padding.
2023-06-03 18:08:16 +02:00
Kawe Mazidjatari
cef62d7f4d Properly implement 'CClientState::IsPaused()'
Should check if host is initialized, and if the VGui system is paused as well. Also added 'CClientState::GetFrameTime()'.
2023-06-03 18:06:35 +02:00
Kawe Mazidjatari
19df5a188b Add 'CEngineVGui::ShouldPause()' virtual method 2023-06-03 18:05:09 +02:00
Kawe Mazidjatari
63ca5d9d98 Make small bitbuf methods inline
Make inline to boost performance.
2023-06-03 18:04:38 +02:00
Kawe Mazidjatari
f30ee91d4e Add CLC_ClientTick netmessage to SDK 2023-06-03 18:03:14 +02:00
Kawe Mazidjatari
e891d74656 Fix cURL error logging for dedicated
Since this file no longer gets build along with the DLL project, but as a static lib instead, the 'DEDICATED' define no longer worked, and therefore this became broken after the CMake port. The 'CURLHandleError' helper function now takes a bool determining whether or not to log the error, and the caller disables it for dedicated (dedicated should only log the error once, this happens from within the caller class).
2023-06-02 00:05:23 +02:00