13 Commits

Author SHA1 Message Date
Kawe Mazidjatari
5eb784a882 FileSystem: add standalone implementation
Standalone FileSystem implementation, allowing SDK code to be used in tools without adjusting them as the vtables remain identical. NOTE that this reimplementation is partial and only contains the reading and writing of files to/from buffers or disk as that's what we are mainly interested at. We can always implement the other methods when needed.

NOTE: the filesystem singleton accessor (CFileSystem_Stdio* FileSystem()) has been moved to an implementation file instead of being inline as this would allow existing code to link to the tools implementation instead.
2024-04-05 17:42:55 +02:00
Kawe Mazidjatari
94939b5b40 Mark filesystem singleton getter inline 2023-05-06 21:56:59 +02:00
Kawe Mazidjatari
aa72579656 Heavy FileSystem upgrades
Implement VFTable's to interface with engine (for the most part mapped out, only the new VPK methods needs further reversing).
This exposes a good majority of the FileSystem implementation of the engine, to the SDK.
2022-08-13 11:24:55 +02:00
Kawe Mazidjatari
9bf7660138 FileSystem improvements
* Added method 'FPrintf'.
* Shifted indexes back by 2 if <GAMEDLL_S3 (Anything <S3 doesn't have the 2 FeatureFlags initialization methods which shifts everything past index 10 back by 2).
2022-08-12 15:51:04 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
87e3313e22 FileSystem improvements
Deref g_pFullFileSystem (most engine functions use this pointer instead of the direct address of g_pFileSystem_Stdio).
2022-06-16 21:19:04 +02:00
Kawe Mazidjatari
b19cf95420 Fix IFileSystem::RemoveSearchPath bug 2022-05-28 16:10:52 +02:00
Kawe Mazidjatari
dbec823be6 FileSystem improvements
* Added vftable interface for 'IFileSystem::RemoveSearchPath'.
* Added hook for 'CBaseFileSystem::AddSearchPath'.
* Added hook for 'CBaseFileSystem::RemoveSearchPath'.
* Added method in KeyValues for loading a KV file and parsing it via the game exe (loads from cache, vpk and disk).
* Added method in KeyValues to parse GameInfo.txt when the engine loads this.
2022-05-28 02:05:54 +02:00
Kawe Mazidjatari
52b8755219 FileSystem improvements
* Added proper pointer to g_pFileSystem_Stdio.
* Renamed existing one to g_pFullFileSystem (correct name).
* Obtain g_pFileSystem from the same constructor as g_pFileSystem_Stdio.
2022-05-27 22:38:49 +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
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
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
6a46486e99 See description
* Added 2 new FileSystem pointers with new features in their classes.
* Register all factory instances created by the GameDLL in the SDK.
* Added new command 'fs_mount_vpk' to mount a specified VPK file.
* Renamed 'fs_decompress_pak' to 'fs_unpack_vpk'.
* Some renaming of Factory and VPK types.
* Some light optimizations/cleanup.
2022-04-09 00:59:42 +02:00