├── .gitattributes ├── .gitignore ├── InjectorWar3 ├── InjectorWar3.cpp ├── InjectorWar3.vcxproj ├── InjectorWar3.vcxproj.filters ├── ShareMemory │ ├── ConsoleShareMemory.cpp │ ├── ConsoleShareMemory.h │ └── ShareMemoryStruct.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── README.md ├── War3Cheat.sln ├── War3Cheat ├── Expr.cpp ├── Expr.h ├── Feature │ ├── CheatFeature.cpp │ ├── CheatFeature.h │ ├── FindGameObject.cpp │ └── FindGameObject.h ├── ShareMemory │ ├── GameShareMemory.cpp │ └── GameShareMemory.h ├── War3Cheat.cpp ├── War3Cheat.vcxproj ├── War3Cheat.vcxproj.filters ├── dllmain.cpp ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── include ├── AlgroithmLib │ ├── Common │ │ └── CommonCharacter.h │ └── Encrypt │ │ ├── CRC32.h │ │ ├── MD5.h │ │ ├── RC4.h │ │ └── SHA1.h ├── CharacterLib │ └── Character.h ├── DbManagerLib │ └── BaseDbManager.h ├── ExceptionLib │ └── Exception.h ├── FileLib │ └── File.h ├── GdiLib │ └── GdiScreenshot.h ├── HookLib │ ├── IATHook │ │ └── IATHook.h │ └── InlineHook │ │ └── InlineHook.h ├── InjectorLib │ ├── DllInjector │ │ └── DllInjector.h │ └── ModuleInjector │ │ └── NoTraceModuleInjector.h ├── LogLib │ ├── CmdLog.h │ ├── Log.h │ ├── LogExpression.h │ ├── LogExpressionCalc.h │ └── LogExpressionPeLoader.h ├── MathLib │ └── DistanceCalc.h ├── ProcessLib │ ├── AntiRootkit │ │ └── AntiRootkit.h │ ├── Common │ │ └── ResHandleManager.h │ ├── KeyboardMsg │ │ └── KeyboardMsg.h │ ├── Memory │ │ ├── Memory.h │ │ └── SearchBinary.h │ ├── Process │ │ └── Process.h │ └── Thread │ │ └── Thread.h ├── SocketClientLib │ └── SocketBaseClientService.h ├── SocketCommon │ ├── SocketBuffer.h │ ├── SocketIoEvent.h │ ├── SocketRemoteClient.h │ └── SocketTag.h ├── SocketServerLib │ └── SocketBaseServerService.h └── TimeLib │ ├── TimeCharacter.h │ ├── TimeRand.h │ └── TimeTick.h ├── lib ├── AlgroithmLib.lib ├── CharacterLib.lib ├── DbManagerLib.lib ├── ExceptionLib.lib ├── FileLib.lib ├── GdiLib.lib ├── HookLib.lib ├── InjectorLib.lib ├── LogLib.lib ├── MathLib.lib ├── ProcessLib.lib ├── SocketClientLib.lib ├── SocketCommon.lib ├── SocketServerLib.lib └── TimeLib.lib └── screenshot ├── 1.png ├── 10.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png /.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 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /InjectorWar3/InjectorWar3.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/InjectorWar3/InjectorWar3.cpp -------------------------------------------------------------------------------- /InjectorWar3/InjectorWar3.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 | 15.0 23 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13} 24 | Win32Proj 25 | InjectorWar3 26 | 10.0.16299.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v141 33 | Unicode 34 | false 35 | 36 | 37 | Application 38 | false 39 | v141 40 | true 41 | Unicode 42 | 43 | 44 | Application 45 | true 46 | v141 47 | Unicode 48 | 49 | 50 | Application 51 | false 52 | v141 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 | true 76 | $(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)include;$(SolutionDir); 77 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(SolutionDir)lib; 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | $(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)include;$(SolutionDir); 85 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(SolutionDir)lib; 86 | 87 | 88 | false 89 | 90 | 91 | 92 | Use 93 | Level4 94 | Disabled 95 | true 96 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 97 | MultiThreadedDebug 98 | 99 | 100 | Console 101 | true 102 | 103 | 104 | 105 | 106 | Use 107 | Level3 108 | Disabled 109 | true 110 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 111 | 112 | 113 | Console 114 | true 115 | 116 | 117 | 118 | 119 | Use 120 | Level4 121 | MaxSpeed 122 | true 123 | true 124 | true 125 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 126 | true 127 | Async 128 | MultiThreaded 129 | 130 | 131 | Console 132 | true 133 | true 134 | true 135 | 136 | 137 | 138 | 139 | Use 140 | Level3 141 | MaxSpeed 142 | true 143 | true 144 | true 145 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 146 | 147 | 148 | Console 149 | true 150 | true 151 | true 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | Create 165 | Create 166 | Create 167 | Create 168 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /InjectorWar3/InjectorWar3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;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 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | -------------------------------------------------------------------------------- /InjectorWar3/ShareMemory/ConsoleShareMemory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ConsoleShareMemory.h" 3 | #include 4 | 5 | CConsoleShareMemory::~CConsoleShareMemory() 6 | { 7 | Release(); 8 | } 9 | 10 | CConsoleShareMemory& CConsoleShareMemory::GetInstance() 11 | { 12 | static CConsoleShareMemory Instance; 13 | return Instance; 14 | } 15 | 16 | BOOL CConsoleShareMemory::Create(_In_ HANDLE hStdOut) 17 | { 18 | _hFileMap = ::CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, NULL, sizeof(ShareContent), SHAREMEMORYNAME); 19 | if (_hFileMap == NULL) 20 | { 21 | _wsErrorText = libTools::CCharacter::MakeFormatText(L"CreateFileMappingW = NULL, Error=%d", ::GetLastError()); 22 | return FALSE; 23 | } 24 | 25 | 26 | _pShareContent = reinterpret_cast(::MapViewOfFile(_hFileMap, FILE_MAP_READ | FILE_MAP_WRITE, NULL, NULL, sizeof(ShareContent))); 27 | if (_pShareContent == nullptr) 28 | { 29 | _wsErrorText = libTools::CCharacter::MakeFormatText(L"MapViewOfFile = NULL, Error=%d", ::GetLastError()); 30 | return FALSE; 31 | } 32 | 33 | 34 | ZeroMemory(_pShareContent, sizeof(ShareContent)); 35 | ::GetCurrentDirectoryW(MAX_PATH, _pShareContent->wszConsolePath); 36 | _pShareContent->hStdOut = hStdOut; 37 | return TRUE; 38 | } 39 | 40 | CONST std::wstring& CConsoleShareMemory::GetErrorText() CONST 41 | { 42 | return _wsErrorText; 43 | } 44 | 45 | VOID CConsoleShareMemory::SetNormalAction(_In_ em_Action_Type emActionType) 46 | { 47 | WaitForGameReadData(); 48 | _pShareContent->emActionType = emActionType; 49 | } 50 | 51 | VOID CConsoleShareMemory::SetActionWithParam(_In_ em_Action_Type emActionType, _In_ CONST std::wstring& wsParam) 52 | { 53 | WaitForGameReadData(); 54 | std::copy(wsParam.begin(), wsParam.end(), _pShareContent->wszParam); 55 | _pShareContent->emActionType = emActionType; 56 | } 57 | 58 | BOOL CConsoleShareMemory::IsConnectedGame() CONST 59 | { 60 | return _pShareContent->bLive; 61 | } 62 | 63 | VOID CConsoleShareMemory::WaitForGameReadData() CONST 64 | { 65 | for (ULONGLONG ulTick = ::GetTickCount64(); _pShareContent->emActionType != em_Action_Type::None && ::GetTickCount64() - ulTick <= 5 * 1000;) 66 | { 67 | ::Sleep(100); 68 | } 69 | } 70 | 71 | VOID CConsoleShareMemory::Release() 72 | { 73 | if (_pShareContent != nullptr) 74 | { 75 | ::UnmapViewOfFile(_pShareContent); 76 | _pShareContent = nullptr; 77 | } 78 | if (_hFileMap != NULL) 79 | { 80 | ::CloseHandle(_hFileMap); 81 | _hFileMap = NULL; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /InjectorWar3/ShareMemory/ConsoleShareMemory.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAR3CHEAT_INJECTORWAR3_SHAREMEMORY_GAMESHAREMEMORY_H__ 2 | #define __WAR3CHEAT_INJECTORWAR3_SHAREMEMORY_GAMESHAREMEMORY_H__ 3 | 4 | #include "ShareMemoryStruct.h" 5 | #include 6 | 7 | class CConsoleShareMemory 8 | { 9 | public: 10 | CConsoleShareMemory() = default; 11 | ~CConsoleShareMemory(); 12 | 13 | static CConsoleShareMemory& GetInstance(); 14 | 15 | BOOL Create(_In_ HANDLE hStdOut); 16 | 17 | CONST std::wstring& GetErrorText() CONST; 18 | 19 | // 20 | VOID SetNormalAction(_In_ em_Action_Type emActionType); 21 | 22 | // 23 | VOID SetActionWithParam(_In_ em_Action_Type emActionType, _In_ CONST std::wstring& wsParam); 24 | 25 | // 26 | BOOL IsConnectedGame() CONST; 27 | private: 28 | // 29 | VOID WaitForGameReadData() CONST; 30 | 31 | VOID Release(); 32 | private: 33 | HANDLE _hFileMap = NULL; 34 | std::wstring _wsErrorText; 35 | ShareContent* _pShareContent = nullptr; 36 | }; 37 | 38 | 39 | #endif // !__WAR3CHEAT_INJECTORWAR3_SHAREMEMORY_GAMESHAREMEMORY_H__ 40 | -------------------------------------------------------------------------------- /InjectorWar3/ShareMemory/ShareMemoryStruct.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAR3CHEAT_INJECTORWAR3_SHAREMEMORY_SHAREMEMORYSTRUCT_H__ 2 | #define __WAR3CHEAT_INJECTORWAR3_SHAREMEMORY_SHAREMEMORYSTRUCT_H__ 3 | 4 | #include 5 | 6 | #define SHAREMEMORYNAME L"War3CheatShareMemoryName" 7 | 8 | enum em_Action_Type 9 | { 10 | None, 11 | SetSelectedObjectInvincible, 12 | SetSelectedObjectAttackType, 13 | SetSelectedHeroSkillCool, 14 | PrintItem, 15 | ChangeItem 16 | }; 17 | 18 | struct ShareContent 19 | { 20 | HANDLE hStdOut; 21 | em_Action_Type emActionType; 22 | WCHAR wszParam[MAX_PATH]; 23 | WCHAR wszConsolePath[MAX_PATH]; 24 | BOOL bLive; 25 | }; 26 | 27 | #endif // !__WAR3CHEAT_INJECTORWAR3_SHAREMEMORY_SHAREMEMORYSTRUCT_H__ 28 | -------------------------------------------------------------------------------- /InjectorWar3/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/InjectorWar3/stdafx.cpp -------------------------------------------------------------------------------- /InjectorWar3/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/InjectorWar3/stdafx.h -------------------------------------------------------------------------------- /InjectorWar3/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/InjectorWar3/targetver.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # War3Cheat 2 | https://zhuanlan.zhihu.com/p/33361106 3 |
4 | -------------------------------------------------------
5 | this project depend on https://github.com/VideoCardGuy/libTools
6 | Log Tools on https://github.com/VideoCardGuy/libTools/tree/master/LogClientForm
7 | 8 | 9 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/1.png)


10 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/2.png)


11 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/3.png)


12 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/4.png)


13 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/5.png)


14 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/6.png)


15 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/7.png)


16 | ---------------------------------------------
17 | Print All of Item on this map, At least 1 minutes or more....
18 | game will "No response"........... because the code run as UI Thread



19 | 20 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/8.png)


21 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/9.png)


22 | ![image](https://github.com/VideoCardGuy/War3Cheat/raw/master/screenshot/10.png)


23 | -------------------------------------------------------------------------------- /War3Cheat.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "War3Cheat", "War3Cheat\War3Cheat.vcxproj", "{6447D200-A019-4548-8B45-2E196142C9B0}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InjectorWar3", "InjectorWar3\InjectorWar3.vcxproj", "{D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x64 = Debug|x64 14 | Debug|x86 = Debug|x86 15 | Release|Any CPU = Release|Any CPU 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {6447D200-A019-4548-8B45-2E196142C9B0}.Debug|Any CPU.ActiveCfg = Debug|Win32 21 | {6447D200-A019-4548-8B45-2E196142C9B0}.Debug|x64.ActiveCfg = Debug|x64 22 | {6447D200-A019-4548-8B45-2E196142C9B0}.Debug|x64.Build.0 = Debug|x64 23 | {6447D200-A019-4548-8B45-2E196142C9B0}.Debug|x86.ActiveCfg = Debug|Win32 24 | {6447D200-A019-4548-8B45-2E196142C9B0}.Debug|x86.Build.0 = Debug|Win32 25 | {6447D200-A019-4548-8B45-2E196142C9B0}.Release|Any CPU.ActiveCfg = Release|Win32 26 | {6447D200-A019-4548-8B45-2E196142C9B0}.Release|x64.ActiveCfg = Release|x64 27 | {6447D200-A019-4548-8B45-2E196142C9B0}.Release|x64.Build.0 = Release|x64 28 | {6447D200-A019-4548-8B45-2E196142C9B0}.Release|x86.ActiveCfg = Release|Win32 29 | {6447D200-A019-4548-8B45-2E196142C9B0}.Release|x86.Build.0 = Release|Win32 30 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Debug|Any CPU.ActiveCfg = Debug|Win32 31 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Debug|x64.ActiveCfg = Debug|x64 32 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Debug|x64.Build.0 = Debug|x64 33 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Debug|x86.ActiveCfg = Debug|Win32 34 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Debug|x86.Build.0 = Debug|Win32 35 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Release|Any CPU.ActiveCfg = Release|Win32 36 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Release|x64.ActiveCfg = Release|x64 37 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Release|x64.Build.0 = Release|x64 38 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Release|x86.ActiveCfg = Release|Win32 39 | {D8A9D5BD-2862-4D4E-8A03-FAC146C40B13}.Release|x86.Build.0 = Release|Win32 40 | EndGlobalSection 41 | GlobalSection(SolutionProperties) = preSolution 42 | HideSolutionNode = FALSE 43 | EndGlobalSection 44 | GlobalSection(ExtensibilityGlobals) = postSolution 45 | SolutionGuid = {6FDEA0E3-CFFD-4E81-B8A0-09B7CC92A6C2} 46 | EndGlobalSection 47 | EndGlobal 48 | -------------------------------------------------------------------------------- /War3Cheat/Expr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/Expr.cpp -------------------------------------------------------------------------------- /War3Cheat/Expr.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAR3CHEAT_FEATURE_EXPR_EXPR_H__ 2 | #define __WAR3CHEAT_FEATURE_EXPR_EXPR_H__ 3 | 4 | /* 5 | #include 6 | #include 7 | 8 | class CExpr : public MyTools::CExprFunBase, public MyTools::CClassInstance 9 | { 10 | private: 11 | using PeekMessageAPtr = BOOL(WINAPI*)(_Out_ LPMSG lpMsg, _In_opt_ HWND hWnd, _In_ UINT wMsgFilterMin, _In_ UINT wMsgFilterMax, _In_ UINT wRemoveMsg); 12 | public: 13 | CExpr() = default; 14 | virtual ~CExpr() = default; 15 | 16 | virtual VOID Release() override; 17 | 18 | virtual VOID Help(CONST std::vector& Vec) override; 19 | 20 | virtual std::vector& GetVec() override; 21 | private: 22 | VOID SetSelectedObjectPowerType(_In_ CONST std::vector& Vec); 23 | 24 | VOID SetSelectedObjectInvincible(_In_ CONST std::vector& Vec); 25 | 26 | VOID SetSelectedHeroSkillCool(_In_ CONST std::vector&); 27 | 28 | VOID PrintItem(_In_ CONST std::vector& Vec); 29 | 30 | VOID ChangeItem(_In_ CONST std::vector& Vec); 31 | 32 | VOID TestPtr(_In_ CONST std::vector&); 33 | private: 34 | };*/ 35 | 36 | 37 | 38 | #endif // !__WAR3CHEAT_FEATURE_EXPR_EXPR_H__ 39 | -------------------------------------------------------------------------------- /War3Cheat/Feature/CheatFeature.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/Feature/CheatFeature.cpp -------------------------------------------------------------------------------- /War3Cheat/Feature/CheatFeature.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAR3CHEAT_WAR3CHEAT_FEATURE_CHEATFEATURE_H__ 2 | #define __WAR3CHEAT_WAR3CHEAT_FEATURE_CHEATFEATURE_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "FindGameObject.h" 9 | 10 | class CCheatFeature 11 | { 12 | private: 13 | using PeekMessageAPtr = BOOL(WINAPI*)(_Out_ LPMSG lpMsg, _In_opt_ HWND hWnd, _In_ UINT wMsgFilterMin, _In_ UINT wMsgFilterMax, _In_ UINT wRemoveMsg); 14 | 15 | struct ThreadMethodInfo 16 | { 17 | std::function ThreadExcutePtr; 18 | HANDLE hEvent; 19 | }; 20 | 21 | struct ItemContent 22 | { 23 | std::string ItemName; 24 | std::string ItemDetail; 25 | std::string ItemId; 26 | 27 | ItemContent() = default; 28 | ItemContent(_In_ LPCSTR pszItemName, _In_ LPCSTR pszItemDetail, _In_ LPCSTR pszItemId) 29 | { 30 | ItemName = pszItemName; 31 | ItemDetail = pszItemDetail; 32 | ItemId = pszItemId; 33 | } 34 | }; 35 | public: 36 | CCheatFeature(); 37 | ~CCheatFeature(); 38 | 39 | public: 40 | /// ------------Feautre--------------------- 41 | VOID SetSelectedObjectInvincible(_In_ DWORD dwSelectedGameObject); 42 | 43 | VOID SetSelectedObjectAttackType(_In_ DWORD dwSelectedGameObject); 44 | 45 | VOID SetSelectedHeroSkillCool(_In_ DWORD dwSelectedGameObject); 46 | 47 | VOID PrintItem(); 48 | 49 | VOID ChangeItem(_In_ DWORD dwSelectedGameObject, _In_ DWORD dwItemIndex, _In_ DWORD dwItemId); 50 | public: 51 | DWORD GetSelectedGameObject(); 52 | 53 | BOOL Initialize(); 54 | 55 | VOID Release(); 56 | private: 57 | DWORD GetItemObject_By_ItemIndex(_In_ DWORD dwGameObject, _In_ DWORD dwItemIndex); 58 | 59 | DWORD GetNameVirtualTable(_In_ DWORD dwVaildItemFlag); 60 | 61 | DWORD GetItemFlag2ByNameFlag(_In_ DWORD dwNameFlag); 62 | 63 | VOID SetItemNameByNameFlag(_In_ DWORD dwNameFlag, _In_ DWORD* Buffer); 64 | 65 | DWORD GetItemNameByNameFlag(_In_ DWORD dwNameFlag); 66 | 67 | VOID OutputItemName(_In_ CONST std::vector& Vec) CONST; 68 | private: 69 | static BOOL WINAPI PeekMessage_(_Out_ LPMSG lpMsg, _In_opt_ HWND hWnd, _In_ UINT wMsgFilterMin, _In_ UINT wMsgFilterMax, _In_ UINT wRemoveMsg); 70 | 71 | static VOID WINAPI PushPtrToMainThread(_In_ std::function Ptr); 72 | private: 73 | static std::queue _QueMethodPtr;; 74 | static CRITICAL_SECTION _QueCrtSection; 75 | 76 | private: 77 | libTools::CSearchBinary _SearchBinary; 78 | CFindGameObject _FindGameObject; 79 | static PeekMessageAPtr _OldPeekMessagePtr; 80 | }; 81 | 82 | 83 | 84 | #endif // !__WAR3CHEAT_WAR3CHEAT_FEATURE_CHEATFEATURE_H__ 85 | -------------------------------------------------------------------------------- /War3Cheat/Feature/FindGameObject.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "FindGameObject.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #pragma comment(lib,"ProcessLib.lib") 9 | #pragma comment(lib,"LogLib.lib") 10 | 11 | #define _SELF L"FindGameObject.cpp" 12 | 13 | #define ReadDWORD(x) libTools::CMemory::ReadDWORD(x) 14 | 15 | DWORD CFindGameObject::FindSelectedObject() 16 | { 17 | FindGameObject_In_Tree(ReadDWORD(GetGameObjectRoot())); 18 | return _dwNodeBase; 19 | } 20 | 21 | DWORD CFindGameObject::GetGameObjectRoot() CONST 22 | { 23 | /* 24 | 6F5FE610 |. D805 B85A876F fadd dword ptr [6F875AB8] 25 | 6F5FE616 |> DEF9 fdivp st(1), st 26 | 6F5FE618 |. D91D 60E6AC6F fstp dword ptr [6FACE660] 27 | 6F5FE61E |. EB 02 jmp short 6F5FE622 ; EB02DDD88B0D????????3B 28 | 6F5FE620 |> DDD8 fstp st 29 | 6F5FE622 |> 8B0D 6CE6AC6F mov ecx, dword ptr [6FACE66C] ; dwGameObjectRoot 30 | 6F5FE628 |. 3BCE cmp ecx, esi 31 | 6F5FE62A |. 74 59 je short 6F5FE685 32 | 6F5FE62C |. 8B11 mov edx, dword ptr [ecx] 33 | 6F5FE62E |. 8B42 24 mov eax, dword ptr [edx+24] 34 | 6F5FE631 |. 68 9CE6AC6F push 6FACE69C 35 | */ 36 | static DWORD dwGameObjectRoot = NULL; 37 | if (dwGameObjectRoot == NULL) 38 | { 39 | dwGameObjectRoot = libTools::CSearchBinary().FindBase("EB02DDD88B0D????????3B", 0x267EDBE - 0x267EDC2, 2, 0, L"Game.dll"); 40 | if (dwGameObjectRoot == NULL) 41 | { 42 | LOG_C_E(L"dwGameObjectRoot=NULL"); 43 | return 0; 44 | } 45 | } 46 | 47 | return dwGameObjectRoot; 48 | } 49 | 50 | DWORD CFindGameObject::GetGameObjectAddr(_In_ DWORD dwNodeBase) CONST 51 | { 52 | return ReadDWORD(ReadDWORD(ReadDWORD(dwNodeBase + 0x3C4) + 0x130) + 0x124); 53 | } 54 | 55 | CONST std::wstring& CFindGameObject::GetSelectedObjectName() CONST 56 | { 57 | return _wsName; 58 | } 59 | 60 | DWORD CFindGameObject::GetGameObjectNameFlag(_In_ DWORD dwNodeBase) CONST 61 | { 62 | /* 63 | 6F346A20 /$ 81EC 04020000 sub esp, 204 64 | 6F346A26 |. A1 40E1AA6F mov eax, dword ptr [6FAAE140] 65 | 6F346A2B |. 33C4 xor eax, esp 66 | 6F346A2D |. 898424 000200>mov dword ptr [esp+200], eax 67 | 6F346A34 |. 56 push esi 68 | 6F346A35 |. 57 push edi 69 | 6F346A36 |. 8B79 30 mov edi, dword ptr [ecx+30] 70 | 6F346A39 |. 8BC7 mov eax, edi 71 | 6F346A3B |. C1E8 18 shr eax, 18 72 | 6F346A3E |. 83C0 BF add eax, -41 73 | 6F346A41 |. 83F8 19 cmp eax, 19 74 | 6F346A44 |. 8BF2 mov esi, edx 75 | 6F346A46 |. 77 15 ja short 6F346A5D 76 | 6F346A48 |. 68 00020000 push 200 77 | 6F346A4D |. 8D4424 0C lea eax, dword ptr [esp+C] 78 | 6F346A51 |. 50 push eax 79 | 6F346A52 |. E8 C980F2FF call 6F26EB20 ; HeroName CALL 80 | 6F346A57 |. 8D4424 08 lea eax, dword ptr [esp+8] 81 | 6F346A5B |. EB 09 jmp short 6F346A66 82 | 6F346A5D |> 33D2 xor edx, edx 83 | 6F346A5F |. 8BCF mov ecx, edi 84 | 6F346A61 |. E8 7A71FEFF call 6F32DBE0 ; Build Name CALL 85 | 6F346A66 |> 8BF8 mov edi, eax 86 | 6F346A68 |. E8 23FFFFFF call 6F346990 87 | 6F346A6D |. 8B8C24 080200>mov ecx, dword ptr [esp+208] 88 | 6F346A74 |. 5F pop edi 89 | 6F346A75 |. 5E pop esi 90 | 6F346A76 |. 33CC xor ecx, esp 91 | 6F346A78 |. E8 DCA54900 call 6F7E1059 92 | 6F346A7D |. 81C4 04020000 add esp, 204 93 | 6F346A83 \. C3 retn 94 | */ 95 | return ReadDWORD(GetGameObjectAddr(dwNodeBase) + 0x30) >> 0x18; 96 | } 97 | 98 | VOID CFindGameObject::GetGameObjectName(_In_ DWORD dwNodeBase) 99 | { 100 | /* 101 | ------------------------------------------------------------------------------------- 102 | 6F35FA31 . 8078 30 0C cmp byte ptr [eax+30], 0C 103 | 6F35FA35 . 73 0F jnb short 6F35FA46 104 | 6F35FA37 . 8D8B F0000000 lea ecx, dword ptr [ebx+F0] 105 | 6F35FA3D . E8 2E371100 call 6F473170 106 | 6F35FA42 . 3BC5 cmp eax, ebp 107 | 6F35FA44 . 75 06 jnz short 6F35FA4C 108 | 6F35FA46 > 896C24 18 mov dword ptr [esp+18], ebp 109 | 6F35FA4A . EB 08 jmp short 6F35FA54 110 | 6F35FA4C > C74424 18 010>mov dword ptr [esp+18], 1 111 | 6F35FA54 > 8B8F 24010000 mov ecx, dword ptr [edi+124] ; ....... 112 | 6F35FA5A . 8B97 28010000 mov edx, dword ptr [edi+128] 113 | 6F35FA60 . E8 BB6FFEFF call 6F346A20 ; 1 114 | 6F35FA65 . 8B5C24 14 mov ebx, dword ptr [esp+14] 115 | 6F35FA69 . 3BDD cmp ebx, ebp 116 | 6F35FA6B . 74 3A je short 6F35FAA7 117 | 6F35FA6D . 8B8F 24010000 mov ecx, dword ptr [edi+124] 118 | 6F35FA73 . E8 187CF1FF call 6F277690 119 | 6F35FA78 . 3BF5 cmp esi, ebp 120 | 6F35FA7A . 74 2B je short 6F35FAA7 121 | 122 | --------------------------------------------------------------------------------- 123 | 6F35EA38 |> /6A 01 push 1 124 | 6F35EA3A |. |8BCD mov ecx, ebp 125 | 6F35EA3C |. |E8 4F7AFEFF call 6F346490 126 | 6F35EA41 |. |8B8D 30010000 mov ecx, dword ptr [ebp+130] ; .... 127 | 6F35EA47 |. |8B11 mov edx, dword ptr [ecx] 128 | 6F35EA49 |. |8B42 78 mov eax, dword ptr [edx+78] 129 | 6F35EA4C |. |6A 01 push 1 130 | 6F35EA4E |. |56 push esi 131 | 6F35EA4F |. |FFD0 call eax ; Name3 132 | 6F35EA51 |. |E9 AB020000 jmp 6F35ED01 133 | 6F35EA56 |> |3BFB cmp edi, ebx 134 | 6F35EA58 |.^ 74 DE je short 6F35EA38 135 | 6F35EA5A |> |6A 01 push 1 136 | 6F35EA5C |. |6A 01 push 1 137 | 6F35EA5E |. |53 push ebx 138 | 139 | --------------------------------------------------------------------------------- 140 | 6F2F8574 |. E8 C7AA0700 call 6F373040 141 | 6F2F8579 |. C786 84020000>mov dword ptr [esi+284], 0 142 | 6F2F8583 |> 8B8E C8030000 mov ecx, dword ptr [esi+3C8] 143 | 6F2F8589 |. E8 C2A90700 call 6F372F50 144 | 6F2F858E |. 8B8E C4030000 mov ecx, dword ptr [esi+3C4] ; ............... 145 | 6F2F8594 |. E8 E7610600 call 6F35E780 ; Name 4 146 | 6F2F8599 |. 8BCD mov ecx, ebp 147 | 6F2F859B |. E8 70741200 call 6F41FA10 148 | 6F2F85A0 |. 50 push eax 149 | 6F2F85A1 |. 8D4C24 18 lea ecx, dword ptr [esp+18] 150 | 6F2F85A5 |. E8 E602D4FF call 6F038890 151 | 6F2F85AA |. 8BCD mov ecx, ebp 152 | 153 | */ 154 | DWORD dwNameObject = GetGameObjectAddr(dwNodeBase); 155 | if (dwNameObject == NULL) 156 | { 157 | LOG_C_E(L"UnExist Name[%X]", dwNodeBase); 158 | return; 159 | } 160 | 161 | CHAR szText[0x200] = { 0 }; 162 | 163 | DWORD dwNameFlag = GetGameObjectNameFlag(dwNodeBase); 164 | if (dwNameFlag - 0x41 < 0x19) 165 | { 166 | GetHeroName(dwNameObject, szText); 167 | } 168 | else 169 | { 170 | GetBuildName(dwNameObject, szText); 171 | } 172 | 173 | if (*szText == '\0') 174 | { 175 | LOG_C_E(L"Empty Name"); 176 | return; 177 | } 178 | 179 | 180 | /// Selected Hero|Build 181 | _dwNodeBase = dwNodeBase; 182 | _wsName = libTools::CCharacter::UTF8ToUnicode(szText); 183 | } 184 | 185 | VOID CFindGameObject::GetHeroName(_In_ DWORD dwNameObject, _Out_ CHAR* pszText) CONST 186 | { 187 | static DWORD dwGameObjectNameCALL = NULL; 188 | if (dwGameObjectNameCALL == NULL) 189 | { 190 | dwGameObjectNameCALL = libTools::CSearchBinary().FindCALL("68000200008D44240C", 0x26D7588 - 0x26D7592, 1, 0, L"Game.dll"); 191 | if (dwGameObjectNameCALL == NULL) 192 | { 193 | LOG_C_E(L"dwGameObjectNameCALL=NULL"); 194 | return; 195 | } 196 | } 197 | 198 | __try 199 | { 200 | _asm 201 | { 202 | PUSHAD; 203 | PUSH 0x200; 204 | MOV EAX, pszText; 205 | PUSH EAX; 206 | MOV ECX, dwNameObject; 207 | MOV EAX, dwGameObjectNameCALL; 208 | CALL EAX; 209 | POPAD; 210 | } 211 | } 212 | __except (EXCEPTION_EXECUTE_HANDLER) 213 | { 214 | LOG_C_E(L"Exception GetHeroName"); 215 | } 216 | } 217 | 218 | VOID CFindGameObject::GetBuildName(_In_ DWORD dwNameObject, _Out_ CHAR* pszText) CONST 219 | { 220 | static DWORD dwGameObjectNameCALL = NULL; 221 | if (dwGameObjectNameCALL == NULL) 222 | { 223 | dwGameObjectNameCALL = libTools::CSearchBinary().FindCALL("68000200008D44240C", 0x6F346A48 - 0x6F346A61, 1, 0, L"Game.dll"); 224 | if (dwGameObjectNameCALL == NULL) 225 | { 226 | LOG_C_E(L"dwGameObjectNameCALL=NULL"); 227 | return; 228 | } 229 | } 230 | 231 | __try 232 | { 233 | DWORD dwNamePtr = NULL; 234 | _asm 235 | { 236 | PUSHAD; 237 | MOV ECX, dwNameObject; 238 | MOV EDI, DWORD PTR DS : [ECX + 0x30]; 239 | MOV ECX, EDI; 240 | MOV EAX, dwGameObjectNameCALL; 241 | CALL EAX; 242 | MOV dwNamePtr, EAX; 243 | POPAD; 244 | } 245 | 246 | if (dwNamePtr != NULL && ReadDWORD(dwNamePtr) != NULL) 247 | { 248 | libTools::CCharacter::strcpy_my(pszText, reinterpret_cast(dwNamePtr), 32); 249 | } 250 | } 251 | __except (EXCEPTION_EXECUTE_HANDLER) 252 | { 253 | LOG_C_E(L"Exception GetBuildName"); 254 | } 255 | } 256 | 257 | VOID CFindGameObject::FindGameObject_In_Tree(_In_ DWORD dwTreeNode) 258 | { 259 | if ((ReadDWORD(dwTreeNode + 0xB0) & 0x3) == 0 && GetGameObjectAddr(dwTreeNode) != NULL) 260 | { 261 | GetGameObjectName(dwTreeNode); 262 | LOG_C_D(L"[%s].dwNodeBase=%X, ObjectAddr=%X", _wsName.c_str(), dwTreeNode, GetGameObjectAddr(dwTreeNode)); 263 | } 264 | 265 | int nNextNodeBase = static_cast(ReadDWORD(dwTreeNode + 0x1C)); 266 | while (nNextNodeBase > 0 && _dwNodeBase == NULL) 267 | { 268 | FindGameObject_In_Tree(ReadDWORD(nNextNodeBase + 0xC)); 269 | nNextNodeBase = static_cast(ReadDWORD(nNextNodeBase + 0x8)); 270 | } 271 | } 272 | 273 | -------------------------------------------------------------------------------- /War3Cheat/Feature/FindGameObject.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAR3CHEAT_FEATURE_OBJECT_FINDGAMEOBJECT_H__ 2 | #define __WAR3CHEAT_FEATURE_OBJECT_FINDGAMEOBJECT_H__ 3 | 4 | #include 5 | #include 6 | 7 | class CFindGameObject 8 | { 9 | public: 10 | CFindGameObject() = default; 11 | ~CFindGameObject() = default; 12 | 13 | DWORD FindSelectedObject(); 14 | 15 | DWORD GetGameObjectAddr(_In_ DWORD dwNodeBase) CONST; 16 | 17 | CONST std::wstring& GetSelectedObjectName() CONST; 18 | private: 19 | DWORD GetGameObjectRoot() CONST; 20 | 21 | DWORD GetGameObjectNameFlag(_In_ DWORD dwNodeBase) CONST; 22 | 23 | VOID GetGameObjectName(_In_ DWORD dwNodeBase); 24 | 25 | VOID GetHeroName(_In_ DWORD dwNameObject, _Out_ CHAR* pszText) CONST; 26 | 27 | VOID GetBuildName(_In_ DWORD dwNameObject, _Out_ CHAR* pszText) CONST; 28 | 29 | VOID FindGameObject_In_Tree(_In_ DWORD dwTreeNode); 30 | private: 31 | DWORD _dwNodeBase = NULL; 32 | std::wstring _wsName; 33 | }; 34 | 35 | 36 | 37 | #endif // !__WAR3CHEAT_FEATURE_OBJECT_FINDGAMEOBJECT_H__ 38 | -------------------------------------------------------------------------------- /War3Cheat/ShareMemory/GameShareMemory.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/ShareMemory/GameShareMemory.cpp -------------------------------------------------------------------------------- /War3Cheat/ShareMemory/GameShareMemory.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAR3CHEAT_WAR3CHEAT_SHAREMEMORY_GAMESHAREMEMORY_H__ 2 | #define __WAR3CHEAT_WAR3CHEAT_SHAREMEMORY_GAMESHAREMEMORY_H__ 3 | 4 | #include 5 | #include "../InjectorWar3/ShareMemory/ShareMemoryStruct.h" 6 | 7 | 8 | class CGameShareMemory 9 | { 10 | public: 11 | struct CheatActionContent 12 | { 13 | em_Action_Type emActionType; 14 | std::wstring wsParam; 15 | 16 | DWORD GetChangeItemParamToItemId() CONST; 17 | 18 | DWORD GetChangeItemParamToItemIndex() CONST; 19 | }; 20 | public: 21 | CGameShareMemory() = default; 22 | ~CGameShareMemory(); 23 | 24 | static CGameShareMemory& GetInstance(); 25 | 26 | BOOL Run(); 27 | 28 | BOOL ExistAction(_Out_opt_ CheatActionContent& Content) CONST; 29 | 30 | LPCWSTR GetConsolePath() CONST; 31 | 32 | VOID Release(); 33 | private: 34 | 35 | private: 36 | HANDLE _hFileMap = NULL; 37 | ShareContent* _pShareContent = nullptr; 38 | }; 39 | 40 | 41 | #endif // !__WAR3CHEAT_WAR3CHEAT_SHAREMEMORY_GAMESHAREMEMORY_H__ 42 | -------------------------------------------------------------------------------- /War3Cheat/War3Cheat.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/War3Cheat.cpp -------------------------------------------------------------------------------- /War3Cheat/War3Cheat.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 | 15.0 23 | {6447D200-A019-4548-8B45-2E196142C9B0} 24 | Win32Proj 25 | War3Cheat 26 | 10.0.16299.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v141 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v141 39 | true 40 | Unicode 41 | Static 42 | 43 | 44 | DynamicLibrary 45 | true 46 | v141 47 | Unicode 48 | 49 | 50 | DynamicLibrary 51 | false 52 | v141 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 | true 76 | ..\..\MyTools;..\War3Cheat;$(IncludePath) 77 | 78 | 79 | true 80 | 81 | 82 | false 83 | $(IncludePath);$(SolutionDir)include;$(SolutionDir); 84 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(SolutionDir)lib; 85 | 86 | 87 | false 88 | 89 | 90 | 91 | Use 92 | Level3 93 | Disabled 94 | true 95 | WIN32;_DEBUG;WAR3CHEAT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 96 | 97 | 98 | Windows 99 | true 100 | 101 | 102 | 103 | 104 | Use 105 | Level3 106 | Disabled 107 | true 108 | _DEBUG;WAR3CHEAT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 109 | 110 | 111 | Windows 112 | true 113 | 114 | 115 | 116 | 117 | Use 118 | Level4 119 | Disabled 120 | true 121 | true 122 | true 123 | WIN32;NDEBUG;WAR3CHEAT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 124 | Async 125 | true 126 | 127 | 128 | Windows 129 | true 130 | true 131 | true 132 | 133 | 134 | 135 | 136 | Use 137 | Level3 138 | MaxSpeed 139 | true 140 | true 141 | true 142 | NDEBUG;WAR3CHEAT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 143 | 144 | 145 | Windows 146 | true 147 | true 148 | true 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | Create 167 | Create 168 | Create 169 | Create 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /War3Cheat/War3Cheat.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;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 | {2a2ab7cd-f612-41c2-9148-796408e4826d} 18 | 19 | 20 | {f0a674af-3f26-4750-8fbc-78b8f3dfbb87} 21 | 22 | 23 | {02bf2949-e784-4b28-8f9d-fc4cad64d849} 24 | 25 | 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Feature\Expr 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | Feature\Object 44 | 45 | 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Feature\Expr 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Feature\Object 67 | 68 | 69 | -------------------------------------------------------------------------------- /War3Cheat/dllmain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/dllmain.cpp -------------------------------------------------------------------------------- /War3Cheat/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/stdafx.cpp -------------------------------------------------------------------------------- /War3Cheat/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/stdafx.h -------------------------------------------------------------------------------- /War3Cheat/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/War3Cheat/targetver.h -------------------------------------------------------------------------------- /include/AlgroithmLib/Common/CommonCharacter.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_ALGORMTHMLIB_COMMON_COMMONCHARACTER_H__ 2 | #define __LIBTOOLS_ALGORMTHMLIB_COMMON_COMMONCHARACTER_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CCommonCharacter 9 | { 10 | public: 11 | CCommonCharacter() = default; 12 | ~CCommonCharacter() = default; 13 | 14 | static CHAR ToHex(_In_ UCHAR uc); 15 | private: 16 | 17 | }; 18 | } 19 | 20 | #endif // !__LIBTOOLS_ALGORMTHMLIB_COMMON_COMMONCHARACTER_H__ 21 | -------------------------------------------------------------------------------- /include/AlgroithmLib/Encrypt/CRC32.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_ALGORMTHMLIB_ENCRYP_CRC32_H__ 2 | #define __LIBTOOLS_ALGORMTHMLIB_ENCRYP_CRC32_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CCRC32 9 | { 10 | public: 11 | CCRC32() = default; 12 | ~CCRC32() = default; 13 | 14 | static DWORD GetCRC32(_In_ LPCSTR pszText, _In_ UINT uSize); 15 | private: 16 | 17 | }; 18 | } 19 | 20 | #endif // !__LIBTOOLS_ALGORMTHMLIB_ENCRYP_CRC32_H__ 21 | -------------------------------------------------------------------------------- /include/AlgroithmLib/Encrypt/MD5.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_ALGORITHMLIB_ENCRYPT_MD5_H__ 2 | #define __LIBTOOLS_ALGORITHMLIB_ENCRYPT_MD5_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace libTools 8 | { 9 | class CMD5 10 | { 11 | private: 12 | struct MD5_CTX 13 | { 14 | UINT Count[2]; 15 | UINT State[4]; 16 | UCHAR Buffer[64]; 17 | }; 18 | 19 | #define F(x,y,z) ((x & y) | (~x & z)) 20 | #define G(x,y,z) ((x & z) | (y & ~z)) 21 | #define H(x,y,z) (x ^ y ^ z) 22 | #define I(x,y,z) (y ^ (x | ~z)) 23 | #define MD5_ROTATE(x,n) ((x << n) | (x >> (32-n))) 24 | 25 | #define FF(a,b,c,d,x,s,ac) { \ 26 | a += F(b,c,d) + x + ac; \ 27 | a = MD5_ROTATE(a,s); \ 28 | a += b; \ 29 | } 30 | 31 | #define GG(a,b,c,d,x,s,ac) { \ 32 | a += G(b,c,d) + x + ac; \ 33 | a = MD5_ROTATE(a,s); \ 34 | a += b; \ 35 | } 36 | 37 | #define HH(a,b,c,d,x,s,ac) { \ 38 | a += H(b,c,d) + x + ac; \ 39 | a = MD5_ROTATE(a,s); \ 40 | a += b; \ 41 | } 42 | 43 | #define II(a,b,c,d,x,s,ac) { \ 44 | a += I(b,c,d) + x + ac; \ 45 | a = MD5_ROTATE(a,s); \ 46 | a += b; \ 47 | } 48 | 49 | public: 50 | CMD5(); 51 | ~CMD5() = default; 52 | 53 | std::string MD5(_In_ CONST std::string& szPlainText); 54 | private: 55 | // initlize 56 | void InitMd5Ctx(); 57 | 58 | // 59 | void Update(_In_ CONST UCHAR* InBuffer, _In_ UINT uLen); 60 | 61 | // 62 | void Transform(_In_ CONST UCHAR* Buffer); 63 | 64 | // 65 | void Decode(_Out_ UCHAR* OutBuffer, _In_ CONST UCHAR* InBuffer, _In_ UINT uLen); 66 | 67 | // 68 | void Encode(_Out_ UCHAR* OutBuffer, _In_ CONST UCHAR* InBuffer, _In_ UINT uLen); 69 | 70 | // 71 | VOID Final(_Out_ UCHAR* pszDigest); 72 | 73 | // 74 | static UINT GetF(_In_ UINT x, _In_ UINT y, _In_ UINT z); 75 | static UINT GetG(_In_ UINT x, _In_ UINT y, _In_ UINT z); 76 | static UINT GetH(_In_ UINT x, _In_ UINT y, _In_ UINT z); 77 | static UINT GetI(_In_ UINT x, _In_ UINT y, _In_ UINT z); 78 | static UINT Rotate(_In_ UINT x, _In_ UINT n); 79 | 80 | static void SetFF(_In_ _Out_ UINT& a, _In_ UINT b, _In_ UINT c, _In_ UINT d, _In_ UINT x, _In_ UINT s, _In_ UINT ac); 81 | static void SetGG(_In_ _Out_ UINT& a, _In_ UINT b, _In_ UINT c, _In_ UINT d, _In_ UINT x, _In_ UINT s, _In_ UINT ac); 82 | static void SetHH(_In_ _Out_ UINT& a, _In_ UINT b, _In_ UINT c, _In_ UINT d, _In_ UINT x, _In_ UINT s, _In_ UINT ac); 83 | static void SetII(_In_ _Out_ UINT& a, _In_ UINT b, _In_ UINT c, _In_ UINT d, _In_ UINT x, _In_ UINT s, _In_ UINT ac); 84 | 85 | 86 | private: 87 | MD5_CTX _Md5Ctx; 88 | }; 89 | } 90 | 91 | #endif // !__LIBTOOLS_ALGORITHMLIB_ENCRYPT_MD5_H__ 92 | -------------------------------------------------------------------------------- /include/AlgroithmLib/Encrypt/RC4.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/AlgroithmLib/Encrypt/RC4.h -------------------------------------------------------------------------------- /include/AlgroithmLib/Encrypt/SHA1.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_ALGORMTHMLIB_ENCRYP_SHA1_H__ 2 | #define __LIBTOOLS_ALGORMTHMLIB_ENCRYP_SHA1_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace libTools 8 | { 9 | class CSHA1 10 | { 11 | private: 12 | struct SHA_CTX 13 | { 14 | UINT State[5]; 15 | UINT Count[2]; 16 | UINT Buffer[80]; 17 | INT LenBuffer; 18 | }; 19 | public: 20 | CSHA1(); 21 | ~CSHA1() = default; 22 | 23 | std::string GetSHA1(_In_ CONST std::string& szPlainText); 24 | private: 25 | // 26 | void Transform(); 27 | 28 | // 29 | void InitSHA1Ctx(); 30 | 31 | // 32 | void Update(_In_ CONST UCHAR* InBuffer, UINT uLen); 33 | 34 | // 35 | void Final(_Out_ UCHAR* pszDigest); 36 | private: 37 | SHA_CTX _ShaCtx; 38 | }; 39 | } 40 | 41 | #endif // !__LIBTOOLS_ALGORMTHMLIB_ENCRYP_SHA1_H__ 42 | -------------------------------------------------------------------------------- /include/CharacterLib/Character.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_CHARACTERLIB_CHARACTER_H__ 2 | #define __LIBTOOLS_CHARACTERLIB_CHARACTER_H__ 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | namespace libTools 10 | { 11 | class CCharacter 12 | { 13 | public: 14 | CCharacter() = default; 15 | ~CCharacter() = default; 16 | 17 | template 18 | static void strcpy_my(_In_ T * dest, _In_ CONST T * src, _In_opt_ SIZE_T MaxSize = 1024) 19 | { 20 | CException::InvokeAction(__FUNCTIONW__, [&] 21 | { 22 | size_t len = strlen_my(src); 23 | for (size_t i = 0; i < len && i < MaxSize; ++i) 24 | { 25 | *(dest + i) = *(src + i); 26 | } 27 | 28 | *(dest + len) = '\0'; 29 | }); 30 | } 31 | 32 | template 33 | static size_t strlen_my(_In_ CONST T * dest) 34 | { 35 | return CException::InvokeFunc(__FUNCTIONW__, [=] 36 | { 37 | size_t i = 0; 38 | for (; *(dest + i) != '\0'; ++i); 39 | return i; 40 | }); 41 | } 42 | 43 | template 44 | static bool strcmp_my(_In_ CONST T * dest, _In_ CONST T * src) 45 | { 46 | if (strlen_my(dest) != strlen_my(src)) 47 | { 48 | return false; 49 | } 50 | 51 | return CException::InvokeFunc(__FUNCTIONW__, [=] 52 | { 53 | while (*dest != '\0') 54 | { 55 | if (*dest != *src) 56 | { 57 | return false; 58 | } 59 | 60 | dest += 1; 61 | src += 1; 62 | } 63 | 64 | return true; 65 | }); 66 | } 67 | 68 | template 69 | static std::basic_string& Trim(_In_ _Out_ std::basic_string& s) 70 | { 71 | if (s.empty()) 72 | return s; 73 | 74 | CException::InvokeAction(__FUNCTIONW__, [&] 75 | { 76 | std::basic_string::iterator c; 77 | for (c = s.begin(); c != s.end() && iswspace(*c++);); s.erase(s.begin(), --c); 78 | for (c = s.end(); c != s.begin() && iswspace(*--c);); s.erase(++c, s.end()); 79 | }); 80 | 81 | return s; 82 | } 83 | 84 | template 85 | static void GetRemoveLeft(_In_ CONST std::basic_string& wsText, _In_ CONST T* wsParm, _Out_ std::basic_string& wsRetText) 86 | { 87 | size_t nIndex = wsText.find(wsParm); 88 | if (nIndex != -1) 89 | { 90 | wsRetText = wsText.substr(0, nIndex); 91 | } 92 | } 93 | 94 | template 95 | static void GetRemoveRight(_In_ CONST std::basic_string& wsText, _In_ CONST T* wsParm, _Out_ std::basic_string& wsRetText) 96 | { 97 | size_t nIndex = wsText.find(wsParm); 98 | if (nIndex != -1) 99 | { 100 | wsRetText = wsText.substr(nIndex + strlen_my(wsParm)); 101 | } 102 | } 103 | 104 | template 105 | static UINT GetCount_By_SpecifyText(_In_ CONST std::basic_string& wsText, _In_ CONST T* wsSpecifyText) 106 | { 107 | UINT uCount = 0; 108 | for (std::size_t pos = 0;; ++uCount, ++pos) 109 | { 110 | pos = wsText.find(wsSpecifyText, pos); 111 | if (pos == std::basic_string::npos) 112 | { 113 | break; 114 | } 115 | } 116 | return uCount; 117 | } 118 | 119 | // 120 | static std::string UnicodeToASCII(_In_ CONST std::wstring& wsText); 121 | 122 | // 123 | static std::wstring ASCIIToUnicode(_In_ CONST std::string& pszText); 124 | 125 | // 126 | static std::wstring UTF8ToUnicode(_In_ CONST std::string& pszText); 127 | 128 | // 129 | static std::string UnicodeToUTF8(_In_ CONST std::wstring& wsText); 130 | 131 | enum em_Split_Option 132 | { 133 | em_Split_Option_RemoveEmptyEntries = 0x2, 134 | em_Split_Option_None = 0x4L, 135 | em_Split_Option_KeepOnly = 0x8L, 136 | em_Split_Option_KeepOnly_RemoveEmptyEntries = em_Split_Option_RemoveEmptyEntries | em_Split_Option_KeepOnly, 137 | }; 138 | // 139 | template 140 | static void Split(_In_ CONST std::basic_string& wsText, _In_ CONST T* wsFormat, _Out_opt_ std::vector>& vlst, _In_opt_ em_Split_Option emOption) 141 | { 142 | std::basic_string wsTmpText = wsText; 143 | size_t nIndex = wsTmpText.find(wsFormat); 144 | while (nIndex != -1) 145 | { 146 | std::basic_string wstr = wsTmpText.substr(0, nIndex); 147 | if (emOption & em_Split_Option_RemoveEmptyEntries) 148 | { 149 | if (!Trim(wstr).empty()) 150 | vlst.push_back(wstr); 151 | } 152 | else if (emOption & em_Split_Option_None) 153 | { 154 | vlst.push_back(wstr); 155 | } 156 | 157 | wsTmpText = wsTmpText.substr(nIndex + strlen_my(wsFormat)); 158 | nIndex = wsTmpText.find(wsFormat); 159 | } 160 | if (!wsTmpText.empty() || vlst.size() > 0 || (emOption & em_Split_Option_KeepOnly)) 161 | { 162 | vlst.push_back(wsTmpText); 163 | } 164 | } 165 | 166 | template 167 | static void GetSplit_By_List(_In_ std::basic_string& wsText, _In_ CONST std::vector>& vSplit, _Out_opt_ std::vector>& vSplitContent, _In_opt_ em_Split_Option emOption) 168 | { 169 | if (vSplit.size() != 2) 170 | return; 171 | 172 | size_t nLeftIndex = wsText.find(vSplit.at(0)); 173 | size_t nRightIndex = wsText.find(vSplit.at(1)); 174 | if (nLeftIndex == -1 || nRightIndex == -1 || nRightIndex <= nLeftIndex) 175 | return; 176 | 177 | std::basic_string wsSplit = wsText.substr(nLeftIndex + 1, nRightIndex - nLeftIndex - 1); 178 | Trim(wsSplit); 179 | 180 | if (emOption | em_Split_Option_RemoveEmptyEntries) 181 | { 182 | if (wsSplit != L"") 183 | vSplitContent.push_back(wsSplit); 184 | } 185 | else if (emOption | em_Split_Option_None) 186 | { 187 | vSplitContent.push_back(wsSplit); 188 | } 189 | 190 | wsText = wsText.substr(0, nLeftIndex) + wsText.substr(nRightIndex + 1); 191 | GetSplit_By_List(wsText, vSplit, vSplitContent, emOption); 192 | } 193 | 194 | static std::wstring MakeFormatText(_In_ LPCWSTR pwszFormat, ...); 195 | 196 | template 197 | static std::basic_string MakeTextToLower(_In_ CONST std::basic_string& wsText) 198 | { 199 | return MakeTextTo(wsText, tolower); 200 | } 201 | 202 | template 203 | static std::basic_string MakeTextToUpper(_In_ CONST std::basic_string& wsText) 204 | { 205 | return MakeTextTo(wsText, toupper); 206 | } 207 | 208 | template 209 | static std::basic_string MakeTextTo(_In_ CONST std::basic_string& wsText, _In_ _fnPtr fnPtr) 210 | { 211 | std::basic_string tmpText; 212 | for (auto& itm : wsText) 213 | tmpText.push_back(static_cast(fnPtr(itm))); 214 | 215 | return tmpText; 216 | } 217 | 218 | // GetVecByParm_RemoveQuotes(L"\"asd\",123,45,\"45\",4",L'\"', Vec={L"asd",L"123",L"34",L"4"}) 219 | static VOID GetVecByParm_RemoveQuotes(_In_ CONST std::wstring& wsText, _In_ WCHAR wchKeyword, _Out_opt_ std::vector& VecParm); 220 | 221 | // SplitFormatText(L"Map(ShangHai),Point=[51,03]",L"Map(*),Point=[*,*]",Vec={L"ShangHai",L"51",L"03"}) 222 | static BOOL SplitFormatText(_In_ CONST std::wstring& wsText, _In_ CONST std::wstring& wsFormatText, _Out_opt_ std::vector& VecResult); 223 | 224 | // 225 | static std::wstring MakeCurrentPath(_In_ CONST std::wstring& wsText); 226 | 227 | static VOID SetConsoleLanguage(); 228 | 229 | static VOID SetSpecialCharacterMode(); 230 | 231 | template 232 | static size_t GetHash(_In_ CONST std::basic_string& wsText) 233 | { 234 | size_t result = 0; 235 | for (auto it = str.cbegin(); it != str.cend(); ++it) { 236 | result = (result * 131) + *it; 237 | } 238 | return result; 239 | } 240 | 241 | // CopyText To Clipboard 242 | static BOOL CopyTextToClipboard(_In_ LPCWSTR pwchText); 243 | private: 244 | static std::vector FindSplitFormatText(_In_ CONST std::wstring& wsFormatText); 245 | 246 | }; 247 | } 248 | 249 | 250 | #endif // !__LIBTOOLS_CHARACTERLIB_CHARACTER_H__ 251 | -------------------------------------------------------------------------------- /include/DbManagerLib/BaseDbManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_DBMANAGERLIB_BASEDBMANAGER_H__ 2 | #define __LIBTOOLS_DBMANAGERLIB_BASEDBMANAGER_H__ 3 | 4 | #include 5 | #include 6 | #include // Type SQLHENV & SQLHDBC & SQLHSTMT 7 | #include // macro SQL_NULL_HENV 8 | #include 9 | 10 | namespace libTools 11 | { 12 | class CBaseDbManager 13 | { 14 | private: 15 | struct SQLEnvParam 16 | { 17 | SQLHENV hEnv = SQL_NULL_HENV; 18 | SQLHDBC hDbc = SQL_NULL_HDBC; 19 | SQLHSTMT hStmt = SQL_NULL_HSTMT; 20 | }; 21 | protected: 22 | typedef std::vector Table; 23 | public: 24 | CBaseDbManager() = default; 25 | ~CBaseDbManager() = default; 26 | 27 | // Warning, Declare local Variable Max Size = 128 28 | BOOL ExcuteSQL(_In_ CONST std::wstring wsSQL, _In_ UINT uResultCount, _Out_ std::vector& VecResult) CONST; 29 | 30 | // 31 | BOOL ExcuteSQL_SingleResult(_In_ CONST std::wstring& wsSQL, _Out_ std::wstring& wsResultText) CONST; 32 | 33 | // 34 | BOOL ExcuteSQL_NoneResult(_In_ CONST std::wstring& wsSQL) CONST; 35 | 36 | // 37 | VOID AsyncExcuteSQL(_In_ CONST std::wstring& wsSQL) CONST; 38 | private: 39 | // 40 | BOOL InitializeSQLEnv(_Out_ SQLEnvParam& Env) CONST; 41 | 42 | // 43 | VOID PrintSQLErrText(_In_ SQLSMALLINT fHandleType, _In_ SQLHANDLE handle) CONST; 44 | 45 | // 46 | VOID FreeMem(_In_ SQLEnvParam& Env) CONST; 47 | 48 | // 49 | virtual VOID Initialize() = NULL; 50 | protected: 51 | std::wstring _wsDns; 52 | std::wstring _wsDbUser; 53 | std::wstring _wsDbPass; 54 | mutable std::mutex _Mtx; 55 | }; 56 | } 57 | 58 | #endif // !__LIBTOOLS_DBMANAGERLIB_BASEDBMANAGER_H__ 59 | -------------------------------------------------------------------------------- /include/ExceptionLib/Exception.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_EXCEPTIONLIB_EXCEPTION_H__ 2 | #define __LIBTOOLS_EXCEPTIONLIB_EXCEPTION_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace libTools 9 | { 10 | extern std::function g_EchoExceptionMsgPtr; 11 | 12 | class CException 13 | { 14 | public: 15 | CException() = default; 16 | ~CException() = default; 17 | 18 | static VOID InvokeAction(_In_ LPCWSTR pwszFunName, _In_ CONST std::function& MethodPtr) 19 | { 20 | __try 21 | { 22 | MethodPtr(); 23 | } 24 | __except (PrintExceptionCode(GetExceptionInformation())) 25 | { 26 | InvokeExceptionPtr(L"InvokeAction Exception[%s]", pwszFunName); 27 | } 28 | } 29 | 30 | template 31 | static T InvokeFunc(_In_ LPCWSTR pwszFunName, _In_ CONST std::function& MethodPtr) 32 | { 33 | __try 34 | { 35 | return MethodPtr(); 36 | } 37 | __except (PrintExceptionCode(GetExceptionInformation())) 38 | { 39 | InvokeExceptionPtr(L"InvokeFunc Exception[%s]", pwszFunName); 40 | } 41 | return T(); 42 | } 43 | 44 | private: 45 | static VOID InvokeExceptionPtr(_In_ LPCWSTR pwszFormat, ...); 46 | 47 | static BOOL PrintExceptionCode(_In_ LPEXCEPTION_POINTERS ExceptionPtr); 48 | }; 49 | 50 | } 51 | #endif // !__LIBTOOLS_EXCEPTIONLIB_EXCEPTION_H__ 52 | -------------------------------------------------------------------------------- /include/FileLib/File.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_FILELIB_FILE_H__ 2 | #define __LIBTOOLS_FILELIB_FILE_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace libTools 8 | { 9 | class CFile 10 | { 11 | public: 12 | CFile() = default; 13 | ~CFile() = default; 14 | 15 | public: 16 | // Create Directory 17 | static BOOL WINAPI CreateMyDirectory(IN LPCWSTR pwchText, BOOL bShowErr = FALSE); 18 | 19 | // Read txt Text in Unicode Encoding 20 | static BOOL WINAPI ReadUnicodeFile(_In_ CONST std::wstring& cwsPath, _Out_ std::wstring& cwsContent); 21 | 22 | // Read txt Text in ASCII Encoding 23 | static BOOL WINAPI ReadASCIIFile(_In_ CONST std::wstring& cwsPath, _Out_ std::wstring& cwsContent); 24 | 25 | // Write txt Text in Unicode Encoding(Overwrite) 26 | static BOOL WINAPI WriteUnicodeFile(_In_ CONST std::wstring& cwsPath, _In_ CONST std::wstring& cwsContent); 27 | 28 | // Write txt Text in ASCII Encoding(Overwrite) 29 | static BOOL WINAPI WriteASCIIFile(_In_ CONST std::wstring& cwsPath, _In_ CONST std::wstring& cwsContent); 30 | 31 | // Write BYTE Content(Overwrite) 32 | static BOOL WINAPI WriteFile(_In_ CONST std::wstring& cwsPath, _In_ CONST BYTE* Buffer, _In_ UINT uSize); 33 | 34 | // Append BYTE Content 35 | static BOOL WINAPI AppendFile(_In_ CONST std::wstring& cwsPath, _In_ CONST BYTE* Buffer, _In_ UINT uSize); 36 | 37 | // Append txt Text in Unicode Encoding 38 | static BOOL WINAPI AppendUnicodeFile(_In_ CONST std::wstring& cwsPath, _In_ CONST std::wstring& cwsContent); 39 | 40 | // Create Text File in Unicode Encoding(Overwrite) 41 | static BOOL WINAPI CreateUnicodeTextFile(_In_ CONST std::wstring& cwsPath); 42 | 43 | // Create Text File in ASCII Encoding(Overwrite) 44 | static BOOL WINAPI CreateASCIITextFile(_In_ CONST std::wstring& cwsPath); 45 | 46 | // Clear ALL Content 47 | static BOOL WINAPI ClearFileContent(_In_ CONST std::wstring& cwsPath); 48 | 49 | // Read File Content(have to use ::VirtualFree(lpFileContent,0,MEM_RELEASE) when free memory~) 50 | static BOOL WINAPI ReadFileContent(_In_ CONST std::wstring& wsPath, _Out_ LPVOID& lpFileContent, _Out_ SIZE_T& uSize); 51 | 52 | // Param1 = "\\Config.ini" 53 | static BOOL WINAPI ReadUnicodeConfig(_In_ CONST std::wstring& wsConfigPath, _In_ CONST std::wstring& wsConfigText, _In_ CONST std::wstring& wsConfigKey, _Out_ std::wstring& wsConfigValue); 54 | 55 | // File Is Exist 56 | static BOOL WINAPI FileExist(_In_ CONST std::wstring& wsPath); 57 | 58 | // Get File Size 59 | static BOOL WINAPI ReadAsciiFileLen(_In_ CONST std::wstring& cwsPath, _Out_ ULONG& ulFileLen); 60 | 61 | // Directory is Exist 62 | static BOOL WINAPI DirectoryExist(_In_ CONST std::wstring& wsPath); 63 | }; 64 | 65 | } 66 | 67 | #endif // !__LIBTOOLS_FILELIB_FILE_H__ 68 | -------------------------------------------------------------------------------- /include/GdiLib/GdiScreenshot.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_GDILIB_GDISCREENSHOT_H__ 2 | #define __LIBTOOLS_GDILIB_GDISCREENSHOT_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace libTools 9 | { 10 | class CGdiScreenshot 11 | { 12 | public: 13 | CGdiScreenshot() = default; 14 | ~CGdiScreenshot() = default; 15 | 16 | static BOOL Screenshot(_In_ HWND hWnd, _In_ CONST std::wstring& wsPath); 17 | 18 | static BOOL GetScreenShotContent(_In_ HWND hWnd, _Out_ std::shared_ptr& PicContentPtr, _Out_ UINT& uSize); 19 | private: 20 | 21 | }; 22 | } 23 | 24 | #endif // !__LIBTOOLS_GDILIB_GDISCREENSHOT_H__ 25 | -------------------------------------------------------------------------------- /include/HookLib/IATHook/IATHook.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_HOOKLIB_IATHOOK_IATHOOK_H__ 2 | #define __LIBTOOLS_HOOKLIB_IATHOOK_IATHOOK_H__ 3 | 4 | #include 5 | #include 6 | namespace libTools 7 | { 8 | // Compatible x86 & x64 9 | class CIATHook 10 | { 11 | public: 12 | CIATHook() = default; 13 | ~CIATHook() = default; 14 | 15 | static BOOL Hook(_In_ CONST std::string& szDLLName, _In_ CONST std::string& szMethodName, _In_ LPVOID HookProcPtr, _Out_opt_ LPVOID* pRealProcPtr); 16 | private: 17 | 18 | }; 19 | } 20 | 21 | #endif // !__LIBTOOLS_HOOKLIB_IATHOOK_IATHOOK_H__ 22 | -------------------------------------------------------------------------------- /include/HookLib/InlineHook/InlineHook.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/HookLib/InlineHook/InlineHook.h -------------------------------------------------------------------------------- /include/InjectorLib/DllInjector/DllInjector.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_INJECTORLIB_DLLINJECTOR_DLLINJECTOR_H__ 2 | #define __LIBTOOLS_INJECTORLIB_DLLINJECTOR_DLLINJECTOR_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace libTools 8 | { 9 | class CDllInjector 10 | { 11 | public: 12 | CDllInjector() = default; 13 | ~CDllInjector() = default; 14 | 15 | // Injector DLl to Already Exist Process ... 16 | static BOOL RemoteThreadInjectorDLL(_In_ DWORD dwPid, _In_ CONST std::wstring& wsDllPath); 17 | 18 | // Create Process and Injector DLL to this process ... (wsDllPath could be empty) use RemoteThread to Injector DLL ... 19 | static BOOL CreateProcess_And_InjectorDLL(_In_ CONST std::wstring& wsProcessCommand, _In_ CONST std::wstring& wsDllPath, _Out_opt_ PROCESS_INFORMATION* pProcInfo = nullptr); 20 | 21 | // Create Process and Injector DLL to this Process .. (wsDllPath couldn't be empty) use shellcode to Injector DLL .... 22 | static BOOL CreateProcess_And_ShellCodeInjectorDLL(_In_ CONST std::wstring& wsProcessCommand, _In_ CONST std::wstring& wsDllPath, _Out_opt_ PROCESS_INFORMATION* pProcInfo = nullptr); 23 | private: 24 | // 25 | static BOOL RaisePrivilige(_In_ LPCWSTR pwszPrivilegeName); 26 | }; 27 | } 28 | 29 | #endif // !__LIBTOOLS_INJECTORLIB_DLLINJECTOR_DLLINJECTOR_H__ 30 | -------------------------------------------------------------------------------- /include/InjectorLib/ModuleInjector/NoTraceModuleInjector.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_INJECTORLIB_MODULEINJECTOR_NOTRACEMODULEINJECTOR_H__ 2 | #define __LIBTOOLS_INJECTORLIB_MODULEINJECTOR_NOTRACEMODULEINJECTOR_H__ 3 | 4 | #define WIN32_NO_STATUS 5 | #include 6 | #undef WIN32_NO_STATUS 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | namespace libTools 13 | { 14 | class CNoTraceModuleInjector 15 | { 16 | private: 17 | #define FLAG_ON(_V, _F) (!!((_V) & (_F))) 18 | #define _TAG4(s) ( \ 19 | (((s) >> 24) & 0xFF) | \ 20 | (((s) >> 8 ) & 0xFF00) | \ 21 | (((s) << 24) & 0xFF000000) | \ 22 | (((s) << 8 ) & 0x00FF0000) \ 23 | ) 24 | #define TAG4(s) _TAG4((UINT32)(s)) 25 | 26 | #define SET_FLAG(_V, _F) ((_V) |= (_F)) 27 | #define CLEAR_FLAG(_V, _F) ((_V) &= ~(_F)) 28 | 29 | 30 | #define LOAD_MEM_DLL_INFO_MAGIC TAG4('LDFM') 31 | #define LMD_REMOVE_PE_HEADER 0x00000001 32 | #define LMD_REMOVE_IAT 0x00000002 33 | #define LMD_REMOVE_EAT 0x00000004 34 | #define LMD_REMOVE_RES 0x00000008 35 | #define LMD_MAPPED_DLL 0x10000000 36 | 37 | typedef enum _SECTION_INHERIT 38 | { 39 | ViewShare = 1, 40 | ViewUnmap = 2 41 | } SECTION_INHERIT; 42 | 43 | 44 | typedef enum _SECTION_INFORMATION_CLASS 45 | { 46 | SectionBasicInformation, 47 | SectionImageInformation, 48 | SectionRelocationInformation, // ret = now_base - desire_base 49 | } SECTION_INFORMATION_CLASS, *PSECTION_INFORMATION_CLASS; 50 | 51 | 52 | typedef struct _SECTION_BASIC_INFORMATION 53 | { 54 | PVOID BaseAddress; 55 | ULONG Attributes; 56 | LARGE_INTEGER Size; 57 | } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION; 58 | 59 | 60 | typedef struct _SECTION_IMAGE_INFORMATION 61 | { 62 | PVOID TransferAddress; // 0x00 63 | ULONG ZeroBits; // 0x04 64 | SIZE_T MaximumStackSize; // 0x08 65 | SIZE_T CommittedStackSize; // 0x0C 66 | ULONG SubSystemType; // 0x10 67 | 68 | union 69 | { 70 | struct SubSystemVersionConten 71 | { 72 | USHORT SubSystemMinorVersion; 73 | USHORT SubSystemMajorVersion; 74 | }SubSystemVersionContent; 75 | ULONG SubSystemVersion; // 0x14 76 | }; 77 | 78 | ULONG GpValue; // 0x18 79 | USHORT ImageCharacteristics; // 0x1C 80 | USHORT DllCharacteristics; // 0x1E 81 | USHORT Machine; // 0x20 82 | UCHAR ImageContainsCode; // 0x22 83 | union 84 | { 85 | UCHAR ImageFlags; // 0x23 86 | struct struc 87 | { 88 | UCHAR ComPlusNativeReady : 1; 89 | UCHAR ComPlusILOnly : 1; 90 | UCHAR ImageDynamicallyRelocated : 1; 91 | UCHAR ImageMappedFlat : 1; 92 | }; 93 | } ImageFlags; 94 | 95 | ULONG LoaderFlags; // 0x24 96 | ULONG ImageFileSize; // 0x28 97 | ULONG CheckSum; // 0x2C 98 | } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION; 99 | 100 | 101 | typedef NTSTATUS(WINAPI *NtUnmapViewOfSectionPtr)(_In_ HANDLE ProcessHandle, _In_ PVOID BaseAddress); 102 | 103 | typedef NTSTATUS(WINAPI *NtOpenSectionPtr)(_Out_ PHANDLE SectionHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes); 104 | 105 | typedef NTSTATUS(WINAPI *NtOpenDirectoryObjectPtr)(_Out_ PHANDLE DirectoryHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes); 106 | 107 | typedef NTSTATUS(WINAPI *NtMapViewOfSectionPtr)( 108 | _In_ HANDLE SectionHandle, 109 | _In_ HANDLE ProcessHandle, 110 | _In_ _Out_ PVOID *BaseAddress, 111 | _In_ ULONG ZeroBits, 112 | _In_ ULONG CommitSize, 113 | _In_ _Out_ PLARGE_INTEGER SectionOffset, // optional 114 | _In_ _Out_ PULONG ViewSize, 115 | _In_ SECTION_INHERIT InheritDisposition, 116 | _In_ ULONG AllocationType, 117 | _In_ ULONG Protect 118 | ); 119 | 120 | typedef NTSTATUS(NTAPI *ZwLoadDriverPtr)( 121 | _In_ PUNICODE_STRING RegistryPath 122 | ); 123 | 124 | typedef VOID(WINAPI *RtlInitUnicodeStringPtr)( 125 | _In_ _Out_ PUNICODE_STRING DestinationString, 126 | _In_ PCWSTR SourceString 127 | ); 128 | 129 | typedef ULONG(WINAPI *RtlNtStatusToDosErrorPtr) ( 130 | _In_ NTSTATUS Status 131 | ); 132 | typedef NTSTATUS(WINAPI *NtClosePtr)( 133 | _In_ HANDLE Object 134 | ); 135 | typedef NTSTATUS(WINAPI *NtCreateFilePtr)( 136 | _Out_ PHANDLE FileHandle, 137 | _In_ ACCESS_MASK DesiredAccess, 138 | _In_ POBJECT_ATTRIBUTES ObjectAttributes, 139 | _Out_ PIO_STATUS_BLOCK IoStatusBlock, 140 | _In_ PLARGE_INTEGER AllocationSize OPTIONAL, 141 | _In_ ULONG FileAttributes, 142 | _In_ ULONG ShareAccess, 143 | _In_ ULONG CreateDisposition, 144 | _In_ ULONG CreateOptions, 145 | _In_ PVOID EaBuffer OPTIONAL, 146 | _In_ ULONG EaLength 147 | ); 148 | 149 | typedef NTSTATUS(WINAPI *NtOpenFilePtr)( 150 | _Out_ PHANDLE FileHandle, 151 | _In_ ACCESS_MASK DesiredAccess, 152 | _In_ POBJECT_ATTRIBUTES ObjectAttributes, 153 | _Out_ PIO_STATUS_BLOCK IoStatusBlock, 154 | _In_ ULONG ShareAccess, 155 | _In_ ULONG OpenOptions 156 | ); 157 | 158 | typedef NTSTATUS(WINAPI *NtCreateSectionPtr)( 159 | _Out_ PHANDLE SectionHandle, 160 | _In_ ACCESS_MASK DesiredAccess, 161 | _In_ POBJECT_ATTRIBUTES ObjectAttributes, // Optional 162 | _In_ PLARGE_INTEGER MaximumSize, // Optional 163 | _In_ ULONG SectionPageProtection, 164 | _In_ ULONG AllocationAttributes, 165 | _In_ HANDLE FileHandle // Optional 166 | ); 167 | typedef NTSTATUS(WINAPI *NtQuerySectionPtr)( 168 | _In_ HANDLE SectionHandle, 169 | _In_ SECTION_INFORMATION_CLASS SectionInformationClass, 170 | _Out_ PVOID SectionInformation, 171 | _In_ ULONG SectionInformationLength, 172 | _Out_ PULONG ResultLength OPTIONAL 173 | ); 174 | 175 | typedef NTSTATUS(WINAPI *NtProtectVirtualMemoryPtr)( 176 | _In_ HANDLE ProcessHandle, 177 | _In_ _Out_ PVOID *BaseAddress, 178 | _In_ _Out_ PULONG ProtectSize, 179 | _In_ ULONG NewProtect, 180 | _Out_ PULONG OldProtect 181 | ); 182 | 183 | typedef NTSTATUS(NTAPI *LdrLoadDllPtr)( 184 | _In_ PWCHAR PathToFile OPTIONAL, 185 | _In_ PULONG Flags OPTIONAL, 186 | _In_ PUNICODE_STRING ModuleFileName, 187 | _Out_ PHANDLE ModuleHandle); 188 | 189 | typedef LONG(NTAPI *RtlCompareUnicodeStringPtr)( 190 | PCUNICODE_STRING String1, 191 | PCUNICODE_STRING String2, 192 | BOOLEAN CaseInSensitive 193 | ); 194 | 195 | enum 196 | { 197 | LDM_STATE_QUERY_ATTRIBUTES, 198 | LDM_STATE_OPEN_FILE, 199 | LDM_STATE_CREATE_SECTION, 200 | LDM_STATE_MAP_SECTION, 201 | LDM_STATE_MANIFESOPEN_FILE, 202 | LDM_STATE_FINISH, 203 | 204 | LDM_STATE_MANIFESMASK = 0xFFFF0000, 205 | LDM_STATE_FLAG_MANIFESOPEN_FILE = 0x00010000, 206 | }; 207 | 208 | 209 | typedef struct TEB_ACTIVE_FRAME_CONTEXT 210 | { 211 | /* 0x000 */ ULONG Flags; 212 | /* 0x004 */ PSTR FrameName; 213 | 214 | } TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT; 215 | 216 | 217 | typedef struct TEB_ACTIVE_FRAME 218 | { 219 | /* 0x000 */ ULONG Context; // Flags; 220 | /* 0x004 */ struct TEB_ACTIVE_FRAME *Previous; 221 | /* 0x008 */ PTEB_ACTIVE_FRAME_CONTEXT pContext; 222 | } TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME; 223 | 224 | 225 | struct LOAD_MEM_DLL_INFO : public TEB_ACTIVE_FRAME 226 | { 227 | ULONG Flags; 228 | PVOID MappedBase; 229 | PVOID MemDllBase; 230 | SIZE_T DllBufferSize; 231 | SIZE_T ViewSize; 232 | UNICODE_STRING Lz32Path; 233 | 234 | union 235 | { 236 | HANDLE DllFileHandle; 237 | HANDLE SectionHandle; 238 | }; 239 | 240 | UNICODE_STRING MemDllFullPath; 241 | }; 242 | 243 | 244 | typedef VOID(NTAPI *RtlPushFramePtr)(PTEB_ACTIVE_FRAME Frame); 245 | typedef PTEB_ACTIVE_FRAME(NTAPI *RtlGetFramePtr)(VOID); 246 | typedef VOID(NTAPI *RtlPopFramePtr)(PTEB_ACTIVE_FRAME Frame); 247 | 248 | 249 | typedef struct _FILE_BASIC_INFORMATION 250 | { 251 | LARGE_INTEGER CreationTime; 252 | LARGE_INTEGER LastAccessTime; 253 | LARGE_INTEGER LastWriteTime; 254 | LARGE_INTEGER ChangeTime; 255 | ULONG FileAttributes; 256 | } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION; 257 | 258 | 259 | typedef NTSTATUS(NTAPI *NtQueryAttributesFilePtr)( 260 | _In_ POBJECT_ATTRIBUTES ObjectAttributes, 261 | _Out_ PFILE_BASIC_INFORMATION FileInformation 262 | ); 263 | 264 | 265 | typedef BOOLEAN(NTAPI *RtlDosPathNameToNtPathName_UPtr)( 266 | _In_ PCWSTR DosName, 267 | _Out_ PUNICODE_STRING NtName, 268 | _Out_ PCWSTR *DosFilePath OPTIONAL, 269 | _Out_ PVOID FileName OPTIONAL 270 | ); 271 | 272 | 273 | typedef struct _LDR_FILE_ 274 | { 275 | DWORD HeadTag; 276 | DWORD DosHeaderOffset; 277 | DWORD DosHeaderSize; 278 | DWORD PeHeaderOffset; 279 | DWORD PeHeaderSize; 280 | DWORD OtherDataOffset; 281 | DWORD OtherDataSize; 282 | BYTE Key[8]; 283 | DWORD LdrFlags; 284 | }LDR_FILE, *PLDR_FILE; 285 | public: 286 | CNoTraceModuleInjector(); 287 | ~CNoTraceModuleInjector(); 288 | 289 | BOOL SetModuleContent(_In_ CONST std::wstring& wsDllPath); 290 | VOID SetModuleContent(_In_ LPVOID pvFileContent, _In_ SIZE_T uSize); 291 | 292 | BOOL LoadModule(); 293 | private: 294 | // 295 | BOOL InitLdr(); 296 | 297 | // 298 | BOOL Hook(); 299 | 300 | // 301 | BOOL UnHook(); 302 | 303 | // 304 | NTSTATUS WINAPI LoadDllFromMemory(_In_ PUNICODE_STRING ModuleFileName, _In_ ULONG Flags); 305 | private: 306 | static PTEB_ACTIVE_FRAME FindThreadFrameByContext(_In_ ULONG_PTR Context); 307 | 308 | static LOAD_MEM_DLL_INFO* GetMemoryModuleInstance(); 309 | 310 | static NTSTATUS WINAPI _NtOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions); 311 | 312 | static NTSTATUS WINAPI _NtCreateSection(_Out_ PHANDLE SectionHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ PLARGE_INTEGER MaximumSize, _In_ ULONG SectionPageProtection, _In_ ULONG AllocationAttributes, _In_ HANDLE FileHandle); 313 | 314 | static NTSTATUS WINAPI _NtQuerySection(_In_ HANDLE SectionHandle, _In_ SECTION_INFORMATION_CLASS SectionInformationClass, _Out_ PVOID SectionInformation, _In_ ULONG SectionInformationLength, _Out_ PULONG ResultLength); 315 | 316 | static NTSTATUS WINAPI _NtMapViewOfSection(_In_ HANDLE SectionHandle, _In_ HANDLE ProcessHandle, _In_ _Out_ PVOID *BaseAddress, _In_ ULONG ZeroBits, _In_ ULONG CommitSize, _In_ _Out_ PLARGE_INTEGER SectionOffset, _In_ _Out_ PULONG ViewSize, _In_ SECTION_INHERIT InheritDisposition, _In_ ULONG AllocationType, _In_ ULONG Protect); 317 | 318 | static NTSTATUS WINAPI _NtClose(_In_ HANDLE Handle); 319 | 320 | static NTSTATUS WINAPI _NtQueryAttributesFile(_In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ PFILE_BASIC_INFORMATION FileInformation); 321 | private: 322 | LPVOID _pvFileContent; 323 | SIZE_T _uFileSize; 324 | BOOL _IsAllocMemory; 325 | 326 | static RtlInitUnicodeStringPtr _RtlInitUnicodeStringPtr; 327 | static NtUnmapViewOfSectionPtr _NtUnmapViewOfSectionPtr; 328 | static NtOpenFilePtr _NtOpenFilePtr; 329 | static NtOpenDirectoryObjectPtr _NtOpenDirectoryObjectPtr; 330 | static NtOpenSectionPtr _NtOpenSectionPtr; 331 | static NtMapViewOfSectionPtr _NtMapViewOfSectionPtr; 332 | static RtlNtStatusToDosErrorPtr _RtlNtStatusToDosErrorPtr; 333 | static NtClosePtr _NtClosePtr; 334 | static NtCreateFilePtr _NtCreateFilePtr; 335 | static NtCreateSectionPtr _NtCreateSectionPtr; 336 | static NtQuerySectionPtr _NtQuerySectionPtr; 337 | static LdrLoadDllPtr _LdrLoadDllPtr; 338 | static RtlCompareUnicodeStringPtr _RtlCompareUnicodeStringPtr; 339 | static RtlPushFramePtr _RtlPushFramePtr; 340 | static RtlGetFramePtr _RtlGetFramePtr; 341 | static RtlPopFramePtr _RtlPopFramePtr; 342 | static NtQueryAttributesFilePtr _NtQueryAttributesFilePtr; 343 | static RtlDosPathNameToNtPathName_UPtr _RtlDosPathNameToNtPathName_UPtr; 344 | static NtOpenFilePtr _NtOpenFilePtr_Old; 345 | static NtCreateSectionPtr _NtCreateSectionPtr_Old; 346 | static NtQuerySectionPtr _NtQuerySectionPtr_Old; 347 | static NtMapViewOfSectionPtr _NtMapViewOfSectionPtr_Old; 348 | static NtClosePtr _NtClosePtr_Old; 349 | static NtQueryAttributesFilePtr _NtQueryAttributesFilePtr_Old; 350 | }; 351 | } 352 | 353 | #endif // !__LIBTOOLS_INJECTORLIB_MODULEINJECTOR_NOTRACEMODULEINJECTOR_H__ 354 | -------------------------------------------------------------------------------- /include/LogLib/CmdLog.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_LOGLIB_CMDLOG_H__ 2 | #define __LIBTOOLS_LOGLIB_CMDLOG_H__ 3 | 4 | #include 5 | #include "LogExpression.h" 6 | 7 | namespace libTools 8 | { 9 | class CCmdLog 10 | { 11 | public: 12 | enum 13 | { 14 | em_CmdLog_Port = 12344, 15 | em_CmdLog_Msg_SendClientInfo = 0x1, 16 | em_CmdLog_MaxClientCount = 100 17 | }; 18 | 19 | struct SendText 20 | { 21 | DWORD dwParm1; 22 | DWORD dwParm2; 23 | DWORD dwMsg; 24 | WCHAR wszText[1024]; 25 | }; 26 | 27 | struct RecvText 28 | { 29 | DWORD dwParm1; 30 | DWORD dwParm2; 31 | WCHAR wszText[1024]; 32 | }; 33 | public: 34 | CCmdLog(); 35 | ~CCmdLog(); 36 | 37 | BOOL Run(_In_ CONST std::wstring& wsClientName, _In_ CONST std::vector& ParmVecFunPtr); 38 | 39 | VOID Stop(); 40 | 41 | VOID ReSetClientName(_In_ CONST std::wstring& wsClientName); 42 | 43 | VOID ExcuteLogServerCmd(_In_ CONST std::wstring& wsCmdText); 44 | 45 | VOID EnableGloablMethod(); 46 | private: 47 | static DWORD WINAPI _RecvThread(LPVOID lpParm); 48 | 49 | 50 | 51 | BOOL ConnectLogServer(); 52 | 53 | VOID BreakLogConnect(); 54 | 55 | BOOL SendClientName(); 56 | 57 | int Send(_In_ CONST CHAR* Buffer, _In_ INT nLen); 58 | 59 | BOOL Recv(_Out_ std::wstring& wsCmdText); 60 | private: 61 | CCmdLog(CONST CCmdLog&) = delete; 62 | CCmdLog(CONST CCmdLog&&) = delete; 63 | CCmdLog& operator= (CONST CCmdLog&) = delete; 64 | private: 65 | UINT_PTR _skClient; 66 | std::wstring _wsClientName; 67 | BOOL _Run; 68 | HANDLE _hRecvThread; 69 | CLogExpression _LogExpression; 70 | }; 71 | } 72 | 73 | 74 | 75 | 76 | #endif // !__LIBTOOLS_LOGLIB_CMDLOG_H__ 77 | -------------------------------------------------------------------------------- /include/LogLib/Log.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/LogLib/Log.h -------------------------------------------------------------------------------- /include/LogLib/LogExpression.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_LOGLIB_LOGEXPRESSION_H__ 2 | #define __LIBTOOLS_LOGLIB_LOGEXPRESSION_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace libTools 10 | { 11 | struct ExpressionFunPtr 12 | { 13 | std::function&)> fnPtr; 14 | std::wstring wsFunName; 15 | }; 16 | 17 | struct ExprStructBase 18 | { 19 | virtual VOID Print() = NULL; 20 | }; 21 | 22 | class CExprFunBase 23 | { 24 | public: 25 | CExprFunBase() = default; 26 | virtual ~CExprFunBase() = default; 27 | 28 | virtual std::vector& GetVec() = NULL; 29 | 30 | virtual VOID Release() = NULL; 31 | 32 | virtual VOID Help(CONST std::vector&) = NULL; 33 | }; 34 | 35 | class CLogExpression 36 | { 37 | public: 38 | CLogExpression() = default; 39 | ~CLogExpression() = default; 40 | 41 | UINT Push(_In_ std::function&)> fnPtr, _In_ CONST std::wstring& wsFunName) throw(); 42 | 43 | VOID SetVecExprFunPtr(_In_ CONST std::vector& ParmVecFunPtr) throw(); 44 | 45 | BOOL Run(_In_ CONST std::wstring& wsText) throw(); 46 | private: 47 | std::vector VecFunPtr; 48 | }; 49 | } 50 | 51 | #endif // !__LIBTOOLS_LOGLIB_LOGEXPRESSION_H__ 52 | -------------------------------------------------------------------------------- /include/LogLib/LogExpressionCalc.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_LOGLIB_LOGEXPRESSIONCALC_H__ 2 | #define __LIBTOOLS_LOGLIB_LOGEXPRESSIONCALC_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace libTools 9 | { 10 | class CLogExpressionCalc 11 | { 12 | public: 13 | enum em_Cmd_Type 14 | { 15 | em_Cmd_Type_dd, 16 | em_Cmd_Type_Calc, 17 | em_Cmd_Type_Function, 18 | em_Cmd_Type_Struct, 19 | em_Cmd_Type_Variable, 20 | em_Cmd_Type_Invalid 21 | }; 22 | private: 23 | enum em_Content_Type 24 | { 25 | em_Content_Type_None, 26 | // 1 27 | em_Content_Type_Number, 28 | // ( 29 | em_Content_Type_LeftBracket, 30 | // ) 31 | em_Content_Type_RightBracket, 32 | // [ 33 | em_Content_Type_LeftAddress, 34 | // ] 35 | em_Content_Type_RightAddress, 36 | // + 37 | em_Content_Type_Symbol_Add, 38 | // - 39 | em_Content_Type_Symbol_Sub, 40 | // * 41 | em_Content_Type_Symbol_Mul, 42 | // / 43 | em_Content_Type_Symbol_Div, 44 | // % 45 | em_Content_Type_Symbol_Mod, 46 | // ^ 47 | em_Content_Type_Symbol_ExOr, 48 | // | 49 | em_Content_Type_Symbol_InOr, 50 | // ~ 51 | em_Content_Type_Symbol_Comp, 52 | // & 53 | em_Content_Type_Symbol_And, 54 | // << 55 | em_Content_Type_Symbol_LeftShift, 56 | // >> 57 | em_Content_Type_Symbol_RightShift 58 | }; 59 | 60 | enum em_Text_Type 61 | { 62 | em_Text_Type_Invalid, 63 | em_Text_Type_Number, 64 | em_Text_Type_Symbol, 65 | em_Text_Type_Bracket, 66 | em_Text_Type_NULL 67 | }; 68 | 69 | struct ExpressionInfo 70 | { 71 | em_Content_Type emContentType; 72 | std::wstring wsText; 73 | UINT_PTR GetHex() CONST 74 | { 75 | #ifdef _WIN64 76 | return wcstoll(wsText.c_str(), nullptr, 16); 77 | #else 78 | return wcstol(wsText.c_str(), nullptr, 16); 79 | #endif // _WIN64 80 | 81 | 82 | } 83 | }; 84 | 85 | struct ExpressionContent 86 | { 87 | em_Cmd_Type emCmdType; 88 | std::vector ExpressionVec; 89 | UINT uMemWatchCount; 90 | ExpressionContent() : emCmdType(em_Cmd_Type::em_Cmd_Type_Invalid), uMemWatchCount(NULL) 91 | { 92 | 93 | } 94 | }; 95 | public: 96 | CLogExpressionCalc() = default; 97 | ~CLogExpressionCalc() = default; 98 | 99 | // Analysis Expression 100 | BOOL Analysis(_In_ CONST std::wstring& wsText) throw(); 101 | 102 | BOOL IsConformToCmdType(_In_ CONST std::wstring& wsText) CONST throw(); 103 | private: 104 | // 105 | em_Cmd_Type GetCmdType(_In_ CONST std::wstring& wsText) CONST throw(); 106 | 107 | // 108 | em_Text_Type GetTextType(_In_ CONST UINT& uIndex) throw(); 109 | 110 | // 111 | em_Content_Type GetContentType(_In_ CONST std::wstring& wsSymbolText, _In_ em_Text_Type emTextType) throw(); 112 | 113 | // 114 | BOOL GetSymbolText(_In_ _Out_ UINT& uIndex, _Out_ std::wstring& wsSymbolText) throw(); 115 | 116 | // 117 | BOOL GetExpression() throw(); 118 | 119 | // 120 | int GetPriority(_In_ em_Content_Type emContentType) throw(); 121 | 122 | // 123 | BOOL CompPrioity(_In_ em_Content_Type emTextType1, _In_ em_Content_Type emTextType2) throw(); 124 | 125 | // 126 | BOOL GetRpn() throw(); 127 | 128 | // 129 | UINT_PTR CalcResult_By_Parm(_In_ UINT_PTR dwNumberLeft, _In_ UINT_PTR dwNumberRight, _In_ em_Content_Type emSymbolType) throw(); 130 | 131 | // 132 | BOOL CalcResult_By_Rpn(_Out_opt_ UINT_PTR* pdwResult) throw(); 133 | 134 | // 135 | BOOL ReadMem_By_Rpn() throw(); 136 | 137 | // 138 | BOOL IsNumber(_In_ CONST std::wstring& wsText) CONST throw(); 139 | 140 | private: 141 | std::stack Rpn; 142 | ExpressionContent ExpContent; 143 | std::wstring wsExpText; 144 | }; 145 | } 146 | 147 | #endif // !__LIBTOOLS_LOGLIB_LOGEXPRESSIONCALC_H__ 148 | -------------------------------------------------------------------------------- /include/LogLib/LogExpressionPeLoader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/LogLib/LogExpressionPeLoader.h -------------------------------------------------------------------------------- /include/MathLib/DistanceCalc.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_MATHLIB_DISTANCECALC_H__ 2 | #define __LIBTOOLS_MATHLIB_DISTANCECALC_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace libTools 9 | { 10 | class CDistanceCalc 11 | { 12 | public: 13 | CDistanceCalc() = default; 14 | ~CDistanceCalc() = default; 15 | 16 | template 17 | static float GetDisBy3D(_In_ CONST T& CurPoint, _In_ CONST T& TarPoint) 18 | { 19 | auto fsum = pow(CurPoint.X - TarPoint.X, 2.0f) + pow(CurPoint.Y - TarPoint.Y, 2.0f) + pow(CurPoint.Z - TarPoint.Z, 2.0f); 20 | return sqrt(fsum); 21 | } 22 | 23 | template 24 | static float GetDisBy2D(_In_ CONST T& CurPoint, _In_ CONST T& TarPoint) 25 | { 26 | float fsum = pow(static_cast(CurPoint.X) - static_cast(TarPoint.X), 2.0f) + pow(static_cast(CurPoint.Y) - static_cast(TarPoint.Y), 2.0f); 27 | return sqrt(fsum); 28 | } 29 | 30 | template 31 | static int GetRecentlyIndexByVec(_In_ CONST std::vector& Vec, _In_ CONST T& TarPoint, _In_ float MinDis = FLT_MAX) 32 | { 33 | auto Index = -1; 34 | auto VecMinDis = FLT_MAX; 35 | 36 | for (UINT i = 0; i < Vec.size(); ++i) 37 | { 38 | auto fDis = GetDisBy2D(TarPoint, Vec.at(i)); 39 | if (fDis < VecMinDis) 40 | { 41 | VecMinDis = fDis; 42 | Index = static_cast(i); 43 | } 44 | } 45 | 46 | return VecMinDis < MinDis ? Index : -1; 47 | } 48 | 49 | template 50 | static int GetRecentlyIndexByPointVec(_In_ CONST std::vector& Vec, _In_ CONST T2& TarPoint, _In_ float MinDis = FLT_MAX) 51 | { 52 | auto Index = -1; 53 | auto VecMinDis = FLT_MAX; 54 | 55 | for (UINT i = 0; i < Vec.size(); ++i) 56 | { 57 | auto fDis = GetDisBy2D(TarPoint, Vec.at(i).GetPoint()); 58 | if (fDis < VecMinDis) 59 | { 60 | VecMinDis = fDis; 61 | Index = static_cast(i); 62 | } 63 | } 64 | return VecMinDis < MinDis ? Index : -1; 65 | } 66 | private: 67 | 68 | }; 69 | } 70 | 71 | #endif // !__LIBTOOLS_MATHLIB_DISTANCECALC_H__ 72 | -------------------------------------------------------------------------------- /include/ProcessLib/AntiRootkit/AntiRootkit.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_PROCESSLIB_ANTIROOKIT_ANTIROOKIT_H__ 2 | #define __LIBTOOLS_PROCESSLIB_ANTIROOKIT_ANTIROOKIT_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CAntiRootkit 9 | { 10 | public: 11 | CAntiRootkit() = default; 12 | ~CAntiRootkit() = default; 13 | 14 | // 15 | BOOL IsAntiLoader(); 16 | 17 | // 18 | BOOL IsExistDebugger(); 19 | private: 20 | 21 | }; 22 | } 23 | 24 | 25 | #endif // !__LIBTOOLS_PROCESSLIB_ANTIROOKIT_ANTIROOKIT_H__ 26 | -------------------------------------------------------------------------------- /include/ProcessLib/Common/ResHandleManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_PROCESSLIB_COMMON_RESHANDLEMANAGER_H__ 2 | #define __LIBTOOLS_PROCESSLIB_COMMON_RESHANDLEMANAGER_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | #define SetResDeleter(VarName, Deleter) CResManager> VarName##Manager(VarName,Deleter) 9 | 10 | template 11 | class CResManager 12 | { 13 | public: 14 | CResManager(_In_ ResHandle& ResHandle_, _In_ Deleter fnDeletePtr) : m_ResHandle(ResHandle_), m_fnDeletePtr(fnDeletePtr) 15 | { 16 | 17 | } 18 | ~CResManager() 19 | { 20 | m_fnDeletePtr(m_ResHandle); 21 | } 22 | 23 | CResManager& operator=(CONST CResManager&) = delete; 24 | private: 25 | ResHandle& m_ResHandle; 26 | Deleter m_fnDeletePtr; 27 | }; 28 | } 29 | 30 | #endif // !__LIBTOOLS_PROCESSLIB_COMMON_RESHANDLEMANAGER_H__ 31 | -------------------------------------------------------------------------------- /include/ProcessLib/KeyboardMsg/KeyboardMsg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/ProcessLib/KeyboardMsg/KeyboardMsg.h -------------------------------------------------------------------------------- /include/ProcessLib/Memory/Memory.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_PROCESSLIB_MEMORY_MEMORY_H__ 2 | #define __LIBTOOLS_PROCESSLIB_MEMORY_MEMORY_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace libTools 8 | { 9 | class CMemory 10 | { 11 | public: 12 | CMemory() = default; 13 | ~CMemory() = default; 14 | 15 | // 16 | static BOOL ClearWorkingMemory(); 17 | 18 | 19 | ///------------------ Read Memory ...----------------------------------------------- 20 | template 21 | static ReturnValueType ReadMemoryValue(_In_ UINT_PTR dwAddr) 22 | { 23 | ReturnValueType Value = 0; 24 | ::ReadProcessMemory(::GetCurrentProcess(), reinterpret_cast(dwAddr), reinterpret_cast(&Value), sizeof(Value), NULL); 25 | return Value; 26 | } 27 | 28 | static UINT_PTR ReadMemValue(_In_ UINT_PTR dwAddr); 29 | static DWORD ReadDWORD(_In_ UINT_PTR dwAddr); 30 | static WORD ReadWORD(_In_ UINT_PTR dwAddr); 31 | static BYTE ReadBYTE(_In_ UINT_PTR dwAddr); 32 | static FLOAT ReadFloat(_In_ UINT_PTR dwAddr); 33 | static double ReadDouble(_In_ UINT_PTR dwAddr); 34 | 35 | template 36 | static BOOL WriteMemoryValue(_In_ WriteAddrType dwAddr, _In_ WriteValueType dwValue) 37 | { 38 | DWORD dwOldProtect = NULL; 39 | if (!::VirtualProtect(reinterpret_cast(dwAddr), sizeof(dwValue), PAGE_EXECUTE_READWRITE, &dwOldProtect)) 40 | { 41 | return FALSE; 42 | } 43 | 44 | ::WriteProcessMemory(::GetCurrentProcess(), reinterpret_cast(dwAddr), reinterpret_cast(&dwValue), sizeof(dwValue), NULL); 45 | ::VirtualProtect(reinterpret_cast(dwAddr), sizeof(dwValue), dwOldProtect, &dwOldProtect); 46 | return TRUE; 47 | } 48 | 49 | static BOOL WriteDWORD64(_In_ DWORD64 dwAddr, _In_ DWORD64 dwValue); 50 | static BOOL WriteDWORD(_In_ UINT_PTR dwAddr, _In_ DWORD dwValue); 51 | static BOOL WriteFloat(_In_ UINT_PTR dwAddr, _In_ FLOAT fValue); 52 | static BOOL WriteBYTE(_In_ UINT_PTR dwAddr, _In_ BYTE bValue); 53 | 54 | 55 | /// --------Read Memory Text----------------------------------------------------------------- 56 | static std::wstring ReadUTF8Text(_In_ UINT_PTR dwAddr); 57 | static std::wstring ReadASCIIText(_In_ UINT_PTR dwAddr); 58 | static std::wstring ReadUnicodeText(_In_ UINT_PTR dwAddr); 59 | private: 60 | 61 | }; 62 | } 63 | 64 | #endif // !__LIBTOOLS_PROCESSLIB_MEMORY_MEMORY_H__ 65 | -------------------------------------------------------------------------------- /include/ProcessLib/Memory/SearchBinary.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_PROCESSLIB_MEMORY_SEARCHBINARY_H__ 2 | #define __LIBTOOLS_PROCESSLIB_MEMORY_SEARCHBINARY_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace libTools 8 | { 9 | class CSearchBinary 10 | { 11 | public: 12 | CSearchBinary() = default; 13 | ~CSearchBinary() = default; 14 | 15 | #ifdef _WIN64 16 | #else 17 | public: 18 | DWORD FindAddr(_In_ LPCSTR lpszCode, _In_ int nOffset, _In_ int nOrderNum, _In_ LPCWSTR lpszModule); 19 | DWORD FindCALL(_In_ LPCSTR lpszCode, _In_ int nOffset, _In_ int nMov, _In_ int nOrderNum, _In_ LPCWSTR lpszModule); 20 | DWORD FindBase(_In_ LPCSTR lpszCode, _In_ int nOffset, _In_ int nMov, _In_ int nOrderNum, _In_ LPCWSTR lpszModule, DWORD dwAddrLen = 0xFFFFFFFF); 21 | DWORD FindBase_ByCALL(_In_ LPCSTR lpszCode, _In_ int nOffset, _In_ int nMov, _In_ int nOrderNum, _In_ LPCWSTR lpszModule, _In_ int nBaseOffset, _In_opt_ DWORD dwAddrLen = 0xFFFFFFFF); 22 | private: 23 | BOOL SearchBase(_In_ LPCSTR szCode, _Out_ DWORD * pArray, _Out_ UINT& puLen, _In_ LPCWSTR lpszModule); 24 | DWORD GetImageSize(_In_ DWORD dwImageBase); 25 | BOOL CL_sunday(_In_ DWORD* pKey, _In_ UINT uKeyLen, _In_ BYTE* pCode, _In_ UINT uCodeLen, _Out_ std::vector& vlst); 26 | int GetWord_By_Char(_In_ BYTE dwWord, _In_ DWORD* pKey, _In_ UINT uKeyLen); 27 | BOOL CompCode(_In_ const DWORD * pCode, _In_ const BYTE * pMem, _In_ UINT uLen); 28 | #endif // _WIN64 29 | }; 30 | } 31 | 32 | #endif // !__LIBTOOLS_PROCESSLIB_MEMORY_SEARCHBINARY_H__ 33 | -------------------------------------------------------------------------------- /include/ProcessLib/Process/Process.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_PROCESSLIB_PROCESS_PROCESS_H__ 2 | #define __LIBTOOLS_PROCESSLIB_PROCESS_PROCESS_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace libTools 9 | { 10 | class CProcess 11 | { 12 | public: 13 | struct ProcessContent 14 | { 15 | DWORD dwPid; 16 | std::wstring wsClientName; // make lower... 17 | }; 18 | public: 19 | CProcess() = default; 20 | ~CProcess() = default; 21 | 22 | // Find Proc ... 23 | static DWORD FindPidByProcName(_In_ CONST std::wstring& wsProcName); 24 | 25 | // Find Proc ... 26 | static BOOL IsExistPid(_In_ DWORD dwPid); 27 | 28 | // Find Proc ... 29 | static BOOL IsExistProcName(_In_ CONST std::wstring& wsProcName); 30 | 31 | // Terminate Process ... 32 | static VOID TerminateProcByProcName(_In_ CONST std::wstring& wsProcName); 33 | 34 | // 35 | static VOID TerminateProcByPid(_In_ DWORD dwPid); 36 | 37 | // Get Vec Process(from Snapshot process) 38 | static BOOL GetVecProcess(_Out_ std::vector& VecProc); 39 | 40 | // 41 | static int GetCpuUsageByPid(_In_ DWORD dwPid, _In_ _Out_ LONGLONG& llLastTime, _In_ _Out_ LONGLONG& llLastSysTime); 42 | 43 | // Memory usage... 44 | static ULONGLONG CalcWorkSetPrivate(_In_ DWORD dwPid); 45 | 46 | // 47 | static BOOL CreateProc(_In_ CONST std::wstring& wsProcPath, _In_ BOOL IsSupended, _Out_opt_ PROCESS_INFORMATION* pRetProcInfo = nullptr); 48 | private: 49 | 50 | }; 51 | } 52 | 53 | #endif // !__LIBTOOLS_PROCESSLIB_PROCESS_PROCESS_H__ 54 | -------------------------------------------------------------------------------- /include/ProcessLib/Thread/Thread.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_PROCESSLIB_THREAD_THREAD_H__ 2 | #define __LIBTOOLS_PROCESSLIB_THREAD_THREAD_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CThread 9 | { 10 | public: 11 | CThread() = default; 12 | ~CThread() = default; 13 | 14 | static DWORD GetMainThreadId(); 15 | private: 16 | 17 | }; 18 | } 19 | 20 | #endif // !__LIBTOOLS_PROCESSLIB_THREAD_THREAD_H__ 21 | -------------------------------------------------------------------------------- /include/SocketClientLib/SocketBaseClientService.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/SocketClientLib/SocketBaseClientService.h -------------------------------------------------------------------------------- /include/SocketCommon/SocketBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_SOCKETCOMMONLIB_SOCKETBUFFER_H__ 2 | #define __LIBTOOLS_SOCKETCOMMONLIB_SOCKETBUFFER_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace libTools 10 | { 11 | class CSocketBuffer 12 | { 13 | public: 14 | enum em_SocketBuffer_Error 15 | { 16 | em_SocketBuffer_Error_None, 17 | em_SocketBuffer_Error_InvalidSize, 18 | em_SocketBuffer_Error_InvalidCRC, 19 | em_SocketBuffer_Error_InvalidHead, 20 | }; 21 | public: 22 | CSocketBuffer(); 23 | ~CSocketBuffer() = default; 24 | 25 | template 26 | CSocketBuffer(T MsgHead) 27 | { 28 | InitializeHead(MsgHead); 29 | } 30 | 31 | 32 | 33 | template 34 | VOID InitializeHead(T MsgHead) 35 | { 36 | _dwMsgHead = static_cast(MsgHead); 37 | AddVerData(); 38 | } 39 | 40 | static VOID SetValue_By_Buffer(_Out_ DWORD& dwValue, _In_ CONST BYTE* Buffer); 41 | 42 | CSocketBuffer& operator << (DWORD dwValue); 43 | 44 | CSocketBuffer& operator << (UINT uValue); 45 | 46 | CSocketBuffer& operator << (int nValue); 47 | 48 | CSocketBuffer& operator << (bool bValue); 49 | 50 | CSocketBuffer& operator << (WORD wValue); 51 | 52 | CSocketBuffer& operator << (BYTE bValue); 53 | 54 | CSocketBuffer& operator << (float fVersion); 55 | 56 | CSocketBuffer& operator << (CONST std::wstring& wsText); 57 | 58 | CSocketBuffer& operator << (LPCWSTR lpwszText); 59 | 60 | CSocketBuffer& operator >> (DWORD& dwValue); 61 | 62 | CSocketBuffer& operator >> (WORD& wValue); 63 | 64 | CSocketBuffer& operator >> (BYTE& bValue); 65 | 66 | CSocketBuffer& operator >> (bool& bValue); 67 | 68 | CSocketBuffer& operator >> (float& fValue); 69 | 70 | CSocketBuffer& operator >> (UINT& uValue); 71 | 72 | CSocketBuffer& operator >> (std::wstring& wsText); 73 | 74 | // 75 | std::shared_ptr GetBuffer(_Out_ UINT& uSize); 76 | 77 | // Clear Data, Send 78 | std::shared_ptr GetDataPtr(_Out_ UINT& uSize); 79 | 80 | VOID SetDataPtr(_In_ CONST std::shared_ptr& DataPtr, _In_ UINT uSize); 81 | 82 | VOID SetDataPtr(_In_ CONST CHAR* Buffer, _In_ UINT uSize); 83 | 84 | template 85 | em_SocketBuffer_Error VerDataPtr(T& MsgHead) 86 | { 87 | DWORD dwValue1, dwValue2, dwSize = 0; 88 | 89 | *this >> dwSize >> dwValue1 >> dwValue2 >> _dwMsgHead; 90 | 91 | if (dwValue1 != 0x434C536F || dwValue2 != 0x636B6574) 92 | return em_SocketBuffer_Error::em_SocketBuffer_Error_InvalidCRC; 93 | else if (dwSize != _Data.size() + 16) // 12 = sizeof(dwValue1) + sizeof(dwValue2) + sizeof(dwMsgType) 94 | return em_SocketBuffer_Error::em_SocketBuffer_Error_InvalidSize; 95 | 96 | MsgHead = GetMsgHead(); 97 | return em_SocketBuffer_Error::em_SocketBuffer_Error_None; 98 | } 99 | 100 | template 101 | T GetMsgHead() 102 | { 103 | return static_cast(_dwMsgHead); 104 | } 105 | 106 | UINT size() CONST 107 | { 108 | return static_cast(_Data.size()); 109 | } 110 | 111 | VOID clear(); 112 | 113 | private: 114 | 115 | VOID AddVerData(); 116 | 117 | VOID Set(BYTE Data); 118 | 119 | BYTE Get(); 120 | 121 | private: 122 | std::vector _Data; 123 | DWORD _dwMsgHead; 124 | }; 125 | } 126 | 127 | #endif // !__LIBTOOLS_SOCKETCOMMONLIB_SOCKETBUFFER_H__ 128 | -------------------------------------------------------------------------------- /include/SocketCommon/SocketIoEvent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/SocketCommon/SocketIoEvent.h -------------------------------------------------------------------------------- /include/SocketCommon/SocketRemoteClient.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/SocketCommon/SocketRemoteClient.h -------------------------------------------------------------------------------- /include/SocketCommon/SocketTag.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_SOCKETCOMMONLIB_SOCKETTAG_H__ 2 | #define __LIBTOOLS_SOCKETCOMMONLIB_SOCKETTAG_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CSocketTag 9 | { 10 | public: 11 | CSocketTag() = default; 12 | ~CSocketTag() = default; 13 | 14 | template 15 | void SetTag(T* Ptr) 16 | { 17 | _lpAddr = reinterpret_cast(Ptr); 18 | } 19 | 20 | template 21 | T* GetTag() 22 | { 23 | return reinterpret_cast(_lpAddr); 24 | } 25 | private: 26 | LPVOID _lpAddr = nullptr; 27 | }; 28 | } 29 | 30 | #endif // !__LIBTOOLS_SOCKETCOMMONLIB_SOCKETTAG_H__ 31 | -------------------------------------------------------------------------------- /include/SocketServerLib/SocketBaseServerService.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/SocketServerLib/SocketBaseServerService.h -------------------------------------------------------------------------------- /include/TimeLib/TimeCharacter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/include/TimeLib/TimeCharacter.h -------------------------------------------------------------------------------- /include/TimeLib/TimeRand.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_TIMELIB_TIMERAND_H__ 2 | #define __LIBTOOLS_TIMELIB_TIMERAND_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CTimeRand 9 | { 10 | public: 11 | CTimeRand() = default; 12 | ~CTimeRand() = default; 13 | 14 | static int GetRand(_In_ int nMinValue, _In_ int nMaxValue); 15 | private: 16 | 17 | }; 18 | } 19 | 20 | #endif // !__LIBTOOLS_TIMELIB_TIMERAND_H__ 21 | -------------------------------------------------------------------------------- /include/TimeLib/TimeTick.h: -------------------------------------------------------------------------------- 1 | #ifndef __LIBTOOLS_TIMELIB_TIMETICK_H__ 2 | #define __LIBTOOLS_TIMELIB_TIMETICK_H__ 3 | 4 | #include 5 | 6 | namespace libTools 7 | { 8 | class CTimeTick 9 | { 10 | public: 11 | enum class em_TimeTick 12 | { 13 | em_TimeTick_Hour, 14 | em_TimeTick_Minute, 15 | em_TimeTick_Second, 16 | em_TimeTick_Millisecond 17 | }; 18 | public: 19 | CTimeTick(); 20 | CTimeTick(_In_ ULONGLONG ulTick); 21 | ~CTimeTick() = default; 22 | 23 | static ULONGLONG _GetTickCount64(); 24 | 25 | VOID Reset(); 26 | 27 | DWORD GetSpentTime(_In_ em_TimeTick emTimeTick) CONST; 28 | DWORD64 GetSpentTime_By_X64(_In_ em_TimeTick emTimeTick) CONST; 29 | private: 30 | ULONGLONG _ulTick; 31 | }; 32 | } 33 | 34 | #endif // !__LIBTOOLS_TIMELIB_TIMETICK_H__ 35 | -------------------------------------------------------------------------------- /lib/AlgroithmLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/AlgroithmLib.lib -------------------------------------------------------------------------------- /lib/CharacterLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/CharacterLib.lib -------------------------------------------------------------------------------- /lib/DbManagerLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/DbManagerLib.lib -------------------------------------------------------------------------------- /lib/ExceptionLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/ExceptionLib.lib -------------------------------------------------------------------------------- /lib/FileLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/FileLib.lib -------------------------------------------------------------------------------- /lib/GdiLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/GdiLib.lib -------------------------------------------------------------------------------- /lib/HookLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/HookLib.lib -------------------------------------------------------------------------------- /lib/InjectorLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/InjectorLib.lib -------------------------------------------------------------------------------- /lib/LogLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/LogLib.lib -------------------------------------------------------------------------------- /lib/MathLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/MathLib.lib -------------------------------------------------------------------------------- /lib/ProcessLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/ProcessLib.lib -------------------------------------------------------------------------------- /lib/SocketClientLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/SocketClientLib.lib -------------------------------------------------------------------------------- /lib/SocketCommon.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/SocketCommon.lib -------------------------------------------------------------------------------- /lib/SocketServerLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/SocketServerLib.lib -------------------------------------------------------------------------------- /lib/TimeLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/lib/TimeLib.lib -------------------------------------------------------------------------------- /screenshot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/1.png -------------------------------------------------------------------------------- /screenshot/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/10.png -------------------------------------------------------------------------------- /screenshot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/2.png -------------------------------------------------------------------------------- /screenshot/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/3.png -------------------------------------------------------------------------------- /screenshot/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/4.png -------------------------------------------------------------------------------- /screenshot/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/5.png -------------------------------------------------------------------------------- /screenshot/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/6.png -------------------------------------------------------------------------------- /screenshot/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/7.png -------------------------------------------------------------------------------- /screenshot/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/8.png -------------------------------------------------------------------------------- /screenshot/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wyexe/War3Cheat/edae97248eecfff2a7aa02723613880915a994e0/screenshot/9.png --------------------------------------------------------------------------------