├── .gitattributes ├── .gitignore ├── LICENSE.txt ├── README.md ├── injector ├── features │ ├── features.cpp │ └── features.h ├── injector.cpp ├── injector.vcxproj └── injector.vcxproj.filters ├── patcher ├── dep │ └── minhooks │ │ ├── headers │ │ └── MinHook.h │ │ └── libs │ │ └── MinHook.lib ├── dllmain.cpp ├── hooks │ ├── hooks.cpp │ └── hooks.h ├── includes.h ├── patcher.vcxproj ├── patcher.vcxproj.filters ├── utils │ ├── memory │ │ ├── memory.cpp │ │ └── memory.h │ ├── utils.cpp │ └── utils.h └── valve │ └── c_client_install_utils.h └── steam_manager.sln /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🛡️ VAC3 Bypasser ![LIC](https://img.shields.io/github/license/W1lliam1337/digital-sdk) ![LANG](https://img.shields.io/badge/language-C%2B%2B-brightgreen?style=flat ) 2 | If you're looking for a way to bypass VAC without risking your game account, VAC Bypass is the perfect solution. 3 | 4 | ![App menu](https://i.imgur.com/2Kfu5In.png) 5 | 6 | # Introduction 7 | - VAC-Bypasser is a program that can help you bypass the Valve Anti-Cheat (VAC) protection. It allows users to play games with modified files and cheats without being detected by VAC. 8 | 9 | - The program works by analyzing the steamclient.dll and finding specific areas that are vulnerable to VAC-Bypasser. It then modifies these areas to make them undetectable to VAC. 10 | 11 | - VAC-Bypasser is easy to use and requires no installation. It is compatible only with all Steam gaming platforms. 12 | 13 | - With VAC-Bypasser, you can play your favorite games without worrying about being detected by VAC. Enjoy the freedom of being able to customize your gaming experience without fear of being banned. 14 | 15 | # FAQ 16 | - This program is only x86 compatible. 17 | - Some code of this program is undocumented and you'll have to go through the VAC codebase to figure out how different things work. 18 | 19 | # How to use: 20 | - Put the dll and the injector into the same folder and run the injector, run the game, you're done! 21 | - Press F10 if you want to unload the module. 22 | 23 | # Comments navigation 24 | - `@note` 25 | - `@ida` 26 | - `@xref` 27 | 28 | # Dependencies 29 | - [c++ redists](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) 30 | - [minhook](https://github.com/TsudaKageyu/minhook) 31 | -------------------------------------------------------------------------------- /injector/features/features.cpp: -------------------------------------------------------------------------------- 1 | #include "features.h" 2 | 3 | void features::error_log( const char* message ) { 4 | std::cout << message << std::endl; 5 | system( "pause" ); 6 | exit( 0 ); 7 | } 8 | 9 | std::string features::random_string( const size_t length ) { 10 | std::string r; 11 | static constexpr char bet[ ] = { "ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyzZ1234567890" }; 12 | srand( static_cast< unsigned >( time( nullptr ) ) * 5 ); 13 | for ( int i = 0; i < length; ++i ) { 14 | r += bet[ rand( ) % ( sizeof bet - 1 ) ]; 15 | } 16 | return r; 17 | } 18 | 19 | bool features::does_file_exist( const char* name ) { 20 | if ( FILE* file = fopen( name, "r" ) ) { 21 | fclose( file ); 22 | return true; 23 | } 24 | 25 | return false; 26 | } 27 | 28 | DWORD features::get_process_id( const char* process_name ) { 29 | const HANDLE h_snap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, NULL ); 30 | 31 | PROCESSENTRY32 pe32{}; 32 | pe32.dwSize = sizeof pe32; 33 | 34 | if ( !Process32First( h_snap, &pe32 ) ) 35 | return NULL; 36 | 37 | do { 38 | if ( !strcmp( pe32.szExeFile, process_name ) ) { 39 | CloseHandle( h_snap ); 40 | return pe32.th32ProcessID; 41 | } 42 | } while ( Process32Next( h_snap, &pe32 ) ); 43 | 44 | CloseHandle( h_snap ); 45 | return NULL; 46 | 47 | } 48 | 49 | uintptr_t features::get_module_base_address( const DWORD pid, const char* mod_name ) { 50 | const HANDLE h_snap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid ); 51 | if ( h_snap != INVALID_HANDLE_VALUE ) { 52 | MODULEENTRY32 mod_entry{}; 53 | mod_entry.dwSize = sizeof mod_entry; 54 | if ( Module32First( h_snap, &mod_entry ) ) { 55 | do { 56 | if ( !strcmp( mod_entry.szModule, mod_name ) ) { 57 | CloseHandle( h_snap ); 58 | return reinterpret_cast< uintptr_t >( mod_entry.modBaseAddr ); 59 | } 60 | } while ( Module32Next( h_snap, &mod_entry ) ); 61 | } 62 | } 63 | return 0; 64 | } 65 | 66 | bool features::inject( const DWORD process_id, const char* dll ) { 67 | if ( process_id == NULL ) 68 | return false; 69 | 70 | char custom_dll[ MAX_PATH ]; 71 | GetFullPathNameA( dll, MAX_PATH, custom_dll, nullptr ); 72 | 73 | const HANDLE h_process = OpenProcess( PROCESS_ALL_ACCESS, FALSE, process_id ); 74 | const LPVOID allocated_mem = VirtualAllocEx( h_process, nullptr, sizeof custom_dll, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ); 75 | 76 | if ( WriteProcessMemory( h_process, allocated_mem, custom_dll, sizeof custom_dll, nullptr ) ) { 77 | CreateRemoteThread( h_process, nullptr, 0, reinterpret_cast< LPTHREAD_START_ROUTINE >( LoadLibrary ), 78 | allocated_mem, 0, nullptr ); 79 | 80 | if ( h_process ) 81 | CloseHandle( h_process ); 82 | 83 | return TRUE; 84 | } 85 | return FALSE; 86 | } 87 | -------------------------------------------------------------------------------- /injector/features/features.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace features { 7 | void error_log( const char* message ); 8 | void log( const char* message ); 9 | std::string random_string( size_t length ); 10 | bool does_file_exist( const char* name ); 11 | DWORD get_process_id( const char* process_name ); 12 | uintptr_t get_module_base_address( DWORD pid, const char* mod_name ); 13 | bool inject( DWORD process_id, const char* dll ); 14 | } 15 | -------------------------------------------------------------------------------- /injector/injector.cpp: -------------------------------------------------------------------------------- 1 | #include "features/features.h" 2 | 3 | int setup( ) { 4 | SetConsoleTitleA( features::random_string( 26 ).c_str( ) ); 5 | 6 | const DWORD process_id = features::get_process_id( "steam.exe" ); 7 | if ( !process_id ) 8 | features::error_log( "[!] steam.exe not founded.\n" ); 9 | 10 | std::cout << "[+] steam.exe founded." << std::dec << process_id << std::endl; 11 | 12 | const HANDLE game = OpenProcess( PROCESS_ALL_ACCESS, FALSE, process_id ); 13 | if ( !game ) 14 | features::error_log( "OpenProcess error\n" ); 15 | 16 | features::error_log( features::inject( process_id, "patcher.dll" ) ? "[+] Injected.\n" : "[!] Injection Failed.\n" ); 17 | 18 | return 0; 19 | } 20 | 21 | int main( ) { 22 | setup( ); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /injector/injector.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {17959ba7-618d-405a-b83f-895ecb96838b} 25 | injector 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | MultiByte 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | MultiByte 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | ../output/release/ 75 | 76 | 77 | ../output/debug/ 78 | 79 | 80 | 81 | TurnOffAllWarnings 82 | true 83 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 84 | true 85 | stdcpp20 86 | 87 | 88 | Console 89 | true 90 | 91 | 92 | 93 | 94 | TurnOffAllWarnings 95 | true 96 | true 97 | true 98 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 99 | true 100 | stdcpp20 101 | 102 | 103 | Console 104 | true 105 | true 106 | true 107 | 108 | 109 | 110 | 111 | Level3 112 | true 113 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 114 | true 115 | 116 | 117 | Console 118 | true 119 | 120 | 121 | 122 | 123 | Level3 124 | true 125 | true 126 | true 127 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 128 | true 129 | 130 | 131 | Console 132 | true 133 | true 134 | true 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /injector/injector.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Исходные файлы 20 | 21 | 22 | Исходные файлы 23 | 24 | 25 | 26 | 27 | Файлы заголовков 28 | 29 | 30 | -------------------------------------------------------------------------------- /patcher/dep/minhooks/headers/MinHook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | 30 | #pragma once 31 | 32 | #if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__) 33 | #error MinHook supports only x86 and x64 systems. 34 | #endif 35 | 36 | #include 37 | 38 | // MinHook Error Codes. 39 | using MH_STATUS = enum MH_STATUS 40 | { 41 | // Unknown error. Should not be returned. 42 | MH_UNKNOWN = -1, 43 | 44 | // Successful. 45 | MH_OK = 0, 46 | 47 | // MinHook is already initialized. 48 | MH_ERROR_ALREADY_INITIALIZED, 49 | 50 | // MinHook is not initialized yet, or already uninitialized. 51 | MH_ERROR_NOT_INITIALIZED, 52 | 53 | // The hook for the specified target function is already created. 54 | MH_ERROR_ALREADY_CREATED, 55 | 56 | // The hook for the specified target function is not created yet. 57 | MH_ERROR_NOT_CREATED, 58 | 59 | // The hook for the specified target function is already enabled. 60 | MH_ERROR_ENABLED, 61 | 62 | // The hook for the specified target function is not enabled yet, or already 63 | // disabled. 64 | MH_ERROR_DISABLED, 65 | 66 | // The specified pointer is invalid. It points the address of non-allocated 67 | // and/or non-executable region. 68 | MH_ERROR_NOT_EXECUTABLE, 69 | 70 | // The specified target function cannot be hooked. 71 | MH_ERROR_UNSUPPORTED_FUNCTION, 72 | 73 | // Failed to allocate memory. 74 | MH_ERROR_MEMORY_ALLOC, 75 | 76 | // Failed to change the memory protection. 77 | MH_ERROR_MEMORY_PROTECT, 78 | 79 | // The specified module is not loaded. 80 | MH_ERROR_MODULE_NOT_FOUND, 81 | 82 | // The specified function is not found. 83 | MH_ERROR_FUNCTION_NOT_FOUND 84 | }; 85 | 86 | // Can be passed as a parameter to MH_EnableHook, MH_DisableHook, 87 | // MH_QueueEnableHook or MH_QueueDisableHook. 88 | #define MH_ALL_HOOKS NULL 89 | 90 | #ifdef __cplusplus 91 | extern "C" { 92 | #endif 93 | 94 | // Initialize the MinHook library. You must call this function EXACTLY ONCE 95 | // at the beginning of your program. 96 | MH_STATUS WINAPI MH_Initialize(VOID); 97 | 98 | // Uninitialize the MinHook library. You must call this function EXACTLY 99 | // ONCE at the end of your program. 100 | MH_STATUS WINAPI MH_Uninitialize(VOID); 101 | 102 | // Creates a Hook for the specified target function, in disabled state. 103 | // Parameters: 104 | // pTarget [in] A pointer to the target function, which will be 105 | // overridden by the detour function. 106 | // pDetour [in] A pointer to the detour function, which will override 107 | // the target function. 108 | // ppOriginal [out] A pointer to the trampoline function, which will be 109 | // used to call the original target function. 110 | // This parameter can be NULL. 111 | MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID* ppOriginal); 112 | 113 | // Creates a Hook for the specified API function, in disabled state. 114 | // Parameters: 115 | // pszModule [in] A pointer to the loaded module name which contains the 116 | // target function. 117 | // pszTarget [in] A pointer to the target function name, which will be 118 | // overridden by the detour function. 119 | // pDetour [in] A pointer to the detour function, which will override 120 | // the target function. 121 | // ppOriginal [out] A pointer to the trampoline function, which will be 122 | // used to call the original target function. 123 | // This parameter can be NULL. 124 | MH_STATUS WINAPI MH_CreateHookApi( 125 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID* ppOriginal); 126 | 127 | // Creates a Hook for the specified API function, in disabled state. 128 | // Parameters: 129 | // pszModule [in] A pointer to the loaded module name which contains the 130 | // target function. 131 | // pszTarget [in] A pointer to the target function name, which will be 132 | // overridden by the detour function. 133 | // pDetour [in] A pointer to the detour function, which will override 134 | // the target function. 135 | // ppOriginal [out] A pointer to the trampoline function, which will be 136 | // used to call the original target function. 137 | // This parameter can be NULL. 138 | // ppTarget [out] A pointer to the target function, which will be used 139 | // with other functions. 140 | // This parameter can be NULL. 141 | MH_STATUS WINAPI MH_CreateHookApiEx( 142 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID* ppOriginal, LPVOID* ppTarget); 143 | 144 | // Removes an already created hook. 145 | // Parameters: 146 | // pTarget [in] A pointer to the target function. 147 | MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); 148 | 149 | // Enables an already created hook. 150 | // Parameters: 151 | // pTarget [in] A pointer to the target function. 152 | // If this parameter is MH_ALL_HOOKS, all created hooks are 153 | // enabled in one go. 154 | MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); 155 | 156 | // Disables an already created hook. 157 | // Parameters: 158 | // pTarget [in] A pointer to the target function. 159 | // If this parameter is MH_ALL_HOOKS, all created hooks are 160 | // disabled in one go. 161 | MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); 162 | 163 | // Queues to enable an already created hook. 164 | // Parameters: 165 | // pTarget [in] A pointer to the target function. 166 | // If this parameter is MH_ALL_HOOKS, all created hooks are 167 | // queued to be enabled. 168 | MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); 169 | 170 | // Queues to disable an already created hook. 171 | // Parameters: 172 | // pTarget [in] A pointer to the target function. 173 | // If this parameter is MH_ALL_HOOKS, all created hooks are 174 | // queued to be disabled. 175 | MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); 176 | 177 | // Applies all queued changes in one go. 178 | MH_STATUS WINAPI MH_ApplyQueued(VOID); 179 | 180 | // Translates the MH_STATUS to its name as a string. 181 | const char* WINAPI MH_StatusToString(MH_STATUS status); 182 | 183 | #ifdef __cplusplus 184 | } 185 | #endif 186 | -------------------------------------------------------------------------------- /patcher/dep/minhooks/libs/MinHook.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/W1lliam1337/vac3_bypasser/dd22a1bac14d27b908e207e3d633a600f96f1fbf/patcher/dep/minhooks/libs/MinHook.lib -------------------------------------------------------------------------------- /patcher/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "includes.h" 2 | #include "hooks/hooks.h" 3 | #include ; 4 | 5 | extern "C" BOOL WINAPI _CRT_INIT( HMODULE moduleHandle, DWORD reason, LPVOID reserved ); 6 | 7 | void main( HMODULE hModule ) { 8 | utils::alloc_console( ); 9 | while ( !GetModuleHandleA( "tier0_s.dll" ) || !GetModuleHandleA( "steamservice.dll" ) ) 10 | std::this_thread::sleep_for( std::chrono::seconds( 2 ) ); 11 | 12 | printf( "hello friend! credits to vac3 patcher:\n @tg: https://t.me/kernel_mode2\n @ds: william_coder#8276\n @github: https://github.com/W1lliam1337\n\n" ); 13 | printf( "[ main ] steam image: 0x%p \n", ctx::m_steam_image = GetModuleHandleA( "steamservice.dll" ) ); 14 | 15 | hooks::init( ); 16 | 17 | while ( !GetAsyncKeyState( 0x79 ) ) 18 | Sleep( 500 ); 19 | 20 | utils::destroy_console( ); 21 | hooks::destroy( ); 22 | 23 | _CRT_INIT( hModule, DLL_PROCESS_DETACH, nullptr ); 24 | FreeLibraryAndExitThread( hModule, 0 ); 25 | 26 | return ExitThread( EXIT_SUCCESS ); 27 | } 28 | 29 | BOOL APIENTRY DllMain( HMODULE hModule, 30 | DWORD ul_reason_for_call, 31 | LPVOID lpReserved 32 | ) { 33 | if ( ul_reason_for_call != DLL_PROCESS_ATTACH ) 34 | return FALSE; 35 | 36 | const auto thread = CreateThread( 0, 0, 37 | reinterpret_cast( main ), 38 | hModule, 0, 0 ); 39 | if ( thread ) 40 | CloseHandle( thread ); 41 | 42 | return TRUE; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /patcher/hooks/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "hooks.h" 2 | 3 | void hooks::init( ) { 4 | if ( MH_Initialize( ) != MH_OK ) { 5 | printf( "failed to init minhooks" ); 6 | return; 7 | } 8 | 9 | static const auto some_status_checks = static_cast< void* >( utils::sig( ctx::m_steam_image, "55 8B EC 6A FF 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 6C" ) ); 10 | HOOK( some_status_checks, hk_some_status_checks, og::m_some_status_checks ); 11 | 12 | static const auto runprocess_log = static_cast< void* >( utils::sig( ctx::m_steam_image, "55 8B EC 81 EC 2C 03 00 00 8D" ) ); 13 | HOOK( runprocess_log, hk_runprocces_log, og::m_runprocces_log ); 14 | 15 | static const auto load_vac = static_cast< void* >( utils::sig( ctx::m_steam_image, "55 8B EC 83 EC 28 53 56 8B 75" ) ); 16 | HOOK( load_vac, hk_load_vac, og::m_load_vac ); 17 | 18 | static const auto crc32 = static_cast< void* >( utils::sig( ctx::m_steam_image, "55 8B EC 80 3D ?? ?? ?? ?? ?? 56 8B" ) ); 19 | HOOK( crc32, hk_crc, og::m_crc ); 20 | 21 | static const auto crc_service_module = static_cast< void* >( utils::sig( ctx::m_steam_image, "55 8B EC 83 EC 0C 53 56 57 8B 7D 08 8B" ) ); 22 | HOOK( crc_service_module, hk_crc_service_module, og::m_crc_service_module ); 23 | 24 | //static const auto ipc_client_detecter = static_cast< void* >( utils::sig( ctx::m_steam_image, "55 8B EC 83 EC 0C 53 56 8B 75 08 8B" ) ); 25 | //HOOK( ipc_client_detecter, hk_ipc_client_detecter, og::m_ipc_client_detecter ); 26 | 27 | //HOOK_API( L"kernel32.dll", "CreateFileMappingA", hk_create_file_mapping, og::m_create_file_mapping ); 28 | HOOK( CreateFileMappingA, hk_create_file_mapping, og::m_create_file_mapping ); 29 | 30 | printf( "[ hooks ] targets: %d\n", m_targets.size( ) ); 31 | printf( "[ main ] hooks passed.\n" ); 32 | } 33 | 34 | int __fastcall hooks::hk_ipc_client_detecter( int a1, int a2, int a3, int a4 ) { 35 | // @xref: "IPC client is in my process, could/should be using an in-process pipe." 36 | static const auto sig = static_cast< void* >( utils::sig( ctx::m_steam_image, "74 23 8B 75 0C" ) ); 37 | if ( _ReturnAddress( ) == sig ) 38 | return 1; 39 | 40 | return og::m_ipc_client_detecter( a1, a2, a3, a4 ); 41 | } 42 | 43 | void __fastcall hooks::hk_runprocces_log( registers, 44 | const char* a2, const char* a3, int a4 ) { 45 | // @xref: "\\logs\\runprocess_log.txt" 46 | // @note: this function collects all data about the launch of any game by the client. 47 | // return nothing. 48 | return; 49 | } 50 | 51 | int __fastcall hooks::hk_some_status_checks( registers, 52 | unsigned int crc_hash, 53 | char mode, 54 | int a4, 55 | int a5, 56 | int a6, 57 | int a7, 58 | int a8, 59 | int a9, 60 | void** a10, 61 | std::size_t* size ) { 62 | int last_result = og::m_some_status_checks( ecx, edx, crc_hash, mode, a4, a5, a6, a7, a8, a9, a10, size ); 63 | static const auto condition = static_cast< void* >( utils::sig( ctx::m_steam_image, "0F 84 ? ? ? ? B9 ? ? ? ? 8B 06" ) ); 64 | 65 | // patch crc hash checks. 66 | if ( _ReturnAddress( ) == condition ) { 67 | return 1; 68 | } 69 | 70 | //mode &= ~3; 71 | if ( last_result != e_last_status::OK && last_result != 2 ) 72 | last_result = e_last_status::OK; 73 | 74 | printf( "[ hook ] patched status: %d\n", last_result ); 75 | return last_result; 76 | } 77 | 78 | bool __stdcall hooks::hk_load_vac( c_module* Src, char mode ) { 79 | // @ida: 55 8B EC 8B 55 0C 81 80 | auto is_valid_module = [ & ]( const c_module* module_struct ) { 81 | const auto module_data = module_struct->m_raw; 82 | const auto module_size = module_struct->m_module_size; 83 | 84 | if ( module_size < 0x200 85 | || *reinterpret_cast< WORD* >( module_data ) != 23117 86 | || *reinterpret_cast< DWORD* >( module_data + 60 ) < 0x40 87 | || *reinterpret_cast< DWORD* >( module_data + 60 ) >= module_size - 248 88 | || *reinterpret_cast< DWORD* >( ( *reinterpret_cast< DWORD* >( module_data + 60 ) ) + module_data ) != 17744 ) { 89 | return false; 90 | } 91 | 92 | if ( *reinterpret_cast< DWORD* >( module_data + 64 ) != 5655638 93 | || *reinterpret_cast< DWORD* >( module_data + 68 ) != 1 94 | || module_size < *reinterpret_cast< DWORD* >( module_data + 72 ) ) { 95 | return false; 96 | } 97 | 98 | const auto v6 = ( *reinterpret_cast< DWORD* >( module_data + 60 ) ) + module_data + 24; 99 | 100 | if ( *reinterpret_cast< WORD* >( v6 ) != 267 101 | && *reinterpret_cast< WORD* >( v6 ) != 523 ) { 102 | return false; 103 | } 104 | 105 | return true; 106 | }; 107 | 108 | // @ida: E8 ?? ?? ?? ?? 83 C4 08 85 C0 74 19 56 109 | // return success if module is invalid. 110 | if ( !is_valid_module( Src ) ) { 111 | Src->m_last_result = e_last_status::OK; 112 | return 1; 113 | } 114 | 115 | // unload vac module 116 | const auto raw = Src->m_raw; 117 | FreeLibrary( Src->m_module ); 118 | Src->m_runfunc = nullptr; 119 | Src->m_raw = -1; 120 | Src->m_module_size = -1; 121 | Src->m_last_result = e_last_status::OK; 122 | 123 | printf( "[ hook ] VAC module was successfully unloaded\n" );; 124 | 125 | return 1; 126 | } 127 | 128 | int __cdecl hooks::hk_crc( int a1, int a2 ) { 129 | int og = og::m_crc( a1, a2 ); 130 | printf( "[ crc hash ] crc32: %d\n", og ); 131 | return og; 132 | } 133 | 134 | bool __fastcall hooks::hk_crc_service_module( registers, int unCRC32, void* Src, std::size_t Size ) { 135 | int og = og::m_crc_service_module( ecx, edx, unCRC32, Src, Size ); 136 | printf( "[ crc hash ] unCRC32: %d\n", unCRC32 ); 137 | printf( "[ crc hash ] return service module: %d\n", og ); 138 | return og; 139 | } 140 | 141 | HANDLE __stdcall hooks::hk_create_file_mapping( HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName ) { 142 | if ( lpName == "Steam_{E9FD3C51-9B58-4DA0-962C-734882B19273}_Pid:%000008X" ) { 143 | lpName = ""; 144 | printf( "[file mapping] found shit and successfully patched\n" ); 145 | } 146 | 147 | return og::m_create_file_mapping( hFile, lpFileMappingAttributes, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow, lpName ); 148 | } 149 | 150 | // unused. 151 | DWORD __stdcall hooks::hk_get_module_file_name_ex( HANDLE hProcess, HMODULE hModule, LPSTR lpFilename, DWORD nSize ) { 152 | return NULL; 153 | } 154 | 155 | void hooks::destroy( ) { 156 | MH_DisableHook( MH_ALL_HOOKS ); 157 | MH_Uninitialize( ); 158 | } -------------------------------------------------------------------------------- /patcher/hooks/hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../utils/utils.h" 3 | #include 4 | 5 | #define registers void* ecx, void* edx 6 | 7 | #define HOOK( target, detour, og ) \ 8 | if (MH_CreateHook( target, detour, reinterpret_cast(&( og ))) == MH_OK \ 9 | && MH_EnableHook( target ) == MH_OK ) { \ 10 | printf("[ hooks ] created target: %s\n", #target); hooks::m_targets.emplace_back(target);\ 11 | } \ 12 | else { std::string str = "failed init "; str += #target; throw std::runtime_error( str ); } 13 | 14 | #define HOOK_API( module_name, func_name, detour, og ) \ 15 | if (MH_CreateHookApi( module_name, func_name, &detour, reinterpret_cast(&( og ))) == MH_OK ) { \ 16 | printf("[ hooks ] created target: %s\n", #func_name); \ 17 | } \ 18 | else { std::string str = "failed init "; str += #func_name; throw std::runtime_error( str ); } 19 | 20 | class c_module { 21 | typedef int( __stdcall* runfunc_t )( int, unsigned char*, int, unsigned char*, int* ); 22 | char gap0[ 4 ]; 23 | public: 24 | HMODULE m_module{ }; 25 | HMODULE m_sec_module{ }; 26 | runfunc_t m_runfunc{ }; 27 | int m_last_result{ }; 28 | std::size_t m_module_size{ }; 29 | int m_raw{ }; 30 | private: 31 | char gap1C[ 16 ]; 32 | }; 33 | 34 | enum e_last_status : int { 35 | OK = 1, 36 | }; 37 | 38 | namespace hooks { 39 | void init( ); 40 | void destroy( ); 41 | void __fastcall hk_runprocces_log( registers, 42 | const char* a2, const char* a3, int a4 ); 43 | int __fastcall hk_some_status_checks( registers, 44 | unsigned int crc_hash, 45 | char mode, 46 | int a4, 47 | int a5, 48 | int a6, 49 | int a7, 50 | int a8, 51 | int a9, 52 | void** a10, 53 | std::size_t* size ); 54 | bool __stdcall hk_load_vac( c_module* Src, char mode ); 55 | int __cdecl hk_crc( int a1, int a2 ); 56 | bool __fastcall hk_crc_service_module( registers, int unCRC32, void* Src, std::size_t Size ); 57 | HANDLE __stdcall hk_create_file_mapping( HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName ); 58 | DWORD __stdcall hk_get_module_file_name_ex( HANDLE hProcess, HMODULE hModule, LPSTR lpFilename, DWORD nSize ); 59 | int __fastcall hk_ipc_client_detecter( int a1, int a2, int a3, int a4 ); 60 | 61 | namespace og { 62 | inline decltype( &hk_ipc_client_detecter ) m_ipc_client_detecter{ }; 63 | inline decltype( &hk_get_module_file_name_ex ) m_get_module_file_name_ex{ }; 64 | inline decltype( &hk_create_file_mapping ) m_create_file_mapping{ }; 65 | inline decltype( &hk_crc_service_module ) m_crc_service_module{ }; 66 | inline decltype( &hk_crc ) m_crc{ }; 67 | inline decltype( &hk_runprocces_log ) m_runprocces_log{ }; 68 | inline decltype( &hk_some_status_checks ) m_some_status_checks{ }; 69 | inline decltype( &hk_load_vac ) m_load_vac{ }; 70 | } 71 | 72 | inline std::vector < LPVOID > m_targets{ }; 73 | } -------------------------------------------------------------------------------- /patcher/includes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #pragma intrinsic(_ReturnAddress) 13 | 14 | namespace ctx { 15 | inline HMODULE m_steam_image{ }; 16 | } -------------------------------------------------------------------------------- /patcher/patcher.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {02f990fd-14a9-49f9-9dec-e2295151d991} 25 | steammanager 26 | 10.0 27 | patcher 28 | 29 | 30 | 31 | DynamicLibrary 32 | true 33 | v143 34 | MultiByte 35 | 36 | 37 | DynamicLibrary 38 | false 39 | v143 40 | true 41 | MultiByte 42 | 43 | 44 | DynamicLibrary 45 | true 46 | v143 47 | Unicode 48 | 49 | 50 | DynamicLibrary 51 | false 52 | v143 53 | true 54 | Unicode 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | $(SolutionDir)\patcher\dep\minhooks\headers\;$(IncludePath) 76 | $(SolutionDir)\patcher\dep\minhooks\libs\;$(LibraryPath) 77 | patcher 78 | ../output/release/ 79 | 80 | 81 | $(SolutionDir)\patcher\dep\minhooks\headers\;$(IncludePath) 82 | $(SolutionDir)\patcher\dep\minhooks\libs\;$(LibraryPath) 83 | patcher 84 | ../output/debug/ 85 | 86 | 87 | 88 | TurnOffAllWarnings 89 | true 90 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;STEAMMANAGER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 91 | true 92 | NotUsing 93 | pch.h 94 | stdcpp20 95 | true 96 | 97 | 98 | Windows 99 | true 100 | false 101 | 102 | 103 | 104 | 105 | TurnOffAllWarnings 106 | true 107 | true 108 | true 109 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;STEAMMANAGER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 110 | true 111 | NotUsing 112 | pch.h 113 | true 114 | stdcpp20 115 | 116 | 117 | Windows 118 | true 119 | true 120 | true 121 | false 122 | 123 | 124 | 125 | 126 | Level3 127 | true 128 | _DEBUG;STEAMMANAGER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 129 | true 130 | Use 131 | pch.h 132 | 133 | 134 | Windows 135 | true 136 | false 137 | 138 | 139 | 140 | 141 | Level3 142 | true 143 | true 144 | true 145 | NDEBUG;STEAMMANAGER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 146 | true 147 | Use 148 | pch.h 149 | 150 | 151 | Windows 152 | true 153 | true 154 | true 155 | false 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /patcher/patcher.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Исходные файлы 20 | 21 | 22 | Исходные файлы 23 | 24 | 25 | Исходные файлы 26 | 27 | 28 | Исходные файлы 29 | 30 | 31 | 32 | 33 | Файлы заголовков 34 | 35 | 36 | Файлы заголовков 37 | 38 | 39 | Файлы заголовков 40 | 41 | 42 | Файлы заголовков 43 | 44 | 45 | Файлы заголовков 46 | 47 | 48 | Файлы заголовков 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /patcher/utils/memory/memory.cpp: -------------------------------------------------------------------------------- 1 | #include "memory.h" 2 | 3 | std::uint8_t* utils::sig( const HMODULE module, const std::string& byte_array ) { 4 | if ( !module ) 5 | return nullptr; 6 | 7 | static const auto pattern_to_byte = [ & ]( std::string pattern ) { 8 | std::vector bytes{}; 9 | const auto start = const_cast< char* >( pattern.c_str( ) ); 10 | const auto end = const_cast< char* >( pattern.c_str( ) ) + pattern.length( ); 11 | 12 | for ( auto current = start; current < end; ++current ) { 13 | if ( *current == '?' ) { 14 | ++current; 15 | 16 | if ( *current == '?' ) 17 | ++current; 18 | 19 | bytes.push_back( -1 ); 20 | } 21 | else { 22 | bytes.push_back( std::strtoul( current, ¤t, 16 ) ); 23 | } 24 | } 25 | return bytes; 26 | }; 27 | 28 | const auto dos_header = reinterpret_cast< PIMAGE_DOS_HEADER >( module ); 29 | const auto nt_headers = 30 | reinterpret_cast< PIMAGE_NT_HEADERS >( reinterpret_cast< std::uint8_t* >( module ) + dos_header->e_lfanew ); 31 | 32 | const auto size_of_image = nt_headers->OptionalHeader.SizeOfImage; 33 | const auto pattern_bytes = pattern_to_byte( byte_array ); 34 | const auto scan_bytes = reinterpret_cast< std::uint8_t* >( module ); 35 | 36 | const auto pattern_size = pattern_bytes.size( ); 37 | const auto pattern_data = pattern_bytes.data( ); 38 | 39 | for ( auto i = 0ul; i < size_of_image - pattern_size; ++i ) { 40 | bool found = true; 41 | 42 | for ( auto j = 0ul; j < pattern_size; ++j ) { 43 | if ( scan_bytes[ i + j ] != pattern_data[ j ] && pattern_data[ j ] != -1 ) { 44 | found = false; 45 | break; 46 | } 47 | } 48 | if ( found ) 49 | return &scan_bytes[ i ]; 50 | } 51 | 52 | return nullptr; 53 | } -------------------------------------------------------------------------------- /patcher/utils/memory/memory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../includes.h" 3 | 4 | namespace utils { 5 | template 6 | [[nodiscard]] static __forceinline T call_vfunc( void* instance, const std::size_t index ) { 7 | return ( *static_cast< T** >( instance ) )[ index ]; 8 | } 9 | 10 | std::uint8_t* sig( const HMODULE module, const std::string& byte_array ); 11 | }; -------------------------------------------------------------------------------- /patcher/utils/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | void utils::alloc_console( ) { 4 | AllocConsole( ); 5 | AttachConsole( ATTACH_PARENT_PROCESS ); 6 | freopen_s( &m_file, "CONOUT$", "w", stdout ); 7 | } 8 | 9 | void utils::destroy_console( ) { 10 | fclose( m_file ); 11 | FreeConsole( ); 12 | 13 | // get console window 14 | if ( const auto console_wnd = GetConsoleWindow( ); console_wnd ) { 15 | // close console window 16 | PostMessageW( console_wnd, WM_CLOSE, 0U, 0L ); 17 | } 18 | } -------------------------------------------------------------------------------- /patcher/utils/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "memory/memory.h" 3 | 4 | #define GET_VFUNC( type, function_name, index, ...) \ 5 | [[nodiscard]] __forceinline auto function_name { \ 6 | return utils::call_vfunc< type >( this, index )( this, __VA_ARGS__ ); \ 7 | } 8 | 9 | namespace utils { 10 | inline FILE* m_file{ }; 11 | void alloc_console( ); 12 | void destroy_console( ); 13 | } -------------------------------------------------------------------------------- /patcher/valve/c_client_install_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../utils/utils.h" 3 | 4 | namespace valve { 5 | class c_client_install_utils { 6 | public: 7 | // @xref: "%s\\Microsoft\\Windows\\GameExplorer\\%s\\%s\\%d" 8 | GET_VFUNC( bool( __thiscall* )( void*, int, LPCCH, BSTR ), 9 | launch_tasks( int a2, LPCCH lpMultiByteStr, BSTR bstrString ), 3, 10 | a2, lpMultiByteStr, bstrString ); 11 | 12 | // @xref: "\"%s\\%s\" steam://uninstall/%d" 13 | GET_VFUNC( bool( __thiscall* )( void*, HKEY, int, BYTE*, BYTE*, BYTE*, int, BYTE* ), 14 | unistall( HKEY phkResult, int a3, BYTE* lpData, BYTE* a5, BYTE* a6, int a7, BYTE* a8 ), 16, 15 | phkResult, a3, lpData, a5, a6, a7, a8 ); 16 | 17 | 18 | // @ida: 55 8B EC B8 28 19 | /*__forceinline bool unistall( HKEY phkResult, int a3, BYTE* lpData, BYTE* a5, BYTE* a6, int a7, BYTE* a8 ) { 20 | sub_100B4F50( SubKey, 260, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App %d", phkResult ); 21 | is_wow_64_process = c_utils::is_wow_64_process( ); 22 | phkResult = 0; 23 | if ( RegCreateKeyExA( HKEY_LOCAL_MACHINE, SubKey, 0, 0, 0, ( is_wow_64_process ? 0x100 : 0 ) | 0xF003F, 0, &phkResult, 0 ) ) 24 | return 0; 25 | sub_100B4F50( v24, 292, "\"%s\\%s\" steam://uninstall/%d", ( this + 4 ), *( this + 264 ), v9 ); 26 | a3 = 1; 27 | sub_100B85B0( v10, Data, 2048, 4 ); 28 | sub_100B85B0( a7, v21, 2048, 4 ); 29 | v12 = RegSetValueExA( phkResult, "DisplayIcon", 0, 1u, lpData, strlen( lpData ) + 1 ); 30 | v13 = RegSetValueExW( phkResult, L"DisplayName", 0, 1u, Data, 2 * wcslen( Data ) + 2 ) | v12; 31 | v14 = RegSetValueExA( phkResult, "HelpLink", 0, 1u, a5, strlen( a5 ) + 1 ) | v13; 32 | v15 = RegSetValueExA( phkResult, "InstallLocation", 0, 1u, a6, strlen( a6 ) + 1 ) | v14; 33 | v16 = RegSetValueExW( phkResult, L"Publisher", 0, 1u, v21, 2 * wcslen( v21 ) + 2 ) | v15; 34 | v17 = RegSetValueExA( phkResult, "UninstallString", 0, 1u, v24, strlen( v24 ) + 1 ) | v16; 35 | v18 = RegSetValueExA( phkResult, "URLInfoAbout", 0, 1u, a8, strlen( a8 ) + 1 ) | v17; 36 | LODWORD( v19 ) = RegSetValueExA( phkResult, "NoRepair", 0, 4u, &a3, 4u ) | v18; 37 | HIDWORD( v19 ) = RegSetValueExA( phkResult, "NoModify", 0, 4u, &a3, 4u ); 38 | RegCloseKey( phkResult ); 39 | return v19 == 0; 40 | }*/ 41 | }; 42 | } -------------------------------------------------------------------------------- /steam_manager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33205.214 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "patcher", "patcher\patcher.vcxproj", "{02F990FD-14A9-49F9-9DEC-E2295151D991}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "injector", "injector\injector.vcxproj", "{17959BA7-618D-405A-B83F-895ECB96838B}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Debug|x64.ActiveCfg = Debug|x64 19 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Debug|x64.Build.0 = Debug|x64 20 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Debug|x86.ActiveCfg = Debug|Win32 21 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Debug|x86.Build.0 = Debug|Win32 22 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Release|x64.ActiveCfg = Release|x64 23 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Release|x64.Build.0 = Release|x64 24 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Release|x86.ActiveCfg = Release|Win32 25 | {02F990FD-14A9-49F9-9DEC-E2295151D991}.Release|x86.Build.0 = Release|Win32 26 | {17959BA7-618D-405A-B83F-895ECB96838B}.Debug|x64.ActiveCfg = Debug|x64 27 | {17959BA7-618D-405A-B83F-895ECB96838B}.Debug|x64.Build.0 = Debug|x64 28 | {17959BA7-618D-405A-B83F-895ECB96838B}.Debug|x86.ActiveCfg = Debug|Win32 29 | {17959BA7-618D-405A-B83F-895ECB96838B}.Debug|x86.Build.0 = Debug|Win32 30 | {17959BA7-618D-405A-B83F-895ECB96838B}.Release|x64.ActiveCfg = Release|x64 31 | {17959BA7-618D-405A-B83F-895ECB96838B}.Release|x64.Build.0 = Release|x64 32 | {17959BA7-618D-405A-B83F-895ECB96838B}.Release|x86.ActiveCfg = Release|Win32 33 | {17959BA7-618D-405A-B83F-895ECB96838B}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {E904CEF9-065D-4DCE-AC86-D347C714AACF} 40 | EndGlobalSection 41 | EndGlobal 42 | --------------------------------------------------------------------------------