19 Commits

Author SHA1 Message Date
Kawe Mazidjatari
e92b5d1300 General cleanup
Use c++ methods, remove unnecessary casts, unnecessary use of auto, etc..
2022-08-09 15:19:12 +02:00
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
7d89a42b56 Mathlib implementation
SourceSDK mathlib port with light modifications.
Renamed Vector to Vector3D (to avoid confusion with std::vector (declared as vector) and Vector2D/Vector4D).
2022-07-06 21:11:32 +02:00
Kawe Mazidjatari
98c43fd6c1 Rename CConLog to ConLog_t 2022-06-26 17:40:02 +02:00
Kawe Mazidjatari
1764f039cf CConsole improvements: Add selectable logger text
CConsole now uses a dedicated class for logging text (modified CTextEditor class (CTextLogger)). The class uses an ImDraw list with a character vector to draw the text.

Text could be selected by double click (word), triple click (line), a selection by dragging the cursor, or everything with 'ctrl + a'.
2022-06-20 10:31:09 +02:00
Kawe Mazidjatari
e6ef3d71f1 Rename variable 'g_pIConsole' to 'g_pConsole' 2022-05-27 02:46:13 +02:00
Kawe Mazidjatari
4b72afb74f Light refactor for logging
Moved logging functions to dbg.h (tier0) and export them from the dll.
Added additional functions for checking bad pointers (debug only!).
Reduced output code size.
2022-05-25 14:18:29 +02:00
Kawe Mazidjatari
ddfdb4ffd8 See description
Add '-nodiscord' and '-nobakedparticles' to launch params for dedicated.
Add hook for 'MemAlloc_Internal()'.
Rename loggers to be more consistent with naming.
Revert omitting frame pointers.
2022-05-17 23:00:30 +02:00
Kawe Mazidjatari
3144227ec8 Update GetAdr implementations to feature spdlog
Fixed all alignments and reduced code verbosity
2022-05-13 14:53:25 +02:00
Kawe Mazidjatari
611ea6447a Console performance improvements and bug fixes
* Heavily reduced string compares for coloring logs (the left overs require a dedicated hook, this is for the future)
The new method uses a ImVec 4 constant containing the color obtained via a switch case by context, this is then out into the new CConLog structure where the loop in the console will now gather the colors directly from.
Error/Warning use a single constant.

* Fixed bugs in several log locations where the ostringstream was cleared before the emission causing double logs.

* Added global log mutex to log wrappers that lacked those.
2022-05-09 02:20:07 +02:00
Kawe Mazidjatari
e32cc6ae6a Code overhaul
Moved every pattern to IDetour interface. This allows for debugging patterns scans more easily, and create threads during pattern searching (Operation is now fired in APIENTRY).

Also cleaned up some unused code/extraneous comments.
Slightly increased performance by purging duplicate patterns.
Made variable search less dependent from other results (except if pattern-to-scan results is within the same header)
2022-04-18 03:35:08 +02:00
Kawe Mazidjatari
092b7e9d43 Start of migration to IDetour interface
Migrating to this to initialize all patterns and prototypes in Systems_Init() instead.
This should make debugging missing/not found patterns easier and allow for opting out variable/constant search (some of these require other patterns to be found, thus resulting in seg faults..).

Also added check to detect if user has a eligible CPU to run this SDK.
The game requires SSE and SSE2 instruction sets. Our SDK requires this too due to the use of SSE intrinsics, so we cannot let the game handle this. We have to check it ourselves.
2022-04-11 01:44:30 +02:00
Kawe Mazidjatari
8c1dfb50f4 Address class cleanup/improvements
* Move most definitions to implementation file to avoid recompiling whole program for small changes
* Pass strings by reference for where possible.
* Split Module class to dedicated file.
* Add const qualifiers to all eligible methods for address/module class
* Some renaming
2022-04-10 19:59:34 +02:00
Kawe Mazidjatari
b3631facbe Update all function casts 2022-04-09 06:05:47 +02:00
Kawe Mazidjatari
e2f06a8a68 Massive performance improvements
Inline every signature defined in the SDK (previously each translation unit had its own copy of the signature and function prototype). DLL init is near instant now (85% speed improvements).
2022-04-09 02:18:57 +02:00
Kawe Mazidjatari
aa57170e0d Start of pattern search refactor 2022-04-09 01:14:22 +02:00
Amos
1c5df4e178 Ansi terminal color support + big optimizations on all log systems + 'Warning()' hook
* Ansi colors can now be enabled with the '-ansiclr- flag.
* All loggers have been optimized and are all initialized only once at process startup.
* New hook for 'Warning()' print function with warning level.
2022-01-14 20:48:16 +01:00
Amos
c382020635 Implement QHull print function properly
Never seems to be called, but the function body was wrong.
2021-12-28 01:15:12 +01:00
Amos
d5b2e58dae Code base refactor + major performance and readability improvement. Read description for details.
* Codebase restructured to SourceSDK codebase style and .cpp/.h assertion paths in the game executable.
* Document most functions with valve style 'Purpose' blocks.
* Rename variables to match the rest of the codebase and Valve's naming convention.
* Dedicated DLL and the SDKLauncher now share the same codebase as the DevSDK.

* Obtain globals or pointers directly instead of waiting for runtime initialized data.
* Dynamically search for all functions and globals (this doesn't count for dedicated yet!).
* Initialize most in-SDK variables.

* Move certain prints and other utilities under ConVars to reduce verbosity and increase performance.
* Print all pattern scan results through a virtual function to make it easier to add and debug new patterns in the future.
* Type global var pointers appropriately if class or type is known and implemented.
* Forward declare 'CClient' class to avoid having 2 'g_pClient' copies.
* Add IDA's pseudo definitions for easier prototyping with decompiled assembly code.

* RPAK decompress Command callback implementation.
* Load decompressed RPaks from 'paks\Win32\' overriding the ones in 'paks\Win64\' (the decompress callback will automatically fix the header and write it to 'paks\Win32\').

* VPK decompress Command callback implementation.
* Move CRC32 ands Adler32 to implementation files.

* Server will print out more details about the connecting client.

* Upgrade ImGui lib to v1.86.
* Don't compile id3dx.h for dedicated.
* Don't compile id3dx.cpp for dedicated
* Implement DevMsg print function allowing to print information to the in-game VGUI/RUI console overlay, ImGui console overlay and the external windows console

* Fixed bug where the Error function would not properly terminate the process when an error is called. This caused access violations for critical/non-recoverable errors.
* Fixed bug where the game would crash if the console or server browser was enabled while the game was still starting up.
* Several bug fixes for the dedicated server (warning: dedicated is still considered work-in-progress!).
2021-12-25 22:36:38 +01:00