16 Commits

Author SHA1 Message Date
Kawe Mazidjatari
cfa2172322 Undo CUtlBuffer::ParseToken patch
The bug was only reproduced on the compiled implementation in the game executable. The CUtlBuffer::ParseToken implementation in the SDK did not bug on the same input string. More research is required, and a possible good fix would be to just hook and replace the game's implementation with that of the SDK.
2023-06-23 00:27:24 +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
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
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
a061f7dd00 Optimize C2S_CONNECT vuln fix
Save 2 bytes from segment padding by performing zero test at original address followed by the long jump to patch, there were 5 bytes, zero test only requires 2, thus only 3 bytes were nopped with these changes.
2023-05-31 21:25:16 +02:00
Kawe Mazidjatari
c2799ff68c Fix bug in vulnerability patch
Value should be treated as unsigned, else negative values could still be used to read outside the static buffer.
2023-05-30 20:24:52 +02:00
Amos
46fafef60c Fix vulnerability in C2S_CONNECT message parser
Thanks Robotic for reporting the crash!
2023-05-30 10:03:53 +02:00
Kawe Mazidjatari
1fbc3291c7 Fix EOF read errors and PAKFILE_LUMP not loading correctly when discrete
This commit adds support for loading cubemap lumps from the disk, several patches and hooks had to be implemented to make this work. Since the game was trying to read the pakfile lump from the BSP file (even when absent), it would read EOF (heavily reduces down map loading performance).
2023-05-22 12:32:49 +02:00
Kawe Mazidjatari
94ae3e58ce Fix exploitable code defect in 'CNetChan::ProcessSubChannelData'
Patch applied to server & client.
2023-04-13 22:38:03 +02:00
Kawe Mazidjatari
4c8952ac96 Improve formatting in patch file document 2023-04-13 20:29:46 +02:00
Kawe Mazidjatari
a26ad748c8 Add patch for dedicated server executable
This patch prevents 'fps_max' from being reset in 'CEngine::Frame' if 'sv_cheats' isn't set; this cvar is now bound to the server's tickrate in sdk code to save CPU time.
2023-04-10 22:36:32 +02:00
rexx
af547c4a5e
Fix typo in dedi patch file 2023-02-26 21:47:32 +00:00
Kawe Mazidjatari
353aee5c2f Add new dedicated server patches 2023-02-26 22:20:06 +01:00
Kawe Mazidjatari
e640ecc391 New dedicated server (r5apex_ds.exe) patches
Added 2 new patches:
* Patch0: Unnecessary loop called from 'CModelLoader::UnloadModel'. This calls a 'nullsub' CMaterialGlue vtable method.
* Patch1:  CClientState constructor; Removed due to high mem allocation during init (100MiB+). 'CClientState' is useless on dedicated, and all its feature are thereof disabled.
2023-02-26 19:45:11 +01:00
Kawe Mazidjatari
08a550327a Fix bug in engine caused by missing comma separator
Valve and Respawn Entertainment forgot a comma in 'g_FieldTypes' causing "FIELD_INTERVAL" and "FIELD_MODELINDEX" to be concatenation. The engine executable patch fixes this problem
2022-12-26 16:58:07 +01:00
Kawe Mazidjatari
138e7d99af Update '-forceborder' comments and add patch documentation file
The documentation file for all patches applied to 'r5apex.exe' could be found in 'r5dev/resource/patch/r5apex.patch'. This is a text file containing the offset to the patch and its original instructions followed by the new instructions.
2022-12-07 01:03:07 +01:00