├── MhyprotSource ├── config.ini ├── Release │ ├── PaladinsHack.tlog │ │ ├── unsuccessfulbuild │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── CL.command.1.tlog │ │ └── PaladinsHack.lastbuildstate │ └── vc143.pdb ├── x64 │ ├── Debug │ │ ├── PaladinsHack.vcxproj.FileListAbsolute.txt │ │ ├── vc142.idb │ │ ├── vc142.pdb │ │ ├── vc143.idb │ │ ├── vc143.pdb │ │ ├── esp.obj.enc │ │ ├── Resource.res │ │ ├── PaladinsHack.ilk │ │ ├── cgraphics.obj.enc │ │ ├── Mhyprot Base Source.ilk │ │ ├── PaladinsHack.tlog │ │ │ ├── CL.read.1.tlog │ │ │ ├── CL.write.1.tlog │ │ │ ├── link.read.1.tlog │ │ │ ├── rc.read.1.tlog │ │ │ ├── rc.write.1.tlog │ │ │ ├── CL.command.1.tlog │ │ │ ├── link.write.1.tlog │ │ │ ├── rc.command.1.tlog │ │ │ ├── link.command.1.tlog │ │ │ └── PaladinsHack.lastbuildstate │ │ ├── Mhyprot .38615e7b.tlog │ │ │ ├── CL.read.1.tlog │ │ │ ├── CL.write.1.tlog │ │ │ ├── link.read.1.tlog │ │ │ ├── rc.read.1.tlog │ │ │ ├── rc.write.1.tlog │ │ │ ├── CL.command.1.tlog │ │ │ ├── link.write.1.tlog │ │ │ ├── rc.command.1.tlog │ │ │ ├── link.command.1.tlog │ │ │ └── Mhyprot Base Source.lastbuildstate │ │ ├── PaladinsHack.exe.recipe │ │ └── Mhyprot Base Source.exe.recipe │ └── Release │ │ ├── MhyprotSource.vcxproj.FileListAbsolute.txt │ │ ├── PaladinsHack.vcxproj.FileListAbsolute.txt │ │ ├── vc142.pdb │ │ ├── Resource.res │ │ ├── Mhyprot Base Source.iobj │ │ ├── PaladinsHack.tlog │ │ ├── CL.read.1.tlog │ │ ├── rc.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── link.read.1.tlog │ │ ├── rc.write.1.tlog │ │ ├── CL.command.1.tlog │ │ ├── link.command.1.tlog │ │ ├── link.write.1.tlog │ │ ├── rc.command.1.tlog │ │ └── PaladinsHack.lastbuildstate │ │ ├── Mhyprot .38615e7b.tlog │ │ ├── CL.read.1.tlog │ │ ├── rc.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── link.read.1.tlog │ │ ├── rc.write.1.tlog │ │ ├── CL.command.1.tlog │ │ ├── link.command.1.tlog │ │ ├── link.write.1.tlog │ │ ├── rc.command.1.tlog │ │ └── Mhyprot Base Source.lastbuildstate │ │ ├── PaladinsHack.exe.recipe │ │ ├── Mhyprot Base Source.exe.recipe │ │ └── Mhyprot Base Source.Build.CppClean.log ├── Coding.h ├── utils │ ├── stb_image.h │ ├── Image.cpp │ └── Image.h ├── imgui.ini ├── Icon.ico ├── res │ ├── img │ │ ├── fov.png │ │ ├── vis.png │ │ ├── vis2.png │ │ ├── check.png │ │ ├── speed.png │ │ ├── speed2.png │ │ └── speed.svg │ └── fonts │ │ ├── opensans.ttf │ │ └── segoeuivf.ttf ├── Mhyprot │ ├── log.h │ ├── utils.h │ ├── baseadress.h │ ├── file_utils.hpp │ ├── logger.hpp │ ├── file_utils.cpp │ ├── win_utils.hpp │ ├── service_utils.hpp │ ├── utils.cpp │ ├── mhyprot.hpp │ ├── service_utils.cpp │ ├── win_utils.cpp │ ├── nt.hpp │ ├── baseadress.cpp │ ├── mhyprot.cpp │ └── readbase.hpp ├── CGraphics.h ├── NoClip.h ├── MhyprotSource.vcxproj.user ├── Singleton.h ├── resource.h ├── Esp.h ├── Offsets.h ├── Aimbot.h ├── ImGui │ ├── imgui_impl_dx11.h │ ├── imgui_impl_win32.h │ └── imconfig.h ├── Resource.rc ├── Inputs.h ├── Overlay.h ├── settings.h ├── MhyprotSource.filters ├── settings.cpp ├── quartic.h ├── Offsets.cpp ├── skCrypter.h ├── NoClip.cpp ├── quartic.cpp ├── CGraphics.cpp ├── Inputs.cpp ├── utils.h ├── Vector3.h ├── SDK │ └── Paladins_classes.hpp ├── Coding.cpp ├── MhyprotSource.vcxproj.filters ├── Overlay.cpp └── MhyprotSource.vcxproj ├── README.md ├── .gitignore ├── Mhyptot Base Source.sln └── .gitattributes /MhyprotSource/config.ini: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MhyprotSource/Release/PaladinsHack.tlog/unsuccessfulbuild: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/MhyprotSource.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MhyprotSource/Coding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | bool init_hack(); 3 | void shutdown(); 4 | -------------------------------------------------------------------------------- /MhyprotSource/utils/stb_image.h: -------------------------------------------------------------------------------- 1 | #define STBI_HEADER_FILE_ONLY 2 | #include "stb_image.c" 3 | -------------------------------------------------------------------------------- /MhyprotSource/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][Debug##Default] 2 | Pos=60,60 3 | Size=400,400 4 | Collapsed=0 5 | 6 | -------------------------------------------------------------------------------- /MhyprotSource/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/Icon.ico -------------------------------------------------------------------------------- /MhyprotSource/res/img/fov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/img/fov.png -------------------------------------------------------------------------------- /MhyprotSource/res/img/vis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/img/vis.png -------------------------------------------------------------------------------- /MhyprotSource/res/img/vis2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/img/vis2.png -------------------------------------------------------------------------------- /MhyprotSource/Release/vc143.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/Release/vc143.pdb -------------------------------------------------------------------------------- /MhyprotSource/res/img/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/img/check.png -------------------------------------------------------------------------------- /MhyprotSource/res/img/speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/img/speed.png -------------------------------------------------------------------------------- /MhyprotSource/res/img/speed2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/img/speed2.png -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/vc142.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/vc142.idb -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/vc142.pdb -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/vc143.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/vc143.idb -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/vc143.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/vc143.pdb -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/esp.obj.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/esp.obj.enc -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/vc142.pdb -------------------------------------------------------------------------------- /MhyprotSource/res/fonts/opensans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/fonts/opensans.ttf -------------------------------------------------------------------------------- /MhyprotSource/res/fonts/segoeuivf.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/res/fonts/segoeuivf.ttf -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Resource.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Resource.res -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Resource.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Resource.res -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.ilk -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/cgraphics.obj.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/cgraphics.obj.enc -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot Base Source.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot Base Source.ilk -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot Base Source.iobj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot Base Source.iobj -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //LOGs 3 | #ifdef _DEBUG 4 | #define log(text,...) //printf(text,__VA_ARGS__) 5 | #else 6 | #define log(text,...) 7 | #endif 8 | -------------------------------------------------------------------------------- /MhyprotSource/Release/PaladinsHack.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/Release/PaladinsHack.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/Release/PaladinsHack.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/Release/PaladinsHack.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/Release/PaladinsHack.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/Release/PaladinsHack.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/rc.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/rc.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/rc.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/rc.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/rc.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/rc.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/rc.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/PaladinsHack.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/rc.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/PaladinsHack.tlog/rc.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/rc.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/rc.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baseult/Tutorial-MHYProt-Source/HEAD/MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/rc.command.1.tlog -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.tlog/PaladinsHack.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.31.31103:TargetPlatformVersion=10.0.19041.0: 2 | Release|x64|C:\Sources\Arma3 - P\| 3 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.tlog/PaladinsHack.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.31.31103:TargetPlatformVersion=10.0.19041.0: 2 | Debug|x64|E:\Programmieren\Sources\Arma3 - P\| 3 | -------------------------------------------------------------------------------- /MhyprotSource/Release/PaladinsHack.tlog/PaladinsHack.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.31.31103:TargetPlatformVersion=10.0.19041.0: 2 | Release|Win32|C:\Sources\BlueFirePaladinsHack-master\| 3 | -------------------------------------------------------------------------------- /MhyprotSource/CGraphics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Vector3.h" 3 | 4 | class c_graphics_instance 5 | { 6 | public: 7 | static Vector3 world_to_screen(const Vector3 position); 8 | static bool initializeit(); 9 | private: 10 | }; 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot .38615e7b.tlog/Mhyprot Base Source.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: 2 | Debug|x64|E:\Programmieren\Tutorial MHYProt Source\| 3 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot .38615e7b.tlog/Mhyprot Base Source.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: 2 | Release|x64|E:\Programmieren\Tutorial MHYProt Source\| 3 | -------------------------------------------------------------------------------- /MhyprotSource/NoClip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Vector3.h" 3 | 4 | class Noclip 5 | { 6 | public: 7 | static void on_fast_update(); 8 | static void Initialize(); 9 | static void on_update(); 10 | static Vector3 current_position; 11 | 12 | private: 13 | static void calculate_new_position(); 14 | }; 15 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/PaladinsHack.exe.recipe: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:\Sources\Arma3 - P\x64\Release\PaladinsHack.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/PaladinsHack.exe.recipe: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | E:\Programmieren\Sources\Arma3 - P\x64\Debug\PaladinsHack.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Debug/Mhyprot Base Source.exe.recipe: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | E:\Programmieren\Tutorial MHYProt Source\x64\Debug\Mhyprot Base Source.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot Base Source.exe.recipe: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | E:\Programmieren\Tutorial MHYProt Source\x64\Release\Mhyprot Base Source.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mhyprot Driverbased Cheat with Nvidia Overlay 2 | External cheat base using Mhyprot to read and write Anticheat protected memory (EAC / BE) and nvidia hijack for overlay 3 | 4 | Credits to Bluefire for the original Source: https://github.com/LagradOst/BlueFirePaladinsHack 5 | 6 | I (Baseult) just updated and modified it, added new features and made it a usable base for reasearch purposes. 7 | -------------------------------------------------------------------------------- /MhyprotSource/res/img/speed.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /MhyprotSource/MhyprotSource.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | 6 | 7 | WindowsLocalDebugger 8 | 9 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | //#include 5 | #include 6 | 7 | struct handle_data 8 | { 9 | DWORD process_id; 10 | HWND window_handle; 11 | }; 12 | 13 | class Utils 14 | { 15 | public: 16 | //static DWORD GetPID(const std::wstring& procname); 17 | //static DWORD GetBase(DWORD PID, const std::wstring& modulename); 18 | static HWND find_main_window(DWORD process_id); 19 | }; 20 | -------------------------------------------------------------------------------- /MhyprotSource/Singleton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | class Singleton 5 | { 6 | protected: 7 | Singleton() {} 8 | ~Singleton() {} 9 | 10 | Singleton(const Singleton&) = delete; 11 | Singleton& operator=(const Singleton&) = delete; 12 | 13 | Singleton(Singleton&&) = delete; 14 | Singleton& operator=(Singleton&&) = delete; 15 | 16 | public: 17 | static T& Get() 18 | { 19 | static T inst{}; 20 | return inst; 21 | } 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /MhyprotSource/utils/Image.cpp: -------------------------------------------------------------------------------- 1 | #include "Image.h" 2 | #include 3 | 4 | Image::Image() 5 | : width(0) 6 | , height(0) 7 | , pixels(NULL) 8 | { 9 | } 10 | 11 | Image::~Image() 12 | { 13 | if (pixels != NULL) 14 | { 15 | delete[] pixels; 16 | } 17 | } 18 | 19 | bool Image::load(const char* filepath) 20 | { 21 | pixels = stbi_load(filepath, &width, &height, &bpp, 0); 22 | if (!pixels) 23 | { 24 | return false; 25 | } 26 | return true; 27 | } 28 | -------------------------------------------------------------------------------- /MhyprotSource/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | #define MAINICON 5 16 | -------------------------------------------------------------------------------- /MhyprotSource/Esp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Overlay.h" 4 | 5 | struct EspInfo 6 | { 7 | Vector3 Position; 8 | Vector3 HeadPosition; 9 | float Health; 10 | int entity; 11 | bool dead; 12 | bool ismyteam; 13 | std::string Name; 14 | }; 15 | 16 | namespace safe_esp 17 | { 18 | extern uint64_t mytarget; 19 | extern uint64_t skiptarget; 20 | extern std::set skiplist; 21 | extern float distancecheck; 22 | } 23 | 24 | class Esp 25 | { 26 | public: 27 | static void esp_draw(); 28 | static void esp_loop(); 29 | }; 30 | -------------------------------------------------------------------------------- /MhyprotSource/utils/Image.h: -------------------------------------------------------------------------------- 1 | #ifndef ROXLU_IMAGEH 2 | #define ROXLU_IMAGEH 3 | 4 | // AWESOME!!: http://nothings.org/ 5 | 6 | #include "stb_image.h" 7 | 8 | struct Image 9 | { 10 | int width; 11 | int height; 12 | int bpp; 13 | unsigned char* pixels; 14 | 15 | Image(); 16 | ~Image(); 17 | bool load(const char* filepath); 18 | int getWidth(); 19 | int getHeight(); 20 | int getComponents(); 21 | unsigned char* getPixels(); 22 | }; 23 | 24 | inline int Image::getComponents() 25 | { 26 | return bpp; 27 | } 28 | 29 | inline int Image::getWidth() 30 | { 31 | return width; 32 | } 33 | 34 | inline int Image::getHeight() 35 | { 36 | return height; 37 | } 38 | 39 | inline unsigned char* Image::getPixels() 40 | { 41 | return pixels; 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /MhyprotSource/Offsets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "Vector3.h" 5 | 6 | class initialize_offsets 7 | { 8 | public: 9 | static bool init_offsets(); 10 | static Vector3 local_player_position(); 11 | static bool is_valid(const uint64_t adress); 12 | }; 13 | 14 | 15 | extern uint64_t process_base; 16 | extern uint64_t m_world; 17 | extern uint64_t world; 18 | extern uint64_t camera; 19 | extern uint64_t current_object; 20 | extern uint64_t first_object; 21 | extern uint64_t camera_matrix; 22 | extern uint64_t gamex; 23 | extern uint64_t graphics; 24 | 25 | extern uint64_t midentlist; 26 | extern uint64_t entitylist; 27 | 28 | extern uint64_t m_entitylist; 29 | extern uint64_t m_midentlist; 30 | extern uint64_t m_entitylistcount; 31 | extern uint64_t m_midentlistcount; 32 | 33 | #define SCREEN_WIDTH 2560 //Enter your Screen Width 34 | #define SCREEN_HEIGHT 1440 //Enter your Screen Height 35 | -------------------------------------------------------------------------------- /MhyprotSource/Aimbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Overlay.h" 3 | #include "Vector3.h" 4 | 5 | class CEntity; 6 | 7 | struct TargetInfo 8 | { 9 | TargetInfo() 10 | { 11 | this->entity = 0; 12 | this->screenPosition = Vector3(0, 0, 0); 13 | this->screenPositionNoPredict = Vector3(0, 0, 0); 14 | this->velocity = Vector3(0, 0, 0); 15 | this->isInScreen = false; 16 | this->Position = Vector3(0, 0, 0); 17 | } 18 | 19 | Vector3 screenPosition; 20 | Vector3 screenPositionNoPredict; 21 | Vector3 Position; 22 | Vector3 velocity; 23 | uint64_t entity; 24 | bool isInScreen; 25 | }; 26 | 27 | class Aimbot 28 | { 29 | static void on_update(); 30 | public: 31 | static Vector3 predict_impact_pos(const Vector3& source, const Vector3& destination, const Vector3& target_velocity, Vector3& impact_coords, double& hittimetokill, double& hitvelocity, double& hitdistance); 32 | static void initialize(); 33 | 34 | static TargetInfo current_target; 35 | static bool is_lock; 36 | 37 | static TargetInfo get_best_target(); 38 | static TargetInfo get_target_info(uint64_t entity); 39 | }; 40 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/baseadress.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | uint64_t get_process_base(int pid); 4 | uint64_t get_process_id(const char* process_name); 5 | uint64_t get_process_id(); 6 | bool is_valid(uint64_t adress); 7 | 8 | bool read_raw(int pid, uint64_t address, void* buffer, size_t size); 9 | bool write_raw(int pid, uint64_t address, void* buffer, size_t size); 10 | 11 | template 12 | inline bool read(uint64_t address, T& value) 13 | { 14 | return read_raw(get_process_id(), address, &value, sizeof(T)); 15 | } 16 | 17 | template 18 | inline bool write(uint64_t address, const T& value) 19 | { 20 | if (is_valid(address)) 21 | { 22 | return write_raw(get_process_id(), address, (void*)&value, sizeof(T)); 23 | } 24 | return false; 25 | } 26 | 27 | template 28 | inline bool read_array(uint64_t address, T* array, size_t len) 29 | { 30 | return read_raw(get_process_id(), address, array, sizeof(T) * len); 31 | } 32 | 33 | template 34 | inline T read(uint64_t address) 35 | { 36 | T buffer{}; 37 | if (is_valid(address)) 38 | { 39 | read(address, buffer); 40 | } 41 | return buffer; 42 | } 43 | -------------------------------------------------------------------------------- /MhyprotSource/ImGui/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX11 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct ID3D11Device; 17 | struct ID3D11DeviceContext; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 20 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Use if you want to reset your rendering device without losing Dear ImGui state. 25 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 26 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 27 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/file_utils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #pragma once 27 | #include 28 | #include 29 | #include 30 | 31 | namespace file_utils 32 | { 33 | bool create_file_from_buffer(const std::string_view file_path, void* buffer, size_t size); 34 | } 35 | -------------------------------------------------------------------------------- /MhyprotSource/Resource.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | MAINICON ICON "Icon.ico" 5 | 6 | 7 | #define APSTUDIO_READONLY_SYMBOLS 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // 10 | // Generated from the TEXTINCLUDE 2 resource. 11 | // 12 | #include "winres.h" 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | #undef APSTUDIO_READONLY_SYMBOLS 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // Engelska (USA) resources 19 | 20 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE) 21 | LANGUAGE 29, 1 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "resource.h\0" 32 | END 33 | 34 | 2 TEXTINCLUDE 35 | BEGIN 36 | "#include ""winres.h""\r\n" 37 | "\0" 38 | END 39 | 40 | 3 TEXTINCLUDE 41 | BEGIN 42 | "\r\n" 43 | "\0" 44 | END 45 | 46 | #endif // APSTUDIO_INVOKED 47 | 48 | #endif // Engelska (USA) resources 49 | ///////////////////////////////////////////////////////////////////////////// 50 | 51 | 52 | 53 | #ifndef APSTUDIO_INVOKED 54 | ///////////////////////////////////////////////////////////////////////////// 55 | // 56 | // Generated from the TEXTINCLUDE 3 resource. 57 | // 58 | 59 | 60 | ///////////////////////////////////////////////////////////////////////////// 61 | #endif // not APSTUDIO_INVOKED -------------------------------------------------------------------------------- /Mhyptot Base Source.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31205.134 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MhyprotSource", "MhyprotSource\MhyprotSource.vcxproj", "{38615E7B-2999-42DB-A704-ED8E79B9A0B5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Debug|x64.ActiveCfg = Debug|x64 17 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Debug|x64.Build.0 = Debug|x64 18 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Debug|x86.ActiveCfg = Debug|Win32 19 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Debug|x86.Build.0 = Debug|Win32 20 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Release|x64.ActiveCfg = Release|x64 21 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Release|x64.Build.0 = Release|x64 22 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Release|x86.ActiveCfg = Release|Win32 23 | {38615E7B-2999-42DB-A704-ED8E79B9A0B5}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {9CBDC5DB-EE2A-4BF3-8678-ECF92361FFF1} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /MhyprotSource/Inputs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "Singleton.h" 10 | 11 | enum class KeyState 12 | { 13 | None = 1, 14 | Down, 15 | Up, 16 | Pressed /*Down and then up*/ 17 | }; 18 | 19 | DEFINE_ENUM_FLAG_OPERATORS(KeyState); 20 | 21 | class InputSys 22 | : public Singleton 23 | { 24 | friend class Singleton; 25 | 26 | InputSys(); 27 | ~InputSys(); 28 | 29 | public: 30 | void initialize(HWND h_target_window); 31 | void shutdown(); 32 | 33 | HWND GetMainWindow() const { return m_hTargetWindow; } 34 | 35 | KeyState get_key_state(uint32_t vk) const; 36 | bool is_key_down(uint32_t vk) const; 37 | bool was_key_pressed(uint32_t vk); 38 | 39 | void register_hotkey(uint32_t vk, const std::function& f); 40 | void remove_hotkey(uint32_t vk); 41 | 42 | static void move_mouse(int x, int y); 43 | 44 | static void left_down(); 45 | static void left_up(); 46 | 47 | private: 48 | static LRESULT WINAPI wnd_proc(HWND h_wnd, UINT msg, WPARAM w_param, LPARAM l_param); 49 | 50 | bool process_message(UINT u_msg, WPARAM w_param, LPARAM l_param); 51 | bool process_mouse_message(const UINT u_msg, const WPARAM w_param); 52 | bool process_keybd_message(const UINT u_msg, const WPARAM w_param); 53 | 54 | 55 | HWND m_hTargetWindow; 56 | LONG_PTR m_originalWndProc; 57 | KeyState m_iKeyMap[256]{}; 58 | 59 | std::function m_Hotkeys[256]; 60 | }; -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/logger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #pragma once 27 | #include 28 | 29 | #define LOG_ERROR() \ 30 | logger::log2(skCrypt("[!] failed at in %s:%d, (0x%lX)\n"), __FILE__, __LINE__, GetLastError()) 31 | 32 | namespace logger 33 | { 34 | template 35 | __forceinline void log2(const char* format, const T& ... args) 36 | { 37 | printf(format, args ...); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/file_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #include "file_utils.hpp" 27 | 28 | // 29 | // create file from memory 30 | // 31 | bool file_utils::create_file_from_buffer( 32 | const std::string_view file_path, void* buffer, size_t size 33 | ) 34 | { 35 | std::ofstream stream( 36 | file_path.data(), 37 | std::ios_base::out | std::ios_base::binary 38 | ); 39 | 40 | if (!stream.write(static_cast(buffer), size)) 41 | { 42 | stream.close(); 43 | return false; 44 | } 45 | 46 | stream.close(); 47 | return true; 48 | } 49 | -------------------------------------------------------------------------------- /MhyprotSource/Overlay.h: -------------------------------------------------------------------------------- 1 | #define _CRT_SECURE_NO_WARNINGS 2 | 3 | #ifndef FOverlay_H 4 | #define FOverlay_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #pragma comment(lib, "Dwrite") 12 | 13 | #pragma comment(lib, "Dwmapi.lib") 14 | #pragma comment(lib, "d2d1.lib") 15 | 16 | 17 | #define _CRT_SECURE_NO_DEPRECATE 18 | #define _CRT_SECURE_NO_WARNINGS 19 | 20 | class FOverlay 21 | { 22 | public: 23 | static int screen_height; 24 | static int screen_width; 25 | static void window_set_style(); 26 | static void window_set_transparency(); 27 | static void window_set_top_most(); 28 | static HWND retrieve_window(); 29 | static void create_window(); 30 | static BOOL window_init(bool use_nvidia_overlay); 31 | static void d2d_shutdown(); 32 | BOOL init_d2d() const; 33 | static void begin_scene(); 34 | static void end_scene(); 35 | static void clear_scene(); 36 | static void draw_text_white(int x, int y, const char* str, ...); 37 | static void draw_text_red(int x, int y, const char* str, ...); 38 | static void draw_text_green(int x, int y, const char* str, ...); 39 | static void clear_screen(); 40 | static void draw_text(int x, int y, void* color, const char* str, ...); 41 | static void draw_line(int x1, int y1, int x2, int y2, D2D1::ColorF color); 42 | static void draw_arc(const int x, const int y, int radius, const int start_angle, const int percent, const int thickness, void* color); 43 | void draw_rect(int x1, int y1, int x2, int y2, void* color) const; 44 | void draw_box(int x, int y, float width, float height, void* color) const; 45 | static void draw_box(D2D1_RECT_F rect, void* color); 46 | static void draw_circle(int x, int y, float radius, float width, void* color); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/win_utils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #pragma once 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include "logger.hpp" 33 | #include "nt.hpp" 34 | 35 | #define CHECK_HANDLE(x) (x && x != INVALID_HANDLE_VALUE) 36 | #define MIN_ADDRESS ((ULONG_PTR)0x8000000000000000) 37 | 38 | namespace win_utils 39 | { 40 | using unique_handle = std::unique_ptr; 41 | 42 | uint32_t find_process_id(const std::string_view process_name); 43 | uint64_t find_base_address(const uint32_t process_id); 44 | 45 | uint64_t obtain_sysmodule_address(const std::string_view target_module_name, bool debug_prints = false); 46 | } 47 | -------------------------------------------------------------------------------- /MhyprotSource/settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ImGui/imgui.h" 5 | 6 | ImVec4 hex(int hex, float alpha = 1.0); 7 | ImVec4 operator "" _h(unsigned long long h); 8 | #define AIMBOT 9 | #define AIMBOT_PREDICTION 10 | #define NORECOIL 11 | //#define TRIGGERBOT 12 | #define GLOW 13 | #define THIRDPERSON 14 | #define NAME_ESP 15 | #define ESP 16 | //#define BONES 17 | #define HP_NAME 18 | #define HP_BAR 19 | 20 | extern int run_speed; 21 | extern bool no_clip; 22 | extern float no_clip_speed; 23 | extern bool esp; 24 | extern bool tracers; 25 | extern int aimbot_fov; 26 | extern float aim_height; 27 | extern float aimbot_speed; 28 | extern float bulletspeed; 29 | extern float bulletgravity; 30 | extern bool spoof; 31 | extern long targetobject; 32 | extern bool aimbot; 33 | extern float humanizer; 34 | extern bool autoshoot; 35 | extern bool warningtracers; 36 | extern bool is_hold; 37 | extern bool invert_hold; 38 | extern int hold_key_index; 39 | extern int hold_key; 40 | extern bool is_aimbot_on; 41 | extern bool aimbot_fov_enabled; 42 | extern float upmove; 43 | extern float velocityreal; 44 | 45 | 46 | extern float velocity; 47 | extern float ttk; 48 | 49 | constexpr int hold_size = 15; 50 | static const char* hold_keys[hold_size]{ 51 | "Left mouse button", 52 | "Right mouse button", 53 | "Middle mouse button", 54 | "TAB key", 55 | "SHIFT key", 56 | "CTRL key", 57 | "ALT key", 58 | "DEL key", 59 | "INS key", 60 | "Numeric keypad 0 key", 61 | "NUM LOCK key", 62 | "Left SHIFT key", 63 | "Right SHIFT key", 64 | "Left CONTROL key", 65 | "Right CONTROL key", 66 | }; 67 | 68 | static constexpr int hold_keys_codes[hold_size]{ 69 | VK_LBUTTON, 70 | VK_RBUTTON, 71 | VK_MBUTTON, 72 | VK_TAB, 73 | VK_SHIFT, 74 | VK_CONTROL, 75 | VK_MENU, 76 | VK_DELETE, 77 | VK_INSERT, 78 | VK_NUMPAD0, 79 | VK_NUMLOCK, 80 | VK_LSHIFT, 81 | VK_RSHIFT, 82 | VK_LCONTROL, 83 | VK_RCONTROL, 84 | }; 85 | 86 | bool save_config(); 87 | bool load_config(); 88 | -------------------------------------------------------------------------------- /MhyprotSource/MhyprotSource.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/service_utils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #pragma once 27 | #include 28 | #include 29 | 30 | #include "logger.hpp" 31 | #include "win_utils.hpp" 32 | #include "mhyprot.hpp" 33 | #include "../skCrypter.h" 34 | 35 | #define CHECK_SC_MANAGER_HANDLE(x, ret_type) \ 36 | if (!CHECK_HANDLE(x)) \ 37 | { \ 38 | logger::log2(skCrypt("[!] failed to obtain service manager handle. (0x%lX)\n"), GetLastError()); \ 39 | return ret_type; \ 40 | } 41 | 42 | namespace service_utils 43 | { 44 | SC_HANDLE open_sc_manager(); 45 | 46 | SC_HANDLE create_service(const std::string_view driver_path); 47 | bool delete_service(SC_HANDLE service_handle, bool close_on_fail = true, bool close_on_success = true); 48 | 49 | bool start_service(SC_HANDLE service_handle); 50 | bool stop_service(SC_HANDLE service_handle); 51 | } 52 | -------------------------------------------------------------------------------- /MhyprotSource/x64/Release/Mhyprot Base Source.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\vc142.pdb 2 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\win_utils.obj 3 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\utils.obj 4 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\service_utils.obj 5 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\mhyprot.obj 6 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\file_utils.obj 7 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\baseadress.obj 8 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui_widgets.obj 9 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui_tables.obj 10 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui_impl_win32.obj 11 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui_impl_dx11.obj 12 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui_draw.obj 13 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui_demo.obj 14 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\imgui.obj 15 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\main.obj 16 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\inputs.obj 17 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\coding.obj 18 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\image.obj 19 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\settings.obj 20 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\quartic.obj 21 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\overlay.obj 22 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\offsets.obj 23 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\mhyprot .38615e7b.tlog\cl.command.1.tlog 24 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\mhyprot .38615e7b.tlog\cl.read.1.tlog 25 | e:\programmieren\tutorial mhyprot source\mhyprotsource\x64\release\mhyprot .38615e7b.tlog\cl.write.1.tlog 26 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | BOOL is_main_window(const HWND handle) 4 | { 5 | return GetWindow(handle, GW_OWNER) == static_cast(nullptr) && IsWindowVisible(handle); 6 | } 7 | 8 | BOOL CALLBACK enum_windows_callback(const HWND handle, const LPARAM l_param) 9 | { 10 | handle_data& data = *(handle_data*)l_param; 11 | unsigned long process_id = 0; 12 | GetWindowThreadProcessId(handle, &process_id); 13 | if (data.process_id != process_id || !is_main_window(handle)) 14 | return TRUE; 15 | data.window_handle = handle; 16 | return FALSE; 17 | } 18 | 19 | HWND Utils::find_main_window(const DWORD process_id) 20 | { 21 | handle_data data; 22 | data.process_id = process_id; 23 | data.window_handle = nullptr; 24 | EnumWindows(enum_windows_callback, reinterpret_cast(&data)); 25 | return data.window_handle; 26 | } 27 | 28 | //DWORD Utils::GetBase(DWORD PID, const std::wstring& modulename) 29 | //{ 30 | // HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, PID); 31 | // DWORD dwModuleBaseAddress = 0; 32 | // if (hSnapshot != INVALID_HANDLE_VALUE) 33 | // { 34 | // MODULEENTRY32 ModuleEntry32 = { 0 }; 35 | // ModuleEntry32.dwSize = sizeof(MODULEENTRY32); 36 | // if (Module32First(hSnapshot, &ModuleEntry32)) 37 | // { 38 | // do 39 | // { 40 | // if (!modulename.compare(ModuleEntry32.szModule)) 41 | // { 42 | // dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr; 43 | // break; 44 | // } 45 | // } while (Module32Next(hSnapshot, &ModuleEntry32)); 46 | // } 47 | // CloseHandle(hSnapshot); 48 | // } 49 | // return dwModuleBaseAddress; 50 | //} 51 | 52 | //DWORD Utils::GetPID(const std::wstring& procname) 53 | //{ 54 | // PROCESSENTRY32 processInfo; 55 | // processInfo.dwSize = sizeof(processInfo); 56 | // 57 | // HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); 58 | // if (processesSnapshot == INVALID_HANDLE_VALUE) { 59 | // return 0; 60 | // } 61 | // 62 | // Process32First(processesSnapshot, &processInfo); 63 | // if (!procname.compare(processInfo.szExeFile)) 64 | // { 65 | // CloseHandle(processesSnapshot); 66 | // return processInfo.th32ProcessID; 67 | // } 68 | // 69 | // while (Process32Next(processesSnapshot, &processInfo)) 70 | // { 71 | // if (!procname.compare(processInfo.szExeFile)) 72 | // { 73 | // CloseHandle(processesSnapshot); 74 | // return processInfo.th32ProcessID; 75 | // } 76 | // } 77 | // 78 | // CloseHandle(processesSnapshot); 79 | // return 0; 80 | //} 81 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /MhyprotSource/settings.cpp: -------------------------------------------------------------------------------- 1 | #include "settings.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | ImVec4 hex(const int hex, const float alpha) 8 | { 9 | const int red = (hex >> 16) & 255; 10 | const int green = (hex >> 8) & 255; 11 | const int blue = (hex >> 0) & 255; 12 | return {red / 255.f, green / 255.f, blue / 255.f, alpha}; 13 | } 14 | 15 | // handy way to convert to ImVec4 from hex 16 | ImVec4 operator "" _h(const unsigned long long h) 17 | { 18 | return hex(static_cast(h)); 19 | } 20 | 21 | int run_speed = 5; 22 | bool no_clip = false; 23 | float no_clip_speed = 0.25; 24 | bool esp = true; 25 | bool tracers = false; 26 | bool warningtracers = false; 27 | bool spoof = false; 28 | int aimbot_fov = 200; 29 | float aim_height = 0.7f; 30 | float aimbot_speed = 0.5; 31 | long targetobject = 0; 32 | bool autoshoot = false; 33 | bool aimbot = false; 34 | float humanizer = 0.5f; 35 | bool is_hold = true; 36 | bool invert_hold = false; 37 | int hold_key_index = -1; 38 | int hold_key = VK_SPACE; 39 | bool is_aimbot_on = false; 40 | bool aimbot_fov_enabled = false; 41 | float bulletspeed = 550.f; 42 | float bulletgravity = 8.5f; 43 | float upmove = 0.f; 44 | 45 | float velocity; 46 | float ttk; 47 | float velocityreal; 48 | 49 | constexpr auto configFileName = "config.ini"; 50 | 51 | #define NAMEOF(name) #name 52 | 53 | bool save_config() 54 | { 55 | #define WRITE(variable) outfile << NAMEOF(variable) << "=" << variable << std::endl; 56 | #define WRITE4(variable) WRITE(variable.x) WRITE(variable.y) WRITE(variable.z) WRITE(variable.w); 57 | 58 | std::ofstream outfile(configFileName); 59 | 60 | outfile.close(); 61 | std::cout << "Saved Config.\n" << std::endl; 62 | 63 | return true; 64 | } 65 | 66 | bool load_config() 67 | { 68 | std::map values; 69 | 70 | std::ifstream myfile; 71 | myfile.open(configFileName); 72 | if (myfile.is_open()) 73 | { 74 | std::string line; 75 | long long count = 0; 76 | while (std::getline(myfile, line)) 77 | { 78 | line.erase(std::remove_if(line.begin(), line.end(), isspace), 79 | line.end()); 80 | if (line[0] == '[' || line[0] == ';' || line.empty()) // COMMETS 81 | continue; 82 | auto delimiterPos = line.find("="); 83 | auto name = line.substr(0, delimiterPos); 84 | auto value = line.substr(delimiterPos + 1); 85 | values[name] = value; 86 | } 87 | myfile.close(); 88 | 89 | #define READ(variable) if(values.find(NAMEOF(variable)) != values.end()) variable = atof(values[NAMEOF(variable)].c_str()); 90 | #define READ4(variable) READ(variable.x) READ(variable.y) READ(variable.z) READ(variable.w); 91 | 92 | std::cout << "Loaded Config.\n" << std::endl; 93 | } 94 | else 95 | { 96 | std::cout << "Failed to read config.\n" << std::endl; 97 | } 98 | 99 | return true; 100 | } 101 | -------------------------------------------------------------------------------- /MhyprotSource/ImGui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for Windows (standard windows API for 32 and 64 bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) 6 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 7 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 8 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 9 | 10 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 11 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 12 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 13 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 14 | 15 | #pragma once 16 | #include "imgui.h" // IMGUI_IMPL_API 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 19 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 21 | 22 | // Win32 message handler your application need to call. 23 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 24 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 25 | #if 0 26 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 27 | #endif 28 | 29 | // DPI-related helpers (optional) 30 | // - Use to enable DPI awareness without having to create an application manifest. 31 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 32 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 33 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 34 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 35 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 36 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 37 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 38 | 39 | // Transparency related helpers (optional) [experimental] 40 | // - Use to enable alpha compositing transparency with the desktop. 41 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 42 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 43 | -------------------------------------------------------------------------------- /MhyprotSource/quartic.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2016 by Саша Миленковић * 3 | * sasa.milenkovic.xyz@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * ( http://www.gnu.org/licenses/gpl-3.0.en.html ) * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef QUARTIC_H_INCLUDED 22 | #define QUARTIC_H_INCLUDED 23 | 24 | #include 25 | 26 | const double PI = 3.141592653589793238463L; 27 | const double M_2PI = 2*PI; 28 | const double eps=1e-12; 29 | 30 | typedef std::complex DComplex; 31 | 32 | //--------------------------------------------------------------------------- 33 | // useful for testing 34 | inline DComplex polinom_2(DComplex x, double a, double b) 35 | { 36 | //Horner's scheme for x*x + a*x + b 37 | return x * (x + a) + b; 38 | } 39 | 40 | //--------------------------------------------------------------------------- 41 | // useful for testing 42 | inline DComplex polinom_3(DComplex x, double a, double b, double c) 43 | { 44 | //Horner's scheme for x*x*x + a*x*x + b*x + c; 45 | return x * (x * (x + a) + b) + c; 46 | } 47 | 48 | //--------------------------------------------------------------------------- 49 | // useful for testing 50 | inline DComplex polinom_4(DComplex x, double a, double b, double c, double d) 51 | { 52 | //Horner's scheme for x*x*x*x + a*x*x*x + b*x*x + c*x + d; 53 | return x * (x * (x * (x + a) + b) + c) + d; 54 | } 55 | 56 | //--------------------------------------------------------------------------- 57 | // x - array of size 3 58 | // In case 3 real roots: => x[0], x[1], x[2], return 3 59 | // 2 real roots: x[0], x[1], return 2 60 | // 1 real root : x[0], x[1] ± i*x[2], return 1 61 | unsigned int solveP3(double* x, double a, double b, double c); 62 | 63 | //--------------------------------------------------------------------------- 64 | // Solve quartic equation x^4 + a*x^3 + b*x^2 + c*x + d 65 | // (attention - this function returns dynamically allocated array. It has to be released afterwards) 66 | DComplex* solve_quartic(double a, double b, double c, double d); 67 | 68 | #endif // QUARTIC_H_INCLUDED 69 | -------------------------------------------------------------------------------- /MhyprotSource/Offsets.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Offsets.h" 3 | #include "skCrypter.h" 4 | #include "Vector3.h" 5 | #include "Mhyprot/baseadress.h" 6 | 7 | uint64_t m_entitylist = 0x00; 8 | uint64_t m_entitylistcount = 0x00; 9 | uint64_t m_world = 0x00; 10 | 11 | uint64_t process_base = 0x0; 12 | uint64_t world = 0x0; 13 | uint64_t camera = 0x0; 14 | uint64_t entitylist = 0x0; 15 | 16 | bool initialize_offsets::init_offsets() 17 | { 18 | 19 | auto process_name = skCrypt("game.exe"); 20 | const auto process_id = get_process_id(process_name); 21 | process_base = get_process_base(process_id); 22 | 23 | world = read(process_base + m_world); 24 | camera = read(world + 0x00); 25 | entitylist = read(world + m_entitylist); 26 | 27 | return true; 28 | 29 | } 30 | 31 | Vector3 initialize_offsets::local_player_position() 32 | { 33 | //Yes I could just read it as Vector3 once instead but doing it this way for novices to understand 34 | const auto myposx = read(world + 0x00); //Get your X position 35 | const auto myposy = read(world + 0x00); //Get your Y position 36 | const auto myposz = read(world + 0x00); //Get your Z position 37 | return {myposx, myposy, myposz}; 38 | } 39 | 40 | bool initialize_offsets::is_valid(const uint64_t adress) 41 | { 42 | if (adress <= 0x400000 || adress == 0xCCCCCCCCCCCCCCCC || reinterpret_cast(adress) == nullptr || adress > 43 | 0x7FFFFFFFFFFFFFFF) 44 | { 45 | return false; 46 | } 47 | 48 | return true; 49 | } 50 | 51 | //bool Example_Patternscan() { 52 | // 53 | // auto TestPatternscan = PatternScan(process_base, skCrypt("48 8B 0D ? ? ? ? 48 85 C9 0F 84 ? ? ? ? 48"), 3); 54 | //} 55 | // 56 | //template 57 | //T PatternScan(uintptr_t moduleAdress, const char* signature, int offset) { 58 | // int instructionLength = offset + sizeof(T); 59 | // IMAGE_DOS_HEADER dos_header; 60 | // IMAGE_NT_HEADERS64 nt_headers; 61 | // read(process_base, dos_header); 62 | // read(process_base + dos_header.e_lfanew, nt_headers); 63 | // 64 | // const size_t target_len = nt_headers.OptionalHeader.SizeOfImage; 65 | // 66 | // static auto patternToByte = [](const char* pattern) 67 | // { 68 | // auto bytes = std::vector{}; 69 | // const auto start = const_cast(pattern); 70 | // const auto end = const_cast(pattern) + strlen(pattern); 71 | // 72 | // for (auto current = start; current < end; ++current) 73 | // { 74 | // if (*current == '?') 75 | // { 76 | // ++current; 77 | // bytes.push_back(-1); 78 | // } 79 | // else { bytes.push_back(strtoul(current, ¤t, 16)); } 80 | // } 81 | // return bytes; 82 | // }; 83 | // 84 | // auto patternBytes = patternToByte(signature); 85 | // const auto s = patternBytes.size(); 86 | // const auto d = patternBytes.data(); 87 | // 88 | // auto target = std::unique_ptr(new uint8_t[target_len]); 89 | // if (read_array(process_base, target.get(), target_len)) { 90 | // for (auto i = 0ul; i < nt_headers.OptionalHeader.SizeOfImage - s; ++i) 91 | // { 92 | // bool found = true; 93 | // for (auto j = 0ul; j < s; ++j) 94 | // { 95 | // if (target[static_cast(i) + j] != d[j] && d[j] != -1) 96 | // { 97 | // found = false; 98 | // break; 99 | // } 100 | // } 101 | // if (found) { 102 | // return read(moduleAdress + i + offset) + i + instructionLength; 103 | // } 104 | // } 105 | // } 106 | // 107 | // return NULL; 108 | //} 109 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/mhyprot.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #pragma once 27 | #include 28 | #include 29 | #include 30 | 31 | #include "logger.hpp" 32 | #include "raw_driver.hpp" 33 | #include "file_utils.hpp" 34 | #include "service_utils.hpp" 35 | 36 | #define MHYPROT_SERVICE_NAME "mhyprot2" 37 | #define MHYPROT_DISPLAY_NAME "mhyprot2" 38 | #define MHYPROT_SYSFILE_NAME "mhyprot.sys" 39 | #define MHYPROT_SYSMODULE_NAME "mhyprot2.sys" 40 | 41 | #define MHYPROT_DEVICE_NAME "\\\\?\\\\mhyprot2" 42 | 43 | #define MHYPROT_IOCTL_INITIALIZE 0x80034000 44 | #define MHYPROT_IOCTL_READ_KERNEL_MEMORY 0x83064000 45 | #define MHYPROT_IOCTL_READ_WRITE_USER_MEMORY 0x81074000 46 | 47 | #define MHYPROT_ACTION_READ 0x0 48 | #define MHYPROT_ACTION_WRITE 0x1 49 | 50 | #define MHYPROT_OFFSET_SEEDMAP 0xA0E8 51 | 52 | namespace mhyprot 53 | { 54 | typedef struct _MHYPROT_INITIALIZE 55 | { 56 | DWORD _m_001; 57 | DWORD _m_002; 58 | DWORD64 _m_003; 59 | } MHYPROT_INITIALIZE, *PMHYPROT_INITIALIZE; 60 | 61 | typedef struct _MHYPROT_KERNEL_READ_REQUEST 62 | { 63 | union _HEADER 64 | { 65 | DWORD result; 66 | DWORD64 address; 67 | } header; 68 | 69 | ULONG size; 70 | } MHYPROT_KERNEL_READ_REQUEST, *PMHYPROT_KERNEL_READ_REQUEST; 71 | 72 | typedef struct _MHYPROT_USER_READ_WRITE_REQUEST 73 | { 74 | DWORD64 random_key; 75 | DWORD action; 76 | DWORD unknown_00; 77 | DWORD process_id; 78 | DWORD unknown_01; 79 | DWORD64 buffer; 80 | DWORD64 address; 81 | ULONG size; 82 | ULONG unknown_02; 83 | } MHYPROT_USER_READ_WRITE_REQUEST, *PMHYPROT_USER_READ_WRITE_REQUEST; 84 | 85 | namespace detail 86 | { 87 | inline HANDLE device_handle; 88 | inline uint64_t seedmap[312]; 89 | inline SC_HANDLE mhyplot_service_handle; 90 | } 91 | 92 | bool init(); 93 | void unload(); 94 | 95 | namespace driver_impl 96 | { 97 | bool request_ioctl(DWORD ioctl_code, LPVOID in_buffer, DWORD in_buffer_size); 98 | bool driver_init(bool debug_prints = false, bool print_seeds = false); 99 | uint64_t generate_key(uint64_t seed); 100 | void encrypt_payload(void* payload, size_t size); 101 | 102 | bool read_kernel_memory(uint64_t address, void* buffer, size_t size); 103 | 104 | template 105 | __forceinline T read_kernel_memory(uint64_t address) 106 | { 107 | T buffer; 108 | read_kernel_memory(address, &buffer, sizeof(T)); 109 | return buffer; 110 | } 111 | 112 | bool read_user_memory(uint32_t process_id, uint64_t address, void* buffer, size_t size); 113 | 114 | template 115 | __forceinline T read_user_memory(uint32_t process_id, uint64_t address) 116 | { 117 | T buffer; 118 | read_user_memory(process_id, address, &buffer, sizeof(T)); 119 | return buffer; 120 | } 121 | 122 | bool write_user_memory(uint32_t process_id, uint64_t address, void* buffer, size_t size); 123 | 124 | template 125 | __forceinline bool write_user_memory(uint32_t process_id, uint64_t address, T value) 126 | { 127 | return write_user_memory(process_id, address, &value, sizeof(T)); 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /MhyprotSource/skCrypter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /*____________________________________________________________________________________________________________ 4 | 5 | Original Author: skadro 6 | Github: https://github.com/skadro-official 7 | License: See end of file 8 | 9 | skCrypter 10 | Compile-time, Usermode + Kernelmode, safe and lightweight string crypter library for C++11+ 11 | 12 | *Not removing this part is appreciated* 13 | ____________________________________________________________________________________________________________*/ 14 | 15 | #ifdef _KERNEL_MODE 16 | namespace std 17 | { 18 | // STRUCT TEMPLATE remove_reference 19 | template 20 | struct remove_reference { 21 | using type = _Ty; 22 | }; 23 | 24 | template 25 | struct remove_reference<_Ty&> { 26 | using type = _Ty; 27 | }; 28 | 29 | template 30 | struct remove_reference<_Ty&&> { 31 | using type = _Ty; 32 | }; 33 | 34 | template 35 | using remove_reference_t = typename remove_reference<_Ty>::type; 36 | 37 | // STRUCT TEMPLATE remove_const 38 | template 39 | struct remove_const { // remove top-level const qualifier 40 | using type = _Ty; 41 | }; 42 | 43 | template 44 | struct remove_const { 45 | using type = _Ty; 46 | }; 47 | 48 | template 49 | using remove_const_t = typename remove_const<_Ty>::type; 50 | } 51 | #else 52 | #include 53 | #endif 54 | 55 | namespace skc 56 | { 57 | template 58 | using clean_type = typename std::remove_const_t>; 59 | 60 | template 61 | class skCrypter 62 | { 63 | public: 64 | __forceinline constexpr skCrypter(T* data) 65 | { 66 | crypt(data); 67 | } 68 | 69 | __forceinline T* get() 70 | { 71 | return _storage; 72 | } 73 | 74 | __forceinline int size() // (w)char count 75 | { 76 | return _size; 77 | } 78 | 79 | __forceinline char key() 80 | { 81 | return _key1; 82 | } 83 | 84 | __forceinline T* encrypt() 85 | { 86 | if (!isEncrypted()) 87 | crypt(_storage); 88 | 89 | return _storage; 90 | } 91 | 92 | __forceinline T* decrypt() 93 | { 94 | if (isEncrypted()) 95 | crypt(_storage); 96 | 97 | return _storage; 98 | } 99 | 100 | __forceinline bool isEncrypted() 101 | { 102 | return _storage[_size - 1] != 0; 103 | } 104 | 105 | __forceinline void clear() // set full storage to 0 106 | { 107 | for (int i = 0; i < _size; i++) 108 | { 109 | _storage[i] = 0; 110 | } 111 | } 112 | 113 | __forceinline operator T*() 114 | { 115 | decrypt(); 116 | 117 | return _storage; 118 | } 119 | 120 | private: 121 | __forceinline constexpr void crypt(T* data) 122 | { 123 | for (int i = 0; i < _size; i++) 124 | { 125 | _storage[i] = data[i] ^ (_key1 + i % (1 + _key2)); 126 | } 127 | } 128 | 129 | T _storage[_size]{}; 130 | }; 131 | } 132 | 133 | #define skCrypt(str) skCrypt_key(str, __TIME__[4], __TIME__[7]) 134 | #define skCrypt_key(str, key1, key2) []() { \ 135 | constexpr static auto crypted = skc::skCrypter \ 136 | >((skc::clean_type*)str); \ 137 | return crypted; }() 138 | 139 | /*________________________________________________________________________________ 140 | 141 | MIT License 142 | 143 | Copyright (c) 2020 skadro 144 | 145 | Permission is hereby granted, free of charge, to any person obtaining a copy 146 | of this software and associated documentation files (the "Software"), to deal 147 | in the Software without restriction, including without limitation the rights 148 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 149 | copies of the Software, and to permit persons to whom the Software is 150 | furnished to do so, subject to the following conditions: 151 | 152 | The above copyright notice and this permission notice shall be included in all 153 | copies or substantial portions of the Software. 154 | 155 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 156 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 157 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 158 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 159 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 160 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 161 | SOFTWARE. 162 | 163 | ________________________________________________________________________________*/ 164 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/service_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #include "service_utils.hpp" 27 | #include "../skCrypter.h" 28 | 29 | // 30 | // open service control manager to operate services 31 | // 32 | SC_HANDLE service_utils::open_sc_manager() 33 | { 34 | return OpenSCManager(nullptr, nullptr, SC_MANAGER_CREATE_SERVICE); 35 | } 36 | 37 | // 38 | // create a new service 39 | // sc create myservice binPath="" type=kernel 40 | // 41 | SC_HANDLE service_utils::create_service(const std::string_view driver_path) 42 | { 43 | const SC_HANDLE sc_manager_handle = open_sc_manager(); 44 | 45 | CHECK_SC_MANAGER_HANDLE(sc_manager_handle, (SC_HANDLE)INVALID_HANDLE_VALUE); 46 | 47 | const SC_HANDLE mhyprot_service_handle = CreateService( 48 | sc_manager_handle, 49 | MHYPROT_SERVICE_NAME, 50 | MHYPROT_DISPLAY_NAME, 51 | SERVICE_START | SERVICE_STOP | DELETE, 52 | SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, 53 | driver_path.data(), nullptr, nullptr, nullptr, nullptr, nullptr 54 | ); 55 | 56 | if (!CHECK_HANDLE(mhyprot_service_handle)) 57 | { 58 | if (const auto last_error = GetLastError(); last_error == ERROR_SERVICE_EXISTS) 59 | { 60 | logger::log2(skCrypt("[+] the service already exists, open handle\n")); 61 | 62 | return OpenService( 63 | sc_manager_handle, 64 | MHYPROT_SERVICE_NAME, 65 | SERVICE_START | SERVICE_STOP | DELETE 66 | ); 67 | } 68 | 69 | logger::log2(skCrypt("[!] failed to create %s service. (0x%lX)\n"), MHYPROT_SERVICE_NAME, GetLastError()); 70 | CloseServiceHandle(sc_manager_handle); 71 | return static_cast((INVALID_HANDLE_VALUE)); 72 | } 73 | 74 | CloseServiceHandle(sc_manager_handle); 75 | 76 | return mhyprot_service_handle; 77 | } 78 | 79 | // 80 | // delete the service 81 | // sc delete myservice 82 | // 83 | bool service_utils::delete_service(const SC_HANDLE service_handle, const bool close_on_fail, const bool close_on_success) 84 | { 85 | const SC_HANDLE sc_manager_handle = open_sc_manager(); 86 | 87 | CHECK_SC_MANAGER_HANDLE(sc_manager_handle, false); 88 | 89 | if (!DeleteService(service_handle)) 90 | { 91 | if (const auto last_error = GetLastError(); last_error == ERROR_SERVICE_MARKED_FOR_DELETE) 92 | { 93 | CloseServiceHandle(sc_manager_handle); 94 | return true; 95 | } 96 | 97 | logger::log2(skCrypt("[!] failed to delete the service. (0x%lX)\n"), GetLastError()); 98 | CloseServiceHandle(sc_manager_handle); 99 | if (close_on_fail) CloseServiceHandle(service_handle); 100 | return false; 101 | } 102 | 103 | CloseServiceHandle(sc_manager_handle); 104 | if (close_on_success) CloseServiceHandle(service_handle); 105 | 106 | return true; 107 | } 108 | 109 | // 110 | // start the service 111 | // sc start myservice 112 | // 113 | bool service_utils::start_service(const SC_HANDLE service_handle) 114 | { 115 | return StartService(service_handle, 0, nullptr); 116 | } 117 | 118 | // 119 | // stop the service 120 | // sc stop myservice 121 | // 122 | bool service_utils::stop_service(const SC_HANDLE service_handle) 123 | { 124 | const SC_HANDLE sc_manager_handle = open_sc_manager(); 125 | 126 | CHECK_SC_MANAGER_HANDLE(sc_manager_handle, false); 127 | 128 | SERVICE_STATUS service_status; 129 | 130 | if (!ControlService(service_handle, SERVICE_CONTROL_STOP, &service_status)) 131 | { 132 | logger::log2(skCrypt("[!] failed to stop the service. (0x%lX)\n"), GetLastError()); 133 | CloseServiceHandle(sc_manager_handle); 134 | return false; 135 | } 136 | 137 | CloseServiceHandle(sc_manager_handle); 138 | 139 | return true; 140 | } 141 | -------------------------------------------------------------------------------- /MhyprotSource/NoClip.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "Noclip.h" 4 | #include "Inputs.h" 5 | #include "Offsets.h" 6 | #include "settings.h" 7 | #include "skCrypter.h" 8 | #include "../MhyprotSource/Mhyprot/baseadress.h" 9 | 10 | # define PI 3.14159265358979323846f /* pi */ 11 | 12 | bool do_init = true; 13 | bool noclip_active = false; 14 | 15 | uint64_t local_player = 0; 16 | uint64_t m_player_base = 0; 17 | Vector3 m_view_angles = Vector3(0, 0, 0); 18 | Vector3 Noclip::current_position = Vector3(0, 0, 0); 19 | Vector3 m_position = Vector3(0, 0, 0); 20 | uint64_t process_basey; 21 | 22 | //Selfcoded trash method of doing noclip. someon please recode this in a better way 23 | 24 | int get_foward_factor() //get w and s movement 25 | { 26 | int ws_factor = 0; 27 | if (GetAsyncKeyState(0x57) & 0x8000) ++ws_factor; 28 | if (GetAsyncKeyState(0x53) & 0x8000) --ws_factor; 29 | return ws_factor; 30 | } 31 | 32 | int get_side_factor() //get a and d movement 33 | { 34 | int ad_factor = 0; 35 | if (GetAsyncKeyState(0x41) & 0x8000) ++ad_factor; 36 | if (GetAsyncKeyState(0x44) & 0x8000) --ad_factor; 37 | return ad_factor; 38 | } 39 | 40 | float get_up_factor() //get up and down movement (Capslock and Shift) 41 | { 42 | float ad_factor = 0; 43 | 44 | if (GetAsyncKeyState(VK_CAPITAL) & 0x8000) ad_factor += 1; 45 | else if (GetAsyncKeyState(VK_SHIFT) & 0x8000) ad_factor -= 1; 46 | else ad_factor = 0; 47 | 48 | return ad_factor; 49 | } 50 | 51 | Vector3 Safe1; 52 | Vector3 Safe2; 53 | 54 | void Noclip::calculate_new_position() 55 | { 56 | 57 | const auto pos1 = read(process_base + 0x02508CD8); //Pointer1 58 | const auto pos2 = read(pos1 + 0x10); //Pointer 2 59 | const auto pos3 = read(pos2 + 0x8); //Pointer 3 60 | const auto pos4 = read(pos3 + 0xD0); //Pointer 4 61 | 62 | const auto yawx = read(pos4 + 0x8); //Local player yaw 63 | const auto yawx2 = read(pos4 + 0x20); //Local player yaw2 64 | 65 | float foward_vector = get_foward_factor() * yawx; 66 | float side_vector = get_foward_factor() * yawx2; 67 | 68 | current_position.z += foward_vector * no_clip_speed; 69 | current_position.x += side_vector * no_clip_speed; 70 | current_position.y += (get_up_factor() / 10) * no_clip_speed; 71 | } 72 | 73 | bool firsttime = true; 74 | bool calculated = false; 75 | bool init = true; 76 | 77 | Vector3 getpos() 78 | { 79 | const auto pos1 = read(process_base + 0x02508CD8); 80 | const auto pos2 = read(pos1 + 0x10); 81 | const auto pos3 = read(pos2 + 0x8); 82 | const auto pos4 = read(pos3 + 0xD0); 83 | 84 | const auto myposx = read(pos4 + 0x2C); //Local Player X position 85 | const auto myposy = read(pos4 + 0x30); //Local Player Y position 86 | const auto myposz = read(pos4 + 0x34); //Local Player Z position 87 | 88 | return { myposx, myposy, myposz }; 89 | } 90 | 91 | void Noclip::on_update() 92 | { 93 | if (!no_clip) 94 | { 95 | firsttime = true; 96 | calculated = false; 97 | return; 98 | } 99 | 100 | if (firsttime) 101 | { 102 | firsttime = false; 103 | 104 | const auto pos1 = read(process_base + 0x02508CD8); 105 | const auto pos2 = read(pos1 + 0x10); 106 | const auto pos3 = read(pos2 + 0x8); 107 | const auto pos4 = read(pos3 + 0xD0); 108 | 109 | const auto myposx = read(pos4 + 0x2C); //Local Player X position 110 | const auto myposy = read(pos4 + 0x30); //Local Player Y position 111 | const auto myposz = read(pos4 + 0x34); //Local Player Z postion 112 | 113 | current_position = Vector3(myposx, myposy, myposz); 114 | 115 | } 116 | 117 | if (GetAsyncKeyState(VK_F5) & 0x8000) 118 | { 119 | Safe1 = getpos(); 120 | } 121 | else if (GetAsyncKeyState(VK_F6) & 0x8000) 122 | { 123 | Safe2 = getpos(); 124 | } 125 | else if (GetAsyncKeyState(VK_F7) & 0x8000) 126 | { 127 | current_position = Safe1; 128 | } 129 | else if (GetAsyncKeyState(VK_F8) & 0x8000) 130 | { 131 | current_position = Safe2; 132 | } 133 | 134 | calculate_new_position(); 135 | 136 | calculated = true; 137 | } 138 | 139 | 140 | inline void change_server_position(const Vector3& v) 141 | { 142 | 143 | const auto pos1 = read(process_base + 0x02508CD8); 144 | const auto pos2 = read(pos1 + 0x10); 145 | const auto pos3 = read(pos2 + 0x8); 146 | const auto pos4 = read(pos3 + 0xD0); 147 | 148 | write(pos4 + 0x2C, v.x); //Overwrite your X Position with the new calculated position 149 | write(pos4 + 0x30, v.y); //Overwrite your Y Position 150 | write(pos4 + 0x34, v.z); //Overwrite your Z Position 151 | 152 | } 153 | 154 | void Noclip::on_fast_update() 155 | { 156 | if (calculated) 157 | { 158 | change_server_position(current_position); 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /MhyprotSource/quartic.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2016 by Саша Миленковић * 3 | * sasa.milenkovic.xyz@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * ( http://www.gnu.org/licenses/gpl-3.0.en.html ) * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #include 22 | #include "quartic.h" 23 | 24 | //--------------------------------------------------------------------------- 25 | // solve cubic equation x^3 + a*x^2 + b*x + c 26 | // x - array of size 3 27 | // In case 3 real roots: => x[0], x[1], x[2], return 3 28 | // 2 real roots: x[0], x[1], return 2 29 | // 1 real root : x[0], x[1] ± i*x[2], return 1 30 | unsigned int solveP3(double *x,double a,double b,double c) { 31 | double a2 = a*a; 32 | double q = (a2 - 3*b)/9; 33 | double r = (a*(2*a2-9*b) + 27*c)/54; 34 | double r2 = r*r; 35 | double q3 = q*q*q; 36 | double A,B; 37 | if(r2 1) t= 1; 42 | t=acos(t); 43 | a/=3; q=-2*sqrt(q); 44 | x[0]=q*cos(t/3)-a; 45 | x[1]=q*cos((t+M_2PI)/3)-a; 46 | x[2]=q*cos((t-M_2PI)/3)-a; 47 | return 3; 48 | } 49 | else 50 | { 51 | A =-pow(fabs(r)+sqrt(r2-q3),1./3); 52 | if( r<0 ) A=-A; 53 | B = (0==A ? 0 : q/A); 54 | 55 | a/=3; 56 | x[0] =(A+B)-a; 57 | x[1] =-0.5*(A+B)-a; 58 | x[2] = 0.5*sqrt(3.)*(A-B); 59 | if(fabs(x[2]) fabs(y)) y = x3[1]; 87 | if(fabs(x3[2]) > fabs(y)) y = x3[2]; 88 | } 89 | 90 | // h1+h2 = y && h1*h2 = d <=> h^2 -y*h + d = 0 (h === q) 91 | 92 | D = y*y - 4*d; 93 | if(fabs(D) < eps) //in other words - D==0 94 | { 95 | q1 = q2 = y * 0.5; 96 | // g1+g2 = a && g1+g2 = b-y <=> g^2 - a*g + b-y = 0 (p === g) 97 | D = a*a - 4*(b-y); 98 | if(fabs(D) < eps) //in other words - D==0 99 | p1 = p2 = a * 0.5; 100 | 101 | else 102 | { 103 | sqD = sqrt(D); 104 | p1 = (a + sqD) * 0.5; 105 | p2 = (a - sqD) * 0.5; 106 | } 107 | } 108 | else 109 | { 110 | sqD = sqrt(D); 111 | q1 = (y + sqD) * 0.5; 112 | q2 = (y - sqD) * 0.5; 113 | // g1+g2 = a && g1*h2 + g2*h1 = c ( && g === p ) Krammer 114 | p1 = (a*q1-c)/(q1-q2); 115 | p2 = (c-a*q2)/(q1-q2); 116 | } 117 | 118 | DComplex* retval = new DComplex[4]; 119 | 120 | // solving quadratic eq. - x^2 + p1*x + q1 = 0 121 | D = p1*p1 - 4*q1; 122 | if(D < 0.0) 123 | { 124 | retval[0].real( -p1 * 0.5 ); 125 | retval[0].imag( sqrt(-D) * 0.5 ); 126 | retval[1] = std::conj(retval[0]); 127 | } 128 | else 129 | { 130 | sqD = sqrt(D); 131 | retval[0].real( (-p1 + sqD) * 0.5 ); 132 | retval[1].real( (-p1 - sqD) * 0.5 ); 133 | } 134 | 135 | // solving quadratic eq. - x^2 + p2*x + q2 = 0 136 | D = p2*p2 - 4*q2; 137 | if(D < 0.0) 138 | { 139 | retval[2].real( -p2 * 0.5 ); 140 | retval[2].imag( sqrt(-D) * 0.5 ); 141 | retval[3] = std::conj(retval[2]); 142 | } 143 | else 144 | { 145 | sqD = sqrt(D); 146 | retval[2].real( (-p2 + sqD) * 0.5 ); 147 | retval[3].real( (-p2 - sqD) * 0.5 ); 148 | } 149 | 150 | return retval; 151 | } 152 | 153 | -------------------------------------------------------------------------------- /MhyprotSource/CGraphics.cpp: -------------------------------------------------------------------------------- 1 | #include "CGraphics.h" 2 | #include "Offsets.h" 3 | #include "../MhyprotSource/Mhyprot/baseadress.h" 4 | #include 5 | 6 | //-----------------------------------W2S for Arma 3 & DayZ-------------------------------------------------- 7 | 8 | Vector3 get_inverted_view_up() 9 | { 10 | return Vector3(read(camera + 0x14)); 11 | } 12 | 13 | Vector3 get_inverted_view_right() 14 | { 15 | return Vector3(read(camera + 0x8)); 16 | } 17 | 18 | Vector3 get_inverted_view_translation() 19 | { 20 | return Vector3(read(camera + 0x2C)); 21 | } 22 | 23 | Vector3 get_inverted_view_forward() 24 | { 25 | return Vector3(read(camera + 0x20)); 26 | } 27 | 28 | Vector3 get_viewport_size() 29 | { 30 | return Vector3(read(camera + 0x58)); 31 | } 32 | 33 | Vector3 get_projection_d1() 34 | { 35 | return Vector3(read(camera + 0xD0)); 36 | } 37 | Vector3 get_projection_d2() 38 | { 39 | return Vector3(read(camera + 0xDC)); 40 | } 41 | 42 | Vector3 invertedviewup; 43 | Vector3 invertedviewright; 44 | Vector3 invertedviewtranslation; 45 | Vector3 invertedviewforward; 46 | Vector3 viewportsize; 47 | Vector3 projectiondl; 48 | Vector3 projectiond1; 49 | Vector3 projectiond2; 50 | 51 | Vector3 c_graphics_instance::world_to_screen(const Vector3 position) 52 | { 53 | 54 | const Vector3 temp = position - invertedviewtranslation; 55 | 56 | const float x = temp.Dot(invertedviewright); 57 | const float y = temp.Dot(invertedviewup); 58 | 59 | if (const float z = temp.Dot(invertedviewforward); z > 0) 60 | { 61 | return { viewportsize.x * (1 + (x / projectiond1.x / z)), get_viewport_size().y * (1 - (y / projectiond2.y / z)), z 62 | }; 63 | } 64 | 65 | return {}; 66 | 67 | 68 | return { 0, 0, 0 }; 69 | } 70 | 71 | bool c_graphics_instance::initializeit() 72 | { 73 | invertedviewtranslation = get_inverted_view_translation(); 74 | invertedviewright = get_inverted_view_right(); 75 | invertedviewup = get_inverted_view_up(); 76 | invertedviewforward = get_inverted_view_forward(); 77 | viewportsize = get_viewport_size(); 78 | projectiond1 = get_projection_d1(); 79 | projectiond2 = get_projection_d2(); 80 | return true; 81 | } 82 | 83 | 84 | //--------------------------------- W2S for many other Games -------------------------------- 85 | 86 | //constexpr auto m_pGraphics = 0x25B8; 87 | //constexpr auto cGameOffset = 0x1440B5458; 88 | //constexpr auto m_Width = 0x20; 89 | //constexpr auto m_Height = 0x24; 90 | //constexpr auto m_camera = 0x68; 91 | //constexpr auto m_cameraMatrix = 0x30; 92 | //constexpr auto m_viewMatrix = 0x1B0; 93 | // 94 | //D3DXMATRIX CGraphicsInstance::GetGameMatrix() 95 | //{ 96 | // D3DXMATRIX gameMatrix; 97 | // D3DXMATRIX cameraMatrix = CGraphicsInstance::GetCameraMatrix(); 98 | // 99 | // gameMatrix.m[0][0] = cameraMatrix.m[0][0]; 100 | // gameMatrix.m[0][1] = cameraMatrix.m[1][0]; 101 | // gameMatrix.m[0][2] = cameraMatrix.m[2][0]; 102 | // gameMatrix.m[0][3] = cameraMatrix.m[3][0]; 103 | // 104 | // gameMatrix.m[1][0] = -cameraMatrix.m[0][1]; 105 | // gameMatrix.m[1][1] = -cameraMatrix.m[1][1]; 106 | // gameMatrix.m[1][2] = -cameraMatrix.m[2][1]; 107 | // gameMatrix.m[1][3] = -cameraMatrix.m[3][1]; 108 | // 109 | // gameMatrix.m[2][0] = cameraMatrix.m[0][2]; 110 | // gameMatrix.m[2][1] = cameraMatrix.m[1][2]; 111 | // gameMatrix.m[2][2] = cameraMatrix.m[2][2]; 112 | // gameMatrix.m[2][3] = cameraMatrix.m[3][2]; 113 | // 114 | // gameMatrix.m[3][0] = cameraMatrix.m[0][3]; 115 | // gameMatrix.m[3][1] = cameraMatrix.m[1][3]; 116 | // gameMatrix.m[3][2] = cameraMatrix.m[2][3]; 117 | // gameMatrix.m[3][3] = cameraMatrix.m[3][3]; 118 | // 119 | // return gameMatrix; 120 | //} 121 | // 122 | //D3DXMATRIX CGraphicsInstance::GetCameraMatrix() 123 | //{ 124 | // uint64_t game = read(cGameOffset); 125 | // uint64_t graphics = read(game + m_pGraphics); 126 | // uint64_t camera = read(graphics + m_camera); 127 | // uint64_t cameraMatrix = read(camera + m_cameraMatrix); 128 | // D3DMATRIX viewMatrix = read(cameraMatrix + m_viewMatrix); 129 | // 130 | // return viewMatrix; 131 | //} 132 | // 133 | //Vector3 c_graphics_instance::world_to_screen(Vector3* ScreenPos, Vector3 WorldPosition) 134 | //{ 135 | // 136 | // D3DXMATRIX gameMatrix = GetGameMatrix(); 137 | // float w = 0.0f; 138 | // 139 | // ScreenPos->x = gameMatrix.m[0][0] * WorldPosition.x + gameMatrix.m[0][1] * WorldPosition.y + gameMatrix.m[0][2] * WorldPosition.z + gameMatrix.m[0][3]; 140 | // ScreenPos->y = gameMatrix.m[1][0] * WorldPosition.x + gameMatrix.m[1][1] * WorldPosition.y + gameMatrix.m[1][2] * WorldPosition.z + gameMatrix.m[1][3]; 141 | // w = (float)(gameMatrix.m[3][0] * WorldPosition.x + gameMatrix.m[3][1] * WorldPosition.y + gameMatrix.m[3][2] * WorldPosition.z + gameMatrix.m[3][3]); 142 | // 143 | // if (w < 0.01f) 144 | // return false; 145 | // 146 | // float invw = 1.0f / w; 147 | // 148 | // ScreenPos->x *= invw; 149 | // ScreenPos->y *= invw; 150 | // 151 | // uint64_t game = read(cGameOffset); 152 | // uint64_t graphics = read(game + m_pGraphics); 153 | // float width = read(graphics + m_Width); 154 | // float height = read(graphics + m_Height); 155 | // 156 | // float x = width / 2.f; 157 | // float y = height / 2.f; 158 | // 159 | // x += 0.5f * (float)ScreenPos->x * width + 0.5f; 160 | // y -= 0.5f * (float)ScreenPos->y * height + 0.5f; 161 | // 162 | // ScreenPos->x = x; 163 | // ScreenPos->y = y; 164 | // ScreenPos->z = 0; 165 | // return true; 166 | //} -------------------------------------------------------------------------------- /MhyprotSource/Inputs.cpp: -------------------------------------------------------------------------------- 1 | #include "Inputs.h" 2 | 3 | //#include "Menu.h" 4 | 5 | #include 6 | 7 | //extern LRESULT ImGui_ImplDX11_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 8 | 9 | InputSys::InputSys() 10 | { 11 | m_hTargetWindow = nullptr; 12 | m_originalWndProc = 0; 13 | } 14 | 15 | InputSys::~InputSys() 16 | { 17 | if (m_originalWndProc) 18 | SetWindowLongPtr(m_hTargetWindow, GWLP_WNDPROC, m_originalWndProc); 19 | m_originalWndProc = 0; 20 | } 21 | 22 | void InputSys::initialize(const HWND h_target_window) 23 | { 24 | m_hTargetWindow = h_target_window; 25 | TCHAR class_name[256]; 26 | GetClassName(m_hTargetWindow, class_name, 256); 27 | std::cout << "Class Name is : " << class_name << std::endl; 28 | 29 | printf("[Inputs] m_hTargetWindow = %p\n", m_hTargetWindow); 30 | if (!m_hTargetWindow) 31 | { 32 | std::cout << "[Inputs] [ERROR] m_hTargetWindow failed\n"; 33 | return; 34 | } 35 | 36 | m_originalWndProc = SetWindowLongPtr(m_hTargetWindow, GWLP_WNDPROC, reinterpret_cast(wnd_proc)); 37 | 38 | if (m_originalWndProc) 39 | std::cout << "[Inputs] [SUCCES]\n"; 40 | else 41 | std::cout << "[Inputs] [FAILED]\n"; 42 | } 43 | 44 | void InputSys::shutdown() 45 | { 46 | if (m_originalWndProc) 47 | SetWindowLongPtr(m_hTargetWindow, GWLP_WNDPROC, m_originalWndProc); 48 | m_originalWndProc = 0; 49 | } 50 | 51 | LRESULT __stdcall InputSys::wnd_proc(const HWND h_wnd, const UINT msg, const WPARAM w_param, const LPARAM l_param) 52 | { 53 | Get().process_message(msg, w_param, l_param); 54 | 55 | //if (Menu::IsVisible()) { 56 | // ImGui_ImplDX9_WndProcHandler(hWnd, msg, wParam, lParam); 57 | //} 58 | //ImGui_ImplDX11_WndProcHandler(hWnd, msg, wParam, lParam); 59 | return CallWindowProcW(reinterpret_cast(Get().m_originalWndProc), h_wnd, msg, w_param, l_param); 60 | } 61 | 62 | bool InputSys::process_message(const UINT u_msg, const WPARAM w_param, const LPARAM l_param) 63 | { 64 | switch (u_msg) 65 | { 66 | case WM_MBUTTONDBLCLK: 67 | case WM_RBUTTONDBLCLK: 68 | case WM_LBUTTONDBLCLK: 69 | case WM_XBUTTONDBLCLK: 70 | case WM_MBUTTONDOWN: 71 | case WM_RBUTTONDOWN: 72 | case WM_LBUTTONDOWN: 73 | case WM_XBUTTONDOWN: 74 | case WM_MBUTTONUP: 75 | case WM_RBUTTONUP: 76 | case WM_LBUTTONUP: 77 | case WM_XBUTTONUP: 78 | return process_mouse_message(u_msg, w_param); 79 | case WM_KEYDOWN: 80 | case WM_KEYUP: 81 | case WM_SYSKEYDOWN: 82 | case WM_SYSKEYUP: 83 | return process_keybd_message(u_msg, w_param); 84 | default: 85 | return false; 86 | } 87 | } 88 | 89 | bool InputSys::process_mouse_message(const UINT u_msg, const WPARAM w_param) 90 | { 91 | auto key = VK_LBUTTON; 92 | auto state = KeyState::None; 93 | switch (u_msg) 94 | { 95 | case WM_MBUTTONDOWN: 96 | case WM_MBUTTONUP: 97 | state = u_msg == WM_MBUTTONUP ? KeyState::Up : KeyState::Down; 98 | key = VK_MBUTTON; 99 | break; 100 | case WM_RBUTTONDOWN: 101 | case WM_RBUTTONUP: 102 | state = u_msg == WM_RBUTTONUP ? KeyState::Up : KeyState::Down; 103 | key = VK_RBUTTON; 104 | break; 105 | case WM_LBUTTONDOWN: 106 | case WM_LBUTTONUP: 107 | state = u_msg == WM_LBUTTONUP ? KeyState::Up : KeyState::Down; 108 | key = VK_LBUTTON; 109 | break; 110 | case WM_XBUTTONDOWN: 111 | case WM_XBUTTONUP: 112 | state = u_msg == WM_XBUTTONUP ? KeyState::Up : KeyState::Down; 113 | key = (HIWORD(w_param) == XBUTTON1 ? VK_XBUTTON1 : VK_XBUTTON2); 114 | break; 115 | default: 116 | return false; 117 | } 118 | 119 | if (state == KeyState::Up && m_iKeyMap[key] == KeyState::Down) 120 | m_iKeyMap[key] = KeyState::Pressed; 121 | else 122 | m_iKeyMap[key] = state; 123 | return true; 124 | } 125 | 126 | bool InputSys::process_keybd_message(const UINT u_msg, const WPARAM w_param) 127 | { 128 | const auto key = w_param; 129 | auto state = KeyState::None; 130 | 131 | switch (u_msg) 132 | { 133 | case WM_KEYDOWN: 134 | case WM_SYSKEYDOWN: 135 | state = KeyState::Down; 136 | break; 137 | case WM_KEYUP: 138 | case WM_SYSKEYUP: 139 | state = KeyState::Up; 140 | break; 141 | default: 142 | return false; 143 | } 144 | 145 | if (state == KeyState::Up && m_iKeyMap[static_cast(key)] == KeyState::Down) 146 | { 147 | m_iKeyMap[static_cast(key)] = KeyState::Pressed; 148 | 149 | if (const auto& hotkey_callback = m_Hotkeys[key]) 150 | hotkey_callback(); 151 | } 152 | else 153 | { 154 | m_iKeyMap[static_cast(key)] = state; 155 | } 156 | 157 | return true; 158 | } 159 | 160 | KeyState InputSys::get_key_state(const std::uint32_t vk) const 161 | { 162 | return m_iKeyMap[vk]; 163 | } 164 | 165 | bool InputSys::is_key_down(const std::uint32_t vk) const 166 | { 167 | return m_iKeyMap[vk] == KeyState::Down; 168 | } 169 | 170 | bool InputSys::was_key_pressed(const std::uint32_t vk) 171 | { 172 | if (m_iKeyMap[vk] == KeyState::Pressed) 173 | { 174 | m_iKeyMap[vk] = KeyState::Up; 175 | return true; 176 | } 177 | return false; 178 | } 179 | 180 | void InputSys::register_hotkey(const std::uint32_t vk, const std::function& f) 181 | { 182 | m_Hotkeys[vk] = f; 183 | } 184 | 185 | void InputSys::remove_hotkey(const std::uint32_t vk) 186 | { 187 | m_Hotkeys[vk] = nullptr; 188 | } 189 | 190 | void InputSys::move_mouse(int x, int y) 191 | { 192 | INPUT input = {0}; 193 | input.type = INPUT_MOUSE; 194 | input.mi.dx = static_cast(x); 195 | input.mi.dy = static_cast(y); 196 | input.mi.dwFlags = MOUSEEVENTF_MOVE; 197 | SendInput(1, &input, sizeof(INPUT)); 198 | } 199 | 200 | void InputSys::left_down() 201 | { 202 | INPUT input = {0}; 203 | input.type = INPUT_MOUSE; 204 | input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN; 205 | SendInput(1, &input, sizeof(INPUT)); 206 | } 207 | 208 | void InputSys::left_up() 209 | { 210 | INPUT input = {0}; 211 | input.type = INPUT_MOUSE; 212 | input.mi.dwFlags = MOUSEEVENTF_LEFTUP; 213 | SendInput(1, &input, sizeof(INPUT)); 214 | } 215 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/win_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #include "win_utils.hpp" 27 | #include "../skCrypter.h" 28 | 29 | // 30 | // find the process id by specific name using ToolHelp32Snapshot 31 | // 32 | uint32_t win_utils::find_process_id(const std::string_view process_name) 33 | { 34 | PROCESSENTRY32 processentry = {}; 35 | 36 | const unique_handle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0), &CloseHandle); 37 | 38 | if (!CHECK_HANDLE(snapshot.get())) 39 | { 40 | logger::log2(skCrypt("[!] Failed to create ToolHelp32Snapshot [0x%lX]\n"), GetLastError()); 41 | return 0; 42 | } 43 | 44 | processentry.dwSize = sizeof(MODULEENTRY32); 45 | 46 | while (Process32Next(snapshot.get(), &processentry) == TRUE) 47 | { 48 | if (process_name.compare(processentry.szExeFile) == 0) 49 | { 50 | return processentry.th32ProcessID; 51 | } 52 | } 53 | 54 | return 0; 55 | } 56 | 57 | // 58 | // find the base address of process by the pid using ToolHelp32Snapshot 59 | // 60 | uint64_t win_utils::find_base_address(const uint32_t process_id) 61 | { 62 | MODULEENTRY32 module_entry = {}; 63 | 64 | const unique_handle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, process_id), 65 | &CloseHandle); 66 | 67 | if (!CHECK_HANDLE(snapshot.get())) 68 | { 69 | printf(skCrypt("[!] Failed to create ToolHelp32Snapshot [0x%lX]\n"), GetLastError()); 70 | return 0; 71 | } 72 | 73 | module_entry.dwSize = sizeof(module_entry); 74 | 75 | Module32First(snapshot.get(), &module_entry); 76 | 77 | return reinterpret_cast(module_entry.modBaseAddr); 78 | } 79 | 80 | // 81 | // lookup base address of specific module that loaded in the system 82 | // by NtQuerySystemInformation api 83 | // 84 | uint64_t win_utils::obtain_sysmodule_address( 85 | const std::string_view target_module_name, 86 | bool debug_prints 87 | ) 88 | { 89 | const HMODULE module_handle = GetModuleHandle(TEXT(skCrypt("ntdll.dll"))); 90 | 91 | if (!CHECK_HANDLE(module_handle)) 92 | { 93 | logger::log2(skCrypt("[!] failed to obtain ntdll.dll handle. (0x%lX)\n"), module_handle); 94 | return 0; 95 | } 96 | 97 | const auto nt_query_system_information = 98 | reinterpret_cast(GetProcAddress(module_handle, "NtQuerySystemInformation")); 99 | 100 | if (!nt_query_system_information) 101 | { 102 | logger::log2(skCrypt("[!] failed to locate NtQuerySystemInformation. (0x%lX)\n"), GetLastError()); 103 | return 0; 104 | } 105 | 106 | NTSTATUS status; 107 | PVOID buffer; 108 | ULONG alloc_size = 0x10000; 109 | ULONG needed_size; 110 | 111 | do 112 | { 113 | buffer = calloc(1, alloc_size); 114 | 115 | if (!buffer) 116 | { 117 | logger::log2(skCrypt("[!] failed to allocate buffer for query (0). (0x%lX)\n"), GetLastError()); 118 | return 0; 119 | } 120 | 121 | status = nt_query_system_information( 122 | SystemModuleInformation, 123 | buffer, 124 | alloc_size, 125 | &needed_size 126 | ); 127 | 128 | if (!NT_SUCCESS(status) && status != STATUS_INFO_LENGTH_MISMATCH) 129 | { 130 | logger::log2(skCrypt("[!] failed to query system module information. NTSTATUS: 0x%llX\n"), status); 131 | free(buffer); 132 | return 0; 133 | } 134 | 135 | if (status == STATUS_INFO_LENGTH_MISMATCH) 136 | { 137 | free(buffer); 138 | buffer = nullptr; 139 | alloc_size *= 2; 140 | } 141 | } 142 | while (status == STATUS_INFO_LENGTH_MISMATCH); 143 | 144 | if (!buffer) 145 | { 146 | logger::log2(skCrypt("[!] failed to allocate buffer for query (1). (0x%lX)\n"), GetLastError()); 147 | return 0; 148 | } 149 | 150 | const auto module_information = static_cast(buffer); 151 | 152 | logger::log2(skCrypt("[>] looking for %s in sysmodules...\n"), target_module_name.data()); 153 | 154 | for (ULONG i = 0; i < module_information->Count; i++) 155 | { 156 | SYSTEM_MODULE_INFORMATION_ENTRY module_entry = module_information->Module[i]; 157 | auto module_address = reinterpret_cast(module_entry.DllBase); 158 | 159 | if (module_address < MIN_ADDRESS) 160 | { 161 | continue; 162 | } 163 | 164 | PCHAR module_name = module_entry.ImageName + module_entry.ModuleNameOffset; 165 | 166 | if (debug_prints) 167 | { 168 | logger::log2(skCrypt("[+] sysmodule: %025s @ 0x%llX\n"), module_name, module_address); 169 | } 170 | 171 | if (target_module_name.compare(module_name) == 0 || 172 | std::string(module_name).find(skCrypt("mhyprot")) != std::string::npos) 173 | { 174 | logger::log2(skCrypt("[<] found\n")); 175 | return module_address; 176 | } 177 | } 178 | 179 | free(buffer); 180 | return 0; 181 | } 182 | -------------------------------------------------------------------------------- /MhyprotSource/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | using KEY_VALUE_INFORMATION_CLASS = enum _KEY_VALUE_INFORMATION_CLASS 4 | { 5 | KeyValueBasicInformation, 6 | KeyValueFullInformation, 7 | KeyValuePartialInformation, 8 | KeyValueFullInformationAlign64, 9 | KeyValuePartialInformationAlign64, 10 | KeyValueLayerInformation, 11 | MaxKeyValueInfoClass // MaxKeyValueInfoClass should always be the last enum 12 | }; 13 | 14 | typedef struct _KEY_VALUE_FULL_INFORMATION 15 | { 16 | ULONG TitleIndex; 17 | ULONG Type; 18 | ULONG DataOffset; 19 | ULONG DataLength; 20 | ULONG NameLength; 21 | WCHAR Name[1]; // Variable size 22 | // Data[1]; // Variable size data not declared 23 | } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION; 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C++" { 28 | char _RTL_CONSTANT_STRING_type_check(const char* s); 29 | char _RTL_CONSTANT_STRING_type_check(const WCHAR* s); 30 | // __typeof would be desirable here instead of sizeof. 31 | template 32 | class _RTL_CONSTANT_STRING_remove_const_template_class; 33 | 34 | template <> 35 | class _RTL_CONSTANT_STRING_remove_const_template_class 36 | { 37 | public: 38 | using T = char; 39 | }; 40 | 41 | template <> 42 | class _RTL_CONSTANT_STRING_remove_const_template_class 43 | { 44 | public: 45 | using T = WCHAR; 46 | }; 47 | 48 | #define _RTL_CONSTANT_STRING_remove_const_macro(s) \ 49 | (const_cast<_RTL_CONSTANT_STRING_remove_const_template_class::T*>(s)) 50 | } 51 | #else 52 | char _RTL_CONSTANT_STRING_type_check(const void* s); 53 | #define _RTL_CONSTANT_STRING_remove_const_macro(s) (s) 54 | #endif 55 | #define RTL_CONSTANT_STRING(s) \ 56 | { \ 57 | sizeof( s ) - sizeof( (s)[0] ), \ 58 | sizeof( s ) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \ 59 | _RTL_CONSTANT_STRING_remove_const_macro(s) \ 60 | } 61 | 62 | extern "C" { 63 | NTSYSAPI 64 | NTSTATUS 65 | NTAPI 66 | ZwQueryValueKey( 67 | _In_ HANDLE KeyHandle, 68 | _In_ PUNICODE_STRING ValueName, 69 | _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, 70 | _Out_writes_bytes_to_opt_ (Length, *ResultLength) PVOID KeyValueInformation 71 | , 72 | _In_ ULONG Length, 73 | _Out_ PULONG ResultLength 74 | ); 75 | 76 | NTSYSAPI 77 | NTSTATUS 78 | NTAPI 79 | ZwClose( 80 | _In_ HANDLE Handle 81 | ); 82 | 83 | NTSYSAPI 84 | NTSTATUS 85 | NTAPI 86 | ZwOpenKey( 87 | _Out_ PHANDLE KeyHandle, 88 | _In_ ACCESS_MASK DesiredAccess, 89 | _In_ POBJECT_ATTRIBUTES ObjectAttributes 90 | ); 91 | 92 | NTSYSAPI 93 | NTSTATUS 94 | NTAPI 95 | ZwQueryValueKey( 96 | _In_ HANDLE KeyHandle, 97 | _In_ PUNICODE_STRING ValueName, 98 | _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, 99 | _Out_writes_bytes_to_opt_ (Length, *ResultLength) PVOID KeyValueInformation 100 | , 101 | _In_ ULONG Length, 102 | _Out_ PULONG ResultLength 103 | ); 104 | 105 | NTSYSAPI 106 | NTSTATUS 107 | NTAPI 108 | ZwSetValueKey( 109 | _In_ HANDLE KeyHandle, 110 | _In_ PUNICODE_STRING ValueName, 111 | _In_opt_ ULONG TitleIndex, 112 | _In_ ULONG Type, 113 | _In_reads_bytes_opt_ (DataSize) PVOID Data, 114 | _In_ ULONG DataSize 115 | ); 116 | 117 | NTSYSAPI NTSTATUS ZwCreateKey( 118 | PHANDLE KeyHandle, 119 | ACCESS_MASK DesiredAccess, 120 | POBJECT_ATTRIBUTES ObjectAttributes, 121 | ULONG TitleIndex, 122 | PUNICODE_STRING Class, 123 | ULONG CreateOptions, 124 | PULONG Disposition 125 | ); 126 | } 127 | 128 | namespace RegistryUtils 129 | { 130 | __forceinline ULONG GetKeyInfoSize(HANDLE hKey, PUNICODE_STRING Key) 131 | { 132 | NTSTATUS Status; 133 | ULONG KeySize; 134 | 135 | Status = ZwQueryValueKey(hKey, Key, KeyValueFullInformation, 0, 0, &KeySize); 136 | 137 | if (Status == STATUS_BUFFER_TOO_SMALL || Status == STATUS_BUFFER_OVERFLOW) 138 | return KeySize; 139 | 140 | return 0; 141 | } 142 | 143 | template 144 | __forceinline type ReadRegistry(UNICODE_STRING RegPath, UNICODE_STRING Key) 145 | { 146 | HANDLE hKey; 147 | OBJECT_ATTRIBUTES ObjAttr; 148 | NTSTATUS Status = STATUS_UNSUCCESSFUL; 149 | 150 | InitializeObjectAttributes(&ObjAttr, &RegPath, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); 151 | 152 | Status = ZwOpenKey(&hKey, KEY_ALL_ACCESS, &ObjAttr); 153 | 154 | if (NT_SUCCESS(Status)) 155 | { 156 | ULONG KeyInfoSize = GetKeyInfoSize(hKey, &Key); 157 | ULONG KeyInfoSizeNeeded; 158 | 159 | if (KeyInfoSize == NULL) 160 | { 161 | ZwClose(hKey); 162 | return 0; 163 | } 164 | 165 | PKEY_VALUE_FULL_INFORMATION pKeyInfo = (PKEY_VALUE_FULL_INFORMATION)malloc(KeyInfoSize); 166 | RtlZeroMemory(pKeyInfo, KeyInfoSize); 167 | 168 | Status = ZwQueryValueKey(hKey, &Key, KeyValueFullInformation, pKeyInfo, KeyInfoSize, &KeyInfoSizeNeeded); 169 | 170 | if (!NT_SUCCESS(Status) || (KeyInfoSize != KeyInfoSizeNeeded)) 171 | { 172 | ZwClose(hKey); 173 | free(pKeyInfo); 174 | return 0; 175 | } 176 | 177 | ZwClose(hKey); 178 | free(pKeyInfo); 179 | 180 | return *(type*)((LONG64)pKeyInfo + pKeyInfo->DataOffset); 181 | } 182 | 183 | return 0; 184 | } 185 | 186 | __forceinline bool WriteRegistry(UNICODE_STRING RegPath, UNICODE_STRING Key, PVOID Address, ULONG Type, ULONG Size) 187 | { 188 | bool Success = false; 189 | HANDLE hKey; 190 | OBJECT_ATTRIBUTES ObjAttr; 191 | NTSTATUS Status = STATUS_UNSUCCESSFUL; 192 | 193 | InitializeObjectAttributes(&ObjAttr, &RegPath, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); 194 | 195 | Status = ZwOpenKey(&hKey, KEY_ALL_ACCESS, &ObjAttr); 196 | 197 | if (NT_SUCCESS(Status)) 198 | { 199 | Status = ZwSetValueKey(hKey, &Key, NULL, Type, Address, Size); 200 | 201 | if (NT_SUCCESS(Status)) 202 | Success = true; 203 | 204 | ZwClose(hKey); 205 | } 206 | else 207 | { 208 | Status = ZwCreateKey(&hKey, KEY_ALL_ACCESS, &ObjAttr, 0, &RegPath, 0, 0); 209 | 210 | if (NT_SUCCESS(Status)) 211 | { 212 | Status = ZwSetValueKey(hKey, &Key, NULL, Type, Address, Size); 213 | 214 | if (NT_SUCCESS(Status)) 215 | Success = true; 216 | } 217 | ZwClose(hKey); 218 | } 219 | 220 | return Success; 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /MhyprotSource/Vector3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class Vector3 5 | { 6 | public: 7 | Vector3(void) 8 | { 9 | Invalidate(); 10 | } 11 | Vector3(float X, float Y, float Z) 12 | { 13 | x = X; 14 | y = Y; 15 | z = Z; 16 | } 17 | Vector3(const float* clr) 18 | { 19 | x = clr[0]; 20 | y = clr[1]; 21 | z = clr[2]; 22 | } 23 | 24 | void Init(float ix = 0.0f, float iy = 0.0f, float iz = 0.0f) 25 | { 26 | x = ix; y = iy; z = iz; 27 | } 28 | bool IsValid() const 29 | { 30 | return std::isfinite(x) && std::isfinite(y) && std::isfinite(z); 31 | } 32 | void Invalidate() 33 | { 34 | x = y = z = std::numeric_limits::infinity(); 35 | } 36 | 37 | float& operator[](int i) 38 | { 39 | return ((float*)this)[i]; 40 | } 41 | float operator[](int i) const 42 | { 43 | return ((float*)this)[i]; 44 | } 45 | 46 | void Zero() 47 | { 48 | x = y = z = 0.0f; 49 | } 50 | 51 | bool operator==(const Vector3& src) const 52 | { 53 | return (src.x == x) && (src.y == y) && (src.z == z); 54 | } 55 | bool operator!=(const Vector3& src) const 56 | { 57 | return (src.x != x) || (src.y != y) || (src.z != z); 58 | } 59 | 60 | Vector3& operator+=(const Vector3& v) 61 | { 62 | x += v.x; y += v.y; z += v.z; 63 | return *this; 64 | } 65 | Vector3& operator-=(const Vector3& v) 66 | { 67 | x -= v.x; y -= v.y; z -= v.z; 68 | return *this; 69 | } 70 | Vector3& operator*=(float fl) 71 | { 72 | x *= fl; 73 | y *= fl; 74 | z *= fl; 75 | return *this; 76 | } 77 | Vector3& operator*=(const Vector3& v) 78 | { 79 | x *= v.x; 80 | y *= v.y; 81 | z *= v.z; 82 | return *this; 83 | } 84 | Vector3& operator/=(const Vector3& v) 85 | { 86 | x /= v.x; 87 | y /= v.y; 88 | z /= v.z; 89 | return *this; 90 | } 91 | Vector3& operator+=(float fl) 92 | { 93 | x += fl; 94 | y += fl; 95 | z += fl; 96 | return *this; 97 | } 98 | Vector3& operator/=(float fl) 99 | { 100 | x /= fl; 101 | y /= fl; 102 | z /= fl; 103 | return *this; 104 | } 105 | Vector3& operator-=(float fl) 106 | { 107 | x -= fl; 108 | y -= fl; 109 | z -= fl; 110 | return *this; 111 | } 112 | 113 | void NormalizeInPlace() 114 | { 115 | *this = Normalized(); 116 | } 117 | Vector3 Normalized() const 118 | { 119 | Vector3 res = *this; 120 | float l = res.Length(); 121 | if (l != 0.0f) { 122 | res /= l; 123 | } 124 | else { 125 | res.x = res.y = res.z = 0.0f; 126 | } 127 | return res; 128 | } 129 | 130 | float DistTo(const Vector3& vOther) const 131 | { 132 | Vector3 delta; 133 | 134 | delta.x = x - vOther.x; 135 | delta.y = y - vOther.y; 136 | delta.z = z - vOther.z; 137 | 138 | return delta.Length(); 139 | } 140 | float DistToSqr(const Vector3& vOther) const 141 | { 142 | Vector3 delta; 143 | 144 | delta.x = x - vOther.x; 145 | delta.y = y - vOther.y; 146 | delta.z = z - vOther.z; 147 | 148 | return delta.LengthSqr(); 149 | } 150 | float Dot(const Vector3& vOther) const 151 | { 152 | return (x * vOther.x + y * vOther.y + z * vOther.z); 153 | } 154 | 155 | //A x B = (aYbZ - aZbY, aZbX - aXbZ, aXbY - aYbX) 156 | static Vector3 CrossProduct(const Vector3& v1, const Vector3& v2) 157 | { 158 | return Vector3(v1.y * v2.z - v1.z * v2.y, 159 | v1.z * v2.x - v1.x * v2.z, 160 | v1.x * v2.y - v1.y * v2.x); 161 | } 162 | 163 | Vector3 perpendicularTo() 164 | { 165 | return Vector3(z, y, -x); 166 | } 167 | 168 | // Project this vector on the vOther 169 | Vector3 ProjectionOn(const Vector3& vOther) const 170 | { 171 | Vector3 toProject = Vector3(x, y, z); 172 | float scale = (toProject.Dot(vOther)) / (vOther.Dot(vOther)); 173 | return vOther * scale; 174 | } 175 | 176 | Vector3 sameDirectionAs(const Vector3& vOther) 177 | { 178 | return vOther.Normalized() * this->Length(); 179 | } 180 | 181 | Vector3 to2D() 182 | { 183 | return Vector3(this->x, 0, this->z); 184 | } 185 | 186 | float Length() const 187 | { 188 | return sqrt(x * x + y * y + z * z); 189 | } 190 | float LengthSqr(void) const 191 | { 192 | return (x * x + y * y + z * z); 193 | } 194 | float Length2D() const 195 | { 196 | return sqrt(x * x + y * y); 197 | } 198 | 199 | //angle = acos(|u|�|v|) 200 | static float angleBetween(Vector3 u, Vector3 v) 201 | { 202 | u.Normalized(); 203 | v.Normalized(); 204 | return std::acos(u.Dot(v)); 205 | } 206 | 207 | 208 | Vector3& operator=(const Vector3& vOther) 209 | { 210 | x = vOther.x; y = vOther.y; z = vOther.z; 211 | return *this; 212 | } 213 | 214 | Vector3 operator-(void) const 215 | { 216 | return Vector3(-x, -y, -z); 217 | } 218 | Vector3 operator+(const Vector3& v) const 219 | { 220 | return Vector3(x + v.x, y + v.y, z + v.z); 221 | } 222 | Vector3 operator-(const Vector3& v) const 223 | { 224 | return Vector3(x - v.x, y - v.y, z - v.z); 225 | } 226 | Vector3 operator*(float fl) const 227 | { 228 | return Vector3(x * fl, y * fl, z * fl); 229 | } 230 | Vector3 operator*(const Vector3& v) const 231 | { 232 | return Vector3(x * v.x, y * v.y, z * v.z); 233 | } 234 | Vector3 operator/(float fl) const 235 | { 236 | return Vector3(x / fl, y / fl, z / fl); 237 | } 238 | Vector3 operator/(const Vector3& v) const 239 | { 240 | return Vector3(x / v.x, y / v.y, z / v.z); 241 | } 242 | 243 | float x, y, z; 244 | }; 245 | 246 | inline Vector3 operator*(float lhs, const Vector3& rhs) 247 | { 248 | return rhs * lhs; 249 | } 250 | inline Vector3 operator/(float lhs, const Vector3& rhs) 251 | { 252 | return rhs / lhs; 253 | } 254 | 255 | 256 | 257 | class __declspec(align(16)) VectorAligned : public Vector3 258 | { 259 | public: 260 | inline VectorAligned(void) {}; 261 | inline VectorAligned(float X, float Y, float Z) 262 | { 263 | Init(X, Y, Z); 264 | } 265 | 266 | public: 267 | explicit VectorAligned(const Vector3& vOther) 268 | { 269 | Init(vOther.x, vOther.y, vOther.z); 270 | } 271 | 272 | VectorAligned& operator=(const Vector3& vOther) 273 | { 274 | Init(vOther.x, vOther.y, vOther.z); 275 | return *this; 276 | } 277 | 278 | VectorAligned& operator=(const VectorAligned& vOther) 279 | { 280 | Init(vOther.x, vOther.y, vOther.z); 281 | return *this; 282 | } 283 | 284 | float w; 285 | }; 286 | 287 | -------------------------------------------------------------------------------- /MhyprotSource/SDK/Paladins_classes.hpp: -------------------------------------------------------------------------------- 1 | #include "Unreal_classes.hpp" 2 | #include "Paladins_enums.hpp" 3 | #include "Paladins_sdk.hpp" 4 | using namespace off; 5 | 6 | class ATgProjectile : public UObject { 7 | public: 8 | inline float GetSpeed() { 9 | return read(data + n_AProjectile::Speed); 10 | } 11 | }; 12 | 13 | class USkeletalMeshComponent : public UObject { 14 | public: 15 | inline FBoxSphereBounds GetBounds() { 16 | return read(data + n_UPrimitiveComponent::Bounds); 17 | } 18 | 19 | inline float GetLastRenderTime() { 20 | return read(data + n_UPrimitiveComponent::LastRenderTime); 21 | } 22 | 23 | inline bool IsVisible(float timeSeconds) { 24 | float lastRenderTime = GetLastRenderTime(); 25 | return (lastRenderTime > timeSeconds - 0.05f); 26 | } 27 | }; 28 | 29 | class ATeamInfo : public UObject { 30 | public: 31 | inline int GetTeamIndex() { 32 | return read(data + n_ATeamInfo::TeamIndex); 33 | } 34 | }; 35 | 36 | class APlayerReplicationInfo : public UObject { 37 | public: 38 | ATeamInfo GetTeamInfo() { 39 | return read(data + n_ATgRepInfo_Player::r_TaskForce); 40 | } 41 | 42 | FString GetName() { 43 | return read(data + n_APlayerReplicationInfo::PlayerName); 44 | } 45 | }; 46 | 47 | struct FRecoilSettings { 48 | int bUsesRecoil; 49 | float fRecoilReductionPerSec; 50 | float fRecoilCenterDelay; 51 | float fRecoilSmoothRate; 52 | }; 53 | 54 | struct FAccuracySettings 55 | { 56 | int bUsesAdvancedAccuracy; 57 | float fMaxAccuracy; 58 | float fMinAccuracy; 59 | float fAccuracyLossPerShot; 60 | float fAccuracyGainPerSec; 61 | float fAccuracyGainDelay; 62 | int nNumFreeShots; 63 | }; 64 | 65 | static FRecoilSettings oldRecoilSettings; 66 | static bool hasRecoil = true; 67 | static FAccuracySettings oldAccuracySettings; 68 | static bool hasSpread = true; 69 | 70 | class ATgDevice : public UObject { 71 | public: 72 | inline FRecoilSettings GetRecoil() { 73 | return read(data + n_ATgDevice::m_RecoilSettings); 74 | } 75 | 76 | inline bool SetRecoil(FRecoilSettings settings) { 77 | return write(data + n_ATgDevice::m_RecoilSettings, settings); 78 | } 79 | 80 | inline FAccuracySettings GetAccuracy() { 81 | return read(data + n_ATgDevice::m_AccuracySettings); 82 | } 83 | 84 | inline bool SetAccuracy(FAccuracySettings settings) { 85 | return write(data + n_ATgDevice::m_AccuracySettings, settings); 86 | } 87 | 88 | inline void NoRecoil(bool toggle = true) { 89 | if(toggle) { 90 | auto recoil = GetRecoil(); 91 | if(recoil.bUsesRecoil) { 92 | oldRecoilSettings = recoil; 93 | } 94 | recoil.bUsesRecoil = false; 95 | recoil.fRecoilCenterDelay = 0; 96 | recoil.fRecoilReductionPerSec = 0; 97 | recoil.fRecoilSmoothRate = 0; 98 | hasRecoil = false; 99 | SetRecoil(recoil); 100 | } 101 | else { 102 | if(!hasRecoil) { 103 | hasRecoil = true; 104 | SetRecoil(oldRecoilSettings); 105 | } 106 | } 107 | } 108 | 109 | inline void NoSpread(bool toggle) { 110 | if(toggle) { 111 | auto accuracy = GetAccuracy(); 112 | accuracy.fAccuracyGainPerSec = 0; 113 | accuracy.fMaxAccuracy = 1; 114 | accuracy.fMinAccuracy = 1; 115 | hasSpread = false; 116 | SetAccuracy(accuracy); 117 | } 118 | else { 119 | if(!hasSpread) { 120 | hasSpread = true; 121 | SetAccuracy(oldAccuracySettings); 122 | } 123 | } 124 | } 125 | 126 | inline TArray GetProjectiles() { 127 | return read>(data + n_ATgDevice::m_FiredProjectiles); 128 | } 129 | 130 | inline int GetMaxAmmoCount() { 131 | return read(data + n_ATgDevice::r_nMaxAmmoClipCount); 132 | } 133 | 134 | inline void SetPerspective(bool thirdPerson) { 135 | write(data + n_ATgDevice::m_fForce3PPersistTimer, thirdPerson ? 1.f : 0.f); // THIS SETS THE DURATION OF THE PERSPECIVE IN SEC 136 | } 137 | }; 138 | 139 | class APawn : public UObject { 140 | public: 141 | inline ATgDevice GetWeapon() { 142 | return read(data + n_APawn::Weapon); 143 | } 144 | 145 | inline int GetHealth() { 146 | return read(data + n_APawn::Health); 147 | } 148 | 149 | inline int GetMaxHealth() { 150 | return (int)read(data + n_ATgPawn::r_fCachedMaxHealth); 151 | } 152 | 153 | inline void SetRotation(FRotator rotation) { 154 | write(data + n_AActor::Rotation, rotation); 155 | } 156 | 157 | inline APlayerReplicationInfo GetPlayerReplicationInfo() { 158 | return read(data + n_APawn::PlayerReplicationInfo); 159 | } 160 | 161 | inline APawn GetNextPawn() { 162 | return read(data + n_APawn::NextPawn); 163 | } 164 | 165 | inline float GetEyeHeight() { 166 | return read(data + n_APawn::BaseEyeHeight); 167 | } 168 | 169 | inline USkeletalMeshComponent GetMesh() { 170 | return read(data + n_APawn::Mesh); 171 | } 172 | 173 | inline void SetGlowhack(bool isGlowing) { 174 | auto offset = data + n_ATgPawn::r_bIsWallHacking; 175 | auto current = read(offset); 176 | if(isGlowing) { 177 | current |= (1u << 17); 178 | } 179 | else { 180 | current &= ~(1u << 17); 181 | } 182 | 183 | write(offset, current); 184 | } 185 | 186 | inline FVector GetLocation() { 187 | return read(data + n_AActor::Location); 188 | } 189 | 190 | inline FRotator GetRotation() { 191 | return read(data + n_AActor::Rotation); 192 | } 193 | 194 | inline FVector GetVelocity() { 195 | return read(data + n_AActor::Velocity); 196 | } 197 | }; 198 | 199 | class ACamera : public UObject { 200 | public: 201 | inline float GetDeafultFov() { 202 | return read(data + n_ACamera::DefaultFOV); 203 | } 204 | 205 | inline FVector GetRealLocation() { 206 | return read(data + n_ACamera::LastFrameCameraCache + 0x4); 207 | } 208 | 209 | inline bool SetDefaultFOV(float fov) { 210 | return write(data + n_ACamera::DefaultFOV, fov); 211 | } 212 | }; 213 | 214 | class AWorldInfo : public UObject { 215 | public: 216 | inline float GetTimeSeconds() { 217 | return read(data + n_AWorldInfo::TimeSeconds); 218 | } 219 | 220 | inline APawn GetPawnList() { 221 | return read(data + n_AWorldInfo::PawnList); 222 | } 223 | }; 224 | 225 | class AActor : public APawn { }; 226 | 227 | class APlayerController : public AActor { 228 | public: 229 | inline float GetFovMultiplier() { 230 | return read(data + n_APlayerController::LODDistanceFactor); 231 | } 232 | 233 | inline APawn GetAcknowledgedPawn() { 234 | return read(data + n_APlayerController::AcknowledgedPawn); 235 | } 236 | 237 | inline ACamera GetCamera() { 238 | return read(data + n_APlayerController::PlayerCamera); 239 | } 240 | 241 | inline AWorldInfo GetWorldInfo() { 242 | return read(data + n_AActor::WorldInfo); 243 | } 244 | }; 245 | 246 | class ULocalPlayer : public UObject { 247 | public: 248 | inline APlayerController GetController() { 249 | return read(data + n_UPlayer::Actor); 250 | } 251 | }; 252 | 253 | class UEngine : public UObject { 254 | public: 255 | inline ULocalPlayer GetLocalPlayer() { 256 | return read(read(data + n_UEngine::GamePlayers)); 257 | } 258 | }; -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/nt.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #pragma once 27 | #include 28 | 29 | // 30 | // windows native definitions 31 | // 32 | 33 | #ifndef NT_SUCCESS 34 | #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) 35 | #endif 36 | 37 | #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) 38 | #define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L) 39 | #define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002L) 40 | #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) 41 | #define STATUS_INVALID_CID ((NTSTATUS)0xC000000BL) 42 | #define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000EL) 43 | #define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000FL) 44 | #define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L) 45 | #define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016L) 46 | #define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018L) 47 | #define STATUS_NO_MORE_ENTRIES ((NTSTATUS)0x8000001AL) 48 | #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) 49 | #define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045L) 50 | #define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007AL) 51 | #define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL) 52 | #define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS)0xC00000AAL) 53 | #define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5L) 54 | #define STATUS_INVALID_PARAMETER_1 ((NTSTATUS)0xC00000EFL) 55 | #define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0L) 56 | #define STATUS_INVALID_PARAMETER_3 ((NTSTATUS)0xC00000F1L) 57 | #define STATUS_INVALID_PARAMETER_4 ((NTSTATUS)0xC00000F2L) 58 | #define STATUS_INVALID_PARAMETER_5 ((NTSTATUS)0xC00000F3L) 59 | #define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4L) 60 | #define STATUS_INVALID_PARAMETER_7 ((NTSTATUS)0xC00000F5L) 61 | #define STATUS_INVALID_PARAMETER_8 ((NTSTATUS)0xC00000F6L) 62 | #define STATUS_INVALID_PARAMETER_9 ((NTSTATUS)0xC00000F7L) 63 | #define STATUS_INVALID_PARAMETER_10 ((NTSTATUS)0xC00000F8L) 64 | #define STATUS_INVALID_PARAMETER_11 ((NTSTATUS)0xC00000F9L) 65 | #define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FAL) 66 | #define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141L) 67 | #define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS)0xC00002C5L) 68 | 69 | using SYSTEM_INFORMATION_CLASS = enum _SYSTEM_INFORMATION_CLASS 70 | { 71 | SystemBasicInformation = 0, 72 | SystemProcessorInformation = 1, 73 | SystemPerformanceInformation = 2, 74 | SystemTimeOfDayInformation = 3, 75 | SystemPathInformation = 4, 76 | SystemProcessInformation = 5, 77 | SystemCallCountInformation = 6, 78 | SystemDeviceInformation = 7, 79 | SystemProcessorPerformanceInformation = 8, 80 | SystemFlagsInformation = 9, 81 | SystemCallTimeInformation = 10, 82 | SystemModuleInformation = 11, 83 | SystemLocksInformation = 12, 84 | SystemStackTraceInformation = 13, 85 | SystemPagedPoolInformation = 14, 86 | SystemNonPagedPoolInformation = 15, 87 | SystemHandleInformation = 16, 88 | SystemObjectInformation = 17, 89 | SystemPageFileInformation = 18, 90 | SystemVdmInstemulInformation = 19, 91 | SystemVdmBopInformation = 20, 92 | SystemFileCacheInformation = 21, 93 | SystemPoolTagInformation = 22, 94 | SystemInterruptInformation = 23, 95 | SystemDpcBehaviorInformation = 24, 96 | SystemFullMemoryInformation = 25, 97 | SystemLoadGdiDriverInformation = 26, 98 | SystemUnloadGdiDriverInformation = 27, 99 | SystemTimeAdjustmentInformation = 28, 100 | SystemSummaryMemoryInformation = 29, 101 | SystemMirrorMemoryInformation = 30, 102 | SystemPerformanceTraceInformation = 31, 103 | SystemObsolete0 = 32, 104 | SystemExceptionInformation = 33, 105 | SystemCrashDumpStateInformation = 34, 106 | SystemKernelDebuggerInformation = 35, 107 | SystemContextSwitchInformation = 36, 108 | SystemRegistryQuotaInformation = 37, 109 | SystemExtendServiceTableInformation = 38, 110 | SystemPrioritySeperation = 39, 111 | SystemVerifierAddDriverInformation = 40, 112 | SystemVerifierRemoveDriverInformation = 41, 113 | SystemProcessorIdleInformation = 42, 114 | SystemLegacyDriverInformation = 43, 115 | SystemCurrentTimeZoneInformation = 44, 116 | SystemLookasideInformation = 45, 117 | SystemTimeSlipNotification = 46, 118 | SystemSessionCreate = 47, 119 | SystemSessionDetach = 48, 120 | SystemSessionInformation = 49, 121 | SystemRangeStartInformation = 50, 122 | SystemVerifierInformation = 51, 123 | SystemVerifierThunkExtend = 52, 124 | SystemSessionProcessInformation = 53, 125 | SystemLoadGdiDriverInSystemSpace = 54, 126 | SystemNumaProcessorMap = 55, 127 | SystemPrefetcherInformation = 56, 128 | SystemExtendedProcessInformation = 57, 129 | SystemRecommendedSharedDataAlignment = 58, 130 | SystemComPlusPackage = 59, 131 | SystemNumaAvailableMemory = 60, 132 | SystemProcessorPowerInformation = 61, 133 | SystemEmulationBasicInformation = 62, 134 | SystemEmulationProcessorInformation = 63, 135 | SystemExtendedHandleInformation = 64, 136 | SystemLostDelayedWriteInformation = 65, 137 | SystemBigPoolInformation = 66, 138 | SystemSessionPoolTagInformation = 67, 139 | SystemSessionMappedViewInformation = 68, 140 | SystemHotpatchInformation = 69, 141 | SystemObjectSecurityMode = 70, 142 | SystemWatchdogTimerHandler = 71, 143 | SystemWatchdogTimerInformation = 72, 144 | SystemLogicalProcessorInformation = 73, 145 | SystemWow64SharedInformation = 74, 146 | SystemRegisterFirmwareTableInformationHandler = 75, 147 | SystemFirmwareTableInformation = 76, 148 | SystemModuleInformationEx = 77, 149 | SystemVerifierTriageInformation = 78, 150 | SystemSuperfetchInformation = 79, 151 | SystemMemoryListInformation = 80, 152 | SystemFileCacheInformationEx = 81, 153 | MaxSystemInfoClass = 82 154 | }; 155 | 156 | typedef struct _SYSTEM_MODULE_INFORMATION_ENTRY 157 | { 158 | ULONG Unknow1; 159 | ULONG Unknow2; 160 | ULONG Unknow3; 161 | ULONG Unknow4; 162 | PVOID DllBase; 163 | ULONG Size; 164 | ULONG Flags; 165 | USHORT Index; 166 | USHORT NameLength; 167 | USHORT LoadCount; 168 | USHORT ModuleNameOffset; 169 | char ImageName[256]; 170 | } SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY; 171 | 172 | typedef struct _SYSTEM_MODULE_INFORMATION 173 | { 174 | ULONG Count; 175 | SYSTEM_MODULE_INFORMATION_ENTRY Module[1]; 176 | } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION; 177 | 178 | using pNtQuerySystemInformation = NTSTATUS(WINAPI*)( 179 | IN SYSTEM_INFORMATION_CLASS SystemInformationClass, 180 | OUT PVOID SystemInformation, 181 | IN ULONG SystemInformationLength, 182 | OUT PULONG ReturnLength 183 | ); 184 | -------------------------------------------------------------------------------- /MhyprotSource/Coding.cpp: -------------------------------------------------------------------------------- 1 | 2 | // THIS SOURCE HAS BEEN UPDATED AND MOFIED BY BASEULT - ORIGINAL SOURCE BY BLUEFIRE1337's PALADINS CHEAT 3 | 4 | #include 5 | #include 6 | #include 7 | #include "d3d9.h" 8 | #include "d3dx9.h" 9 | 10 | #include "Overlay.h" 11 | #include 12 | #include "Mhyprot/mhyprot.hpp" 13 | #include "skCrypter.h" 14 | #include "settings.h" 15 | #include "Mhyprot/baseadress.h" 16 | #include "NoClip.h" 17 | #include "Esp.h" 18 | #include "Aimbot.h" 19 | #include "Offsets.h" 20 | 21 | uint64_t game; 22 | uint32_t width; 23 | uint32_t height; 24 | FOverlay* g_overlay; 25 | 26 | float screen_center_x; 27 | float screen_center_y; 28 | 29 | const LPCSTR window_class_name = "Game Title Name"; //Searched for the Window Name of the Game 30 | 31 | bool use_nvidia_overlay = true; // change this if you have problems with overlay 32 | bool rendering = true; 33 | 34 | static void getentities() 35 | { 36 | Esp::esp_loop(); 37 | } 38 | 39 | static void render(const FOverlay* overlay) 40 | { 41 | while (rendering) 42 | { 43 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); 44 | 45 | FOverlay::begin_scene(); 46 | FOverlay::clear_scene(); 47 | 48 | if (esp) 49 | { 50 | Esp::esp_draw(); 51 | } 52 | 53 | if (aimbot) 54 | { 55 | 56 | Aimbot::initialize(); 57 | } 58 | 59 | 60 | if (aimbot_fov_enabled) 61 | { 62 | 63 | 64 | //g_overlay->draw_circle(ScreenCenterX, ScreenCenterY, (float)aimbotFov, 1.0f, &Fovcolor); //If you want circle FOV instead 65 | //g_overlay->draw_circle(ScreenCenterX, ScreenCenterY, (float)aimbotFov, 1.0f, &Fovcolor); 66 | 67 | 68 | FOverlay::draw_line(screen_center_x - static_cast(aimbot_fov), 69 | screen_center_y + static_cast(aimbot_fov), 70 | screen_center_x + static_cast(aimbot_fov), 71 | screen_center_y + static_cast(aimbot_fov), 72 | D2D1::ColorF(1.0f, 0.0f, 0.0f, 0.5f)); // bottom 73 | FOverlay::draw_line(screen_center_x - static_cast(aimbot_fov), 74 | screen_center_y - static_cast(aimbot_fov), 75 | screen_center_x + static_cast(aimbot_fov), 76 | screen_center_y - static_cast(aimbot_fov), 77 | D2D1::ColorF(1.0f, 0.0f, 0.0f, 0.5f)); // up 78 | FOverlay::draw_line(screen_center_x - static_cast(aimbot_fov), 79 | screen_center_y - static_cast(aimbot_fov), 80 | screen_center_x - static_cast(aimbot_fov), 81 | screen_center_y + static_cast(aimbot_fov), 82 | D2D1::ColorF(1.0f, 0.0f, 0.0f, 0.5f)); // left 83 | FOverlay::draw_line(screen_center_x + static_cast(aimbot_fov), 84 | screen_center_y - static_cast(aimbot_fov), 85 | screen_center_x + static_cast(aimbot_fov), 86 | screen_center_y + static_cast(aimbot_fov), 87 | D2D1::ColorF(1.0f, 0.0f, 0.0f, 0.5f)); // right 88 | } 89 | 90 | FOverlay::end_scene(); 91 | } 92 | } 93 | 94 | static void noclip() 95 | { 96 | while (true) 97 | { 98 | if (no_clip) 99 | { 100 | Noclip::on_fast_update(); 101 | } 102 | } 103 | } 104 | 105 | static void noclip2() 106 | { 107 | while (true) 108 | { 109 | 110 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); 111 | Noclip::on_update(); 112 | 113 | } 114 | } 115 | 116 | void aimbot_key() { 117 | while (true) { 118 | 119 | std::this_thread::sleep_for(std::chrono::milliseconds(1)); 120 | 121 | bool should_run = false; 122 | 123 | if (is_hold) { 124 | should_run = (GetKeyState(hold_key) & 0x8000); 125 | if (invert_hold) should_run = !should_run; 126 | } 127 | else { 128 | should_run = (GetKeyState(hold_key) == 1); 129 | } 130 | 131 | if (!should_run) { 132 | Sleep(10); 133 | } 134 | 135 | no_clip = should_run; 136 | 137 | } 138 | } 139 | 140 | bool initoffsets = false; 141 | static void init(FOverlay* overlay) 142 | { 143 | // Initialize the window 144 | if (!FOverlay::window_init(use_nvidia_overlay)) 145 | return; 146 | 147 | // D2D Failed to initialize? 148 | if (!overlay->init_d2d()) 149 | return; 150 | 151 | if (!initoffsets) 152 | { 153 | initoffsets = true; 154 | initialize_offsets::init_offsets(); 155 | } 156 | 157 | // render loop 158 | std::thread r(render, overlay); 159 | std::thread n(noclip); 160 | std::thread n2(noclip2); 161 | std::thread k(aimbot_key); 162 | 163 | r.join(); // threading 164 | n.join(); 165 | n2.join(); 166 | k.join(); 167 | 168 | FOverlay::d2d_shutdown(); //shutdown 169 | } 170 | 171 | void shutdown() 172 | { 173 | FOverlay::d2d_shutdown(); 174 | } 175 | 176 | LONG WINAPI simplest_crash_handler(EXCEPTION_POINTERS* exception_info) 177 | { 178 | std::cout << skCrypt("[!!] Crash at addr 0x") << exception_info->ExceptionRecord->ExceptionAddress << 179 | skCrypt(" by 0x") << std::hex << exception_info->ExceptionRecord->ExceptionCode << std::endl; 180 | return EXCEPTION_EXECUTE_HANDLER; 181 | } 182 | 183 | bool init_hack() 184 | { 185 | SetConsoleTitle(skCrypt("BLUEFIRE1337's MhyProt Source - Modified by Baseult")); 186 | SetUnhandledExceptionFilter(simplest_crash_handler); 187 | //initTrace(); 188 | 189 | system(skCrypt("sc stop mhyprot2")); // RELOAD DRIVER JUST IN CASE 190 | system(skCrypt("CLS")); // CLEAR 191 | 192 | auto process_name = skCrypt("game.exe"); 193 | const auto process_id = get_process_id(process_name); 194 | if (!process_id) 195 | { 196 | printf(skCrypt("[!] process \"%s\ was not found\n"), process_name); 197 | return false; 198 | } 199 | 200 | printf(skCrypt("[+] %s (%d)\n"), process_name, process_id); 201 | 202 | // 203 | // initialize its service, etc 204 | // 205 | if (!mhyprot::init()) 206 | { 207 | printf(skCrypt("[!] failed to initialize vulnerable driver\n")); 208 | return false; 209 | } 210 | 211 | if (!mhyprot::driver_impl::driver_init( 212 | false, // print debug 213 | false // print seedmap 214 | )) 215 | { 216 | printf(skCrypt("[!] failed to initialize driver properly\n")); 217 | mhyprot::unload(); 218 | return false; 219 | } 220 | process_base = get_process_base(process_id); 221 | if (!process_base) 222 | { 223 | printf(skCrypt("[!] failed to get baseadress\n")); 224 | mhyprot::unload(); 225 | return false; 226 | } 227 | 228 | //printf("[+] Game Base is 0x%llX\n", process_base); 229 | const auto [e_magic, e_cblp, e_cp, e_crlc, e_cparhdr, e_minalloc, e_maxalloc, e_ss, e_sp, e_csum, e_ip, e_cs, e_lfarlc, e_ovno, e_res, e_oemid, e_oeminfo, e_res2, e_lfanew] = read(process_base); 230 | printf(skCrypt("[+] Game header Magic is 0x%llX\n"), e_magic); 231 | if (e_magic != 0x5A4D) 232 | { 233 | printf(skCrypt("[!] Game header Magic should be 0x5A4D\n")); 234 | } 235 | 236 | RECT desktop; 237 | // Get a handle to the desktop window 238 | const HWND h_desktop = GetDesktopWindow(); 239 | // Get the size of screen to the variable desktop 240 | GetWindowRect(h_desktop, &desktop); 241 | const HDC monitor = GetDC(h_desktop); 242 | 243 | const int current = GetDeviceCaps(monitor, VERTRES); 244 | const int total = GetDeviceCaps(monitor, DESKTOPVERTRES); 245 | 246 | FOverlay::screen_width = (desktop.right - desktop.left) * total / current; 247 | FOverlay::screen_height = (desktop.bottom - desktop.top) * total / current; 248 | 249 | screen_center_x = FOverlay::screen_width / 2.f; 250 | screen_center_y = FOverlay::screen_height / 2.f; 251 | g_overlay = {nullptr}; 252 | 253 | init(g_overlay); 254 | 255 | if (const HWND h_target_window = FindWindow(window_class_name, nullptr); !h_target_window) 256 | { 257 | printf("Error : Could not find window class name : %s", window_class_name); 258 | } 259 | 260 | return true; 261 | } 262 | -------------------------------------------------------------------------------- /MhyprotSource/MhyprotSource.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | Mhyprot 9 | 10 | 11 | Mhyprot 12 | 13 | 14 | Mhyprot 15 | 16 | 17 | Mhyprot 18 | 19 | 20 | Mhyprot 21 | 22 | 23 | Mhyprot 24 | 25 | 26 | utils 27 | 28 | 29 | utils 30 | 31 | 32 | ImGui 33 | 34 | 35 | ImGui 36 | 37 | 38 | ImGui 39 | 40 | 41 | ImGui 42 | 43 | 44 | ImGui 45 | 46 | 47 | ImGui 48 | 49 | 50 | ImGui 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Features 63 | 64 | 65 | Source Files 66 | 67 | 68 | Features 69 | 70 | 71 | Features 72 | 73 | 74 | SDK 75 | 76 | 77 | 78 | Offsets 79 | 80 | 81 | 82 | 83 | Header Files 84 | 85 | 86 | Header Files 87 | 88 | 89 | 90 | Header Files 91 | 92 | 93 | Mhyprot 94 | 95 | 96 | Mhyprot 97 | 98 | 99 | Mhyprot 100 | 101 | 102 | Mhyprot 103 | 104 | 105 | Mhyprot 106 | 107 | 108 | Mhyprot 109 | 110 | 111 | Mhyprot 112 | 113 | 114 | Mhyprot 115 | 116 | 117 | Mhyprot 118 | 119 | 120 | Mhyprot 121 | 122 | 123 | Mhyprot 124 | 125 | 126 | Header Files 127 | 128 | 129 | utils 130 | 131 | 132 | utils 133 | 134 | 135 | ImGui 136 | 137 | 138 | ImGui 139 | 140 | 141 | ImGui 142 | 143 | 144 | ImGui 145 | 146 | 147 | ImGui 148 | 149 | 150 | ImGui 151 | 152 | 153 | ImGui 154 | 155 | 156 | ImGui 157 | 158 | 159 | Header Files 160 | 161 | 162 | Header Files 163 | 164 | 165 | Features 166 | 167 | 168 | SDK 169 | 170 | 171 | Header Files 172 | 173 | 174 | Header Files 175 | 176 | 177 | Features 178 | 179 | 180 | Features 181 | 182 | 183 | SDK 184 | 185 | 186 | 187 | Offsets 188 | 189 | 190 | 191 | 192 | {7120ad04-ae0b-428e-9db8-e5debd1e8666} 193 | 194 | 195 | {55d1cb7c-6ec4-4116-b86b-a79c80cd88dd} 196 | 197 | 198 | {a6bc496b-7683-472f-9075-cab7da83704a} 199 | 200 | 201 | {0cf05589-dc4d-476a-a4c1-aa0fbd420931} 202 | 203 | 204 | {19719a17-1dd9-4ced-9036-cd877871d86b} 205 | 206 | 207 | {d97feecf-3686-4af8-a086-be1a79567bc3} 208 | 209 | 210 | {4c25352b-5ed5-4ad5-8aaf-539013058132} 211 | 212 | 213 | {1e752358-d2ab-4bc9-bdd4-bfb22c7215cb} 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/baseadress.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "baseadress.h" 3 | #include 4 | #include "mhyprot.hpp" 5 | #include "readbase.hpp" 6 | 7 | uint64_t process_id; 8 | uint64_t systembase = 0; 9 | uint64_t ep_image_file_name = 0; 10 | uint64_t ep_unique_process_id = 0; 11 | uint64_t ep_section_base_address = 0; 12 | uint64_t ep_active_process_links = 0; 13 | 14 | bool read_virtual(const uint64_t address, uint8_t* buffer, const int size) 15 | { 16 | const auto paddress = address; 17 | return mhyprot::driver_impl::read_kernel_memory(paddress, buffer, size); 18 | } 19 | 20 | uint64_t sf_get_e_process(const int pid) 21 | { 22 | const auto handle_info = QueryInfo(SystemHandleInformation); 23 | if (!handle_info) 24 | return 0; 25 | 26 | for (size_t i = 0; i < handle_info->HandleCount; i++) 27 | if (pid == handle_info->Handles[i].ProcessId && 7 == handle_info->Handles[i].ObjectTypeNumber) 28 | { 29 | //logger::log2("[+] Got Handle is 0x%llX\n", reinterpret_cast(handle_info->Handles[i].Object)); 30 | return reinterpret_cast(handle_info->Handles[i].Object); 31 | } 32 | return 0; 33 | } 34 | 35 | uint64_t get_e_process(const int pid) 36 | { 37 | _LIST_ENTRY active_process_links; 38 | 39 | read_virtual(sf_get_e_process(4) + ep_active_process_links, reinterpret_cast(&active_process_links), sizeof(active_process_links)); 40 | 41 | while (true) 42 | { 43 | uint64_t next_pid = 0; 44 | char buffer[0xFFFF]; 45 | const uint64_t next_link = reinterpret_cast(active_process_links.Flink); 46 | const uint64_t next = next_link - ep_active_process_links; 47 | read_virtual(next + ep_unique_process_id, reinterpret_cast(&next_pid), sizeof(next_pid)); 48 | read_virtual(next + ep_image_file_name, reinterpret_cast(&buffer), sizeof(buffer)); 49 | read_virtual(next + ep_active_process_links, reinterpret_cast(&active_process_links), sizeof(active_process_links)); 50 | if (GetAsyncKeyState(VK_MENU)) 51 | { 52 | mhyprot::unload(); 53 | } 54 | 55 | if (next_pid == pid) 56 | { 57 | return next; 58 | } 59 | if (next_pid == 4 || next_pid == 0) 60 | break; 61 | } 62 | return 0; 63 | } 64 | 65 | uint64_t get_kernel_module_address(const std::string& module_name) 66 | { 67 | void* buffer = nullptr; 68 | DWORD buffer_size = 0; 69 | 70 | NTSTATUS status = NtQuerySystemInformation(static_cast(SystemModuleInformation), buffer, 71 | buffer_size, &buffer_size); 72 | 73 | while (status == STATUS_INFO_LENGTH_MISMATCH) 74 | { 75 | VirtualFree(buffer, 0, MEM_RELEASE); 76 | 77 | buffer = VirtualAlloc(nullptr, buffer_size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); 78 | status = NtQuerySystemInformation(static_cast(SystemModuleInformation), buffer, 79 | buffer_size, &buffer_size); 80 | } 81 | 82 | if (!NT_SUCCESS(status)) 83 | { 84 | VirtualFree(buffer, 0, MEM_RELEASE); 85 | return 0; 86 | } 87 | 88 | const auto modules = static_cast(buffer); 89 | 90 | for (auto i = 0u; i < modules->NumberOfModules; ++i) 91 | { 92 | const auto current_module_name = std::string( 93 | reinterpret_cast(modules->Modules[i].FullPathName) + modules->Modules[i].OffsetToFileName); 94 | 95 | if (!_stricmp(current_module_name.c_str(), module_name.c_str())) 96 | { 97 | const auto result = reinterpret_cast(modules->Modules[i].ImageBase); 98 | 99 | VirtualFree(buffer, 0, MEM_RELEASE); 100 | return result; 101 | } 102 | } 103 | 104 | VirtualFree(buffer, 0, MEM_RELEASE); 105 | return 0; 106 | } 107 | 108 | void fix_offsets() 109 | { 110 | using namespace std; 111 | 112 | NTSTATUS (WINAPI * rtl_get_version)(LPOSVERSIONINFOEXW); 113 | OSVERSIONINFOEXW os_info; 114 | 115 | *reinterpret_cast(&rtl_get_version) = GetProcAddress(GetModuleHandleA("ntdll"), 116 | "RtlGetVersion"); 117 | 118 | DWORD build = 0; 119 | 120 | if (nullptr != rtl_get_version) 121 | { 122 | os_info.dwOSVersionInfoSize = sizeof(os_info); 123 | rtl_get_version(&os_info); 124 | build = os_info.dwBuildNumber; 125 | } 126 | 127 | //https://www.vergiliusproject.com/kernels/x64/Windows%2010%20|%202016/2009%2020H2%20(October%202020%20Update)/_EPROCESS 128 | switch (build) // some offsets might be wrong, check it yourself it if does not work 129 | { 130 | case 22000: //WIN11 131 | ep_image_file_name = 0x5a8; 132 | ep_unique_process_id = 0x440; 133 | ep_section_base_address = 0x520; 134 | ep_active_process_links = 0x448; 135 | break; 136 | case 19044: //WIN10_21H2 137 | ep_image_file_name = 0x5a8; 138 | ep_unique_process_id = 0x440; 139 | ep_section_base_address = 0x520; 140 | ep_active_process_links = 0x448; 141 | break; 142 | case 19043: //WIN10_21H1 143 | ep_image_file_name = 0x5a8; 144 | ep_unique_process_id = 0x440; 145 | ep_section_base_address = 0x520; 146 | ep_active_process_links = 0x448; 147 | break; 148 | case 19042: //WIN10_20H2 149 | ep_image_file_name = 0x5a8; 150 | ep_unique_process_id = 0x440; 151 | ep_section_base_address = 0x520; 152 | ep_active_process_links = 0x448; 153 | break; 154 | case 19041: //WIN10_20H1 155 | ep_image_file_name = 0x5a8; 156 | ep_unique_process_id = 0x440; 157 | ep_section_base_address = 0x520; 158 | ep_active_process_links = 0x448; 159 | break; 160 | case 18363: //WIN10_19H2 161 | ep_image_file_name = 0x450; 162 | ep_unique_process_id = 0x2e8; 163 | ep_section_base_address = 0x3c8; 164 | ep_active_process_links = 0x2f0; 165 | break; 166 | case 18362: //WIN10_19H1 167 | ep_image_file_name = 0x450; 168 | ep_unique_process_id = 0x2e8; 169 | ep_section_base_address = 0x3c8; 170 | ep_active_process_links = 0x2f0; 171 | break; 172 | case 17763: //WIN10_RS5 173 | ep_image_file_name = 0x450; 174 | ep_unique_process_id = 0x2e0; 175 | ep_section_base_address = 0x3c0; 176 | ep_active_process_links = 0x2e8; 177 | break; 178 | case 17134: //WIN10_RS4 179 | ep_image_file_name = 0x450; 180 | ep_unique_process_id = 0x2e0; 181 | ep_section_base_address = 0x3c0; 182 | ep_active_process_links = 0x2e8; 183 | break; 184 | case 16299: //WIN10_RS3 185 | ep_image_file_name = 0x450; 186 | ep_unique_process_id = 0x2e0; 187 | ep_section_base_address = 0x3c0; 188 | ep_active_process_links = 0x2e8; 189 | break; 190 | case 15063: //WIN10_RS2 191 | ep_image_file_name = 0x450; 192 | ep_unique_process_id = 0x2e0; 193 | ep_section_base_address = 0x3c0; 194 | ep_active_process_links = 0x2e8; 195 | break; 196 | case 14393: //WIN10_RS1 197 | ep_image_file_name = 0x450; 198 | ep_unique_process_id = 0x2e8; 199 | ep_section_base_address = 0x3c0; 200 | ep_active_process_links = 0x2f0; 201 | break; 202 | case 10586: //WIN10_TH2 203 | ep_image_file_name = 0x450; 204 | ep_unique_process_id = 0x2e8; 205 | ep_section_base_address = 0x3c0; 206 | ep_active_process_links = 0x2f0; 207 | break; 208 | default: 209 | printf( 210 | "[!] No Support for %d,\n check https://www.vergiliusproject.com/kernels/x64/Windows%2011/Insider%20Preview%20(Jun%202021)/_EPROCESS to update the code\n", 211 | build); 212 | exit(0); 213 | break; 214 | } 215 | printf("[+] Found offsets for %d!\n", build); 216 | } 217 | 218 | uint64_t get_process_id() 219 | { 220 | return process_id; 221 | } 222 | 223 | uint64_t get_process_base(const int pid) 224 | { 225 | fix_offsets(); 226 | 227 | if (systembase == 0) 228 | { 229 | systembase = get_kernel_module_address("ntoskrnl.exe"); 230 | } 231 | uint64_t base = 0; 232 | logger::log2(skCrypt("[+] Got System Base is 0x%llX\n"), systembase); 233 | read_virtual(get_e_process(pid) + ep_section_base_address, (uint8_t*)&base, sizeof(base)); 234 | logger::log2(skCrypt("[+] Got Process Base is 0x%llX\n"), base); 235 | process_id = pid; 236 | return base; 237 | } 238 | 239 | uint64_t get_process_id(const char* process_name) 240 | { 241 | UINT pid = 0; 242 | const HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 243 | PROCESSENTRY32 process; 244 | ZeroMemory(&process, sizeof(process)); 245 | process.dwSize = sizeof(process); 246 | if (Process32First(snapshot, &process)) 247 | { 248 | do 249 | { 250 | if (std::strcmp(process.szExeFile, process_name) == 0) 251 | { 252 | //printf("PID::: %d : [%s] , %s\n\n", process.th32ProcessID, process.szExeFile, process_name); 253 | pid = process.th32ProcessID; 254 | break; 255 | } 256 | } 257 | while (Process32Next(snapshot, &process)); 258 | } 259 | CloseHandle(snapshot); 260 | return pid; 261 | } 262 | 263 | bool read_raw(const int pid, const uint64_t address, void* buffer, const size_t size) 264 | { 265 | return mhyprot::driver_impl::read_user_memory(pid, address, buffer, size); 266 | } 267 | 268 | bool write_raw(const int pid, const uint64_t address, void* buffer, const size_t size) 269 | { 270 | return mhyprot::driver_impl::write_user_memory(pid, address, buffer, size); 271 | } 272 | 273 | bool is_valid(const uint64_t adress) 274 | { 275 | if (adress <= 0x400000 || adress == 0xCCCCCCCCCCCCCCCC || reinterpret_cast(adress) == nullptr || adress > 276 | 0x7FFFFFFFFFFFFFFF) 277 | { 278 | return false; 279 | } 280 | 281 | return true; 282 | } 283 | -------------------------------------------------------------------------------- /MhyprotSource/ImGui/imconfig.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI 3 | // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. 4 | // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. 5 | //----------------------------------------------------------------------------- 6 | // A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it) 7 | // B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template. 8 | //----------------------------------------------------------------------------- 9 | // You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp 10 | // files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures. 11 | // Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts. 12 | // Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using. 13 | //----------------------------------------------------------------------------- 14 | 15 | #pragma once 16 | 17 | //---- Define assertion handler. Defaults to calling assert(). 18 | // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. 19 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) 20 | //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts 21 | 22 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows 23 | // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. 24 | // DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions() 25 | // for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details. 26 | //#define IMGUI_API __declspec( dllexport ) 27 | //#define IMGUI_API __declspec( dllimport ) 28 | 29 | //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. 30 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 31 | //#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions. 32 | 33 | //---- Disable all of Dear ImGui or don't implement standard windows. 34 | // It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp. 35 | //#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty. 36 | //#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended. 37 | //#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger and other debug tools: ShowMetricsWindow() and ShowStackToolWindow() will be empty. 38 | 39 | //---- Don't implement some functions to reduce linkage requirements. 40 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a) 41 | //#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW) 42 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a) 43 | //#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime). 44 | //#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default). 45 | //#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf) 46 | //#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself. 47 | //#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies) 48 | //#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function. 49 | //#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions(). 50 | //#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available 51 | 52 | //---- Include imgui_user.h at the end of imgui.h as a convenience 53 | //#define IMGUI_INCLUDE_IMGUI_USER_H 54 | 55 | //---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another) 56 | //#define IMGUI_USE_BGRA_PACKED_COLOR 57 | 58 | //---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...) 59 | //#define IMGUI_USE_WCHAR32 60 | 61 | //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version 62 | // By default the embedded implementations are declared static and not available outside of Dear ImGui sources files. 63 | //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" 64 | //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" 65 | //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION 66 | //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION 67 | 68 | //---- Use stb_printf's faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined) 69 | // Requires 'stb_sprintf.h' to be available in the include path. Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf. 70 | // #define IMGUI_USE_STB_SPRINTF 71 | 72 | //---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui) 73 | // Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided). 74 | // On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'. 75 | //#define IMGUI_ENABLE_FREETYPE 76 | 77 | //---- Use stb_truetype to build and rasterize the font atlas (default) 78 | // The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend. 79 | //#define IMGUI_ENABLE_STB_TRUETYPE 80 | 81 | //---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4. 82 | // This will be inlined as part of ImVec2 and ImVec4 class declarations. 83 | /* 84 | #define IM_VEC2_CLASS_EXTRA \ 85 | ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ 86 | operator MyVec2() const { return MyVec2(x,y); } 87 | 88 | #define IM_VEC4_CLASS_EXTRA \ 89 | ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ 90 | operator MyVec4() const { return MyVec4(x,y,z,w); } 91 | */ 92 | 93 | //---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices. 94 | // Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices). 95 | // Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer. 96 | // Read about ImGuiBackendFlags_RendererHasVtxOffset for details. 97 | //#define ImDrawIdx unsigned int 98 | 99 | //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly) 100 | //struct ImDrawList; 101 | //struct ImDrawCmd; 102 | //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); 103 | //#define ImDrawCallback MyImDrawCallback 104 | 105 | //---- Debug Tools: Macro to break in Debugger 106 | // (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.) 107 | //#define IM_DEBUG_BREAK IM_ASSERT(0) 108 | //#define IM_DEBUG_BREAK __debugbreak() 109 | 110 | //---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(), 111 | // (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.) 112 | // This adds a small runtime cost which is why it is not enabled by default. 113 | //#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX 114 | 115 | //---- Debug Tools: Enable slower asserts 116 | //#define IMGUI_DEBUG_PARANOID 117 | 118 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. 119 | /* 120 | namespace ImGui 121 | { 122 | void MyFunction(const char* name, const MyMatrix44& v); 123 | } 124 | */ 125 | -------------------------------------------------------------------------------- /MhyprotSource/Overlay.cpp: -------------------------------------------------------------------------------- 1 | #include "overlay.h" 2 | #include 3 | #include 4 | 5 | static HWND win; 6 | int FOverlay::screen_height = 0; 7 | int FOverlay::screen_width = 0; 8 | 9 | /* 10 | Window functions 11 | */ 12 | 13 | void FOverlay::window_set_style() 14 | { 15 | int i = 0; 16 | 17 | i = static_cast(GetWindowLong(win, -20)); 18 | 19 | SetWindowLongPtr(win, -20, i | 0x20); 20 | } 21 | 22 | void FOverlay::window_set_transparency() 23 | { 24 | MARGINS margin; 25 | UINT color_key = 0; 26 | UINT opacity = 0; 27 | 28 | margin.cyBottomHeight = -1; 29 | margin.cxLeftWidth = -1; 30 | margin.cxRightWidth = -1; 31 | margin.cyTopHeight = -1; 32 | 33 | DwmExtendFrameIntoClientArea(win, &margin); 34 | 35 | constexpr UINT opacity_flag = 0x02; 36 | UINT color_key_flag = 0x01; 37 | color_key = 0x000000; 38 | opacity = 0xFF; 39 | 40 | SetLayeredWindowAttributes(win, color_key, opacity, opacity_flag); 41 | } 42 | 43 | void FOverlay::window_set_top_most() 44 | { 45 | SetWindowPos(win, HWND_TOPMOST, screen_width, screen_height, screen_width, screen_height, 0x0002 | 0x0001); 46 | } 47 | 48 | HWND FOverlay::retrieve_window() { return win; } 49 | 50 | constexpr MARGINS margin = {0, 0, 0, 0}; 51 | 52 | LRESULT CALLBACK window_proc(const HWND hwnd, const UINT u_msg, const WPARAM w_param, const LPARAM l_param) 53 | { 54 | switch (u_msg) 55 | { 56 | case (WM_PAINT): 57 | DwmExtendFrameIntoClientArea(win, &margin); 58 | break; 59 | } 60 | 61 | return DefWindowProc(hwnd, u_msg, w_param, l_param); 62 | } 63 | 64 | void FOverlay::create_window() 65 | { 66 | const auto lp_class_name = "espoverlay"; 67 | const auto lp_window_name = "Baseult Overlay"; 68 | 69 | WNDCLASSEX wc; 70 | ZeroMemory(&wc, sizeof(WNDCLASSEX)); 71 | 72 | wc.cbSize = sizeof(WNDCLASSEX); 73 | wc.style = CS_HREDRAW | CS_VREDRAW; 74 | wc.lpfnWndProc = window_proc; 75 | wc.hInstance = GetModuleHandleA(nullptr); 76 | wc.hCursor = LoadCursor(nullptr, IDC_ARROW); 77 | wc.hbrBackground = (HBRUSH)(RGB(0, 0, 0)); 78 | wc.lpszClassName = lp_class_name; 79 | wc.lpszMenuName = lp_window_name; 80 | 81 | RegisterClassEx(&wc); 82 | 83 | win = CreateWindowExA(WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TRANSPARENT, lp_class_name, lp_window_name, WS_POPUP, 0, 0, 84 | screen_width, screen_height, nullptr, nullptr, wc.hInstance, nullptr); 85 | } 86 | 87 | // Hijacking method down here. 88 | 89 | BOOL FOverlay::window_init(const bool use_nvidia_overlay) 90 | { 91 | if (use_nvidia_overlay) 92 | { 93 | //win = FindWindow("WorkerW", ""); 94 | win = FindWindow("CEF-OSC-WIDGET", "NVIDIA GeForce Overlay"); 95 | } 96 | if (!win) 97 | create_window(); 98 | 99 | if (!win) 100 | return FALSE; 101 | 102 | window_set_style(); 103 | window_set_transparency(); 104 | window_set_top_most(); 105 | 106 | ShowWindow(win, SW_SHOW); 107 | 108 | return TRUE; 109 | } 110 | 111 | /* 112 | Overlay functions 113 | */ 114 | 115 | ID2D1Factory* d2d_factory; 116 | ID2D1HwndRenderTarget* tar; 117 | IDWriteFactory* write_factory; 118 | ID2D1SolidColorBrush* brush; 119 | ID2D1SolidColorBrush* red_brush; 120 | ID2D1SolidColorBrush* green_brush; 121 | IDWriteTextFormat* format; 122 | 123 | void FOverlay::d2d_shutdown() 124 | { 125 | // Release 126 | tar->Release(); 127 | write_factory->Release(); 128 | brush->Release(); 129 | red_brush->Release(); 130 | green_brush->Release(); 131 | d2d_factory->Release(); 132 | } 133 | 134 | BOOL FOverlay::init_d2d() const 135 | { 136 | RECT rc; 137 | 138 | // Initialize D2D here 139 | HRESULT ret = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2d_factory); 140 | if (FAILED(ret)) 141 | return FALSE; 142 | 143 | ret = 144 | DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), 145 | reinterpret_cast(&write_factory)); 146 | if (FAILED(ret)) 147 | return FALSE; 148 | 149 | write_factory->CreateTextFormat( 150 | L"Consolas", nullptr, DWRITE_FONT_WEIGHT_REGULAR, DWRITE_FONT_STYLE_NORMAL, 151 | DWRITE_FONT_STRETCH_NORMAL, 13.0, L"en-us", &format); 152 | 153 | GetClientRect(retrieve_window(), &rc); 154 | 155 | ret = d2d_factory->CreateHwndRenderTarget( 156 | D2D1::RenderTargetProperties( 157 | D2D1_RENDER_TARGET_TYPE_DEFAULT, 158 | D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, 159 | D2D1_ALPHA_MODE_PREMULTIPLIED)), 160 | D2D1::HwndRenderTargetProperties( 161 | retrieve_window(), 162 | D2D1::SizeU(rc.right - rc.left, rc.bottom - rc.top)), 163 | &tar); 164 | if (FAILED(ret)) 165 | return FALSE; 166 | 167 | tar->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::White), &brush); 168 | tar->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Red), &red_brush); 169 | tar->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Green), &green_brush); 170 | 171 | return TRUE; 172 | } 173 | 174 | void FOverlay::begin_scene() { tar->BeginDraw(); } 175 | 176 | void FOverlay::end_scene() { tar->EndDraw(); } 177 | 178 | void FOverlay::clear_scene() { tar->Clear(); } 179 | 180 | void FOverlay::draw_text_white(const int x, const int y, const char* str, ...) 181 | { 182 | char buf[4096]; 183 | int len = 0; 184 | wchar_t b[256]; 185 | 186 | // if (!draw) // no need for it. 187 | // return; 188 | 189 | va_list arg_list; 190 | va_start(arg_list, str); 191 | vsnprintf(buf, sizeof(buf), str, arg_list); 192 | va_end(arg_list); 193 | 194 | len = strlen(buf); 195 | mbstowcs(b, buf, len); 196 | 197 | tar->DrawText(b, len, format, D2D1::RectF(x, y, 1920, 1080), brush, 198 | D2D1_DRAW_TEXT_OPTIONS_NONE, DWRITE_MEASURING_MODE_NATURAL); 199 | } 200 | 201 | void FOverlay::draw_line(const int x1, const int y1, const int x2, const int y2, const D2D1::ColorF color) 202 | { 203 | auto point1 = D2D1_POINT_2F(); 204 | point1.x = x1; 205 | point1.y = y1; 206 | 207 | auto point2 = D2D1_POINT_2F(); 208 | point2.x = x2; 209 | point2.y = y2; 210 | 211 | ID2D1SolidColorBrush* temp; 212 | 213 | tar->CreateSolidColorBrush(color, &temp); 214 | tar->DrawLine(point1, point2, temp); 215 | temp->Release(); 216 | } 217 | 218 | void FOverlay::draw_arc(const int x, const int y, int radius, const int start_angle, const int percent, const int thickness, void* color) { 219 | constexpr auto precision = (2 * M_PI) / 30; 220 | constexpr auto step = M_PI / 180; 221 | const auto inner = radius - thickness; 222 | const auto end_angle = (start_angle + percent) * step; 223 | const auto start_angles = (start_angle * M_PI) / 180; 224 | 225 | for (; radius > inner; --radius) { 226 | for (auto angle = start_angles; angle < end_angle; angle += precision) { 227 | const auto cx = std::round(x + radius * std::cos(angle)); 228 | const auto cy = std::round(y + radius * std::sin(angle)); 229 | 230 | const auto cx2 = std::round(x + radius * std::cos(angle + precision)); 231 | const auto cy2 = std::round(y + radius * std::sin(angle + precision)); 232 | 233 | FOverlay::draw_line(cx, cy, cx2, cy2, D2D1::ColorF(0.0f, 1.0f, 0.0f, 1.0f)); 234 | } 235 | } 236 | } 237 | 238 | void FOverlay::draw_rect(const int x1, const int y1, const int x2, const int y2, void* color) const 239 | { 240 | auto rect = D2D1_RECT_F(); 241 | rect.bottom = y1; 242 | rect.top = y2; 243 | rect.right = x2; 244 | rect.left = x1; 245 | 246 | draw_box(rect, color); 247 | } 248 | 249 | void FOverlay::draw_box(const int x, const int y, const float width, const float height, void* color) const 250 | { 251 | auto rect = D2D1_RECT_F(); 252 | rect.bottom = y - height / 2; 253 | rect.top = y + height / 2; 254 | rect.right = x + width / 2; 255 | rect.left = x - width / 2; 256 | 257 | draw_box(rect, color); 258 | } 259 | 260 | void FOverlay::draw_box(const D2D1_RECT_F rect, void* color) 261 | { 262 | ID2D1SolidColorBrush* temp; 263 | 264 | tar->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Red), &temp); 265 | 266 | tar->FillRectangle(rect, temp); 267 | temp->Release(); 268 | } 269 | 270 | void FOverlay::draw_circle(const int x, const int y, const float radius, const float width, void* color) 271 | { 272 | ID2D1SolidColorBrush* temp; 273 | auto point = D2D1_POINT_2F(); 274 | point.x = x; 275 | point.y = y; 276 | 277 | auto elipse = D2D1_ELLIPSE(); 278 | elipse.point = point; 279 | elipse.radiusX = radius; 280 | elipse.radiusY = radius; 281 | 282 | tar->CreateSolidColorBrush(*static_cast(color), &temp); 283 | tar->DrawEllipse(elipse, temp, width); 284 | temp->Release(); 285 | } 286 | 287 | 288 | void FOverlay::draw_text(const int x, const int y, void* color, const char* str, ...) 289 | { 290 | char buf[4096]; 291 | int len = 0; 292 | wchar_t b[256]; 293 | 294 | // if (!draw) // no need for it. 295 | // return; 296 | 297 | va_list arg_list; 298 | va_start(arg_list, str); 299 | vsnprintf(buf, sizeof(buf), str, arg_list); 300 | va_end(arg_list); 301 | 302 | len = strlen(buf); 303 | mbstowcs(b, buf, len); 304 | ID2D1SolidColorBrush* temp; 305 | 306 | tar->CreateSolidColorBrush(*static_cast(color), &temp); 307 | 308 | tar->DrawText(b, len, format, D2D1::RectF(x, y, 2560, 1440), temp, 309 | D2D1_DRAW_TEXT_OPTIONS_NONE, DWRITE_MEASURING_MODE_NATURAL); 310 | temp->Release(); 311 | } 312 | 313 | void FOverlay::draw_text_red(const int x, const int y, const char* str, ...) 314 | { 315 | char buf[4096]; 316 | int len = 0; 317 | wchar_t b[256]; 318 | 319 | // if (!draw) // no need for it. 320 | // return; 321 | 322 | va_list arg_list; 323 | va_start(arg_list, str); 324 | vsnprintf(buf, sizeof(buf), str, arg_list); 325 | va_end(arg_list); 326 | 327 | len = strlen(buf); 328 | mbstowcs(b, buf, len); 329 | 330 | tar->DrawText(b, len, format, D2D1::RectF(x, y, 1920, 1080), red_brush, 331 | D2D1_DRAW_TEXT_OPTIONS_NONE, DWRITE_MEASURING_MODE_NATURAL); 332 | } 333 | 334 | void FOverlay::draw_text_green(const int x, const int y, const char* str, ...) 335 | { 336 | char buf[4096]; 337 | int len = 0; 338 | wchar_t b[256]; 339 | 340 | // if (!draw) // no need for it. 341 | // return; 342 | 343 | va_list arg_list; 344 | va_start(arg_list, str); 345 | vsnprintf(buf, sizeof(buf), str, arg_list); 346 | va_end(arg_list); 347 | 348 | len = strlen(buf); 349 | mbstowcs(b, buf, len); 350 | 351 | tar->DrawText(b, len, format, D2D1::RectF(x, y, 1920, 1080), green_brush, 352 | D2D1_DRAW_TEXT_OPTIONS_NONE, DWRITE_MEASURING_MODE_NATURAL); 353 | } 354 | 355 | void FOverlay::clear_screen() 356 | { 357 | begin_scene(); 358 | clear_scene(); 359 | end_scene(); 360 | } 361 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/mhyprot.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2020 Kento Oki 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | #include "mhyprot.hpp" 27 | #include "../skCrypter.h" 28 | 29 | // 30 | // initialization of its service and device 31 | // 32 | bool mhyprot::init() 33 | { 34 | logger::log2(skCrypt("[>] loading vulnerable driver...\n")); 35 | 36 | char temp_path[MAX_PATH]; 37 | 38 | if (const uint32_t length = GetTempPath(sizeof(temp_path), temp_path); length > MAX_PATH || !length) 39 | { 40 | logger::log2(skCrypt("[!] failed to obtain temp path. (0x%lX)\n"), GetLastError()); 41 | return false; 42 | } 43 | 44 | // 45 | // place the driver binary into the temp path 46 | // 47 | const std::string placement_path = std::string(temp_path) + MHYPROT_SYSFILE_NAME; 48 | 49 | if (std::filesystem::exists(placement_path)) 50 | { 51 | std::remove(placement_path.c_str()); 52 | } 53 | 54 | // 55 | // create driver sys from memory 56 | // 57 | if (!file_utils::create_file_from_buffer( 58 | placement_path, 59 | (void*)resource::raw_driver, 60 | sizeof(resource::raw_driver) 61 | )) 62 | { 63 | logger::log2(skCrypt("[!] failed to prepare %s. (0x%lX)\n"), MHYPROT_SYSFILE_NAME, GetLastError()); 64 | return false; 65 | } 66 | 67 | logger::log2(skCrypt("[>] preparing service...\n")); 68 | 69 | // 70 | // create service using winapi, this needs administrator privileage 71 | // 72 | detail::mhyplot_service_handle = service_utils::create_service(placement_path); 73 | 74 | if (!CHECK_HANDLE(detail::mhyplot_service_handle)) 75 | { 76 | logger::log2(skCrypt("[!] failed to create service. (0x%lX)\n"), GetLastError()); 77 | return false; 78 | } 79 | 80 | // 81 | // start the service 82 | // 83 | if (!service_utils::start_service(detail::mhyplot_service_handle)) 84 | { 85 | logger::log2(skCrypt("[!] failed to start service. (0x%lX)\n"), GetLastError()); 86 | return false; 87 | } 88 | 89 | logger::log2(skCrypt("[<] %s prepared\n"), MHYPROT_SYSFILE_NAME); 90 | 91 | // 92 | // open the handle of its driver device 93 | // 94 | detail::device_handle = CreateFile( 95 | TEXT(MHYPROT_DEVICE_NAME), 96 | GENERIC_READ | GENERIC_WRITE, 97 | 0, 98 | nullptr, 99 | OPEN_EXISTING, 100 | NULL, 101 | nullptr 102 | ); 103 | 104 | if (!CHECK_HANDLE(detail::device_handle)) 105 | { 106 | logger::log2(skCrypt("[!] failed to obtain device handle (0x%lX)\n"), GetLastError()); 107 | return false; 108 | } 109 | 110 | logger::log2(skCrypt("[+] device handle snatched (0x%llX)\n"), detail::device_handle); 111 | 112 | logger::log2(skCrypt("[>] mhyprot initialized successfully\n")); 113 | 114 | return true; 115 | } 116 | 117 | void mhyprot::unload() 118 | { 119 | if (detail::device_handle) 120 | { 121 | CloseHandle(detail::device_handle); 122 | } 123 | 124 | if (detail::mhyplot_service_handle) 125 | { 126 | service_utils::stop_service(detail::mhyplot_service_handle); 127 | service_utils::delete_service(detail::mhyplot_service_handle); 128 | } 129 | } 130 | 131 | 132 | bool mhyprot::driver_impl::request_ioctl(const DWORD ioctl_code, const LPVOID in_buffer, const DWORD in_buffer_size) 133 | { 134 | // 135 | // allocate memory for this command result 136 | // 137 | const LPVOID out_buffer = calloc(1, in_buffer_size); 138 | DWORD out_buffer_size; 139 | 140 | if (!out_buffer) 141 | { 142 | return false; 143 | } 144 | 145 | // 146 | // send the ioctl request 147 | // 148 | const bool result = DeviceIoControl( 149 | mhyprot::detail::device_handle, 150 | ioctl_code, 151 | in_buffer, 152 | in_buffer_size, 153 | out_buffer, 154 | in_buffer_size, 155 | &out_buffer_size, 156 | nullptr 157 | ); 158 | 159 | // 160 | // store the result 161 | // 162 | if (out_buffer_size) 163 | { 164 | memcpy(in_buffer, out_buffer, out_buffer_size); 165 | } 166 | 167 | 168 | free(out_buffer); 169 | 170 | 171 | return result; 172 | } 173 | 174 | // 175 | // initialize driver implementations with payload encryption requirements 176 | // 177 | bool mhyprot::driver_impl::driver_init(const bool debug_prints, const bool print_seeds) 178 | { 179 | logger::log2(skCrypt("[>] initializing driver...\n")); 180 | 181 | // 182 | // the driver initializer 183 | // 184 | MHYPROT_INITIALIZE initializer; 185 | initializer._m_002 = 0x0BAEBAEEC; 186 | initializer._m_003 = 0x0EBBAAEF4FFF89042; 187 | 188 | if (!request_ioctl(MHYPROT_IOCTL_INITIALIZE, &initializer, sizeof(initializer))) 189 | { 190 | logger::log2(skCrypt("[!] failed to initialize mhyplot driver implementation\n")); 191 | return false; 192 | } 193 | 194 | // 195 | // driver's base address in the system 196 | // 197 | const uint64_t mhyprot_address = win_utils:: 198 | obtain_sysmodule_address(MHYPROT_SYSFILE_NAME, debug_prints); 199 | 200 | if (!mhyprot_address) 201 | { 202 | logger::log2(skCrypt("[!] failed to locate mhyprot module address. (0x%lX)\n"), GetLastError()); 203 | return false; 204 | } 205 | 206 | logger::log2(skCrypt("[+] %s is @ 0x%llX\n"), MHYPROT_SYSFILE_NAME, mhyprot_address); 207 | 208 | // 209 | // read the pointer that points to the seedmap that used to encrypt payloads 210 | // the pointer on the [driver.sys + 0xA0E8] 211 | // 212 | const auto seedmap_address = driver_impl:: 213 | read_kernel_memory(mhyprot_address + MHYPROT_OFFSET_SEEDMAP); 214 | 215 | logger::log2(skCrypt("[+] seedmap in kernel [0x%llX + 0x%lX] @ (seedmap)0x%llX\n"), 216 | mhyprot_address, MHYPROT_OFFSET_SEEDMAP, seedmap_address); 217 | 218 | if (!seedmap_address) 219 | { 220 | logger::log2(skCrypt("[!] failed to locate seedmap in kernel\n")); 221 | return false; 222 | } 223 | 224 | // 225 | // read the entire seedmap as size of 0x9C0 226 | // 227 | if (!driver_impl::read_kernel_memory( 228 | seedmap_address, 229 | &detail::seedmap, 230 | sizeof(detail::seedmap) 231 | )) 232 | { 233 | logger::log2(skCrypt("[!] failed to pickup seedmap from kernel\n")); 234 | return false; 235 | } 236 | 237 | for (int i = 0; i < (sizeof(detail::seedmap) / sizeof(detail::seedmap[0])); i++) 238 | { 239 | if (print_seeds) 240 | logger::log2(skCrypt("[+] seedmap (%05d): 0x%llX\n"), i, detail::seedmap[i]); 241 | } 242 | 243 | logger::log2(skCrypt("[<] driver initialized successfully.\n")); 244 | 245 | return true; 246 | } 247 | 248 | // 249 | // generate a key for the payload 250 | // 251 | uint64_t mhyprot::driver_impl::generate_key(const uint64_t seed) 252 | { 253 | uint64_t k = ((((seed >> 29) & 0x555555555 ^ seed) & 0x38EB3FFFF6D3) << 17) ^ (seed >> 29) & 0x555555555 ^ seed; 254 | return ((k & 0xFFFFFFFFFFFFBF77u) << 37) ^ k ^ ((((k & 0xFFFFFFFFFFFFBF77u) << 37) ^ k) >> 43); 255 | } 256 | 257 | // 258 | // encrypt the payload 259 | // 260 | void mhyprot::driver_impl::encrypt_payload(void* payload, const size_t size) 261 | { 262 | if (size % 8) 263 | { 264 | logger::log2(skCrypt("[!] (payload) size must be 8-byte alignment")); 265 | return; 266 | } 267 | 268 | if (size / 8 >= 312) 269 | { 270 | logger::log2(skCrypt("[!] (payload) size must be < 0x9C0")); 271 | return; 272 | } 273 | 274 | const auto p_payload = static_cast(payload); 275 | DWORD64 key_to_base = 0; 276 | 277 | for (DWORD i = 1; i < size / 8; i++) 278 | { 279 | const uint64_t key = driver_impl::generate_key(detail::seedmap[i - 1]); 280 | p_payload[i] = p_payload[i] ^ key ^ (key_to_base + p_payload[0]); 281 | key_to_base += 0x10; 282 | } 283 | } 284 | 285 | // 286 | // read memory from the kernel using vulnerable ioctl 287 | // 288 | bool mhyprot::driver_impl::read_kernel_memory(const uint64_t address, void* buffer, const size_t size) 289 | { 290 | if (!buffer) 291 | { 292 | return false; 293 | } 294 | 295 | const DWORD payload_size = size + sizeof(DWORD); 296 | const auto payload = static_cast(calloc(1, payload_size)); 297 | 298 | if (!payload) 299 | { 300 | return false; 301 | } 302 | 303 | payload->header.address = address; 304 | payload->size = size; 305 | 306 | if (!request_ioctl(MHYPROT_IOCTL_READ_KERNEL_MEMORY, payload, payload_size)) 307 | { 308 | return false; 309 | } 310 | 311 | if (!payload->header.result) 312 | { 313 | memcpy(buffer, reinterpret_cast(payload) + 4, size); 314 | return true; 315 | } 316 | 317 | return false; 318 | } 319 | 320 | // 321 | // read specific process memory from the kernel using vulnerable ioctl 322 | // let the driver to execute MmCopyVirtualMemory 323 | // 324 | bool mhyprot::driver_impl::read_user_memory( 325 | const uint32_t process_id, const uint64_t address, void* buffer, const size_t size) 326 | { 327 | MHYPROT_USER_READ_WRITE_REQUEST payload; 328 | payload.action = MHYPROT_ACTION_READ; // action code 329 | payload.process_id = process_id; // target process id 330 | payload.address = address; // address 331 | payload.buffer = (uint64_t)buffer; // our buffer 332 | payload.size = size; // size 333 | 334 | encrypt_payload(&payload, sizeof(payload)); 335 | 336 | return request_ioctl( 337 | MHYPROT_IOCTL_READ_WRITE_USER_MEMORY, 338 | &payload, 339 | sizeof(payload) 340 | ); 341 | } 342 | 343 | // 344 | // write specific process memory from the kernel using vulnerable ioctl 345 | // let the driver to execute MmCopyVirtualMemory 346 | // 347 | bool mhyprot::driver_impl::write_user_memory( 348 | const uint32_t process_id, const uint64_t address, void* buffer,const size_t size) 349 | { 350 | MHYPROT_USER_READ_WRITE_REQUEST payload; 351 | payload.action = MHYPROT_ACTION_WRITE; // action code 352 | payload.process_id = process_id; // target process id 353 | payload.address = (uint64_t)buffer; // our buffer 354 | payload.buffer = address; // destination 355 | payload.size = size; // size 356 | 357 | encrypt_payload(&payload, sizeof(payload)); 358 | 359 | return request_ioctl( 360 | MHYPROT_IOCTL_READ_WRITE_USER_MEMORY, 361 | &payload, 362 | sizeof(payload) 363 | ); 364 | } 365 | -------------------------------------------------------------------------------- /MhyprotSource/MhyprotSource.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {38615e7b-2999-42db-a704-ed8e79b9a0b5} 25 | PaladinsHack 26 | 10.0 27 | Mhyprot Base Source 28 | 29 | 30 | 31 | Application 32 | true 33 | v143 34 | MultiByte 35 | 36 | 37 | Application 38 | false 39 | v143 40 | true 41 | Unicode 42 | 43 | 44 | Application 45 | true 46 | v142 47 | MultiByte 48 | 49 | 50 | Application 51 | false 52 | v142 53 | true 54 | MultiByte 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | true 76 | 77 | 78 | false 79 | 80 | 81 | true 82 | $(DXSDK_DIR)Lib\x64;$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86;$(IncludePath);$(DXSDK_DIR)Include;$(LibraryPath) 83 | $(DXSDK_DIR)Include;$(WindowsSDK_IncludePath);$(VC_IncludePath);$(IncludePath) 84 | 85 | 86 | false 87 | $(DXSDK_DIR)Include;$(WindowsSDK_IncludePath);$(VC_IncludePath);$(IncludePath) 88 | $(DXSDK_DIR)Lib\x64;$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86;$(IncludePath);$(DXSDK_DIR)Include;$(LibraryPath) 89 | 90 | 91 | 92 | Level3 93 | true 94 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 95 | true 96 | stdcpp17 97 | stdc17 98 | 99 | 100 | Console 101 | true 102 | 103 | 104 | 105 | 106 | Level3 107 | true 108 | true 109 | true 110 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 111 | true 112 | 113 | 114 | Console 115 | true 116 | true 117 | true 118 | 119 | 120 | 121 | 122 | Level3 123 | true 124 | _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 125 | true 126 | stdcpp17 127 | 128 | 129 | Console 130 | true 131 | RequireAdministrator 132 | d3d11.lib;d3dcompiler.lib;dxgi.lib;%(AdditionalDependencies) 133 | 134 | 135 | 136 | 137 | Level3 138 | true 139 | true 140 | true 141 | NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 142 | true 143 | stdcpp17 144 | 145 | 146 | 147 | 148 | Console 149 | true 150 | true 151 | false 152 | RequireAdministrator 153 | UseLinkTimeCodeGeneration 154 | d3d11.lib;d3dcompiler.lib;dxgi.lib;%(AdditionalDependencies) 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /MhyprotSource/Mhyprot/readbase.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _SUPERFETCH_NATIVE_H 2 | #define _SUPERFETCH_NATIVE_H 3 | #pragma comment(lib, "ntdll.lib") 4 | #define _AMD64_ 5 | #include 6 | #include "nt.hpp" 7 | #include 8 | 9 | typedef long NTSTATUS, *PNTSTATUS; 10 | #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) 11 | #include 12 | #include 13 | 14 | 15 | using SUPERFETCH_INFORMATION_CLASS = enum _SUPERFETCH_INFORMATION_CLASS 16 | { 17 | SuperfetchRetrieveTrace = 1, 18 | // Query 19 | SuperfetchSystemParameters = 2, 20 | // Query 21 | SuperfetchLogEvent = 3, 22 | // Set 23 | SuperfetchGenerateTrace = 4, 24 | // Set 25 | SuperfetchPrefetch = 5, 26 | // Set 27 | SuperfetchPfnQuery = 6, 28 | // Query 29 | SuperfetchPfnSetPriority = 7, 30 | // Set 31 | SuperfetchPrivSourceQuery = 8, 32 | // Query 33 | SuperfetchSequenceNumberQuery = 9, 34 | // Query 35 | SuperfetchScenarioPhase = 10, 36 | // Set 37 | SuperfetchWorkerPriority = 11, 38 | // Set 39 | SuperfetchScenarioQuery = 12, 40 | // Query 41 | SuperfetchScenarioPrefetch = 13, 42 | // Set 43 | SuperfetchRobustnessControl = 14, 44 | // Set 45 | SuperfetchTimeControl = 15, 46 | // Set 47 | SuperfetchMemoryListQuery = 16, 48 | // Query 49 | SuperfetchMemoryRangesQuery = 17, 50 | // Query 51 | SuperfetchTracingControl = 18, 52 | // Set 53 | SuperfetchTrimWhileAgingControl = 19, 54 | SuperfetchInformationMax = 20 55 | }; 56 | 57 | // 58 | // Buffer for NtQuery/SetInformationSystem for the Superfetch Class 59 | // 60 | typedef struct _SUPERFETCH_INFORMATION 61 | { 62 | ULONG Version; 63 | ULONG Magic; 64 | SUPERFETCH_INFORMATION_CLASS InfoClass; 65 | PVOID Data; 66 | ULONG Length; 67 | } SUPERFETCH_INFORMATION, *PSUPERFETCH_INFORMATION; 68 | 69 | typedef struct _RTL_BITMAP 70 | { 71 | ULONG SizeOfBitMap; 72 | PULONG Buffer; 73 | } RTL_BITMAP, *PRTL_BITMAP; 74 | 75 | 76 | typedef struct _PF_PHYSICAL_MEMORY_RANGE 77 | { 78 | ULONG_PTR BasePfn; 79 | ULONG_PTR PageCount; 80 | } PF_PHYSICAL_MEMORY_RANGE, *PPF_PHYSICAL_MEMORY_RANGE; 81 | 82 | typedef struct _PF_MEMORY_RANGE_INFO 83 | { 84 | ULONG Version; 85 | ULONG RangeCount; 86 | PF_PHYSICAL_MEMORY_RANGE Ranges[ANYSIZE_ARRAY]; 87 | } PF_MEMORY_RANGE_INFO, *PPF_MEMORY_RANGE_INFO; 88 | 89 | typedef struct _PHYSICAL_MEMORY_RUN 90 | { 91 | SIZE_T BasePage; 92 | SIZE_T PageCount; 93 | } PHYSICAL_MEMORY_RUN, *PPHYSICAL_MEMORY_RUN; 94 | 95 | 96 | typedef struct _SYSTEM_BASIC_INFORMATION 97 | { 98 | ULONG Reserved; 99 | ULONG TimerResolution; 100 | ULONG PageSize; 101 | ULONG NumberOfPhysicalPages; 102 | ULONG LowestPhysicalPageNumber; 103 | ULONG HighestPhysicalPageNumber; 104 | ULONG AllocationGranularity; 105 | ULONG_PTR MinimumUserModeAddress; 106 | ULONG_PTR MaximumUserModeAddress; 107 | ULONG_PTR ActiveProcessorsAffinityMask; 108 | CCHAR NumberOfProcessors; 109 | } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION; 110 | 111 | struct RTL_PROCESS_MODULE_INFORMATION 112 | { 113 | unsigned int Section; 114 | void* MappedBase; 115 | void* ImageBase; 116 | unsigned int ImageSize; 117 | unsigned int Flags; 118 | unsigned short LoadOrderIndex; 119 | unsigned short InitOrderIndex; 120 | unsigned short LoadCount; 121 | unsigned short OffsetToFileName; 122 | char FullPathName[256]; 123 | }; 124 | 125 | typedef struct RTL_PROCESS_MODULES 126 | { 127 | unsigned int NumberOfModules; 128 | RTL_PROCESS_MODULE_INFORMATION Modules[0]; 129 | } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES; 130 | 131 | struct SYSTEM_HANDLE 132 | { 133 | ULONG ProcessId; 134 | BYTE ObjectTypeNumber; 135 | BYTE Flags; 136 | USHORT Handle; 137 | PVOID Object; 138 | ACCESS_MASK GrantedAccess; 139 | }; 140 | 141 | struct SYSTEM_HANDLE_INFORMATION 142 | { 143 | ULONG HandleCount; 144 | SYSTEM_HANDLE Handles[0]; 145 | }; 146 | 147 | extern "C" NTSTATUS WINAPI NtQuerySystemInformation( 148 | IN SYSTEM_INFORMATION_CLASS SystemInformationClass, 149 | OUT PVOID SystemInformation, 150 | IN ULONG SystemInformationLength, 151 | OUT PULONG ReturnLength OPTIONAL 152 | ); 153 | 154 | 155 | #define PAGE_SHIFT 12 156 | #define PAGE_SIZE (1 << 12) 157 | 158 | #define SE_DEBUG_PRIVILEGE (20L) 159 | #define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L) 160 | 161 | extern "C" NTSTATUS NTAPI RtlAdjustPrivilege( 162 | IN ULONG Privilege, 163 | IN BOOLEAN NewValue, 164 | IN BOOLEAN ForThread, 165 | OUT PBOOLEAN OldValue 166 | ); 167 | 168 | #define SPAGE_SIZE 0x1000 169 | #define SUPERFETCH_VERSION 45 170 | #define SUPERFETCH_MAGIC 'kuhC' 171 | 172 | #endif 173 | 174 | #define PAGE_SHIFT 12 175 | #define PAGE_SIZE (1 << 12) 176 | 177 | #define SE_DEBUG_PRIVILEGE (20L) 178 | #define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L) 179 | 180 | extern "C" NTSTATUS NTAPI RtlAdjustPrivilege( 181 | IN ULONG Privilege, 182 | IN BOOLEAN NewValue, 183 | IN BOOLEAN ForThread, 184 | OUT PBOOLEAN OldValue 185 | ); 186 | 187 | #define SPAGE_SIZE 0x1000 188 | #define SUPERFETCH_VERSION 45 189 | #define SUPERFETCH_MAGIC 'kuhC' 190 | 191 | #define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR)&(((type *)0)->field)) 192 | #define MI_GET_PFN(x) (PMMPFN_IDENTITY)(&MmPfnDatabase->PageData[(x)]) 193 | 194 | typedef struct _SYSTEM_MEMORY_LIST_INFORMATION 195 | { 196 | SIZE_T ZeroPageCount; 197 | SIZE_T FreePageCount; 198 | SIZE_T ModifiedPageCount; 199 | SIZE_T ModifiedNoWritePageCount; 200 | SIZE_T BadPageCount; 201 | SIZE_T PageCountByPriority[8]; 202 | SIZE_T RepurposedPagesByPriority[8]; 203 | ULONG_PTR ModifiedPageCountPageFile; 204 | } SYSTEM_MEMORY_LIST_INFORMATION, *PSYSTEM_MEMORY_LIST_INFO; 205 | 206 | typedef struct _MEMORY_FRAME_INFORMATION 207 | { 208 | ULONGLONG UseDescription : 4; 209 | ULONGLONG ListDescription : 3; 210 | ULONGLONG Reserved0 : 1; 211 | ULONGLONG Pinned : 1; 212 | ULONGLONG DontUse : 48; 213 | ULONGLONG Priority : 3; 214 | ULONGLONG Reserved : 4; 215 | } MEMORY_FRAME_INFORMATION, *PMEMORY_FRAME_INFORMATION; 216 | 217 | typedef struct _FILEOFFSET_INFORMATION 218 | { 219 | ULONGLONG DontUse : 9; 220 | ULONGLONG Offset : 48; 221 | ULONGLONG Reserved : 7; 222 | } FILEOFFSET_INFORMATION, *PFILEOFFSET_INFORMATION; 223 | 224 | typedef struct _PAGEDIR_INFORMATION 225 | { 226 | ULONGLONG DontUse : 9; 227 | ULONGLONG PageDirectoryBase : 48; 228 | ULONGLONG Reserved : 7; 229 | } PAGEDIR_INFORMATION, *PPAGEDIR_INFORMATION; 230 | 231 | typedef struct _UNIQUE_PROCESS_INFORMATION 232 | { 233 | ULONGLONG DontUse : 9; 234 | ULONGLONG UniqueProcessKey : 48; 235 | ULONGLONG Reserved : 7; 236 | } UNIQUE_PROCESS_INFORMATION, *PUNIQUE_PROCESS_INFORMATION; 237 | 238 | typedef struct _MMPFN_IDENTITY 239 | { 240 | union 241 | { 242 | MEMORY_FRAME_INFORMATION e1; 243 | FILEOFFSET_INFORMATION e2; 244 | PAGEDIR_INFORMATION e3; 245 | UNIQUE_PROCESS_INFORMATION e4; 246 | } u1; 247 | 248 | SIZE_T PageFrameIndex; 249 | 250 | union 251 | { 252 | struct 253 | { 254 | ULONG Image : 1; 255 | ULONG Mismatch : 1; 256 | } e1; 257 | 258 | PVOID FileObject; 259 | PVOID UniqueFileObjectKey; 260 | PVOID ProtoPteAddress; 261 | PVOID VirtualAddress; 262 | } u2; 263 | } MMPFN_IDENTITY, *PMMPFN_IDENTITY; 264 | 265 | typedef struct _PF_PFN_PRIO_REQUEST 266 | { 267 | ULONG Version; 268 | ULONG RequestFlags; 269 | SIZE_T PfnCount; 270 | SYSTEM_MEMORY_LIST_INFORMATION MemInfo; 271 | MMPFN_IDENTITY PageData[256]; 272 | } PF_PFN_PRIO_REQUEST, *PPF_PFN_PRIO_REQUEST; 273 | 274 | #ifndef NT_SUCCESS 275 | #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) 276 | #endif 277 | 278 | #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) 279 | #define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L) 280 | #define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002L) 281 | #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) 282 | #define STATUS_INVALID_CID ((NTSTATUS)0xC000000BL) 283 | #define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000EL) 284 | #define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000FL) 285 | #define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L) 286 | #define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016L) 287 | #define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018L) 288 | #define STATUS_NO_MORE_ENTRIES ((NTSTATUS)0x8000001AL) 289 | #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) 290 | #define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045L) 291 | #define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007AL) 292 | #define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL) 293 | #define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS)0xC00000AAL) 294 | #define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5L) 295 | #define STATUS_INVALID_PARAMETER_1 ((NTSTATUS)0xC00000EFL) 296 | #define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0L) 297 | #define STATUS_INVALID_PARAMETER_3 ((NTSTATUS)0xC00000F1L) 298 | #define STATUS_INVALID_PARAMETER_4 ((NTSTATUS)0xC00000F2L) 299 | #define STATUS_INVALID_PARAMETER_5 ((NTSTATUS)0xC00000F3L) 300 | #define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4L) 301 | #define STATUS_INVALID_PARAMETER_7 ((NTSTATUS)0xC00000F5L) 302 | #define STATUS_INVALID_PARAMETER_8 ((NTSTATUS)0xC00000F6L) 303 | #define STATUS_INVALID_PARAMETER_9 ((NTSTATUS)0xC00000F7L) 304 | #define STATUS_INVALID_PARAMETER_10 ((NTSTATUS)0xC00000F8L) 305 | #define STATUS_INVALID_PARAMETER_11 ((NTSTATUS)0xC00000F9L) 306 | #define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FAL) 307 | #define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141L) 308 | #define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS)0xC00002C5L) 309 | 310 | using LONG = long; 311 | 312 | using KPRIORITY = LONG; 313 | 314 | using UNICODE_STRING = struct _UNICODE_STRING 315 | { 316 | USHORT Length; 317 | USHORT MaximumLength; 318 | PWSTR Buffer; 319 | }; 320 | 321 | using PUNICODE_STRING = UNICODE_STRING*; 322 | using PCUNICODE_STRING = const UNICODE_STRING*; 323 | 324 | struct SFMemoryInfo 325 | { 326 | uint64_t Start; 327 | uint64_t End; 328 | int PageCount; 329 | uint64_t Size; 330 | }; 331 | 332 | #define PHYSICAL_ADDRESS LARGE_INTEGER 333 | 334 | typedef struct _POOL_HEADER 335 | { 336 | union 337 | { 338 | struct 339 | { 340 | #if defined(_AMD64_) 341 | ULONG PreviousSize : 8; 342 | ULONG PoolIndex : 8; 343 | ULONG BlockSize : 8; 344 | ULONG PoolType : 8; 345 | #else 346 | USHORT PreviousSize : 9; 347 | USHORT PoolIndex : 7; 348 | USHORT BlockSize : 9; 349 | USHORT PoolType : 7; 350 | #endif 351 | }; 352 | 353 | ULONG Ulong1; 354 | }; 355 | #if defined(_WIN64) 356 | ULONG PoolTag; 357 | #endif 358 | union 359 | { 360 | #if defined(_WIN64) 361 | void* ProcessBilled; 362 | #else 363 | ULONG PoolTag; 364 | #endif 365 | struct 366 | { 367 | USHORT AllocatorBackTraceIndex; 368 | USHORT PoolTagHash; 369 | }; 370 | }; 371 | } POOL_HEADER, *PPOOL_HEADER; 372 | 373 | typedef struct _OBJECT_HEADER 374 | { 375 | LONG PointerCount; 376 | 377 | union 378 | { 379 | LONG HandleCount; 380 | PVOID NextToFree; 381 | }; 382 | 383 | uint64_t Lock; 384 | UCHAR TypeIndex; 385 | 386 | union 387 | { 388 | UCHAR TraceFlags; 389 | 390 | struct 391 | { 392 | UCHAR DbgRefTrace : 1; 393 | UCHAR DbgTracePermanent : 1; 394 | UCHAR Reserved : 6; 395 | }; 396 | }; 397 | 398 | UCHAR InfoMask; 399 | 400 | union 401 | { 402 | UCHAR Flags; 403 | 404 | struct 405 | { 406 | UCHAR NewObject : 1; 407 | UCHAR KernelObject : 1; 408 | UCHAR KernelOnlyAccess : 1; 409 | UCHAR ExclusiveObject : 1; 410 | UCHAR PermanentObject : 1; 411 | UCHAR DefaultSecurityQuota : 1; 412 | UCHAR SingleHandleEntry : 1; 413 | UCHAR DeletedInline : 1; 414 | }; 415 | }; 416 | 417 | union 418 | { 419 | PVOID ObjectCreateInfo; 420 | PVOID QuotaBlockCharged; 421 | }; 422 | 423 | PVOID SecurityDescriptor; 424 | PVOID Body; 425 | } OBJECT_HEADER, *POBJECT_HEADER; 426 | 427 | struct PfnList 428 | { 429 | bool isPool; 430 | }; 431 | 432 | template 433 | std::unique_ptr 434 | QueryInfo( 435 | __in SYSTEM_INFORMATION_CLASS sysClass 436 | ) 437 | { 438 | size_t size = sizeof(RTL_PROCESS_MODULES) + SPAGE_SIZE; 439 | NTSTATUS status = STATUS_INFO_LENGTH_MISMATCH; 440 | void* info = malloc(size); 441 | if (!info) 442 | return std::unique_ptr(nullptr); 443 | 444 | for (; STATUS_INFO_LENGTH_MISMATCH == status; size *= 2) 445 | { 446 | status = NtQuerySystemInformation( 447 | (SYSTEM_INFORMATION_CLASS)sysClass, 448 | info, 449 | size, 450 | nullptr); 451 | 452 | info = realloc(info, size * 2); 453 | if (!info) 454 | break; 455 | } 456 | 457 | std::unique_ptr r_info = std::unique_ptr(static_cast(info)); 458 | return r_info; 459 | } 460 | --------------------------------------------------------------------------------