├── .gitattributes ├── Drv ├── EFI │ └── Boot │ │ └── bootx64.efi └── memory.efi ├── ProjectHex.sln ├── ProjectHex ├── DrawEsp.h ├── Driver.cpp ├── Driver.h ├── Imgui │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_impl_dx9.cpp │ ├── imgui_impl_dx9.h │ ├── imgui_impl_win32.cpp │ ├── imgui_impl_win32.h │ ├── imgui_internal.h │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ └── imstb_truetype.h ├── Key.h ├── Main.cpp ├── Main.h ├── Print │ ├── print.cpp │ └── print.h ├── ProjectHex.vcxproj ├── ProjectHex.vcxproj.filters ├── ProjectHex.vcxproj.user ├── Protect.cpp ├── Protect.h ├── Remap │ ├── log.h │ ├── ntdll.h │ ├── remap.cpp │ └── remap.h ├── Text.h ├── config.h ├── crypto │ ├── 3way.cpp │ ├── 3way.h │ ├── Doxyfile │ ├── Filelist.txt │ ├── GNUmakefile │ ├── GNUmakefile-cross │ ├── History.txt │ ├── Install.txt │ ├── License.txt │ ├── Readme.txt │ ├── adhoc.cpp │ ├── adhoc.cpp.copied │ ├── adhoc.cpp.proto │ ├── adler32.cpp │ ├── adler32.h │ ├── adv_simd.h │ ├── aes.h │ ├── aes_armv4.S │ ├── aes_armv4.h │ ├── algebra.cpp │ ├── algebra.h │ ├── algparam.cpp │ ├── algparam.h │ ├── arc4.cpp │ ├── arc4.h │ ├── argnames.h │ ├── aria.cpp │ ├── aria.h │ ├── aria_simd.cpp │ ├── ariatab.cpp │ ├── arm_simd.h │ ├── asn.cpp │ ├── asn.h │ ├── authenc.cpp │ ├── authenc.h │ ├── base32.cpp │ ├── base32.h │ ├── base64.cpp │ ├── base64.h │ ├── basecode.cpp │ ├── basecode.h │ ├── bds10.zip │ ├── bench.h │ ├── bench1.cpp │ ├── bench2.cpp │ ├── bench3.cpp │ ├── bfinit.cpp │ ├── blake2.cpp │ ├── blake2.h │ ├── blake2b_simd.cpp │ ├── blake2s_simd.cpp │ ├── blowfish.cpp │ ├── blowfish.h │ ├── blumshub.cpp │ ├── blumshub.h │ ├── camellia.cpp │ ├── camellia.h │ ├── cast.cpp │ ├── cast.h │ ├── casts.cpp │ ├── cbcmac.cpp │ ├── cbcmac.h │ ├── ccm.cpp │ ├── ccm.h │ ├── chacha.cpp │ ├── chacha.h │ ├── chacha_avx.cpp │ ├── chacha_simd.cpp │ ├── chachapoly.cpp │ ├── chachapoly.h │ ├── cham.cpp │ ├── cham.h │ ├── cham_simd.cpp │ ├── channels.cpp │ ├── channels.h │ ├── cmac.cpp │ ├── cmac.h │ ├── config.h │ ├── cpu.cpp │ ├── cpu.h │ ├── crc.cpp │ ├── crc.h │ ├── crc_simd.cpp │ ├── cryptdll.vcxproj │ ├── cryptdll.vcxproj.filters │ ├── cryptdll.vcxproj.user │ ├── cryptest.nmake │ ├── cryptest.sh │ ├── cryptest.sln │ ├── cryptest.suo │ ├── cryptest.vcxproj │ ├── cryptest.vcxproj.filters │ ├── cryptest.vcxproj.user │ ├── cryptlib.cpp │ ├── cryptlib.h │ ├── cryptlib.lib │ ├── cryptlib.vcxproj │ ├── cryptlib.vcxproj.filters │ ├── cryptlib.vcxproj.user │ ├── crypto.cpp │ ├── crypto.h │ ├── cryptopp.rc │ ├── cryptopp.supp │ ├── darn.cpp │ ├── darn.h │ ├── datatest.cpp │ ├── default.cpp │ ├── default.h │ ├── des.cpp │ ├── des.h │ ├── dessp.cpp │ ├── dh.cpp │ ├── dh.h │ ├── dh2.cpp │ ├── dh2.h │ ├── dll.cpp │ ├── dll.h │ ├── dlltest.cpp │ ├── dlltest.vcxproj │ ├── dlltest.vcxproj.filters │ ├── dmac.h │ ├── donna.h │ ├── donna_32.cpp │ ├── donna_32.h │ ├── donna_64.cpp │ ├── donna_64.h │ ├── donna_sse.cpp │ ├── donna_sse.h │ ├── drbg.h │ ├── dsa.cpp │ ├── dsa.h │ ├── eax.cpp │ ├── eax.h │ ├── ec2n.cpp │ ├── ec2n.h │ ├── eccrypto.cpp │ ├── eccrypto.h │ ├── ecp.cpp │ ├── ecp.h │ ├── ecpoint.h │ ├── elgamal.cpp │ ├── elgamal.h │ ├── emsa2.cpp │ ├── emsa2.h │ ├── eprecomp.cpp │ ├── eprecomp.h │ ├── esign.cpp │ ├── esign.h │ ├── factory.h │ ├── fhmqv.h │ ├── files.cpp │ ├── files.h │ ├── filters.cpp │ ├── filters.h │ ├── fips140.cpp │ ├── fips140.h │ ├── fipsalgt.cpp │ ├── fipstest.cpp │ ├── fltrimpl.h │ ├── gcm.cpp │ ├── gcm.h │ ├── gcm_simd.cpp │ ├── gf256.cpp │ ├── gf256.h │ ├── gf2_32.cpp │ ├── gf2_32.h │ ├── gf2n.cpp │ ├── gf2n.h │ ├── gf2n_simd.cpp │ ├── gfpcrypt.cpp │ ├── gfpcrypt.h │ ├── gost.cpp │ ├── gost.h │ ├── gzip.cpp │ ├── gzip.h │ ├── hashfwd.h │ ├── hc128.cpp │ ├── hc128.h │ ├── hc256.cpp │ ├── hc256.h │ ├── hex.cpp │ ├── hex.h │ ├── hight.cpp │ ├── hight.h │ ├── hkdf.h │ ├── hmac.cpp │ ├── hmac.h │ ├── hmqv.h │ ├── hrtimer.cpp │ ├── hrtimer.h │ ├── ida.cpp │ ├── ida.h │ ├── idea.cpp │ ├── idea.h │ ├── integer.cpp │ ├── integer.h │ ├── iterhash.cpp │ ├── iterhash.h │ ├── kalyna.cpp │ ├── kalyna.h │ ├── kalynatab.cpp │ ├── keccak.cpp │ ├── keccak.h │ ├── keccak_core.cpp │ ├── keccak_simd.cpp │ ├── lea.cpp │ ├── lea.h │ ├── lea_simd.cpp │ ├── lubyrack.h │ ├── luc.cpp │ ├── luc.h │ ├── mars.cpp │ ├── mars.h │ ├── marss.cpp │ ├── md2.cpp │ ├── md2.h │ ├── md4.cpp │ ├── md4.h │ ├── md5.cpp │ ├── md5.h │ ├── mdc.h │ ├── mersenne.h │ ├── misc.cpp │ ├── misc.h │ ├── modarith.h │ ├── modes.cpp │ ├── modes.h │ ├── modexppc.h │ ├── mqueue.cpp │ ├── mqueue.h │ ├── mqv.cpp │ ├── mqv.h │ ├── naclite.h │ ├── nbtheory.cpp │ ├── nbtheory.h │ ├── neon_simd.cpp │ ├── nr.h │ ├── oaep.cpp │ ├── oaep.h │ ├── oids.h │ ├── osrng.cpp │ ├── osrng.h │ ├── ossig.h │ ├── padlkrng.cpp │ ├── padlkrng.h │ ├── panama.cpp │ ├── panama.h │ ├── pch.cpp │ ├── pch.h │ ├── pkcspad.cpp │ ├── pkcspad.h │ ├── poly1305.cpp │ ├── poly1305.h │ ├── polynomi.cpp │ ├── polynomi.h │ ├── ppc_power7.cpp │ ├── ppc_power8.cpp │ ├── ppc_power9.cpp │ ├── ppc_simd.cpp │ ├── ppc_simd.h │ ├── pssr.cpp │ ├── pssr.h │ ├── pubkey.cpp │ ├── pubkey.h │ ├── pwdbased.h │ ├── queue.cpp │ ├── queue.h │ ├── rabbit.cpp │ ├── rabbit.h │ ├── rabin.cpp │ ├── rabin.h │ ├── randpool.cpp │ ├── randpool.h │ ├── rc2.cpp │ ├── rc2.h │ ├── rc5.cpp │ ├── rc5.h │ ├── rc6.cpp │ ├── rc6.h │ ├── rdrand-masm.cmd │ ├── rdrand-nasm.sh │ ├── rdrand.asm │ ├── rdrand.cpp │ ├── rdrand.h │ ├── rdrand.s │ ├── rdtables.cpp │ ├── regtest1.cpp │ ├── regtest2.cpp │ ├── regtest3.cpp │ ├── regtest4.cpp │ ├── resource.h │ ├── rijndael.cpp │ ├── rijndael.h │ ├── rijndael_simd.cpp │ ├── ripemd.cpp │ ├── ripemd.h │ ├── rng.cpp │ ├── rng.h │ ├── rsa.cpp │ ├── rsa.h │ ├── rw.cpp │ ├── rw.h │ ├── safer.cpp │ ├── safer.h │ ├── salsa.cpp │ ├── salsa.h │ ├── scrypt.cpp │ ├── scrypt.h │ ├── seal.cpp │ ├── seal.h │ ├── secblock.h │ ├── seckey.h │ ├── seed.cpp │ ├── seed.h │ ├── serpent.cpp │ ├── serpent.h │ ├── serpentp.h │ ├── sha.cpp │ ├── sha.h │ ├── sha3.cpp │ ├── sha3.h │ ├── sha_simd.cpp │ ├── shacal2.cpp │ ├── shacal2.h │ ├── shacal2_simd.cpp │ ├── shake.cpp │ ├── shake.h │ ├── shark.cpp │ ├── shark.h │ ├── sharkbox.cpp │ ├── simeck.cpp │ ├── simeck.h │ ├── simeck_simd.cpp │ ├── simon.cpp │ ├── simon.h │ ├── simon128_simd.cpp │ ├── simon64_simd.cpp │ ├── simple.cpp │ ├── simple.h │ ├── siphash.h │ ├── skipjack.cpp │ ├── skipjack.h │ ├── sm3.cpp │ ├── sm3.h │ ├── sm4.cpp │ ├── sm4.h │ ├── sm4_simd.cpp │ ├── smartptr.h │ ├── sosemanuk.cpp │ ├── sosemanuk.h │ ├── speck.cpp │ ├── speck.h │ ├── speck128_simd.cpp │ ├── speck64_simd.cpp │ ├── square.cpp │ ├── square.h │ ├── squaretb.cpp │ ├── sse_simd.cpp │ ├── stdcpp.h │ ├── strciphr.cpp │ ├── strciphr.h │ ├── tea.cpp │ ├── tea.h │ ├── test.cpp │ ├── tftables.cpp │ ├── threefish.cpp │ ├── threefish.h │ ├── tiger.cpp │ ├── tiger.h │ ├── tigertab.cpp │ ├── trap.h │ ├── trunhash.h │ ├── ttmac.cpp │ ├── ttmac.h │ ├── tweetnacl.cpp │ ├── tweetnacl.h │ ├── twofish.cpp │ ├── twofish.h │ ├── validat0.cpp │ ├── validat1.cpp │ ├── validat10.cpp │ ├── validat2.cpp │ ├── validat3.cpp │ ├── validat4.cpp │ ├── validat5.cpp │ ├── validat6.cpp │ ├── validat7.cpp │ ├── validat8.cpp │ ├── validat9.cpp │ ├── validate.h │ ├── vmac.cpp │ ├── vmac.h │ ├── vs2005.zip │ ├── wake.cpp │ ├── wake.h │ ├── whrlpool.cpp │ ├── whrlpool.h │ ├── words.h │ ├── x64dll.asm │ ├── x64masm.asm │ ├── xed25519.cpp │ ├── xed25519.h │ ├── xtr.cpp │ ├── xtr.h │ ├── xtrcrypt.cpp │ ├── xtrcrypt.h │ ├── zdeflate.cpp │ ├── zdeflate.h │ ├── zinflate.cpp │ ├── zinflate.h │ ├── zlib.cpp │ └── zlib.h ├── curl │ ├── Makefile.am │ ├── Makefile.in │ ├── curl.h │ ├── curlver.h │ ├── easy.h │ ├── libcurl.lib │ ├── mprintf.h │ ├── multi.h │ ├── stdcheaders.h │ ├── system.h │ ├── typecheck-gcc.h │ └── urlapi.h ├── defs.h ├── font.h ├── hashlib │ ├── md5.cpp │ ├── md5.h │ ├── md5wrapper.cpp │ └── md5wrapper.h ├── imgui.ini ├── others │ ├── auth.cpp │ ├── auth.h │ ├── hwid.cpp │ ├── hwid.h │ ├── program.h │ └── xor.h ├── prediction.h ├── program.cpp ├── program.h ├── skCrypter │ └── skCrypter.h ├── vars.h ├── vector.h └── x64 │ ├── Debug │ ├── Color.obj │ ├── Driver.obj │ ├── Main.obj │ ├── ProjectHex.Build.CppClean.log │ ├── ProjectHex.exe.recipe │ ├── ProjectHex.log │ ├── ProjectHex.tlog │ │ ├── CL.command.1.tlog │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── ProjectHex.lastbuildstate │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ └── link.write.1.tlog │ ├── ProjectHex.vcxproj.FileListAbsolute.txt │ ├── Protect.obj │ ├── imgui.obj │ ├── imgui_demo.obj │ ├── imgui_draw.obj │ ├── imgui_impl_dx9.obj │ ├── imgui_impl_win32.obj │ ├── imgui_widgets.obj │ ├── vc142.idb │ └── vc142.pdb │ └── Release │ ├── Driver.obj │ ├── Hook.obj │ ├── Main.obj │ ├── ProjectHex.Build.CppClean.log │ ├── ProjectHex.exe.recipe │ ├── ProjectHex.log │ ├── ProjectHex.tlog │ ├── CL.command.1.tlog │ ├── CL.read.1.tlog │ ├── CL.write.1.tlog │ ├── ProjectHex.lastbuildstate │ ├── ProjectHex.write.1u.tlog │ ├── link.command.1.tlog │ ├── link.read.1.tlog │ └── link.write.1.tlog │ ├── ProjectHex.vcxproj.FileListAbsolute.txt │ ├── Protect.obj │ ├── auth.obj │ ├── crypto.obj │ ├── hwid.obj │ ├── imgui.obj │ ├── imgui_demo.obj │ ├── imgui_draw.obj │ ├── imgui_impl_dx9.obj │ ├── imgui_impl_win32.obj │ ├── imgui_widgets.obj │ ├── md5.obj │ ├── md5wrapper.obj │ ├── print.obj │ ├── program.obj │ └── vc142.pdb └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Drv/EFI/Boot/bootx64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/Drv/EFI/Boot/bootx64.efi -------------------------------------------------------------------------------- /Drv/memory.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/Drv/memory.efi -------------------------------------------------------------------------------- /ProjectHex.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30711.63 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProjectHex", "ProjectHex\ProjectHex.vcxproj", "{2C026072-9554-4B49-AA8D-5CE50F3EF79E}" 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 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Debug|x64.ActiveCfg = Debug|x64 17 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Debug|x64.Build.0 = Debug|x64 18 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Debug|x86.Build.0 = Debug|Win32 20 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Release|x64.ActiveCfg = Release|x64 21 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Release|x64.Build.0 = Release|x64 22 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Release|x86.ActiveCfg = Release|Win32 23 | {2C026072-9554-4B49-AA8D-5CE50F3EF79E}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {6DF4ABEF-21CC-4335-A0E7-DEBBCF4E2862} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /ProjectHex/Imgui/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for DirectX9 2 | // This needs to be used along with a Platform Binding (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 6 | 7 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 8 | // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. 9 | // https://github.com/ocornut/imgui 10 | 11 | #pragma once 12 | 13 | struct IDirect3DDevice9; 14 | 15 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 16 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 17 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 18 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 19 | 20 | // Use if you want to reset your rendering device without losing ImGui state. 21 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 22 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 23 | -------------------------------------------------------------------------------- /ProjectHex/Imgui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding 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 imgui) 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). 8 | // Missing features: 9 | // [ ] Platform: Gamepad support (best leaving it to user application to fill io.NavInputs[] with gamepad inputs from their source of choice). 10 | 11 | #pragma once 12 | 13 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 14 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 15 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 16 | 17 | // Handler for Win32 messages, update mouse/keyboard data. 18 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 19 | // Intentionally commented out to avoid dragging dependencies on types. You can COPY this line into your .cpp code instead. 20 | /* 21 | IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 22 | */ 23 | -------------------------------------------------------------------------------- /ProjectHex/Key.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /ProjectHex/Main.cpp: -------------------------------------------------------------------------------- 1 | #include "others/hwid.h" 2 | #include 3 | #include 4 | #include "crypto/crypto.h" 5 | #include "others/auth.h" 6 | #include "others/xor.h" 7 | #include 8 | #include "crypto/hex.h" 9 | #include 10 | 11 | #pragma comment(lib, "libcurl.lib") 12 | #pragma comment(lib, "wldap32.lib") 13 | #pragma comment(lib, "crypt32.lib") 14 | #pragma comment(lib, "Ws2_32.lib") 15 | #pragma comment(lib, "ntdll.lib") 16 | bool IsValid = false; 17 | std::string userid = ""; // ENTER USER ID 18 | std::string ProgramID = ""; // ENTER PROGRAM ID 19 | 20 | uint64_t add[16]; 21 | 22 | bool k_f5 = 0; 23 | bool k_f6 = 0; 24 | bool k_f7 = 0; 25 | bool k_f8 = 0; 26 | 27 | bool IsKeyDown(int vk) 28 | { 29 | return (GetAsyncKeyState(vk) & 0x8000) != 0; 30 | } 31 | 32 | int aim_key = VK_RBUTTON; 33 | 34 | int main() 35 | { 36 | 37 | std::cout << _xor_("Key: "); 38 | std::string i2; 39 | std::cin >> i2; 40 | 41 | program::login(i2, userid, ProgramID); 42 | 43 | } -------------------------------------------------------------------------------- /ProjectHex/Print/print.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "print.h" 3 | 4 | void Print::color(const int forg_col) 5 | { 6 | const auto h_std_out = GetStdHandle(STD_OUTPUT_HANDLE); 7 | CONSOLE_SCREEN_BUFFER_INFO csbi; 8 | if (GetConsoleScreenBufferInfo(h_std_out, &csbi)) 9 | { 10 | const WORD w_color = (csbi.wAttributes & 0xF0) + (forg_col & 0x0F); 11 | SetConsoleTextAttribute(h_std_out, w_color); 12 | } 13 | } 14 | 15 | void Print::text(const char* text, const int colour) 16 | { 17 | color(colour); 18 | printf(static_cast(text)); 19 | color(White); 20 | } 21 | 22 | void Print::error(const char* text) 23 | { 24 | color(Red); 25 | printf(static_cast(text)); 26 | color(White); 27 | } 28 | 29 | void Print::warning(const char* text) 30 | { 31 | color(Yellow); 32 | printf(static_cast(text)); 33 | color(White); 34 | } 35 | 36 | void Print::ok(const char* text) 37 | { 38 | color(Green); 39 | printf(static_cast(text)); 40 | color(White); 41 | } -------------------------------------------------------------------------------- /ProjectHex/Print/print.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | enum console_color 6 | { 7 | Black = 0, 8 | Blue, 9 | Green, 10 | Cyan, 11 | Red, 12 | Magenta, 13 | Brown, 14 | LightGray, 15 | DarkGray, 16 | LightBlue, 17 | LightGreen, 18 | LightCyan, 19 | LightRed, 20 | LightMagenta, 21 | Yellow, 22 | White, 23 | }; 24 | class Print 25 | { 26 | public: 27 | static void color(const int forg_col); 28 | static void text(const char* text, const int color); 29 | static void error(const char* text); 30 | static void warning(const char* text); 31 | static void ok(const char* text); 32 | }; 33 | -------------------------------------------------------------------------------- /ProjectHex/ProjectHex.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ProjectHex/Protect.cpp: -------------------------------------------------------------------------------- 1 | #include "Protect.h" 2 | 3 | int funcCount = 0; 4 | ProtectedFunction functions[50]; 5 | 6 | void unsafe_unprotect(int index) { 7 | //XOR((BYTE*)functions[index].address, functions[index].size, functions[index].lastXor); 8 | } 9 | 10 | void nextLastXor(int index) { 11 | BYTE xorByte = functions[index].lastXor; 12 | if (xorByte > 0xf3) { 13 | xorByte = 0x5; 14 | } 15 | xorByte += 0x01; 16 | functions[index].lastXor = xorByte; 17 | } 18 | 19 | void unsafe_protect(int index) { 20 | nextLastXor(index); 21 | unsafe_unprotect(index); 22 | } 23 | 24 | int GetFunctionIndex(void* FunctionAddress) { 25 | for (int i = 0; i < funcCount; i++) { 26 | if ((uintptr_t)functions[i].address <= (uintptr_t)FunctionAddress && 27 | (uintptr_t)functions[i].address + functions[i].size >= (uintptr_t)FunctionAddress) { 28 | return i; 29 | } 30 | } 31 | return -1; 32 | } 33 | 34 | void Unprotect(void* FunctionAddress) { 35 | int function = GetFunctionIndex(FunctionAddress); 36 | 37 | if (function > -1 && functions[function].crypted == true) { 38 | unsafe_unprotect(function); 39 | functions[function].crypted = false; 40 | } 41 | } 42 | 43 | void Protect(void* FunctionAddress) { 44 | int function = GetFunctionIndex(FunctionAddress); 45 | if (function > -1 && functions[function].crypted == false) { 46 | unsafe_protect(function); 47 | functions[function].crypted = true; 48 | } 49 | } 50 | 51 | void ProtectedSleep(int ms) { 52 | Protect(_ReturnAddress()); 53 | Sleep(ms); 54 | Unprotect(_ReturnAddress()); 55 | } 56 | 57 | 58 | void addFunc(ProtectedFunction func) { 59 | functions[funcCount] = func; 60 | funcCount++; 61 | } 62 | 63 | void XOR(BYTE* data, size_t size, BYTE XOR_KEY) { 64 | for (size_t i = 0; i < size; i++) { 65 | data[i] = data[i] ^ XOR_KEY; 66 | } 67 | } 68 | 69 | void ProtectedExit(int value) { 70 | 71 | Protect(_ReturnAddress()); 72 | exit(value); 73 | Unprotect(_ReturnAddress()); 74 | 75 | } -------------------------------------------------------------------------------- /ProjectHex/Protect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "config.h" 6 | #pragma intrinsic(_ReturnAddress) 7 | 8 | #define SLog(text) 9 | 10 | struct ProtectedFunction { 11 | void* address; 12 | size_t size; 13 | BYTE lastXor; 14 | bool crypted; 15 | }; 16 | extern int funcCount; 17 | extern ProtectedFunction functions[50]; 18 | void addFunc(ProtectedFunction func); 19 | void unsafe_unprotect(int index); 20 | void unsafe_protect(int index); 21 | int GetFunctionIndex(void* FunctionAddress); 22 | void Unprotect(void* FunctionAddress); 23 | void Protect(void* FunctionAddress); 24 | void XOR(BYTE* data, size_t size, BYTE XOR_KEY = STRING_XOR_KEY); 25 | void ProtectedSleep(int ms); 26 | void ProtectedExit(int value); -------------------------------------------------------------------------------- /ProjectHex/Remap/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | //============================================================================= 8 | // Public Interface 9 | //============================================================================= 10 | #define DBG_PRINT printf 11 | #define INF_PRINT printf 12 | #define WRN_PRINT printf 13 | #define ERR_PRINT printf 14 | -------------------------------------------------------------------------------- /ProjectHex/Remap/ntdll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifndef _NTDEF_ 6 | typedef _Return_type_success_(return >= 0) LONG NTSTATUS; 7 | #endif 8 | 9 | 10 | #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) 11 | 12 | #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) 13 | #define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045L) 14 | #define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007AL) 15 | 16 | #define SEC_NO_CHANGE 0x00400000 17 | 18 | #define PAGE_SIZE 0x1000 19 | #define POINTER_IS_ALIGNED(Pointer, Alignment) \ 20 | (((((ULONG_PTR)(Pointer)) & (((Alignment)-1))) == 0) ? TRUE : FALSE) 21 | 22 | #define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1) 23 | 24 | 25 | typedef struct _UNICODE_STRING 26 | { 27 | USHORT Length; 28 | USHORT MaximumLength; 29 | PWSTR Buffer; 30 | } UNICODE_STRING, *PUNICODE_STRING; 31 | 32 | typedef struct _OBJECT_ATTRIBUTES 33 | { 34 | ULONG Length; 35 | HANDLE RootDirectory; 36 | PUNICODE_STRING ObjectName; 37 | ULONG Attributes; 38 | PVOID SecurityDescriptor; 39 | PVOID SecurityQualityOfService; 40 | } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; 41 | 42 | typedef enum _SECTION_INHERIT 43 | { 44 | ViewShare = 1, 45 | ViewUnmap = 2 46 | } SECTION_INHERIT, *PSECTION_INHERIT; 47 | 48 | typedef enum _MEMORY_INFORMATION_CLASS 49 | { 50 | MemoryBasicInformation 51 | } MEMORY_INFORMATION_CLASS, *PMEMORY_INFORMATION_CLASS; 52 | 53 | 54 | EXTERN_C 55 | NTSTATUS 56 | NTAPI 57 | NtCreateSection( 58 | _Out_ PHANDLE SectionHandle, 59 | _In_ ACCESS_MASK DesiredAccess, 60 | _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, 61 | _In_opt_ PLARGE_INTEGER MaximumSize, 62 | _In_ ULONG SectionPageProtection, 63 | _In_ ULONG AllocationAttributes, 64 | _In_opt_ HANDLE FileHandle 65 | ); 66 | 67 | EXTERN_C 68 | NTSTATUS 69 | NTAPI 70 | NtMapViewOfSection( 71 | _In_ HANDLE SectionHandle, 72 | _In_ HANDLE ProcessHandle, 73 | _Inout_ PVOID *BaseAddress, 74 | _In_ ULONG_PTR ZeroBits, 75 | _In_ SIZE_T CommitSize, 76 | _Inout_opt_ PLARGE_INTEGER SectionOffset, 77 | _Inout_ PSIZE_T ViewSize, 78 | _In_ SECTION_INHERIT InheritDisposition, 79 | _In_ ULONG AllocationType, 80 | _In_ ULONG Win32Protect 81 | ); 82 | 83 | EXTERN_C 84 | NTSTATUS 85 | NTAPI 86 | NtUnmapViewOfSection( 87 | _In_ HANDLE ProcessHandle, 88 | _In_opt_ PVOID BaseAddress 89 | ); 90 | 91 | EXTERN_C 92 | NTSTATUS 93 | NTAPI 94 | NtClose( 95 | _In_ HANDLE Handle 96 | ); 97 | 98 | EXTERN_C 99 | PIMAGE_NT_HEADERS 100 | NTAPI 101 | RtlImageNtHeader( 102 | _In_ PVOID BaseAddress 103 | ); 104 | -------------------------------------------------------------------------------- /ProjectHex/Remap/remap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | //============================================================================= 6 | // Public Interface 7 | //============================================================================= 8 | _Check_return_ 9 | BOOL 10 | RmpRemapImage( 11 | _In_ ULONG_PTR ImageBase 12 | ); 13 | -------------------------------------------------------------------------------- /ProjectHex/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //MISC 4 | #define SMOOTH 2.f //1~20 5 | #define Max_Cheat_Distance 400.f 6 | 7 | 8 | //XOR Keys 9 | #define STRING_XOR_KEY 0x6F -------------------------------------------------------------------------------- /ProjectHex/crypto/3way.h: -------------------------------------------------------------------------------- 1 | // 3way.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file 3way.h 4 | /// \brief Classes for the 3-Way block cipher 5 | 6 | #ifndef CRYPTOPP_THREEWAY_H 7 | #define CRYPTOPP_THREEWAY_H 8 | 9 | #include "config.h" 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief ThreeWay block cipher information 16 | struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "3-Way";} 19 | }; 20 | 21 | /// \brief ThreeWay block cipher 22 | /// \sa 3-Way 23 | class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation 24 | { 25 | /// \brief Class specific implementation and overrides used to operate the cipher. 26 | /// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions 27 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 28 | { 29 | public: 30 | void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); 31 | 32 | protected: 33 | unsigned int m_rounds; 34 | FixedSizeSecBlock m_k; 35 | }; 36 | 37 | /// \brief Class specific methods used to operate the cipher in the forward direction. 38 | /// \details Implementations and overrides in \p Enc apply to \p ENCRYPTION. 39 | class CRYPTOPP_NO_VTABLE Enc : public Base 40 | { 41 | public: 42 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 43 | }; 44 | 45 | /// \brief Class specific methods used to operate the cipher in the reverse direction. 46 | /// \details Implementations and overrides in \p Dec apply to \p DECRYPTION. 47 | class CRYPTOPP_NO_VTABLE Dec : public Base 48 | { 49 | public: 50 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 51 | }; 52 | 53 | public: 54 | typedef BlockCipherFinal Encryption; 55 | typedef BlockCipherFinal Decryption; 56 | }; 57 | 58 | typedef ThreeWay::Encryption ThreeWayEncryption; 59 | typedef ThreeWay::Decryption ThreeWayDecryption; 60 | 61 | NAMESPACE_END 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /ProjectHex/crypto/adhoc.cpp: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | #include 3 | #include 4 | 5 | #if CRYPTOPP_MSC_VERSION 6 | # pragma warning(disable: 4100 4189 4996) 7 | #endif 8 | 9 | #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 10 | # pragma GCC diagnostic ignored "-Wunused-variable" 11 | #endif 12 | 13 | USING_NAMESPACE(CryptoPP) 14 | USING_NAMESPACE(std) 15 | 16 | #ifndef CRYPTOPP_UNUSED 17 | # define CRYPTOPP_UNUSED(x) (void(x)) 18 | #endif 19 | 20 | // Used for testing the compiler and linker in cryptest.sh 21 | #if defined(CRYPTOPP_ADHOC_MAIN) || defined(ADHOC_MAIN) 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv); 26 | return 0; 27 | } 28 | 29 | // Classic use of adhoc to setup calling convention 30 | #else 31 | 32 | extern int (*AdhocTest)(int argc, char *argv[]); 33 | 34 | int MyAdhocTest(int argc, char *argv[]) 35 | { 36 | CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv); 37 | return 0; 38 | } 39 | 40 | static int s_i = (AdhocTest = &MyAdhocTest, 0); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ProjectHex/crypto/adhoc.cpp.copied: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /ProjectHex/crypto/adhoc.cpp.proto: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | #include 3 | #include 4 | 5 | #if CRYPTOPP_MSC_VERSION 6 | # pragma warning(disable: 4100 4189 4996) 7 | #endif 8 | 9 | #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 10 | # pragma GCC diagnostic ignored "-Wunused-variable" 11 | #endif 12 | 13 | USING_NAMESPACE(CryptoPP) 14 | USING_NAMESPACE(std) 15 | 16 | #ifndef CRYPTOPP_UNUSED 17 | # define CRYPTOPP_UNUSED(x) (void(x)) 18 | #endif 19 | 20 | // Used for testing the compiler and linker in cryptest.sh 21 | #if defined(CRYPTOPP_ADHOC_MAIN) || defined(ADHOC_MAIN) 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv); 26 | return 0; 27 | } 28 | 29 | // Classic use of adhoc to setup calling convention 30 | #else 31 | 32 | extern int (*AdhocTest)(int argc, char *argv[]); 33 | 34 | int MyAdhocTest(int argc, char *argv[]) 35 | { 36 | CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv); 37 | return 0; 38 | } 39 | 40 | static int s_i = (AdhocTest = &MyAdhocTest, 0); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ProjectHex/crypto/adler32.cpp: -------------------------------------------------------------------------------- 1 | // adler32.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "adler32.h" 5 | 6 | NAMESPACE_BEGIN(CryptoPP) 7 | 8 | void Adler32::Update(const byte *input, size_t length) 9 | { 10 | const unsigned long BASE = 65521; 11 | 12 | unsigned long s1 = m_s1; 13 | unsigned long s2 = m_s2; 14 | 15 | if (length % 8 != 0) 16 | { 17 | do 18 | { 19 | s1 += *input++; 20 | s2 += s1; 21 | length--; 22 | } while (length % 8 != 0); 23 | 24 | if (s1 >= BASE) 25 | s1 -= BASE; 26 | s2 %= BASE; 27 | } 28 | 29 | while (length > 0) 30 | { 31 | s1 += input[0]; s2 += s1; 32 | s1 += input[1]; s2 += s1; 33 | s1 += input[2]; s2 += s1; 34 | s1 += input[3]; s2 += s1; 35 | s1 += input[4]; s2 += s1; 36 | s1 += input[5]; s2 += s1; 37 | s1 += input[6]; s2 += s1; 38 | s1 += input[7]; s2 += s1; 39 | 40 | length -= 8; 41 | input += 8; 42 | 43 | if (s1 >= BASE) 44 | s1 -= BASE; 45 | if (length % 0x8000 == 0) 46 | s2 %= BASE; 47 | } 48 | 49 | CRYPTOPP_ASSERT(s1 < BASE); 50 | CRYPTOPP_ASSERT(s2 < BASE); 51 | 52 | m_s1 = (word16)s1; 53 | m_s2 = (word16)s2; 54 | } 55 | 56 | void Adler32::TruncatedFinal(byte *hash, size_t size) 57 | { 58 | ThrowIfInvalidTruncatedSize(size); 59 | 60 | switch (size) 61 | { 62 | default: 63 | hash[3] = byte(m_s1); 64 | // fall through 65 | case 3: 66 | hash[2] = byte(m_s1 >> 8); 67 | // fall through 68 | case 2: 69 | hash[1] = byte(m_s2); 70 | // fall through 71 | case 1: 72 | hash[0] = byte(m_s2 >> 8); 73 | // fall through 74 | case 0: 75 | ;; 76 | // fall through 77 | } 78 | 79 | Reset(); 80 | } 81 | 82 | NAMESPACE_END 83 | -------------------------------------------------------------------------------- /ProjectHex/crypto/adler32.h: -------------------------------------------------------------------------------- 1 | // adler32.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file adler32.h 4 | /// \brief Class file for ADLER-32 checksum calculations 5 | 6 | #ifndef CRYPTOPP_ADLER32_H 7 | #define CRYPTOPP_ADLER32_H 8 | 9 | #include "cryptlib.h" 10 | 11 | NAMESPACE_BEGIN(CryptoPP) 12 | 13 | /// ADLER-32 checksum calculations 14 | class Adler32 : public HashTransformation 15 | { 16 | public: 17 | CRYPTOPP_CONSTANT(DIGESTSIZE = 4) 18 | Adler32() {Reset();} 19 | void Update(const byte *input, size_t length); 20 | void TruncatedFinal(byte *hash, size_t size); 21 | unsigned int DigestSize() const {return DIGESTSIZE;} 22 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Adler32";} 23 | std::string AlgorithmName() const {return StaticAlgorithmName();} 24 | 25 | private: 26 | void Reset() {m_s1 = 1; m_s2 = 0;} 27 | 28 | word16 m_s1, m_s2; 29 | }; 30 | 31 | NAMESPACE_END 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /ProjectHex/crypto/aes.h: -------------------------------------------------------------------------------- 1 | // aes.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file 4 | /// \brief Class file for the AES cipher (Rijndael) 5 | /// \details AES is a typdef for Rijndael classes. All key sizes are supported. 6 | /// The library only provides Rijndael with 128-bit blocks, and not 192-bit or 256-bit blocks 7 | /// \since Rijndael since Crypto++ 3.1, Intel AES-NI since Crypto++ 5.6.1, ARMv8 AES since Crypto++ 6.0, 8 | /// Power8 AES since Crypto++ 6.0 9 | 10 | #ifndef CRYPTOPP_AES_H 11 | #define CRYPTOPP_AES_H 12 | 13 | #include "rijndael.h" 14 | 15 | NAMESPACE_BEGIN(CryptoPP) 16 | 17 | /// \brief AES block cipher (Rijndael) 18 | /// \details AES is a typdef for Rijndael classes. All key sizes are supported. 19 | /// The library only provides Rijndael with 128-bit blocks, and not 192-bit or 256-bit blocks 20 | /// \sa AES winner, announced on 10/2/2000 21 | /// \since Rijndael since Crypto++ 3.1, Intel AES-NI since Crypto++ 5.6.1, ARMv8 AES since Crypto++ 6.0, 22 | /// Power8 AES since Crypto++ 6.0 23 | DOCUMENTED_TYPEDEF(Rijndael, AES) 24 | 25 | typedef RijndaelEncryption AESEncryption; 26 | typedef RijndaelDecryption AESDecryption; 27 | 28 | NAMESPACE_END 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ProjectHex/crypto/aes_armv4.h: -------------------------------------------------------------------------------- 1 | /* Header file for use with Cryptogam's ARMv4 AES. */ 2 | /* Also see http://www.openssl.org/~appro/cryptogams/ and */ 3 | /* https://wiki.openssl.org/index.php?title=Cryptogams_AES */ 4 | 5 | #ifndef CRYPTOGAMS_AES_ARMV4_H 6 | #define CRYPTOGAMS_AES_ARMV4_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | //#define AES_MAXNR 14 13 | //typedef struct AES_KEY_st { 14 | // unsigned int rd_key[4 * (AES_MAXNR + 1)]; 15 | // int rounds; 16 | //} AES_KEY; 17 | 18 | // Instead of AES_KEY we use a 'word32 rkey[4*15+4]'. It has space for 19 | // both the AES_MAXNR round keys and the number of rounds in the tail. 20 | 21 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey); 22 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey); 23 | void AES_encrypt(const unsigned char in[16], unsigned char out[16], const unsigned int *rkey); 24 | void AES_decrypt(const unsigned char in[16], unsigned char out[16], const unsigned int *rkey); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif /* CRYPTOGAMS_AES_ARMV4_H */ 31 | -------------------------------------------------------------------------------- /ProjectHex/crypto/algparam.cpp: -------------------------------------------------------------------------------- 1 | // algparam.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "algparam.h" 8 | #include "integer.h" 9 | 10 | NAMESPACE_BEGIN(CryptoPP) 11 | 12 | bool CombinedNameValuePairs::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const 13 | { 14 | if (strcmp(name, "ValueNames") == 0) 15 | return m_pairs1.GetVoidValue(name, valueType, pValue) && m_pairs2.GetVoidValue(name, valueType, pValue); 16 | else 17 | return m_pairs1.GetVoidValue(name, valueType, pValue) || m_pairs2.GetVoidValue(name, valueType, pValue); 18 | } 19 | 20 | void AlgorithmParametersBase::operator=(const AlgorithmParametersBase &rhs) 21 | { 22 | CRYPTOPP_UNUSED(rhs); 23 | CRYPTOPP_ASSERT(false); 24 | } 25 | 26 | bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const 27 | { 28 | if (strcmp(name, "ValueNames") == 0) 29 | { 30 | NameValuePairs::ThrowIfTypeMismatch(name, typeid(std::string), valueType); 31 | if (m_next.get()) 32 | m_next->GetVoidValue(name, valueType, pValue); 33 | (*reinterpret_cast(pValue) += m_name) += ";"; 34 | return true; 35 | } 36 | else if (strcmp(name, m_name) == 0) 37 | { 38 | AssignValue(name, valueType, pValue); 39 | m_used = true; 40 | return true; 41 | } 42 | else if (m_next.get()) 43 | return m_next->GetVoidValue(name, valueType, pValue); 44 | else 45 | return false; 46 | } 47 | 48 | AlgorithmParameters::AlgorithmParameters() 49 | : m_defaultThrowIfNotUsed(true) 50 | { 51 | } 52 | 53 | AlgorithmParameters::AlgorithmParameters(const AlgorithmParameters &x) 54 | : m_defaultThrowIfNotUsed(x.m_defaultThrowIfNotUsed) 55 | { 56 | m_next.reset(const_cast(x).m_next.release()); 57 | } 58 | 59 | AlgorithmParameters & AlgorithmParameters::operator=(const AlgorithmParameters &x) 60 | { 61 | m_next.reset(const_cast(x).m_next.release()); 62 | return *this; 63 | } 64 | 65 | bool AlgorithmParameters::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const 66 | { 67 | if (m_next.get()) 68 | return m_next->GetVoidValue(name, valueType, pValue); 69 | else 70 | return false; 71 | } 72 | 73 | NAMESPACE_END 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /ProjectHex/crypto/arc4.cpp: -------------------------------------------------------------------------------- 1 | // arc4.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | // The ARC4 algorithm was first revealed in an anonymous email to the 4 | // cypherpunks mailing list. This file originally contained some 5 | // code copied from this email. The code has since been rewritten in order 6 | // to clarify the copyright status of this file. It should now be 7 | // completely in the public domain. 8 | 9 | #include "pch.h" 10 | #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 11 | #include "arc4.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | namespace Weak1 { 15 | 16 | #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 17 | void ARC4_TestInstantiations() 18 | { 19 | ARC4 x; 20 | } 21 | #endif 22 | 23 | ARC4_Base::~ARC4_Base() 24 | { 25 | m_x = m_y = 0; 26 | } 27 | 28 | void ARC4_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) 29 | { 30 | AssertValidKeyLength(length); 31 | 32 | m_x = 1; 33 | m_y = 0; 34 | 35 | unsigned int i; 36 | for (i=0; i<256; i++) 37 | m_state[i] = byte(i); 38 | 39 | unsigned int keyIndex = 0, stateIndex = 0; 40 | for (i=0; i<256; i++) 41 | { 42 | unsigned int a = m_state[i]; 43 | stateIndex += key[keyIndex] + a; 44 | stateIndex &= 0xff; 45 | m_state[i] = m_state[stateIndex]; 46 | m_state[stateIndex] = byte(a); 47 | if (++keyIndex >= length) 48 | keyIndex = 0; 49 | } 50 | 51 | int discardBytes = params.GetIntValueWithDefault("DiscardBytes", GetDefaultDiscardBytes()); 52 | DiscardBytes(discardBytes); 53 | } 54 | 55 | template 56 | static inline unsigned int MakeByte(T &x, T &y, byte *s) 57 | { 58 | unsigned int a = s[x]; 59 | y = byte((y+a) & 0xff); 60 | unsigned int b = s[y]; 61 | s[x] = byte(b); 62 | s[y] = byte(a); 63 | x = byte((x+1) & 0xff); 64 | return s[(a+b) & 0xff]; 65 | } 66 | 67 | void ARC4_Base::GenerateBlock(byte *output, size_t size) 68 | { 69 | while (size--) 70 | *output++ = static_cast(MakeByte(m_x, m_y, m_state)); 71 | } 72 | 73 | void ARC4_Base::ProcessData(byte *outString, const byte *inString, size_t length) 74 | { 75 | if (length == 0) 76 | return; 77 | 78 | byte *const s = m_state; 79 | unsigned int x = m_x; 80 | unsigned int y = m_y; 81 | 82 | if (inString == outString) 83 | { 84 | do 85 | { 86 | *outString++ ^= MakeByte(x, y, s); 87 | } while (--length); 88 | } 89 | else 90 | { 91 | do 92 | { 93 | *outString++ = *inString++ ^ byte(MakeByte(x, y, s)); 94 | } 95 | while(--length); 96 | } 97 | 98 | m_x = byte(x); 99 | m_y = byte(y); 100 | } 101 | 102 | void ARC4_Base::DiscardBytes(size_t n) 103 | { 104 | if (n == 0) 105 | return; 106 | 107 | byte *const s = m_state; 108 | unsigned int x = m_x; 109 | unsigned int y = m_y; 110 | 111 | do 112 | { 113 | MakeByte(x, y, s); 114 | } 115 | while(--n); 116 | 117 | m_x = byte(x); 118 | m_y = byte(y); 119 | } 120 | 121 | } 122 | NAMESPACE_END 123 | -------------------------------------------------------------------------------- /ProjectHex/crypto/bds10.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/bds10.zip -------------------------------------------------------------------------------- /ProjectHex/crypto/bench.h: -------------------------------------------------------------------------------- 1 | // bench.h - originally written and placed in the public domain by Wei Dai 2 | // CryptoPP::Test namespace added by JW in February 2017 3 | 4 | #ifndef CRYPTOPP_BENCH_H 5 | #define CRYPTOPP_BENCH_H 6 | 7 | #include "cryptlib.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | NAMESPACE_BEGIN(CryptoPP) 15 | NAMESPACE_BEGIN(Test) 16 | 17 | // More granular control over benchmarks 18 | enum TestClass { 19 | UnkeyedRNG=(1<<0),UnkeyedHash=(1<<1),UnkeyedOther=(1<<2), 20 | SharedKeyMAC=(1<<3),SharedKeyStream=(1<<4),SharedKeyBlock=(1<<5),SharedKeyOther=(1<<6), 21 | PublicKeyAgreement=(1<<7),PublicKeyEncryption=(1<<8),PublicKeySignature=(1<<9),PublicKeyOther=(1<<10), 22 | Unkeyed=UnkeyedRNG|UnkeyedHash|UnkeyedOther, 23 | SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther, 24 | PublicKey=PublicKeyAgreement|PublicKeyEncryption|PublicKeySignature|PublicKeyOther, 25 | All=Unkeyed|SharedKey|PublicKey, 26 | TestFirst=(0), TestLast=(1<<11) 27 | }; 28 | 29 | extern const double CLOCK_TICKS_PER_SECOND; 30 | extern double g_allocatedTime; 31 | extern double g_hertz; 32 | extern double g_logTotal; 33 | extern unsigned int g_logCount; 34 | extern const byte defaultKey[]; 35 | 36 | // Test book keeping 37 | extern time_t g_testBegin; 38 | extern time_t g_testEnd; 39 | 40 | // Benchmark command handler 41 | void BenchmarkWithCommand(int argc, const char* const argv[]); 42 | // Top level, prints preamble and postamble 43 | void Benchmark(Test::TestClass suites, double t, double hertz); 44 | // Unkeyed systems 45 | void Benchmark1(double t, double hertz); 46 | // Shared key systems 47 | void Benchmark2(double t, double hertz); 48 | // Public key systems 49 | void Benchmark3(double t, double hertz); 50 | 51 | // These are defined in bench1.cpp 52 | extern void OutputResultKeying(double iterations, double timeTaken); 53 | extern void OutputResultBytes(const char *name, const char *provider, double length, double timeTaken); 54 | extern void OutputResultOperations(const char *name, const char *provider, const char *operation, bool pc, unsigned long iterations, double timeTaken); 55 | 56 | // These are defined in bench1.cpp 57 | extern void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal); 58 | extern void BenchMark(const char *name, StreamTransformation &cipher, double timeTotal); 59 | extern void BenchMark(const char *name, HashTransformation &ht, double timeTotal); 60 | extern void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal); 61 | 62 | // These are defined in bench2.cpp 63 | extern void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs ¶ms); 64 | extern void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal); 65 | 66 | NAMESPACE_END // Test 67 | NAMESPACE_END // CryptoPP 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /ProjectHex/crypto/blowfish.cpp: -------------------------------------------------------------------------------- 1 | // blowfish.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "blowfish.h" 5 | #include "misc.h" 6 | 7 | NAMESPACE_BEGIN(CryptoPP) 8 | 9 | void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &) 10 | { 11 | AssertValidKeyLength(keylength); 12 | 13 | unsigned i, j=0, k; 14 | word32 data, dspace[2] = {0, 0}; 15 | 16 | memcpy(pbox, p_init, sizeof(p_init)); 17 | memcpy(sbox, s_init, sizeof(s_init)); 18 | 19 | // Xor key string into encryption key vector 20 | for (i=0 ; i Block; 74 | 75 | word32 left, right; 76 | Block::Get(inBlock)(left)(right); 77 | 78 | const word32 *const s=sbox; 79 | const word32 *p=pbox; 80 | 81 | left ^= p[0]; 82 | 83 | for (unsigned i=0; i, public VariableKeyLength<16, 4, 56>, public FixedRounds<16> 16 | { 17 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Blowfish";} 18 | }; 19 | 20 | // Blowfish 21 | 22 | /// \brief Blowfish block cipher 23 | /// \since Crypto++ 1.0 24 | class Blowfish : public Blowfish_Info, public BlockCipherDocumentation 25 | { 26 | /// \brief Class specific implementation and overrides used to operate the cipher. 27 | /// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions 28 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 29 | { 30 | public: 31 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 32 | void UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs ¶ms); 33 | 34 | private: 35 | void crypt_block(const word32 in[2], word32 out[2]) const; 36 | 37 | static const word32 p_init[ROUNDS+2]; 38 | static const word32 s_init[4*256]; 39 | 40 | FixedSizeSecBlock pbox; 41 | FixedSizeSecBlock sbox; 42 | }; 43 | 44 | public: 45 | typedef BlockCipherFinal Encryption; 46 | typedef BlockCipherFinal Decryption; 47 | }; 48 | 49 | typedef Blowfish::Encryption BlowfishEncryption; 50 | typedef Blowfish::Decryption BlowfishDecryption; 51 | 52 | NAMESPACE_END 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /ProjectHex/crypto/blumshub.cpp: -------------------------------------------------------------------------------- 1 | // blumshub.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "blumshub.h" 5 | #include "integer.h" 6 | 7 | NAMESPACE_BEGIN(CryptoPP) 8 | 9 | PublicBlumBlumShub::PublicBlumBlumShub(const Integer &n, const Integer &seed) 10 | : modn(n), 11 | current(modn.Square(modn.Square(seed))), 12 | maxBits(BitPrecision(n.BitCount())-1), 13 | bitsLeft(maxBits) 14 | { 15 | } 16 | 17 | unsigned int PublicBlumBlumShub::GenerateBit() 18 | { 19 | if (bitsLeft==0) 20 | { 21 | current = modn.Square(current); 22 | bitsLeft = maxBits; 23 | } 24 | 25 | return static_cast(current.GetBit(--bitsLeft)); 26 | } 27 | 28 | byte PublicBlumBlumShub::GenerateByte() 29 | { 30 | byte b=0; 31 | for (int i=0; i<8; i++) 32 | b = byte((b << 1) | PublicBlumBlumShub::GenerateBit()); 33 | return b; 34 | } 35 | 36 | void PublicBlumBlumShub::GenerateBlock(byte *output, size_t size) 37 | { 38 | while (size--) 39 | *output++ = PublicBlumBlumShub::GenerateByte(); 40 | } 41 | 42 | void PublicBlumBlumShub::ProcessData(byte *outString, const byte *inString, size_t length) 43 | { 44 | while (length--) 45 | *outString++ = *inString++ ^ PublicBlumBlumShub::GenerateByte(); 46 | } 47 | 48 | BlumBlumShub::BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed) 49 | : PublicBlumBlumShub(p*q, seed), 50 | p(p), q(q), 51 | x0(modn.Square(seed)) 52 | { 53 | } 54 | 55 | void BlumBlumShub::Seek(lword index) 56 | { 57 | Integer i(Integer::POSITIVE, index); 58 | i *= 8; 59 | Integer e = a_exp_b_mod_c (2, i / maxBits + 1, (p-1)*(q-1)); 60 | current = modn.Exponentiate(x0, e); 61 | bitsLeft = maxBits - i % maxBits; 62 | } 63 | 64 | NAMESPACE_END 65 | -------------------------------------------------------------------------------- /ProjectHex/crypto/blumshub.h: -------------------------------------------------------------------------------- 1 | // blumshub.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file blumshub.h 4 | /// \brief Classes for Blum Blum Shub generator 5 | 6 | #ifndef CRYPTOPP_BLUMSHUB_H 7 | #define CRYPTOPP_BLUMSHUB_H 8 | 9 | #include "cryptlib.h" 10 | #include "modarith.h" 11 | #include "integer.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// BlumBlumShub without factorization of the modulus 16 | class PublicBlumBlumShub : public RandomNumberGenerator, 17 | public StreamTransformation 18 | { 19 | public: 20 | virtual ~PublicBlumBlumShub() {} 21 | 22 | PublicBlumBlumShub(const Integer &n, const Integer &seed); 23 | 24 | unsigned int GenerateBit(); 25 | byte GenerateByte(); 26 | void GenerateBlock(byte *output, size_t size); 27 | void ProcessData(byte *outString, const byte *inString, size_t length); 28 | 29 | bool IsSelfInverting() const {return true;} 30 | bool IsForwardTransformation() const {return true;} 31 | 32 | protected: 33 | ModularArithmetic modn; 34 | Integer current; 35 | word maxBits, bitsLeft; 36 | }; 37 | 38 | /// BlumBlumShub with factorization of the modulus 39 | class BlumBlumShub : public PublicBlumBlumShub 40 | { 41 | public: 42 | virtual ~BlumBlumShub() {} 43 | 44 | // Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long, 45 | // seed is the secret key and should be about as big as p*q 46 | BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed); 47 | 48 | bool IsRandomAccess() const {return true;} 49 | void Seek(lword index); 50 | 51 | protected: 52 | const Integer p, q; 53 | const Integer x0; 54 | }; 55 | 56 | NAMESPACE_END 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /ProjectHex/crypto/camellia.h: -------------------------------------------------------------------------------- 1 | // camellia.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file camellia.h 4 | /// \brief Classes for the Camellia block cipher 5 | 6 | #ifndef CRYPTOPP_CAMELLIA_H 7 | #define CRYPTOPP_CAMELLIA_H 8 | 9 | #include "config.h" 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief Camellia block cipher information 16 | struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Camellia";} 19 | }; 20 | 21 | /// \brief Camellia block cipher 22 | /// \sa Camellia 23 | class Camellia : public Camellia_Info, public BlockCipherDocumentation 24 | { 25 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 26 | { 27 | public: 28 | void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs ¶ms); 29 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 30 | 31 | protected: 32 | CRYPTOPP_ALIGN_DATA(4) static const byte s1[256]; 33 | static const word32 SP[4][256]; 34 | 35 | unsigned int m_rounds; 36 | SecBlock m_key; 37 | }; 38 | 39 | public: 40 | typedef BlockCipherFinal Encryption; 41 | typedef BlockCipherFinal Decryption; 42 | }; 43 | 44 | typedef Camellia::Encryption CamelliaEncryption; 45 | typedef Camellia::Decryption CamelliaDecryption; 46 | 47 | NAMESPACE_END 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cbcmac.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #ifndef CRYPTOPP_IMPORTS 4 | 5 | #include "cbcmac.h" 6 | 7 | NAMESPACE_BEGIN(CryptoPP) 8 | 9 | void CBC_MAC_Base::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) 10 | { 11 | AccessCipher().SetKey(key, length, params); 12 | m_reg.CleanNew(AccessCipher().BlockSize()); 13 | m_counter = 0; 14 | } 15 | 16 | void CBC_MAC_Base::Update(const byte *input, size_t length) 17 | { 18 | unsigned int blockSize = AccessCipher().BlockSize(); 19 | 20 | while (m_counter && length) 21 | { 22 | m_reg[m_counter++] ^= *input++; 23 | if (m_counter == blockSize) 24 | ProcessBuf(); 25 | length--; 26 | } 27 | 28 | if (length >= blockSize) 29 | { 30 | size_t leftOver = AccessCipher().AdvancedProcessBlocks(m_reg, input, m_reg, length, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); 31 | input += (length - leftOver); 32 | length = leftOver; 33 | } 34 | 35 | while (length--) 36 | { 37 | m_reg[m_counter++] ^= *input++; 38 | if (m_counter == blockSize) 39 | ProcessBuf(); 40 | } 41 | } 42 | 43 | void CBC_MAC_Base::TruncatedFinal(byte *mac, size_t size) 44 | { 45 | ThrowIfInvalidTruncatedSize(size); 46 | 47 | if (m_counter) 48 | ProcessBuf(); 49 | 50 | memcpy(mac, m_reg, size); 51 | memset(m_reg, 0, AccessCipher().BlockSize()); 52 | } 53 | 54 | void CBC_MAC_Base::ProcessBuf() 55 | { 56 | AccessCipher().ProcessBlock(m_reg); 57 | m_counter = 0; 58 | } 59 | 60 | NAMESPACE_END 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cbcmac.h: -------------------------------------------------------------------------------- 1 | // cbcmac.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file 4 | /// \brief Classes for CBC MAC 5 | /// \since Crypto++ 3.1 6 | 7 | #ifndef CRYPTOPP_CBCMAC_H 8 | #define CRYPTOPP_CBCMAC_H 9 | 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief CBC-MAC base class 16 | /// \since Crypto++ 3.1 17 | class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_MAC_Base : public MessageAuthenticationCode 18 | { 19 | public: 20 | CBC_MAC_Base() : m_counter(0) {} 21 | 22 | void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); 23 | void Update(const byte *input, size_t length); 24 | void TruncatedFinal(byte *mac, size_t size); 25 | unsigned int DigestSize() const {return const_cast(this)->AccessCipher().BlockSize();} 26 | 27 | protected: 28 | virtual BlockCipher & AccessCipher() =0; 29 | 30 | private: 31 | void ProcessBuf(); 32 | SecByteBlock m_reg; 33 | unsigned int m_counter; 34 | }; 35 | 36 | /// \brief CBC-MAC 37 | /// \tparam T BlockCipherDocumentation derived class 38 | /// \details CBC-MAC is compatible with FIPS 113. The MAC is secure only for fixed 39 | /// length messages. For variable length messages use CMAC or DMAC. 40 | /// \sa CBC-MAC 41 | /// \since Crypto++ 3.1 42 | template 43 | class CBC_MAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs 44 | { 45 | public: 46 | CBC_MAC() {} 47 | CBC_MAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH) 48 | {this->SetKey(key, length);} 49 | 50 | static std::string StaticAlgorithmName() {return std::string("CBC-MAC(") + T::StaticAlgorithmName() + ")";} 51 | 52 | private: 53 | BlockCipher & AccessCipher() {return m_cipher;} 54 | typename T::Encryption m_cipher; 55 | }; 56 | 57 | NAMESPACE_END 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cmac.h: -------------------------------------------------------------------------------- 1 | // cmac.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file cmac.h 4 | /// \brief Classes for CMAC message authentication code 5 | /// \since Crypto++ 5.6.0 6 | 7 | #ifndef CRYPTOPP_CMAC_H 8 | #define CRYPTOPP_CMAC_H 9 | 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief CMAC base implementation 16 | /// \since Crypto++ 5.6.0 17 | class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode 18 | { 19 | public: 20 | 21 | virtual ~CMAC_Base() {} 22 | 23 | CMAC_Base() : m_counter(0) {} 24 | 25 | void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); 26 | void Update(const byte *input, size_t length); 27 | void TruncatedFinal(byte *mac, size_t size); 28 | unsigned int DigestSize() const {return GetCipher().BlockSize();} 29 | unsigned int OptimalBlockSize() const {return GetCipher().BlockSize();} 30 | unsigned int OptimalDataAlignment() const {return GetCipher().OptimalDataAlignment();} 31 | std::string AlgorithmProvider() const {return GetCipher().AlgorithmProvider();} 32 | 33 | protected: 34 | friend class EAX_Base; 35 | 36 | const BlockCipher & GetCipher() const {return const_cast(this)->AccessCipher();} 37 | virtual BlockCipher & AccessCipher() =0; 38 | 39 | void ProcessBuf(); 40 | SecByteBlock m_reg; 41 | unsigned int m_counter; 42 | }; 43 | 44 | /// \brief CMAC message authentication code 45 | /// \tparam T block cipher 46 | /// \details Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32. 47 | /// \sa CMAC 48 | /// \since Crypto++ 5.6.0 49 | template 50 | class CMAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs 51 | { 52 | public: 53 | /// \brief Construct a CMAC 54 | CMAC() {} 55 | /// \brief Construct a CMAC 56 | /// \param key the MAC key 57 | /// \param length the key size, in bytes 58 | CMAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH) 59 | {this->SetKey(key, length);} 60 | 61 | static std::string StaticAlgorithmName() {return std::string("CMAC(") + T::StaticAlgorithmName() + ")";} 62 | 63 | private: 64 | BlockCipher & AccessCipher() {return m_cipher;} 65 | typename T::Encryption m_cipher; 66 | }; 67 | 68 | NAMESPACE_END 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /ProjectHex/crypto/crc.h: -------------------------------------------------------------------------------- 1 | // crc.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file crc.h 4 | /// \brief Classes for CRC-32 and CRC-32C checksum algorithm 5 | 6 | #ifndef CRYPTOPP_CRC32_H 7 | #define CRYPTOPP_CRC32_H 8 | 9 | #include "cryptlib.h" 10 | 11 | NAMESPACE_BEGIN(CryptoPP) 12 | 13 | const word32 CRC32_NEGL = 0xffffffffL; 14 | 15 | #if (CRYPTOPP_LITTLE_ENDIAN) 16 | #define CRC32_INDEX(c) (c & 0xff) 17 | #define CRC32_SHIFTED(c) (c >> 8) 18 | #else 19 | #define CRC32_INDEX(c) (c >> 24) 20 | #define CRC32_SHIFTED(c) (c << 8) 21 | #endif 22 | 23 | /// \brief CRC-32 Checksum Calculation 24 | /// \details Uses CRC polynomial 0xEDB88320 25 | class CRC32 : public HashTransformation 26 | { 27 | public: 28 | CRYPTOPP_CONSTANT(DIGESTSIZE = 4) 29 | CRC32(); 30 | void Update(const byte *input, size_t length); 31 | void TruncatedFinal(byte *hash, size_t size); 32 | unsigned int DigestSize() const {return DIGESTSIZE;} 33 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32";} 34 | std::string AlgorithmName() const {return StaticAlgorithmName();} 35 | 36 | void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);} 37 | byte GetCrcByte(size_t i) const {return reinterpret_cast(&m_crc)[i];} 38 | 39 | std::string AlgorithmProvider() const; 40 | 41 | protected: 42 | void Reset() {m_crc = CRC32_NEGL;} 43 | 44 | private: 45 | static const word32 m_tab[256]; 46 | word32 m_crc; 47 | }; 48 | 49 | /// \brief CRC-32C Checksum Calculation 50 | /// \details Uses CRC polynomial 0x82F63B78 51 | /// \since Crypto++ 5.6.4 52 | class CRC32C : public HashTransformation 53 | { 54 | public: 55 | CRYPTOPP_CONSTANT(DIGESTSIZE = 4) 56 | CRC32C(); 57 | void Update(const byte *input, size_t length); 58 | void TruncatedFinal(byte *hash, size_t size); 59 | unsigned int DigestSize() const {return DIGESTSIZE;} 60 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32C";} 61 | std::string AlgorithmName() const {return StaticAlgorithmName();} 62 | 63 | void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);} 64 | byte GetCrcByte(size_t i) const {return reinterpret_cast(&m_crc)[i];} 65 | 66 | std::string AlgorithmProvider() const; 67 | 68 | protected: 69 | void Reset() {m_crc = CRC32_NEGL;} 70 | 71 | private: 72 | static const word32 m_tab[256]; 73 | word32 m_crc; 74 | }; 75 | 76 | NAMESPACE_END 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptdll.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptest.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/cryptest.suo -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptest.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | v 5 | 6 | 7 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/cryptlib.lib -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptlib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ProjectHex/crypto/crypto.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/crypto.cpp -------------------------------------------------------------------------------- /ProjectHex/crypto/crypto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #pragma warning (disable: 4191 4099) 4 | #pragma comment (lib, "crypto/cryptlib.lib") 5 | #include "aes.h" 6 | #include "modes.h" 7 | #include "base64.h" 8 | #include "hex.h" 9 | #include 10 | #include "stdcpp.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | class security 19 | { 20 | public: 21 | static std::string encrypt(const std::string str_in, const std::string key, const std::string iv); 22 | static std::string decrypt(const std::string str_in, const std::string key, const std::string iv); 23 | static std::vector encrypt_decrypt_data(std::vector data, std::vector key); 24 | static std::string random_string(int len); 25 | static std::string random_num(int len); 26 | static std::string random_string2(int len); 27 | std::string key_enc; 28 | std::string key; 29 | std::string iv; 30 | private: 31 | }; 32 | -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptopp.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/cryptopp.rc -------------------------------------------------------------------------------- /ProjectHex/crypto/cryptopp.supp: -------------------------------------------------------------------------------- 1 | # Valgrind suppression file 2 | 3 | { 4 | # https://github.com/weidai11/cryptopp/issues/543 5 | __memcmp_sse4_1 6 | Memcheck:Cond 7 | fun:__memcmp_sse4_1 8 | } 9 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dh.cpp: -------------------------------------------------------------------------------- 1 | // dh.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "dh.h" 8 | 9 | NAMESPACE_BEGIN(CryptoPP) 10 | 11 | #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 12 | void DH_TestInstantiations() 13 | { 14 | DH dh1; 15 | DH dh2(NullRNG(), 10); 16 | } 17 | #endif 18 | 19 | NAMESPACE_END 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dh2.cpp: -------------------------------------------------------------------------------- 1 | // dh2.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "cryptlib.h" 5 | #include "misc.h" 6 | #include "dh2.h" 7 | 8 | NAMESPACE_BEGIN(CryptoPP) 9 | 10 | #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 11 | struct NullCryptoParameters : public CryptoParameters 12 | { 13 | void AssignFrom(const NameValuePairs &source) { 14 | CRYPTOPP_UNUSED(source); 15 | } 16 | bool Validate(RandomNumberGenerator &rng, unsigned int level) const { 17 | CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(level); 18 | return false; 19 | } 20 | bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const { 21 | CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue); 22 | return false; 23 | } 24 | }; 25 | 26 | struct NullSimpleKeyAgreementDomain : public TwoBases 27 | { 28 | CryptoParameters & AccessCryptoParameters() { 29 | return *this; 30 | } 31 | unsigned int AgreedValueLength() const { 32 | return 1; 33 | } 34 | unsigned int PrivateKeyLength() const { 35 | return 1; 36 | } 37 | unsigned int PublicKeyLength() const { 38 | return 1; 39 | } 40 | void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const { 41 | CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(privateKey); 42 | } 43 | void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const { 44 | CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(privateKey); CRYPTOPP_UNUSED(publicKey); 45 | } 46 | bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const { 47 | CRYPTOPP_UNUSED(agreedValue); CRYPTOPP_UNUSED(privateKey); 48 | CRYPTOPP_UNUSED(otherPublicKey); CRYPTOPP_UNUSED(validateOtherPublicKey); 49 | return false; 50 | } 51 | }; 52 | 53 | void DH2_TestInstantiations() 54 | { 55 | NullSimpleKeyAgreementDomain dom; 56 | DH2 dh(dom); 57 | } 58 | #endif 59 | 60 | bool DH2::Agree(byte *agreedValue, 61 | const byte *staticSecretKey, const byte *ephemeralSecretKey, 62 | const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, 63 | bool validateStaticOtherPublicKey) const 64 | { 65 | return d1.Agree(agreedValue, staticSecretKey, staticOtherPublicKey, validateStaticOtherPublicKey) 66 | && d2.Agree(agreedValue+d1.AgreedValueLength(), ephemeralSecretKey, ephemeralOtherPublicKey, true); 67 | } 68 | 69 | NAMESPACE_END 70 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dh2.h: -------------------------------------------------------------------------------- 1 | // dh2.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file dh2.h 4 | /// \brief Classes for Unified Diffie-Hellman key exchange 5 | /// \since Crypto++ 3.0 6 | 7 | #ifndef CRYPTOPP_DH2_H 8 | #define CRYPTOPP_DH2_H 9 | 10 | #include "cryptlib.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief Unified Diffie-Hellman in GF(p) 15 | /// \details A Diffie-Hellman domain is a set of parameters that must be shared 16 | /// by two parties in a key agreement protocol, along with the algorithms 17 | /// for generating key pairs and deriving agreed values. 18 | /// \sa AuthenticatedKeyAgreementDomain, Unified Diffie-Hellman 19 | /// \since Crypto++ 3.0 20 | class DH2 : public AuthenticatedKeyAgreementDomain 21 | { 22 | public: 23 | virtual ~DH2() {} 24 | 25 | /// \brief Construct a DH2 26 | DH2(SimpleKeyAgreementDomain &domain) 27 | : d1(domain), d2(domain) {} 28 | /// \brief Construct a DH2 29 | DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain) 30 | : d1(staticDomain), d2(ephemeralDomain) {} 31 | 32 | CryptoParameters & AccessCryptoParameters() {return d1.AccessCryptoParameters();} 33 | 34 | unsigned int AgreedValueLength() const 35 | {return d1.AgreedValueLength() + d2.AgreedValueLength();} 36 | 37 | unsigned int StaticPrivateKeyLength() const 38 | {return d1.PrivateKeyLength();} 39 | unsigned int StaticPublicKeyLength() const 40 | {return d1.PublicKeyLength();} 41 | void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const 42 | {d1.GeneratePrivateKey(rng, privateKey);} 43 | void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const 44 | {d1.GeneratePublicKey(rng, privateKey, publicKey);} 45 | void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const 46 | {d1.GenerateKeyPair(rng, privateKey, publicKey);} 47 | 48 | unsigned int EphemeralPrivateKeyLength() const 49 | {return d2.PrivateKeyLength();} 50 | unsigned int EphemeralPublicKeyLength() const 51 | {return d2.PublicKeyLength();} 52 | void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const 53 | {d2.GeneratePrivateKey(rng, privateKey);} 54 | void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const 55 | {d2.GeneratePublicKey(rng, privateKey, publicKey);} 56 | void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const 57 | {d2.GenerateKeyPair(rng, privateKey, publicKey);} 58 | 59 | bool Agree(byte *agreedValue, 60 | const byte *staticPrivateKey, const byte *ephemeralPrivateKey, 61 | const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, 62 | bool validateStaticOtherPublicKey=true) const; 63 | 64 | protected: 65 | SimpleKeyAgreementDomain &d1, &d2; 66 | }; 67 | 68 | NAMESPACE_END 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dll.h: -------------------------------------------------------------------------------- 1 | // dll.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file dll.h 4 | /// \brief Functions and definitions required for building the FIPS-140 DLL on Windows 5 | 6 | #ifndef CRYPTOPP_DLL_H 7 | #define CRYPTOPP_DLL_H 8 | 9 | #if !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) && !defined(CRYPTOPP_DEFAULT_NO_DLL) 10 | #ifdef CRYPTOPP_CONFIG_H 11 | #error To use the DLL version of Crypto++, this file must be included before any other Crypto++ header files. 12 | #endif 13 | #define CRYPTOPP_IMPORTS 14 | #endif 15 | 16 | #include "aes.h" 17 | #include "cbcmac.h" 18 | #include "ccm.h" 19 | #include "cmac.h" 20 | #include "channels.h" 21 | #include "des.h" 22 | #include "dh.h" 23 | #include "dsa.h" 24 | #include "ec2n.h" 25 | #include "eccrypto.h" 26 | #include "ecp.h" 27 | #include "files.h" 28 | #include "fips140.h" 29 | #include "gcm.h" 30 | #include "hex.h" 31 | #include "hmac.h" 32 | #include "modes.h" 33 | #include "mqueue.h" 34 | #include "nbtheory.h" 35 | #include "osrng.h" 36 | #include "pkcspad.h" 37 | #include "pssr.h" 38 | #include "randpool.h" 39 | #include "rsa.h" 40 | #include "rw.h" 41 | #include "sha.h" 42 | #include "skipjack.h" 43 | 44 | #ifdef CRYPTOPP_IMPORTS 45 | 46 | #ifdef _DLL 47 | // cause CRT DLL to be initialized before Crypto++ so that we can use malloc and free during DllMain() 48 | #ifdef CRYPTOPP_DEBUG 49 | # pragma comment(lib, "msvcrtd") 50 | # pragma comment(lib, "cryptopp") 51 | #else 52 | # pragma comment(lib, "msvcrt") 53 | # pragma comment(lib, "cryptopp") 54 | #endif 55 | #endif 56 | 57 | #endif // #ifdef CRYPTOPP_IMPORTS 58 | 59 | #include // for new_handler 60 | 61 | NAMESPACE_BEGIN(CryptoPP) 62 | 63 | typedef void * (CRYPTOPP_API * PNew)(size_t); 64 | typedef void (CRYPTOPP_API * PDelete)(void *); 65 | typedef void (CRYPTOPP_API * PGetNewAndDelete)(PNew &, PDelete &); 66 | typedef std::new_handler (CRYPTOPP_API * PSetNewHandler)(std::new_handler); 67 | typedef void (CRYPTOPP_API * PSetNewAndDelete)(PNew, PDelete, PSetNewHandler); 68 | 69 | NAMESPACE_END 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dlltest.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {d7fe0401-fa2d-40cd-80b9-b91f937996a3} 6 | .cpp 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dsa.cpp: -------------------------------------------------------------------------------- 1 | // dsa.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "dsa.h" 8 | #include "asn.h" 9 | #include "integer.h" 10 | #include "filters.h" 11 | #include "nbtheory.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat) 16 | { 17 | Integer r, s; 18 | StringStore store(signature, signatureLen); 19 | ArraySink sink(buffer, bufferSize); 20 | 21 | switch (fromFormat) 22 | { 23 | case DSA_P1363: 24 | r.Decode(store, signatureLen/2); 25 | s.Decode(store, signatureLen/2); 26 | break; 27 | case DSA_DER: 28 | { 29 | BERSequenceDecoder seq(store); 30 | r.BERDecode(seq); 31 | s.BERDecode(seq); 32 | seq.MessageEnd(); 33 | break; 34 | } 35 | case DSA_OPENPGP: 36 | r.OpenPGPDecode(store); 37 | s.OpenPGPDecode(store); 38 | break; 39 | } 40 | 41 | switch (toFormat) 42 | { 43 | case DSA_P1363: 44 | r.Encode(sink, bufferSize/2); 45 | s.Encode(sink, bufferSize/2); 46 | break; 47 | case DSA_DER: 48 | { 49 | DERSequenceEncoder seq(sink); 50 | r.DEREncode(seq); 51 | s.DEREncode(seq); 52 | seq.MessageEnd(); 53 | break; 54 | } 55 | case DSA_OPENPGP: 56 | r.OpenPGPEncode(sink); 57 | s.OpenPGPEncode(sink); 58 | break; 59 | } 60 | 61 | return (size_t)sink.TotalPutLength(); 62 | } 63 | 64 | NAMESPACE_END 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /ProjectHex/crypto/dsa.h: -------------------------------------------------------------------------------- 1 | // dsa.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file dsa.h 4 | /// \brief Classes for the DSA signature algorithm 5 | 6 | #ifndef CRYPTOPP_DSA_H 7 | #define CRYPTOPP_DSA_H 8 | 9 | #include "cryptlib.h" 10 | #include "gfpcrypt.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief DSA Signature Format 15 | /// \details The DSA signature format used by Crypto++ is as defined by IEEE P1363. 16 | /// Java and .Net use the DER format, and OpenPGP uses the OpenPGP format. 17 | enum DSASignatureFormat { 18 | /// \brief Crypto++ native signature encoding format 19 | DSA_P1363, 20 | /// \brief signature encoding format used by Java and .Net 21 | DSA_DER, 22 | /// \brief OpenPGP signature encoding format 23 | DSA_OPENPGP 24 | }; 25 | 26 | /// \brief Converts between signature encoding formats 27 | /// \param buffer byte buffer for the converted signature encoding 28 | /// \param bufferSize the length of the converted signature encoding buffer 29 | /// \param toFormat the source signature format 30 | /// \param signature byte buffer for the existing signature encoding 31 | /// \param signatureLen the length of the existing signature encoding buffer 32 | /// \param fromFormat the source signature format 33 | /// \details This function converts between these formats, and returns length 34 | /// of signature in the target format. If toFormat == DSA_P1363, then 35 | /// bufferSize must equal publicKey.SignatureLength() 36 | /// \since Crypto++ 1.0 37 | size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, 38 | const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat); 39 | 40 | NAMESPACE_END 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ProjectHex/crypto/eax.cpp: -------------------------------------------------------------------------------- 1 | // eax.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "eax.h" 5 | 6 | NAMESPACE_BEGIN(CryptoPP) 7 | 8 | void EAX_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms) 9 | { 10 | AccessMAC().SetKey(userKey, keylength, params); 11 | m_buffer.New(2*AccessMAC().TagSize()); 12 | } 13 | 14 | void EAX_Base::Resync(const byte *iv, size_t len) 15 | { 16 | MessageAuthenticationCode &mac = AccessMAC(); 17 | unsigned int blockSize = mac.TagSize(); 18 | 19 | memset(m_buffer, 0, blockSize); 20 | mac.Update(m_buffer, blockSize); 21 | mac.CalculateDigest(m_buffer+blockSize, iv, len); 22 | 23 | m_buffer[blockSize-1] = 1; 24 | mac.Update(m_buffer, blockSize); 25 | 26 | m_ctr.SetCipherWithIV(AccessMAC().AccessCipher(), m_buffer+blockSize, blockSize); 27 | } 28 | 29 | size_t EAX_Base::AuthenticateBlocks(const byte *data, size_t len) 30 | { 31 | AccessMAC().Update(data, len); 32 | return 0; 33 | } 34 | 35 | void EAX_Base::AuthenticateLastHeaderBlock() 36 | { 37 | CRYPTOPP_ASSERT(m_bufferedDataLength == 0); 38 | MessageAuthenticationCode &mac = AccessMAC(); 39 | const unsigned int blockSize = mac.TagSize(); 40 | 41 | mac.Final(m_buffer); 42 | xorbuf(m_buffer+blockSize, m_buffer, blockSize); 43 | 44 | memset(m_buffer, 0, blockSize); 45 | m_buffer[blockSize-1] = 2; 46 | mac.Update(m_buffer, blockSize); 47 | } 48 | 49 | void EAX_Base::AuthenticateLastFooterBlock(byte *tag, size_t macSize) 50 | { 51 | CRYPTOPP_ASSERT(m_bufferedDataLength == 0); 52 | MessageAuthenticationCode &mac = AccessMAC(); 53 | unsigned int blockSize = mac.TagSize(); 54 | 55 | mac.TruncatedFinal(m_buffer, macSize); 56 | xorbuf(tag, m_buffer, m_buffer+blockSize, macSize); 57 | } 58 | 59 | NAMESPACE_END 60 | -------------------------------------------------------------------------------- /ProjectHex/crypto/elgamal.cpp: -------------------------------------------------------------------------------- 1 | // elgamal.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "elgamal.h" 5 | #include "asn.h" 6 | #include "nbtheory.h" 7 | 8 | // Squash MS LNK4221 and libtool warnings 9 | extern const char ELGAMAL_FNAME[] = __FILE__; 10 | 11 | NAMESPACE_BEGIN(CryptoPP) 12 | 13 | #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 14 | void ElGamal_TestInstantiations() 15 | { 16 | ElGamalEncryptor test1(1, 1, 1); 17 | ElGamalDecryptor test2(NullRNG(), 123); 18 | ElGamalEncryptor test3(test2); 19 | } 20 | #endif 21 | 22 | NAMESPACE_END 23 | -------------------------------------------------------------------------------- /ProjectHex/crypto/emsa2.cpp: -------------------------------------------------------------------------------- 1 | // emsa2.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "emsa2.h" 5 | 6 | #ifndef CRYPTOPP_IMPORTS 7 | 8 | NAMESPACE_BEGIN(CryptoPP) 9 | 10 | // Inclusion based on DLL due to Clang, http://github.com/weidai11/cryptopp/issues/300 11 | #ifndef CRYPTOPP_IS_DLL 12 | template<> const byte EMSA2HashId::id = 0x33; 13 | template<> const byte EMSA2HashId::id = 0x38; 14 | template<> const byte EMSA2HashId::id = 0x34; 15 | template<> const byte EMSA2HashId::id = 0x36; 16 | template<> const byte EMSA2HashId::id = 0x35; 17 | #endif 18 | 19 | void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator& /*rng*/, 20 | const byte* recoverableMessage, size_t recoverableMessageLength, 21 | HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, 22 | byte *representative, size_t representativeBitLength) const 23 | { 24 | CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength), CRYPTOPP_UNUSED(representativeBitLength); 25 | CRYPTOPP_ASSERT(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize())); 26 | 27 | if (representativeBitLength % 8 != 7) 28 | throw PK_SignatureScheme::InvalidKeyLength("EMSA2: EMSA2 requires a key length that is a multiple of 8"); 29 | 30 | size_t digestSize = hash.DigestSize(); 31 | size_t representativeByteLength = BitsToBytes(representativeBitLength); 32 | 33 | representative[0] = messageEmpty ? 0x4b : 0x6b; 34 | memset(representative+1, 0xbb, representativeByteLength-digestSize-4); // pad with 0xbb 35 | byte *afterP2 = representative+representativeByteLength-digestSize-3; 36 | afterP2[0] = 0xba; 37 | hash.Final(afterP2+1); 38 | representative[representativeByteLength-2] = *hashIdentifier.first; 39 | representative[representativeByteLength-1] = 0xcc; 40 | } 41 | 42 | NAMESPACE_END 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ProjectHex/crypto/filters.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/filters.cpp -------------------------------------------------------------------------------- /ProjectHex/crypto/fips140.cpp: -------------------------------------------------------------------------------- 1 | // fips140.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "fips140.h" 8 | #include "misc.h" 9 | 10 | NAMESPACE_BEGIN(CryptoPP) 11 | 12 | // Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during 13 | // startup, random number generation, and key generation. These tests may affect performance. 14 | #ifndef CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 15 | #define CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 0 16 | #endif 17 | 18 | #if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(OS_RNG_AVAILABLE)) 19 | #error FIPS 140-2 compliance requires the availability of OS provided RNG. 20 | #endif 21 | 22 | PowerUpSelfTestStatus g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE; 23 | 24 | bool FIPS_140_2_ComplianceEnabled() 25 | { 26 | return CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2; 27 | } 28 | 29 | void SimulatePowerUpSelfTestFailure() 30 | { 31 | g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED; 32 | } 33 | 34 | PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus() 35 | { 36 | return g_powerUpSelfTestStatus; 37 | } 38 | 39 | #if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 40 | // One variable for all threads for compatibility. Previously this 41 | // was a ThreadLocalStorage variable, which is per-thread. Also see 42 | // https://github.com/weidai11/cryptopp/issues/208 43 | static bool s_inProgress = false; 44 | #endif 45 | 46 | bool PowerUpSelfTestInProgressOnThisThread() 47 | { 48 | #if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 49 | return s_inProgress; 50 | #endif 51 | return false; 52 | } 53 | 54 | void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress) 55 | { 56 | CRYPTOPP_UNUSED(inProgress); 57 | #if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 58 | s_inProgress = inProgress; 59 | #endif 60 | } 61 | 62 | void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor) 63 | { 64 | CRYPTOPP_UNUSED(encryptor), CRYPTOPP_UNUSED(decryptor); 65 | #if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 66 | EncryptionPairwiseConsistencyTest(encryptor, decryptor); 67 | #endif 68 | } 69 | 70 | void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier) 71 | { 72 | CRYPTOPP_UNUSED(signer), CRYPTOPP_UNUSED(verifier); 73 | #if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 74 | SignaturePairwiseConsistencyTest(signer, verifier); 75 | #endif 76 | } 77 | 78 | NAMESPACE_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /ProjectHex/crypto/fltrimpl.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_FLTRIMPL_H 2 | #define CRYPTOPP_FLTRIMPL_H 3 | 4 | #if CRYPTOPP_MSC_VERSION 5 | # pragma warning(push) 6 | # pragma warning(disable: 4100) 7 | #endif 8 | 9 | #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 10 | # pragma GCC diagnostic push 11 | # pragma GCC diagnostic ignored "-Wunused-value" 12 | #endif 13 | 14 | #define FILTER_BEGIN \ 15 | switch (m_continueAt) \ 16 | { \ 17 | case 0: \ 18 | m_inputPosition = 0; 19 | 20 | #define FILTER_END_NO_MESSAGE_END_NO_RETURN \ 21 | break; \ 22 | default: \ 23 | CRYPTOPP_ASSERT(false); \ 24 | } 25 | 26 | #define FILTER_END_NO_MESSAGE_END \ 27 | FILTER_END_NO_MESSAGE_END_NO_RETURN \ 28 | return 0; 29 | 30 | /* 31 | #define FILTER_END \ 32 | case -1: \ 33 | if (messageEnd && Output(-1, NULLPTR, 0, messageEnd, blocking)) \ 34 | return 1; \ 35 | FILTER_END_NO_MESSAGE_END 36 | */ 37 | 38 | #define FILTER_OUTPUT3(site, statement, output, length, messageEnd, channel) \ 39 | {\ 40 | case site: \ 41 | statement; \ 42 | if (Output(site, output, length, messageEnd, blocking, channel)) \ 43 | return STDMAX(size_t(1), length-m_inputPosition);\ 44 | } 45 | 46 | #define FILTER_OUTPUT2(site, statement, output, length, messageEnd) \ 47 | FILTER_OUTPUT3(site, statement, output, length, messageEnd, DEFAULT_CHANNEL) 48 | 49 | #define FILTER_OUTPUT(site, output, length, messageEnd) \ 50 | FILTER_OUTPUT2(site, 0, output, length, messageEnd) 51 | 52 | #define FILTER_OUTPUT_BYTE(site, output) \ 53 | FILTER_OUTPUT(site, &(const byte &)(byte)output, 1, 0) 54 | 55 | #define FILTER_OUTPUT2_MODIFIABLE(site, statement, output, length, messageEnd) \ 56 | {\ 57 | /* fall through */ \ 58 | case site: \ 59 | statement; \ 60 | if (OutputModifiable(site, output, length, messageEnd, blocking)) \ 61 | return STDMAX(size_t(1), length-m_inputPosition);\ 62 | } 63 | 64 | #define FILTER_OUTPUT_MODIFIABLE(site, output, length, messageEnd) \ 65 | FILTER_OUTPUT2_MODIFIABLE(site, 0, output, length, messageEnd) 66 | 67 | #define FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, statement, output, length, messageEnd, modifiable) \ 68 | {\ 69 | /* fall through */ \ 70 | case site: \ 71 | statement; \ 72 | if (modifiable ? OutputModifiable(site, output, length, messageEnd, blocking) : Output(site, output, length, messageEnd, blocking)) \ 73 | return STDMAX(size_t(1), length-m_inputPosition);\ 74 | } 75 | 76 | #define FILTER_OUTPUT_MAYBE_MODIFIABLE(site, output, length, messageEnd, modifiable) \ 77 | FILTER_OUTPUT2_MAYBE_MODIFIABLE(site, 0, output, length, messageEnd, modifiable) 78 | 79 | #if CRYPTOPP_MSC_VERSION 80 | # pragma warning(pop) 81 | #endif 82 | 83 | #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 84 | # pragma GCC diagnostic pop 85 | #endif 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /ProjectHex/crypto/gf256.cpp: -------------------------------------------------------------------------------- 1 | // gf256.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "gf256.h" 5 | 6 | NAMESPACE_BEGIN(CryptoPP) 7 | 8 | GF256::Element GF256::Multiply(Element a, Element b) const 9 | { 10 | word result = 0, t = b; 11 | 12 | for (unsigned int i=0; i<8; i++) 13 | { 14 | result <<= 1; 15 | if (result & 0x100) 16 | result ^= m_modulus; 17 | 18 | t <<= 1; 19 | if (t & 0x100) 20 | result ^= a; 21 | } 22 | 23 | return (GF256::Element) result; 24 | } 25 | 26 | GF256::Element GF256::MultiplicativeInverse(Element a) const 27 | { 28 | Element result = a; 29 | for (int i=1; i<7; i++) 30 | result = Multiply(Square(result), a); 31 | return Square(result); 32 | } 33 | 34 | NAMESPACE_END 35 | -------------------------------------------------------------------------------- /ProjectHex/crypto/gf256.h: -------------------------------------------------------------------------------- 1 | // gf256.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file gf256.h 4 | /// \brief Classes and functions for schemes over GF(256) 5 | 6 | #ifndef CRYPTOPP_GF256_H 7 | #define CRYPTOPP_GF256_H 8 | 9 | #include "cryptlib.h" 10 | #include "misc.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief GF(256) with polynomial basis 15 | class GF256 16 | { 17 | public: 18 | typedef byte Element; 19 | typedef int RandomizationParameter; 20 | 21 | GF256(byte modulus) : m_modulus(modulus) {} 22 | 23 | Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const 24 | {CRYPTOPP_UNUSED(ignored); return rng.GenerateByte();} 25 | 26 | bool Equal(Element a, Element b) const 27 | {return a==b;} 28 | 29 | Element Zero() const 30 | {return 0;} 31 | 32 | Element Add(Element a, Element b) const 33 | {return a^b;} 34 | 35 | Element& Accumulate(Element &a, Element b) const 36 | {return a^=b;} 37 | 38 | Element Inverse(Element a) const 39 | {return a;} 40 | 41 | Element Subtract(Element a, Element b) const 42 | {return a^b;} 43 | 44 | Element& Reduce(Element &a, Element b) const 45 | {return a^=b;} 46 | 47 | Element Double(Element a) const 48 | {CRYPTOPP_UNUSED(a); return 0;} 49 | 50 | Element One() const 51 | {return 1;} 52 | 53 | Element Multiply(Element a, Element b) const; 54 | 55 | Element Square(Element a) const 56 | {return Multiply(a, a);} 57 | 58 | bool IsUnit(Element a) const 59 | {return a != 0;} 60 | 61 | Element MultiplicativeInverse(Element a) const; 62 | 63 | Element Divide(Element a, Element b) const 64 | {return Multiply(a, MultiplicativeInverse(b));} 65 | 66 | private: 67 | word m_modulus; 68 | }; 69 | 70 | NAMESPACE_END 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /ProjectHex/crypto/gf2_32.cpp: -------------------------------------------------------------------------------- 1 | // gf2_32.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "misc.h" 5 | #include "gf2_32.h" 6 | 7 | NAMESPACE_BEGIN(CryptoPP) 8 | 9 | GF2_32::Element GF2_32::Multiply(Element a, Element b) const 10 | { 11 | word32 table[4]; 12 | table[0] = 0; 13 | table[1] = m_modulus; 14 | if (a & 0x80000000) 15 | { 16 | table[2] = m_modulus ^ (a<<1); 17 | table[3] = a<<1; 18 | } 19 | else 20 | { 21 | table[2] = a<<1; 22 | table[3] = m_modulus ^ (a<<1); 23 | } 24 | 25 | #if CRYPTOPP_FAST_ROTATE(32) 26 | b = rotrConstant<30>(b); 27 | word32 result = table[b&2]; 28 | 29 | for (int i=29; i>=0; --i) 30 | { 31 | b = rotlConstant<1>(b); 32 | result = (result<<1) ^ table[(b&2) + (result>>31)]; 33 | } 34 | 35 | return (b&1) ? result ^ a : result; 36 | #else 37 | word32 result = table[(b>>30) & 2]; 38 | 39 | for (int i=29; i>=0; --i) 40 | result = (result<<1) ^ table[((b>>i)&2) + (result>>31)]; 41 | 42 | return (b&1) ? result ^ a : result; 43 | #endif 44 | } 45 | 46 | GF2_32::Element GF2_32::MultiplicativeInverse(Element a) const 47 | { 48 | if (a <= 1) // 1 is a special case 49 | return a; 50 | 51 | // warning - don't try to adapt this algorithm for another situation 52 | word32 g0=m_modulus, g1=a, g2=a; 53 | word32 v0=0, v1=1, v2=1; 54 | 55 | CRYPTOPP_ASSERT(g1); 56 | 57 | while (!(g2 & 0x80000000)) 58 | { 59 | g2 <<= 1; 60 | v2 <<= 1; 61 | } 62 | 63 | g2 <<= 1; 64 | v2 <<= 1; 65 | 66 | g0 ^= g2; 67 | v0 ^= v2; 68 | 69 | while (g0 != 1) 70 | { 71 | if (g1 < g0 || ((g0^g1) < g0 && (g0^g1) < g1)) 72 | { 73 | CRYPTOPP_ASSERT(BitPrecision(g1) <= BitPrecision(g0)); 74 | g2 = g1; 75 | v2 = v1; 76 | } 77 | else 78 | { 79 | CRYPTOPP_ASSERT(BitPrecision(g1) > BitPrecision(g0)); 80 | g2 = g0; g0 = g1; g1 = g2; 81 | v2 = v0; v0 = v1; v1 = v2; 82 | } 83 | 84 | while ((g0^g2) >= g2) 85 | { 86 | CRYPTOPP_ASSERT(BitPrecision(g0) > BitPrecision(g2)); 87 | g2 <<= 1; 88 | v2 <<= 1; 89 | } 90 | 91 | CRYPTOPP_ASSERT(BitPrecision(g0) == BitPrecision(g2)); 92 | g0 ^= g2; 93 | v0 ^= v2; 94 | } 95 | 96 | return v0; 97 | } 98 | 99 | NAMESPACE_END 100 | -------------------------------------------------------------------------------- /ProjectHex/crypto/gf2_32.h: -------------------------------------------------------------------------------- 1 | // gf2_32.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file gf2_32.h 4 | /// \brief Classes and functions for schemes over GF(2^32) 5 | 6 | #ifndef CRYPTOPP_GF2_32_H 7 | #define CRYPTOPP_GF2_32_H 8 | 9 | #include "cryptlib.h" 10 | #include "secblock.h" 11 | #include "misc.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief GF(2^32) with polynomial basis 16 | class GF2_32 17 | { 18 | public: 19 | typedef word32 Element; 20 | typedef int RandomizationParameter; 21 | 22 | GF2_32(word32 modulus=0x0000008D) : m_modulus(modulus) {} 23 | 24 | Element RandomElement(RandomNumberGenerator &rng, int ignored = 0) const 25 | {CRYPTOPP_UNUSED(ignored); return rng.GenerateWord32();} 26 | 27 | bool Equal(Element a, Element b) const 28 | {return a==b;} 29 | 30 | Element Identity() const 31 | {return 0;} 32 | 33 | Element Add(Element a, Element b) const 34 | {return a^b;} 35 | 36 | Element& Accumulate(Element &a, Element b) const 37 | {return a^=b;} 38 | 39 | Element Inverse(Element a) const 40 | {return a;} 41 | 42 | Element Subtract(Element a, Element b) const 43 | {return a^b;} 44 | 45 | Element& Reduce(Element &a, Element b) const 46 | {return a^=b;} 47 | 48 | Element Double(Element a) const 49 | {CRYPTOPP_UNUSED(a); return 0;} 50 | 51 | Element MultiplicativeIdentity() const 52 | {return 1;} 53 | 54 | Element Multiply(Element a, Element b) const; 55 | 56 | Element Square(Element a) const 57 | {return Multiply(a, a);} 58 | 59 | bool IsUnit(Element a) const 60 | {return a != 0;} 61 | 62 | Element MultiplicativeInverse(Element a) const; 63 | 64 | Element Divide(Element a, Element b) const 65 | {return Multiply(a, MultiplicativeInverse(b));} 66 | 67 | private: 68 | word32 m_modulus; 69 | }; 70 | 71 | NAMESPACE_END 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /ProjectHex/crypto/gost.h: -------------------------------------------------------------------------------- 1 | // gost.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file gost.h 4 | /// \brief Classes for the GIST block cipher 5 | 6 | #ifndef CRYPTOPP_GOST_H 7 | #define CRYPTOPP_GOST_H 8 | 9 | #include "seckey.h" 10 | #include "secblock.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief GOST block cipher information 15 | /// \since Crypto++ 2.1 16 | struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "GOST";} 19 | }; 20 | 21 | /// \brief GOST block cipher 22 | /// \sa GOST 23 | /// \since Crypto++ 2.1 24 | class GOST : public GOST_Info, public BlockCipherDocumentation 25 | { 26 | /// \brief GOST block cipher default operation 27 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 28 | { 29 | public: 30 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 31 | 32 | protected: 33 | static void PrecalculateSTable(); 34 | 35 | static const byte sBox[8][16]; 36 | static volatile bool sTableCalculated; 37 | static word32 sTable[4][256]; 38 | 39 | FixedSizeSecBlock m_key; 40 | }; 41 | 42 | /// \brief GOST block cipher encryption operation 43 | class CRYPTOPP_NO_VTABLE Enc : public Base 44 | { 45 | public: 46 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 47 | }; 48 | 49 | /// \brief GOST block cipher decryption operation 50 | class CRYPTOPP_NO_VTABLE Dec : public Base 51 | { 52 | public: 53 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 54 | }; 55 | 56 | public: 57 | typedef BlockCipherFinal Encryption; 58 | typedef BlockCipherFinal Decryption; 59 | }; 60 | 61 | typedef GOST::Encryption GOSTEncryption; 62 | typedef GOST::Decryption GOSTDecryption; 63 | 64 | NAMESPACE_END 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hashfwd.h: -------------------------------------------------------------------------------- 1 | // hashfwd.h - written and placed in the public domain by Jeffrey Walton 2 | 3 | /// \file hashfwd.h 4 | /// \brief Forward declarations for hash functions used in signature encoding methods 5 | 6 | #ifndef CRYPTOPP_HASHFWD_H 7 | #define CRYPTOPP_HASHFWD_H 8 | 9 | #include "config.h" 10 | 11 | NAMESPACE_BEGIN(CryptoPP) 12 | 13 | class SHA1; 14 | class SHA224; 15 | class SHA256; 16 | class SHA384; 17 | class SHA512; 18 | 19 | class SHA3_256; 20 | class SHA3_384; 21 | class SHA3_512; 22 | 23 | class SHAKE128; 24 | class SHAKE256; 25 | 26 | class Tiger; 27 | class RIPEMD128; 28 | class RIPEMD160; 29 | class Whirlpool; 30 | 31 | namespace Weak1 { 32 | class MD2; 33 | class MD5; 34 | } 35 | 36 | NAMESPACE_END 37 | 38 | #endif // CRYPTOPP_HASHFWD_H 39 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hc128.h: -------------------------------------------------------------------------------- 1 | // hc128.h - written and placed in the public domain by Jeffrey Walton 2 | // based on public domain code by Hongjun Wu. 3 | // 4 | // The reference materials and source files are available at 5 | // The eSTREAM Project, http://www.ecrypt.eu.org/stream/e2-hc128.html. 6 | 7 | /// \file hc128.h 8 | /// \brief Classes for HC-128 stream cipher 9 | /// \sa The 10 | /// eSTREAM Project | HC-128 and 11 | /// Crypto++ Wiki | HC-128. 12 | /// \since Crypto++ 8.0 13 | 14 | #ifndef CRYPTOPP_HC128_H 15 | #define CRYPTOPP_HC128_H 16 | 17 | #include "strciphr.h" 18 | #include "secblock.h" 19 | 20 | NAMESPACE_BEGIN(CryptoPP) 21 | 22 | /// \brief HC-128 stream cipher information 23 | /// \since Crypto++ 8.0 24 | struct HC128Info : public FixedKeyLength<16, SimpleKeyingInterface::UNIQUE_IV, 16> 25 | { 26 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() { return "HC-128"; } 27 | }; 28 | 29 | /// \brief HC-128 stream cipher implementation 30 | /// \since Crypto++ 8.0 31 | class HC128Policy : public AdditiveCipherConcretePolicy, public HC128Info 32 | { 33 | protected: 34 | void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); 35 | void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); 36 | void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); 37 | bool CanOperateKeystream() const { return true; } 38 | bool CipherIsRandomAccess() const { return false; } 39 | 40 | void GenerateKeystream(word32* keystream); 41 | void SetupUpdate(); 42 | 43 | private: 44 | FixedSizeSecBlock m_X; 45 | FixedSizeSecBlock m_Y; 46 | FixedSizeSecBlock m_key; 47 | FixedSizeSecBlock m_iv; 48 | word32 m_T[1024]; 49 | word32 m_ctr; 50 | }; 51 | 52 | /// \brief HC-128 stream cipher 53 | /// \details HC-128 is a stream cipher developed by Hongjun Wu. HC-128 is one of the 54 | /// final four Profile 1 (software) ciphers selected for the eSTREAM portfolio. 55 | /// \sa The 56 | /// eSTREAM Project | HC-128 and 57 | /// Crypto++ Wiki | HC-128. 58 | /// \since Crypto++ 8.0 59 | struct HC128 : public HC128Info, public SymmetricCipherDocumentation 60 | { 61 | typedef SymmetricCipherFinal >, HC128Info> Encryption; 62 | typedef Encryption Decryption; 63 | }; 64 | 65 | NAMESPACE_END 66 | 67 | #endif // CRYPTOPP_HC128_H 68 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hc256.h: -------------------------------------------------------------------------------- 1 | // hc256.h - written and placed in the public domain by Jeffrey Walton 2 | // based on public domain code by Hongjun Wu. 3 | // 4 | // The reference materials and source files are available at 5 | // The eSTREAM Project, http://www.ecrypt.eu.org/stream/hc256.html. 6 | 7 | /// \file hc256.h 8 | /// \brief Classes for HC-256 stream cipher 9 | /// \sa The 10 | /// eSTREAM Project | HC-256 and 11 | /// Crypto++ Wiki | HC-128. 12 | /// \since Crypto++ 8.0 13 | 14 | #ifndef CRYPTOPP_HC256_H 15 | #define CRYPTOPP_HC256_H 16 | 17 | #include "strciphr.h" 18 | #include "secblock.h" 19 | 20 | NAMESPACE_BEGIN(CryptoPP) 21 | 22 | /// \brief HC-256 stream cipher information 23 | /// \since Crypto++ 8.0 24 | struct HC256Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 32> 25 | { 26 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() { return "HC-256"; } 27 | }; 28 | 29 | /// \brief HC-256 stream cipher implementation 30 | /// \since Crypto++ 8.0 31 | class HC256Policy : public AdditiveCipherConcretePolicy, public HC256Info 32 | { 33 | protected: 34 | void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); 35 | void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); 36 | void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); 37 | bool CanOperateKeystream() const { return true; } 38 | bool CipherIsRandomAccess() const { return false; } 39 | 40 | word32 H1(word32 u); 41 | word32 H2(word32 u); 42 | word32 Generate(); 43 | 44 | private: 45 | FixedSizeSecBlock m_key; 46 | FixedSizeSecBlock m_iv; 47 | word32 m_P[1024]; 48 | word32 m_Q[1024]; 49 | word32 m_ctr; 50 | }; 51 | 52 | /// \brief HC-256 stream cipher 53 | /// \details HC-256 is a stream cipher developed by Hongjun Wu. HC-256 is the 54 | /// successor to HC-128 from the eSTREAM project. 55 | /// \sa The 56 | /// eSTREAM Project | HC-256 and 57 | /// Crypto++ Wiki | HC-128. 58 | /// \since Crypto++ 8.0 59 | struct HC256 : public HC256Info, public SymmetricCipherDocumentation 60 | { 61 | typedef SymmetricCipherFinal >, HC256Info> Encryption; 62 | typedef Encryption Decryption; 63 | }; 64 | 65 | NAMESPACE_END 66 | 67 | #endif // CRYPTOPP_HC256_H 68 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hex.cpp: -------------------------------------------------------------------------------- 1 | // hex.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "hex.h" 8 | 9 | NAMESPACE_BEGIN(CryptoPP) 10 | ANONYMOUS_NAMESPACE_BEGIN 11 | 12 | const byte s_vecUpper[] = "0123456789ABCDEF"; 13 | const byte s_vecLower[] = "0123456789abcdef"; 14 | const int s_array[256] = { 15 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, 19 | -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21 | -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 29 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 31 | }; 32 | 33 | ANONYMOUS_NAMESPACE_END 34 | 35 | void HexEncoder::IsolatedInitialize(const NameValuePairs ¶meters) 36 | { 37 | bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true); 38 | m_filter->Initialize(CombinedNameValuePairs( 39 | parameters, 40 | MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 4, true))); 41 | } 42 | 43 | void HexDecoder::IsolatedInitialize(const NameValuePairs ¶meters) 44 | { 45 | BaseN_Decoder::IsolatedInitialize(CombinedNameValuePairs( 46 | parameters, 47 | MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 4, true))); 48 | } 49 | 50 | // Unrolled initialization, http://github.com/weidai11/cryptopp/issues/376 51 | const int *HexDecoder::GetDefaultDecodingLookupArray() 52 | { 53 | return s_array; 54 | } 55 | 56 | NAMESPACE_END 57 | 58 | #endif // CRYPTOPP_IMPORTS 59 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hex.h: -------------------------------------------------------------------------------- 1 | // hex.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file hex.h 4 | /// \brief Classes for HexEncoder and HexDecoder 5 | 6 | #ifndef CRYPTOPP_HEX_H 7 | #define CRYPTOPP_HEX_H 8 | 9 | #include "cryptlib.h" 10 | #include "basecode.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief Converts given data to base 16 15 | class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter 16 | { 17 | public: 18 | /// \brief Construct a HexEncoder 19 | /// \param attachment a BufferedTrasformation to attach to this object 20 | /// \param uppercase a flag indicating uppercase output 21 | /// \param groupSize the size of the output grouping 22 | /// \param separator the separator to use between groups 23 | /// \param terminator the terminator append after processing 24 | HexEncoder(BufferedTransformation *attachment = NULLPTR, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "") 25 | : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) 26 | { 27 | IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator))); 28 | } 29 | 30 | void IsolatedInitialize(const NameValuePairs ¶meters); 31 | }; 32 | 33 | /// \brief Decode base 16 data back to bytes 34 | class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder 35 | { 36 | public: 37 | /// \brief Construct a HexDecoder 38 | /// \param attachment a BufferedTrasformation to attach to this object 39 | HexDecoder(BufferedTransformation *attachment = NULLPTR) 40 | : BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {} 41 | 42 | void IsolatedInitialize(const NameValuePairs ¶meters); 43 | 44 | private: 45 | static const int * CRYPTOPP_API GetDefaultDecodingLookupArray(); 46 | }; 47 | 48 | NAMESPACE_END 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hmac.cpp: -------------------------------------------------------------------------------- 1 | // hmac.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "hmac.h" 8 | 9 | NAMESPACE_BEGIN(CryptoPP) 10 | 11 | void HMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &) 12 | { 13 | AssertValidKeyLength(keylength); 14 | 15 | Restart(); 16 | 17 | HashTransformation &hash = AccessHash(); 18 | unsigned int blockSize = hash.BlockSize(); 19 | 20 | if (!blockSize) 21 | throw InvalidArgument("HMAC: can only be used with a block-based hash function"); 22 | 23 | m_buf.resize(2*AccessHash().BlockSize() + AccessHash().DigestSize()); 24 | 25 | if (keylength <= blockSize) 26 | memcpy(AccessIpad(), userKey, keylength); 27 | else 28 | { 29 | AccessHash().CalculateDigest(AccessIpad(), userKey, keylength); 30 | keylength = hash.DigestSize(); 31 | } 32 | 33 | CRYPTOPP_ASSERT(keylength <= blockSize); 34 | memset(AccessIpad()+keylength, 0, blockSize-keylength); 35 | 36 | for (unsigned int i=0; i, public MessageAuthenticationCode 18 | { 19 | public: 20 | virtual ~HMAC_Base() {} 21 | 22 | /// \brief Construct a HMAC_Base 23 | HMAC_Base() : m_innerHashKeyed(false) {} 24 | void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); 25 | 26 | void Restart(); 27 | void Update(const byte *input, size_t length); 28 | void TruncatedFinal(byte *mac, size_t size); 29 | unsigned int OptimalBlockSize() const {return const_cast(this)->AccessHash().OptimalBlockSize();} 30 | unsigned int DigestSize() const {return const_cast(this)->AccessHash().DigestSize();} 31 | 32 | protected: 33 | virtual HashTransformation & AccessHash() =0; 34 | byte * AccessIpad() {return m_buf;} 35 | byte * AccessOpad() {return m_buf + AccessHash().BlockSize();} 36 | byte * AccessInnerHash() {return m_buf + 2*AccessHash().BlockSize();} 37 | 38 | private: 39 | void KeyInnerHash(); 40 | 41 | SecByteBlock m_buf; 42 | bool m_innerHashKeyed; 43 | }; 44 | 45 | /// \brief HMAC 46 | /// \tparam T HashTransformation derived class 47 | /// \details HMAC derives from MessageAuthenticationCodeImpl. It calculates the HMAC using 48 | /// HMAC(K, text) = H(K XOR opad, H(K XOR ipad, text)). 49 | /// \sa HMAC 50 | /// \since Crypto++ 2.1 51 | template 52 | class HMAC : public MessageAuthenticationCodeImpl > 53 | { 54 | public: 55 | CRYPTOPP_CONSTANT(DIGESTSIZE=T::DIGESTSIZE) 56 | CRYPTOPP_CONSTANT(BLOCKSIZE=T::BLOCKSIZE) 57 | 58 | virtual ~HMAC() {} 59 | 60 | /// \brief Construct a HMAC 61 | HMAC() {} 62 | /// \brief Construct a HMAC 63 | /// \param key the HMAC key 64 | /// \param length the size of the HMAC key 65 | HMAC(const byte *key, size_t length=HMAC_Base::DEFAULT_KEYLENGTH) 66 | {this->SetKey(key, length);} 67 | 68 | static std::string StaticAlgorithmName() {return std::string("HMAC(") + T::StaticAlgorithmName() + ")";} 69 | std::string AlgorithmName() const {return std::string("HMAC(") + m_hash.AlgorithmName() + ")";} 70 | std::string AlgorithmProvider() const {return m_hash.AlgorithmProvider();} 71 | 72 | private: 73 | HashTransformation & AccessHash() {return m_hash;} 74 | 75 | T m_hash; 76 | }; 77 | 78 | NAMESPACE_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /ProjectHex/crypto/hrtimer.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_HRTIMER_H 2 | #define CRYPTOPP_HRTIMER_H 3 | 4 | #include "config.h" 5 | 6 | #if !defined(HIGHRES_TIMER_AVAILABLE) || (defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(THREAD_TIMER_AVAILABLE)) 7 | #include 8 | #endif 9 | 10 | NAMESPACE_BEGIN(CryptoPP) 11 | 12 | #ifdef HIGHRES_TIMER_AVAILABLE 13 | typedef word64 TimerWord; 14 | #else 15 | typedef clock_t TimerWord; 16 | #endif 17 | 18 | /// \brief Base class for timers 19 | class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TimerBase 20 | { 21 | public: 22 | enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS}; 23 | TimerBase(Unit unit, bool stuckAtZero) 24 | : m_timerUnit(unit), m_stuckAtZero(stuckAtZero), m_started(false) 25 | , m_start(0), m_last(0) {} 26 | 27 | virtual TimerWord GetCurrentTimerValue() =0; // GetCurrentTime is a macro in MSVC 6.0 28 | virtual TimerWord TicksPerSecond() =0; // this is not the resolution, just a conversion factor into seconds 29 | 30 | void StartTimer(); 31 | double ElapsedTimeAsDouble(); 32 | unsigned long ElapsedTime(); 33 | 34 | private: 35 | double ConvertTo(TimerWord t, Unit unit); 36 | 37 | Unit m_timerUnit; // HPUX workaround: m_unit is a system macro on HPUX 38 | bool m_stuckAtZero, m_started; 39 | TimerWord m_start, m_last; 40 | }; 41 | 42 | /// \brief Measure CPU time spent executing instructions of this thread (if supported by OS) 43 | /// \note ThreadUserTimer only works correctly on Windows NT or later desktops and servers. 44 | /// On Unix-based it reports process time. On Windows Phone and Windows Store it reports wall 45 | /// clock time with performance counter precision. On all others it reports wall clock time. 46 | class ThreadUserTimer : public TimerBase 47 | { 48 | public: 49 | ThreadUserTimer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} 50 | TimerWord GetCurrentTimerValue(); 51 | TimerWord TicksPerSecond(); 52 | }; 53 | 54 | /// high resolution timer 55 | class CRYPTOPP_DLL Timer : public TimerBase 56 | { 57 | public: 58 | Timer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} 59 | TimerWord GetCurrentTimerValue(); 60 | TimerWord TicksPerSecond(); 61 | }; 62 | 63 | NAMESPACE_END 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /ProjectHex/crypto/idea.h: -------------------------------------------------------------------------------- 1 | // idea.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file idea.h 4 | /// \brief Classes for the IDEA block cipher 5 | 6 | #ifndef CRYPTOPP_IDEA_H 7 | #define CRYPTOPP_IDEA_H 8 | 9 | #include "seckey.h" 10 | #include "secblock.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief IDEA block cipher information 15 | /// \since Crypto++ 1.0 16 | struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "IDEA";} 19 | }; 20 | 21 | /// \brief IDEA block cipher 22 | /// \sa IDEA 23 | /// \since Crypto++ 1.0 24 | class IDEA : public IDEA_Info, public BlockCipherDocumentation 25 | { 26 | public: // made public for internal purposes 27 | #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE 28 | typedef word Word; 29 | #else 30 | typedef hword Word; 31 | #endif 32 | 33 | private: 34 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 35 | { 36 | public: 37 | unsigned int OptimalDataAlignment() const {return 2;} 38 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 39 | 40 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 41 | 42 | private: 43 | void EnKey(const byte *); 44 | void DeKey(); 45 | FixedSizeSecBlock m_key; 46 | 47 | #ifdef IDEA_LARGECACHE 48 | static inline void LookupMUL(word &a, word b); 49 | void LookupKeyLogs(); 50 | static void BuildLogTables(); 51 | static volatile bool tablesBuilt; 52 | static word16 log[0x10000], antilog[0x10000]; 53 | #endif 54 | }; 55 | 56 | public: 57 | typedef BlockCipherFinal Encryption; 58 | typedef BlockCipherFinal Decryption; 59 | }; 60 | 61 | typedef IDEA::Encryption IDEAEncryption; 62 | typedef IDEA::Decryption IDEADecryption; 63 | 64 | NAMESPACE_END 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /ProjectHex/crypto/keccak.cpp: -------------------------------------------------------------------------------- 1 | // keccak.cpp - modified by Wei Dai from Ronny Van Keer's public domain 2 | // sha3-simple.c. All modifications here are placed in the 3 | // public domain by Wei Dai. 4 | // Keccack core function moved to keccakc.cpp in AUG 2018 5 | // by Jeffrey Walton. Separating the core file allows both 6 | // SHA3 and Keccack to share the core implementation. 7 | 8 | /* 9 | The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, 10 | Michael Peeters and Gilles Van Assche. For more information, feedback or 11 | questions, please refer to our website: http://keccak.noekeon.org/ 12 | 13 | Implementation by Ronny Van Keer, hereby denoted as "the implementer". 14 | 15 | To the extent possible under law, the implementer has waived all copyright 16 | and related or neighboring rights to the source code in this file. 17 | http://creativecommons.org/publicdomain/zero/1.0/ 18 | */ 19 | 20 | #include "pch.h" 21 | #include "keccak.h" 22 | 23 | NAMESPACE_BEGIN(CryptoPP) 24 | 25 | // The Keccak core function 26 | extern void KeccakF1600(word64 *state); 27 | 28 | void Keccak::Update(const byte *input, size_t length) 29 | { 30 | CRYPTOPP_ASSERT(!(input == NULLPTR && length != 0)); 31 | if (length == 0) { return; } 32 | 33 | size_t spaceLeft; 34 | while (length >= (spaceLeft = r() - m_counter)) 35 | { 36 | if (spaceLeft) 37 | xorbuf(m_state.BytePtr() + m_counter, input, spaceLeft); 38 | KeccakF1600(m_state); 39 | input += spaceLeft; 40 | length -= spaceLeft; 41 | m_counter = 0; 42 | } 43 | 44 | if (length) 45 | xorbuf(m_state.BytePtr() + m_counter, input, length); 46 | m_counter += (unsigned int)length; 47 | } 48 | 49 | void Keccak::Restart() 50 | { 51 | memset(m_state, 0, m_state.SizeInBytes()); 52 | m_counter = 0; 53 | } 54 | 55 | void Keccak::TruncatedFinal(byte *hash, size_t size) 56 | { 57 | CRYPTOPP_ASSERT(hash != NULLPTR); 58 | ThrowIfInvalidTruncatedSize(size); 59 | 60 | m_state.BytePtr()[m_counter] ^= 0x01; 61 | m_state.BytePtr()[r()-1] ^= 0x80; 62 | KeccakF1600(m_state); 63 | std::memcpy(hash, m_state, size); 64 | Restart(); 65 | } 66 | 67 | NAMESPACE_END 68 | -------------------------------------------------------------------------------- /ProjectHex/crypto/lea_simd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/lea_simd.cpp -------------------------------------------------------------------------------- /ProjectHex/crypto/mars.h: -------------------------------------------------------------------------------- 1 | // mars.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file mars.h 4 | /// \brief Classes for the MARS block cipher (IBM AES submission) 5 | /// \since Crypto++ 3.0 6 | 7 | #ifndef CRYPTOPP_MARS_H 8 | #define CRYPTOPP_MARS_H 9 | 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief MARS block cipher information 16 | /// \since Crypto++ 3.0 17 | struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 8> 18 | { 19 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MARS";} 20 | }; 21 | 22 | /// \brief MARS block cipher 23 | /// \sa MARS 24 | /// \since Crypto++ 3.0 25 | class MARS : public MARS_Info, public BlockCipherDocumentation 26 | { 27 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 28 | { 29 | public: 30 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 31 | 32 | protected: 33 | static const word32 Sbox[512]; 34 | 35 | FixedSizeSecBlock m_k; 36 | }; 37 | 38 | class CRYPTOPP_NO_VTABLE Enc : public Base 39 | { 40 | public: 41 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 42 | }; 43 | 44 | class CRYPTOPP_NO_VTABLE Dec : public Base 45 | { 46 | public: 47 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 48 | }; 49 | 50 | public: 51 | typedef BlockCipherFinal Encryption; 52 | typedef BlockCipherFinal Decryption; 53 | }; 54 | 55 | typedef MARS::Encryption MARSEncryption; 56 | typedef MARS::Decryption MARSDecryption; 57 | 58 | NAMESPACE_END 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ProjectHex/crypto/md2.h: -------------------------------------------------------------------------------- 1 | // md2.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file md2.h 4 | /// \brief Classes for the MD2 message digest 5 | /// \since Crypto++ 3.0 6 | 7 | #ifndef CRYPTOPP_MD2_H 8 | #define CRYPTOPP_MD2_H 9 | 10 | #include "cryptlib.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | namespace Weak1 { 16 | 17 | /// \brief MD2 message digest 18 | /// \sa MD2 19 | /// \since Crypto++ 3.0 20 | class MD2 : public HashTransformation 21 | { 22 | public: 23 | MD2(); 24 | void Update(const byte *input, size_t length); 25 | void TruncatedFinal(byte *hash, size_t size); 26 | unsigned int DigestSize() const {return DIGESTSIZE;} 27 | unsigned int BlockSize() const {return BLOCKSIZE;} 28 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MD2";} 29 | 30 | CRYPTOPP_CONSTANT(DIGESTSIZE = 16) 31 | CRYPTOPP_CONSTANT(BLOCKSIZE = 16) 32 | 33 | private: 34 | void Transform(); 35 | void Init(); 36 | SecByteBlock m_X, m_C, m_buf; 37 | unsigned int m_count; 38 | }; 39 | 40 | } 41 | #if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 42 | namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak 43 | #else 44 | using namespace Weak1; // import Weak1 into CryptoPP with warning 45 | #ifdef __GNUC__ 46 | #warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." 47 | #else 48 | #pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") 49 | #endif 50 | #endif 51 | 52 | NAMESPACE_END 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /ProjectHex/crypto/md4.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_MD4_H 2 | #define CRYPTOPP_MD4_H 3 | 4 | #include "iterhash.h" 5 | 6 | NAMESPACE_BEGIN(CryptoPP) 7 | 8 | namespace Weak1 { 9 | 10 | /// MD4 11 | /*! \warning MD4 is considered insecure, and should not be used 12 | unless you absolutely need it for compatibility. */ 13 | class MD4 : public IteratedHashWithStaticTransform 14 | { 15 | public: 16 | static void InitState(HashWordType *state); 17 | static void Transform(word32 *digest, const word32 *data); 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MD4";} 19 | }; 20 | 21 | } 22 | #if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 23 | namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak 24 | #else 25 | using namespace Weak1; // import Weak1 into CryptoPP with warning 26 | #ifdef __GNUC__ 27 | #warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." 28 | #else 29 | #pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") 30 | #endif 31 | #endif 32 | 33 | NAMESPACE_END 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ProjectHex/crypto/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_MD5_H 2 | #define CRYPTOPP_MD5_H 3 | 4 | #include "iterhash.h" 5 | 6 | NAMESPACE_BEGIN(CryptoPP) 7 | 8 | namespace Weak1 { 9 | 10 | /// \brief MD5 message digest 11 | /// \sa MD5 12 | /// \since Crypto++ 1.0 13 | class MD5 : public IteratedHashWithStaticTransform 14 | { 15 | public: 16 | static void InitState(HashWordType *state); 17 | static void Transform(word32 *digest, const word32 *data); 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MD5";} 19 | }; 20 | 21 | } 22 | #if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1 23 | namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak 24 | #else 25 | using namespace Weak1; // import Weak1 into CryptoPP with warning 26 | #ifdef __GNUC__ 27 | #warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning." 28 | #else 29 | #pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.") 30 | #endif 31 | #endif 32 | 33 | NAMESPACE_END 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ProjectHex/crypto/modexppc.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_MODEXPPC_H 2 | #define CRYPTOPP_MODEXPPC_H 3 | 4 | #include "cryptlib.h" 5 | #include "modarith.h" 6 | #include "integer.h" 7 | #include "algebra.h" 8 | #include "eprecomp.h" 9 | #include "smartptr.h" 10 | #include "pubkey.h" 11 | 12 | #if CRYPTOPP_MSC_VERSION 13 | # pragma warning(push) 14 | # pragma warning(disable: 4231 4275) 15 | #endif 16 | 17 | NAMESPACE_BEGIN(CryptoPP) 18 | 19 | CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl; 20 | 21 | class ModExpPrecomputation : public DL_GroupPrecomputation 22 | { 23 | public: 24 | virtual ~ModExpPrecomputation() {} 25 | 26 | // DL_GroupPrecomputation 27 | bool NeedConversions() const {return true;} 28 | Element ConvertIn(const Element &v) const {return m_mr->ConvertIn(v);} 29 | virtual Element ConvertOut(const Element &v) const {return m_mr->ConvertOut(v);} 30 | const AbstractGroup & GetGroup() const {return m_mr->MultiplicativeGroup();} 31 | Element BERDecodeElement(BufferedTransformation &bt) const {return Integer(bt);} 32 | void DEREncodeElement(BufferedTransformation &bt, const Element &v) const {v.DEREncode(bt);} 33 | 34 | // non-inherited 35 | void SetModulus(const Integer &v) {m_mr.reset(new MontgomeryRepresentation(v));} 36 | const Integer & GetModulus() const {return m_mr->GetModulus();} 37 | 38 | private: 39 | value_ptr m_mr; 40 | }; 41 | 42 | NAMESPACE_END 43 | 44 | #if CRYPTOPP_MSC_VERSION 45 | # pragma warning(pop) 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /ProjectHex/crypto/mqv.cpp: -------------------------------------------------------------------------------- 1 | // mqv.cpp - originally written and placed in the public domain by Wei Dai 2 | // HMQV provided by Jeffrey Walton, Ray Clayton and Uri Blumenthal. 3 | // FHMQV provided by Uri Blumenthal. 4 | 5 | #include "pch.h" 6 | #include "config.h" 7 | #include "mqv.h" 8 | #include "hmqv.h" 9 | #include "fhmqv.h" 10 | 11 | // Squash MS LNK4221 and libtool warnings 12 | extern const char MQV_FNAME[] = __FILE__; 13 | 14 | NAMESPACE_BEGIN(CryptoPP) 15 | 16 | #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 17 | void TestInstantiations_MQV() 18 | { 19 | MQV mqv; 20 | } 21 | 22 | void TestInstantiations_HMQV() 23 | { 24 | HMQV hmqv; 25 | } 26 | 27 | void TestInstantiations_FHMQV() 28 | { 29 | FHMQV fhmqv; 30 | } 31 | #endif 32 | 33 | NAMESPACE_END 34 | -------------------------------------------------------------------------------- /ProjectHex/crypto/nr.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_NR_H 2 | #define CRYPTOPP_NR_H 3 | 4 | #include "gfpcrypt.h" 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /ProjectHex/crypto/oaep.h: -------------------------------------------------------------------------------- 1 | // oaep.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file oaep.h 4 | /// \brief Classes for optimal asymmetric encryption padding 5 | /// \since Crypto++ 2.1 6 | 7 | #ifndef CRYPTOPP_OAEP_H 8 | #define CRYPTOPP_OAEP_H 9 | 10 | #include "cryptlib.h" 11 | #include "pubkey.h" 12 | #include "sha.h" 13 | 14 | NAMESPACE_BEGIN(CryptoPP) 15 | 16 | /// \brief OAEP padding base class 17 | /// \since Crypto++ 2.1 18 | class CRYPTOPP_DLL OAEP_Base : public PK_EncryptionMessageEncodingMethod 19 | { 20 | public: 21 | bool ParameterSupported(const char *name) const {return strcmp(name, Name::EncodingParameters()) == 0;} 22 | size_t MaxUnpaddedLength(size_t paddedLength) const; 23 | void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedLength, const NameValuePairs ¶meters) const; 24 | DecodingResult Unpad(const byte *padded, size_t paddedLength, byte *raw, const NameValuePairs ¶meters) const; 25 | 26 | protected: 27 | virtual unsigned int DigestSize() const =0; 28 | virtual HashTransformation * NewHash() const =0; 29 | virtual MaskGeneratingFunction * NewMGF() const =0; 30 | }; 31 | 32 | /// \brief OAEP padding 33 | /// \tparam H HashTransformation derived class 34 | /// \tparam MGF MaskGeneratingFunction derived class 35 | /// \sa EME-OAEP, for use with classes derived from TF_ES 36 | /// \since Crypto++ 2.1 37 | template 38 | class OAEP : public OAEP_Base, public EncryptionStandard 39 | { 40 | public: 41 | static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string("OAEP-") + MGF::StaticAlgorithmName() + "(" + H::StaticAlgorithmName() + ")";} 42 | typedef OAEP EncryptionMessageEncodingMethod; 43 | 44 | protected: 45 | unsigned int DigestSize() const {return H::DIGESTSIZE;} 46 | HashTransformation * NewHash() const {return new H;} 47 | MaskGeneratingFunction * NewMGF() const {return new MGF;} 48 | }; 49 | 50 | CRYPTOPP_DLL_TEMPLATE_CLASS OAEP; 51 | 52 | NAMESPACE_END 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /ProjectHex/crypto/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /ProjectHex/crypto/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file pch.h 4 | /// \brief Precompiled header file 5 | /// \details The precompiled header files are used Windows. 6 | 7 | #ifndef CRYPTOPP_PCH_H 8 | #define CRYPTOPP_PCH_H 9 | 10 | # ifdef CRYPTOPP_GENERATE_X64_MASM 11 | #include "cpu.h" 12 | 13 | # else 14 | #include "config.h" 15 | 16 | #ifdef USE_PRECOMPILED_HEADERS 17 | #include "simple.h" 18 | #include "secblock.h" 19 | #include "misc.h" 20 | #include "smartptr.h" 21 | #include "stdcpp.h" 22 | #endif 23 | # endif 24 | 25 | // Enable file and line numbers, if available. 26 | // #if defined(_MSC_VER) && defined(_DEBUG) && defined(USE_PRECOMPILED_HEADERS) 27 | // # define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) 28 | // # define new DEBUG_NEW 29 | // #endif 30 | 31 | #endif // CRYPTOPP_PCH_H 32 | -------------------------------------------------------------------------------- /ProjectHex/crypto/ppc_power7.cpp: -------------------------------------------------------------------------------- 1 | // ppc_power7.cpp - written and placed in the public domain by 2 | // Jeffrey Walton, Uri Blumenthal and Marcel Raad. 3 | // 4 | // This source file uses intrinsics and built-ins to gain access to 5 | // Power7 instructions. A separate source file is needed because 6 | // additional CXXFLAGS are required to enable the appropriate 7 | // instructions sets in some build configurations. 8 | 9 | #include "pch.h" 10 | #include "config.h" 11 | 12 | #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 13 | # include 14 | # include 15 | #endif 16 | 17 | #if defined(_ARCH_PWR7) 18 | # include "ppc_simd.h" 19 | #endif 20 | 21 | // Squash MS LNK4221 and libtool warnings 22 | extern const char PPC_POWER7_FNAME[] = __FILE__; 23 | 24 | NAMESPACE_BEGIN(CryptoPP) 25 | 26 | // ************************* Feature Probes ************************* // 27 | 28 | #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 29 | extern "C" { 30 | typedef void (*SigHandler)(int); 31 | 32 | static jmp_buf s_jmpSIGILL; 33 | static void SigIllHandler(int) 34 | { 35 | longjmp(s_jmpSIGILL, 1); 36 | } 37 | } 38 | #endif // CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 39 | 40 | #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) 41 | bool CPU_ProbePower7() 42 | { 43 | #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) 44 | return false; 45 | #elif (_ARCH_PWR7) && defined(CRYPTOPP_POWER7_AVAILABLE) 46 | # if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) 47 | 48 | // longjmp and clobber warnings. Volatile is required. 49 | // http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854 50 | volatile int result = false; 51 | 52 | volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler); 53 | if (oldHandler == SIG_ERR) 54 | return false; 55 | 56 | volatile sigset_t oldMask; 57 | if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask)) 58 | return false; 59 | 60 | if (setjmp(s_jmpSIGILL)) 61 | result = false; 62 | else 63 | { 64 | // POWER7 added unaligned loads and store operations 65 | byte b1[19] = {255, 255, 255, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, b2[17]; 66 | 67 | // Specifically call the VSX loads and stores 68 | #if defined(__early_xlc__) || defined(__early_xlC__) 69 | vec_xstw4(vec_xlw4(0, b1+3), 0, b2+1); 70 | #elif defined(__xlc__) || defined(__xlC__) || defined(__clang__) 71 | vec_xst(vec_xl(0, b1+3), 0, b2+1); 72 | #else 73 | vec_vsx_st(vec_vsx_ld(0, b1+3), 0, b2+1); 74 | #endif 75 | 76 | result = (0 == std::memcmp(b1+3, b2+1, 16)); 77 | } 78 | 79 | sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR); 80 | signal(SIGILL, oldHandler); 81 | return result; 82 | # endif 83 | #else 84 | return false; 85 | #endif // _ARCH_PWR7 86 | } 87 | 88 | #endif // PPC32 or PPC64 89 | 90 | NAMESPACE_END 91 | -------------------------------------------------------------------------------- /ProjectHex/crypto/rc5.cpp: -------------------------------------------------------------------------------- 1 | // rc5.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | #include "rc5.h" 5 | #include "misc.h" 6 | #include "secblock.h" 7 | 8 | NAMESPACE_BEGIN(CryptoPP) 9 | 10 | void RC5::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms) 11 | { 12 | AssertValidKeyLength(keylen); 13 | 14 | r = GetRoundsAndThrowIfInvalid(params, this); 15 | sTable.New(2*(r+1)); 16 | 17 | static const RC5_WORD MAGIC_P = 0xb7e15163L; // magic constant P for wordsize 18 | static const RC5_WORD MAGIC_Q = 0x9e3779b9L; // magic constant Q for wordsize 19 | static const int U=sizeof(RC5_WORD); 20 | 21 | const unsigned int c = STDMAX((keylen+U-1)/U, 1U); // RC6 paper says c=1 if keylen==0 22 | SecBlock l(c); 23 | 24 | GetUserKey(LITTLE_ENDIAN_ORDER, l.begin(), c, k, keylen); 25 | 26 | sTable[0] = MAGIC_P; 27 | for (unsigned j=1; j((sTable[h % sTable.size()] + a + b)); 36 | b = l[h % c] = rotlMod((l[h % c] + a + b), (a+b)); 37 | } 38 | } 39 | 40 | typedef BlockGetAndPut Block; 41 | 42 | void RC5::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const 43 | { 44 | const RC5_WORD *sptr = sTable; 45 | RC5_WORD a, b; 46 | 47 | Block::Get(inBlock)(a)(b); 48 | a += sptr[0]; 49 | b += sptr[1]; 50 | sptr += 2; 51 | 52 | for(unsigned i=0; i, public VariableKeyLength<16, 0, 255>, public VariableRounds<16> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC5";} 19 | typedef word32 RC5_WORD; 20 | }; 21 | 22 | /// \brief RC5 block cipher 23 | /// \sa RC5 24 | /// \since Crypto++ 1.0 25 | class RC5 : public RC5_Info, public BlockCipherDocumentation 26 | { 27 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 28 | { 29 | public: 30 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 31 | 32 | protected: 33 | unsigned int r; // number of rounds 34 | SecBlock sTable; // expanded key table 35 | }; 36 | 37 | class CRYPTOPP_NO_VTABLE Enc : public Base 38 | { 39 | public: 40 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 41 | }; 42 | 43 | class CRYPTOPP_NO_VTABLE Dec : public Base 44 | { 45 | public: 46 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 47 | }; 48 | 49 | public: 50 | typedef BlockCipherFinal Encryption; 51 | typedef BlockCipherFinal Decryption; 52 | }; 53 | 54 | typedef RC5::Encryption RC5Encryption; 55 | typedef RC5::Decryption RC5Decryption; 56 | 57 | NAMESPACE_END 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /ProjectHex/crypto/rc6.cpp: -------------------------------------------------------------------------------- 1 | // rc6.cpp - written and placed in the public domain by Sean Woods 2 | // based on Wei Dai's RC5 code. 3 | 4 | #include "pch.h" 5 | #include "rc6.h" 6 | #include "misc.h" 7 | #include "secblock.h" 8 | 9 | NAMESPACE_BEGIN(CryptoPP) 10 | 11 | void RC6::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms) 12 | { 13 | AssertValidKeyLength(keylen); 14 | 15 | r = GetRoundsAndThrowIfInvalid(params, this); 16 | sTable.New(2*(r+2)); 17 | 18 | static const RC6_WORD MAGIC_P = 0xb7e15163L; // magic constant P for wordsize 19 | static const RC6_WORD MAGIC_Q = 0x9e3779b9L; // magic constant Q for wordsize 20 | static const int U=sizeof(RC6_WORD); 21 | 22 | const unsigned int c = STDMAX((keylen+U-1)/U, 1U); // RC6 paper says c=1 if keylen==0 23 | SecBlock l(c); 24 | 25 | GetUserKey(LITTLE_ENDIAN_ORDER, l.begin(), c, k, keylen); 26 | 27 | sTable[0] = MAGIC_P; 28 | for (unsigned j=1; j((sTable[h % sTable.size()] + a + b)); 37 | b = l[h % c] = rotlMod((l[h % c] + a + b), (a+b)); 38 | } 39 | } 40 | 41 | typedef BlockGetAndPut Block; 42 | 43 | void RC6::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const 44 | { 45 | const RC6_WORD *sptr = sTable; 46 | RC6_WORD a, b, c, d, t, u; 47 | 48 | Block::Get(inBlock)(a)(b)(c)(d); 49 | b += sptr[0]; 50 | d += sptr[1]; 51 | sptr += 2; 52 | 53 | for(unsigned i=0; i(b*(2*b+1)); 56 | u = rotlConstant<5>(d*(2*d+1)); 57 | a = rotlMod(a^t,u) + sptr[0]; 58 | c = rotlMod(c^u,t) + sptr[1]; 59 | t = a; a = b; b = c; c = d; d = t; 60 | sptr += 2; 61 | } 62 | 63 | a += sptr[0]; 64 | c += sptr[1]; 65 | 66 | Block::Put(xorBlock, outBlock)(a)(b)(c)(d); 67 | } 68 | 69 | void RC6::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const 70 | { 71 | const RC6_WORD *sptr = sTable.end(); 72 | RC6_WORD a, b, c, d, t, u; 73 | 74 | Block::Get(inBlock)(a)(b)(c)(d); 75 | 76 | sptr -= 2; 77 | c -= sptr[1]; 78 | a -= sptr[0]; 79 | 80 | for (unsigned i=0; i < r; i++) 81 | { 82 | sptr -= 2; 83 | t = a; a = d; d = c; c = b; b = t; 84 | u = rotlConstant<5>(d*(2 * d + 1)); 85 | t = rotlConstant<5>(b*(2 * b + 1)); 86 | c = rotrMod(c-sptr[1], t) ^ u; 87 | a = rotrMod(a-sptr[0], u) ^ t; 88 | } 89 | 90 | d -= sTable[1]; 91 | b -= sTable[0]; 92 | 93 | Block::Put(xorBlock, outBlock)(a)(b)(c)(d); 94 | } 95 | 96 | NAMESPACE_END 97 | -------------------------------------------------------------------------------- /ProjectHex/crypto/rc6.h: -------------------------------------------------------------------------------- 1 | // rc6.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file rc6.h 4 | /// \brief Classes for the RC6 block cipher 5 | /// \since Crypto++ 3.0 6 | 7 | #ifndef CRYPTOPP_RC6_H 8 | #define CRYPTOPP_RC6_H 9 | 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief RC6 block cipher information 16 | /// \since Crypto++ 3.0 17 | struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, public VariableRounds<20> 18 | { 19 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC6";} 20 | typedef word32 RC6_WORD; 21 | }; 22 | 23 | /// \brief RC6 block cipher 24 | /// \sa RC6 25 | /// \since Crypto++ 3.0 26 | class RC6 : public RC6_Info, public BlockCipherDocumentation 27 | { 28 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 29 | { 30 | public: 31 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 32 | 33 | protected: 34 | unsigned int r; // number of rounds 35 | SecBlock sTable; // expanded key table 36 | }; 37 | 38 | class CRYPTOPP_NO_VTABLE Enc : public Base 39 | { 40 | public: 41 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 42 | }; 43 | 44 | class CRYPTOPP_NO_VTABLE Dec : public Base 45 | { 46 | public: 47 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 48 | }; 49 | 50 | public: 51 | typedef BlockCipherFinal Encryption; 52 | typedef BlockCipherFinal Decryption; 53 | }; 54 | 55 | typedef RC6::Encryption RC6Encryption; 56 | typedef RC6::Decryption RC6Decryption; 57 | 58 | NAMESPACE_END 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ProjectHex/crypto/rdrand-nasm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | IS_LINUX=$(uname -s | grep -i -c linux) 4 | IS_SOLARIS=$(uname -s | grep -i -c sunos) 5 | IS_DARWIN=$(uname -s | grep -i -c darwin) 6 | IS_CYGWIN=$(uname -s | grep -i -c cygwin) 7 | IS_OPENBSD=$(uname -s | grep -i -c openbsd) 8 | IS_DRAGONFLY=$(uname -s | grep -i -c dragonfly) 9 | IS_FREEBSD=$(uname -s | grep -i -c freebsd) 10 | IS_NETBSD=$(uname -s | grep -i -c netbsd) 11 | 12 | rm -f rdrand-x86.o rdrand-x32.o rdrand-x64.o &>/dev/null 13 | SUCCESS=0 14 | 15 | NASM=$(which nasm 2>&1) 16 | if [ ! -f "$NASM" ]; then 17 | echo "Unable to locate Nasm" 18 | [ "$0" = "$BASH_SOURCE" ] && exit 1 || return 1 19 | fi 20 | 21 | if [ "$IS_LINUX" -eq "1" ]; then 22 | echo "Building rdrand and rdseed modules for Linux" 23 | nasm -f elf32 rdrand.s -DX86 -g -o rdrand-x86.o 24 | nasm -f elfx32 rdrand.s -DX32 -g -o rdrand-x32.o 25 | nasm -f elf64 rdrand.s -DX64 -g -o rdrand-x64.o 26 | SUCCESS=1 27 | fi 28 | 29 | if [ "$IS_OPENBSD" -eq "1" ] || [ "$IS_NETBSD" -eq "1" ] || [ "$IS_FREEBSD" -eq "1" ] || [ "$IS_DRAGONFLY" -eq "1" ]; then 30 | echo "Building rdrand and rdseed modules for BSD" 31 | nasm -f elf32 rdrand.s -DX86 -g -o rdrand-x86.o 32 | nasm -f elfx32 rdrand.s -DX32 -g -o rdrand-x32.o 33 | nasm -f elf64 rdrand.s -DX64 -g -o rdrand-x64.o 34 | SUCCESS=1 35 | fi 36 | 37 | if [ "$IS_SOLARIS" -eq "1" ]; then 38 | echo "Building rdrand and rdseed modules for Solaris" 39 | nasm -f elf32 rdrand.s -DX86 -o rdrand-x86.o 40 | nasm -f elfx32 rdrand.s -DX32 -o rdrand-x32.o 41 | nasm -f elf64 rdrand.s -DX64 -o rdrand-x64.o 42 | SUCCESS=1 43 | fi 44 | 45 | if [ "$IS_DARWIN" -eq "1" ]; then 46 | echo "Building rdrand and rdseed modules for Darwin" 47 | nasm -f macho32 rdrand.s -DDARWIN -DX86 -g -o rdrand-x86.o 48 | nasm -f macho64 rdrand.s -DDARWIN -DX64 -g -o rdrand-x64.o 49 | SUCCESS=1 50 | fi 51 | 52 | if [ "$IS_CYGWIN" -eq "1" ]; then 53 | echo "Building rdrand and rdseed modules for Cygwin" 54 | nasm -f win32 rdrand.s -DCYGWIN -DX86 -g -o rdrand-x86.o 55 | nasm -f win64 rdrand.s -DCYGWIN -DX64 -g -o rdrand-x64.o 56 | SUCCESS=1 57 | fi 58 | 59 | if [ "$SUCCESS" -eq "0" ]; then 60 | echo "Failed to build rdrand and rdseed modules" 61 | [ "$0" = "$BASH_SOURCE" ] && exit 1 || return 1 62 | fi 63 | 64 | [ "$0" = "$BASH_SOURCE" ] && exit 0 || return 0 65 | -------------------------------------------------------------------------------- /ProjectHex/crypto/regtest4.cpp: -------------------------------------------------------------------------------- 1 | // regtest4.cpp - originally written and placed in the public domain by Wei Dai 2 | // regtest.cpp split into 3 files due to OOM kills by JW 3 | // in April 2017. A second split occured in July 2018. 4 | 5 | #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 6 | 7 | #include "cryptlib.h" 8 | #include "factory.h" 9 | #include "bench.h" 10 | #include "cpu.h" 11 | 12 | #include "dh.h" 13 | #include "nr.h" 14 | #include "rw.h" 15 | #include "rsa.h" 16 | #include "dsa.h" 17 | #include "pssr.h" 18 | #include "esign.h" 19 | 20 | // Hashes 21 | #include "md2.h" 22 | #include "md5.h" 23 | #include "sha.h" 24 | 25 | // Aggressive stack checking with VS2005 SP1 and above. 26 | #if (_MSC_FULL_VER >= 140050727) 27 | # pragma strict_gs_check (on) 28 | #endif 29 | 30 | #if CRYPTOPP_MSC_VERSION 31 | # pragma warning(disable: 4505 4355) 32 | #endif 33 | 34 | USING_NAMESPACE(CryptoPP) 35 | 36 | void RegisterFactories5() 37 | { 38 | RegisterDefaultFactoryFor(); 39 | RegisterAsymmetricCipherDefaultFactories > >("RSA/OAEP-MGF1(SHA-1)"); 40 | RegisterAsymmetricCipherDefaultFactories >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)"); 41 | RegisterSignatureSchemeDefaultFactories(); 42 | RegisterSignatureSchemeDefaultFactories >(); 43 | RegisterSignatureSchemeDefaultFactories >(); 44 | RegisterSignatureSchemeDefaultFactories >(); 45 | RegisterSignatureSchemeDefaultFactories >(); 46 | RegisterSignatureSchemeDefaultFactories >(); 47 | RegisterSignatureSchemeDefaultFactories >(); 48 | RegisterSignatureSchemeDefaultFactories >(); 49 | RegisterSignatureSchemeDefaultFactories >(); 50 | RegisterSignatureSchemeDefaultFactories >(); 51 | RegisterSignatureSchemeDefaultFactories >("NR(1363)/EMSA1(SHA-1)"); 52 | RegisterSignatureSchemeDefaultFactories >("DSA-1363/EMSA1(SHA-1)"); 53 | RegisterSignatureSchemeDefaultFactories >("RSA/PKCS1-1.5(MD2)"); 54 | RegisterSignatureSchemeDefaultFactories >("RSA/PKCS1-1.5(SHA-1)"); 55 | RegisterSignatureSchemeDefaultFactories >("ESIGN/EMSA5-MGF1(SHA-1)"); 56 | RegisterSignatureSchemeDefaultFactories >("RW/EMSA2(SHA-1)"); 57 | RegisterSignatureSchemeDefaultFactories >("RSA/PSS-MGF1(SHA-1)"); 58 | } 59 | -------------------------------------------------------------------------------- /ProjectHex/crypto/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by cryptopp.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /ProjectHex/crypto/ripemd.h: -------------------------------------------------------------------------------- 1 | // ripemd.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file 4 | /// \brief Classes for RIPEMD message digest 5 | 6 | #ifndef CRYPTOPP_RIPEMD_H 7 | #define CRYPTOPP_RIPEMD_H 8 | 9 | #include "iterhash.h" 10 | 11 | NAMESPACE_BEGIN(CryptoPP) 12 | 13 | /// \brief RIPEMD-160 message digest 14 | /// \details Digest size is 160-bits. 15 | /// \sa RIPEMD-160 16 | /// \since Crypto++ 2.1 17 | class RIPEMD160 : public IteratedHashWithStaticTransform 18 | { 19 | public: 20 | static void InitState(HashWordType *state); 21 | static void Transform(word32 *digest, const word32 *data); 22 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-160";} 23 | }; 24 | 25 | /// \brief RIPEMD-320 message digest 26 | /// \details Digest size is 320-bits. 27 | /// \sa RIPEMD-320 28 | /// \since Crypto++ 2.1 29 | class RIPEMD320 : public IteratedHashWithStaticTransform 30 | { 31 | public: 32 | static void InitState(HashWordType *state); 33 | static void Transform(word32 *digest, const word32 *data); 34 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-320";} 35 | }; 36 | 37 | /// \brief RIPEMD-128 message digest 38 | /// \details Digest size is 128-bits. 39 | /// \warning RIPEMD-128 is considered insecure, and should not be used unless you absolutely need it for compatibility. 40 | /// \sa RIPEMD-128 41 | /// \since Crypto++ 2.1 42 | class RIPEMD128 : public IteratedHashWithStaticTransform 43 | { 44 | public: 45 | static void InitState(HashWordType *state); 46 | static void Transform(word32 *digest, const word32 *data); 47 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-128";} 48 | }; 49 | 50 | /// \brief RIPEMD-256 message digest 51 | /// \details Digest size is 256-bits. 52 | /// \warning RIPEMD-256 is considered insecure, and should not be used unless you absolutely need it for compatibility. 53 | /// \sa RIPEMD-256 54 | /// \since Crypto++ 2.1 55 | class RIPEMD256 : public IteratedHashWithStaticTransform 56 | { 57 | public: 58 | static void InitState(HashWordType *state); 59 | static void Transform(word32 *digest, const word32 *data); 60 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-256";} 61 | }; 62 | 63 | NAMESPACE_END 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /ProjectHex/crypto/seal.h: -------------------------------------------------------------------------------- 1 | // seal.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file seal.h 4 | /// \brief Classes for SEAL stream cipher 5 | /// \since Crypto++ 2.2 6 | 7 | #ifndef CRYPTOPP_SEAL_H 8 | #define CRYPTOPP_SEAL_H 9 | 10 | #include "strciphr.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief SEAL stream cipher information 16 | /// \tparam B Endianness of the stream cipher 17 | /// \since Crypto++ 2.2 18 | template 19 | struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4> 20 | { 21 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";} 22 | }; 23 | 24 | /// \brief SEAL stream cipher operation 25 | /// \tparam B Endianness of the stream cipher 26 | /// \since Crypto++ 2.2 27 | template 28 | class CRYPTOPP_NO_VTABLE SEAL_Policy : public AdditiveCipherConcretePolicy, public SEAL_Info 29 | { 30 | protected: 31 | void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); 32 | void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); 33 | void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); 34 | bool CipherIsRandomAccess() const {return true;} 35 | void SeekToIteration(lword iterationCount); 36 | 37 | private: 38 | FixedSizeSecBlock m_T; 39 | FixedSizeSecBlock m_S; 40 | SecBlock m_R; 41 | 42 | word32 m_startCount, m_iterationsPerCount; 43 | word32 m_outsideCounter, m_insideCounter; 44 | }; 45 | 46 | /// \brief SEAL stream cipher 47 | /// \tparam B Endianness of the stream cipher 48 | /// \sa SEAL 49 | /// \since Crypto++ 2.2 50 | template 51 | struct SEAL : public SEAL_Info, public SymmetricCipherDocumentation 52 | { 53 | typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, SEAL_Info > Encryption; 54 | typedef Encryption Decryption; 55 | }; 56 | 57 | NAMESPACE_END 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /ProjectHex/crypto/seed.h: -------------------------------------------------------------------------------- 1 | // seed.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file seed.h 4 | /// \brief Classes for the SEED block cipher 5 | /// \since Crypto++ 5.6.0 6 | 7 | #ifndef CRYPTOPP_SEED_H 8 | #define CRYPTOPP_SEED_H 9 | 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief SEED block cipher information 16 | /// \since Crypto++ 5.6.0 17 | struct SEED_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, public FixedRounds<16> 18 | { 19 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SEED";} 20 | }; 21 | 22 | /// \brief SEED block cipher 23 | /// \sa SEED 24 | /// \since Crypto++ 5.6.0 25 | class SEED : public SEED_Info, public BlockCipherDocumentation 26 | { 27 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 28 | { 29 | public: 30 | void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); 31 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 32 | 33 | protected: 34 | FixedSizeSecBlock m_k; 35 | }; 36 | 37 | public: 38 | typedef BlockCipherFinal Encryption; 39 | typedef BlockCipherFinal Decryption; 40 | }; 41 | 42 | NAMESPACE_END 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ProjectHex/crypto/serpent.h: -------------------------------------------------------------------------------- 1 | // serpent.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file serpent.h 4 | /// \brief Classes for the Serpent block cipher 5 | 6 | #ifndef CRYPTOPP_SERPENT_H 7 | #define CRYPTOPP_SERPENT_H 8 | 9 | #include "seckey.h" 10 | #include "secblock.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief Serpent block cipher information 15 | /// \since Crypto++ 3.1 16 | struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, public FixedRounds<32> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Serpent";} 19 | }; 20 | 21 | /// \brief Serpent block cipher 22 | /// \sa Serpent 23 | /// \since Crypto++ 3.1 24 | class Serpent : public Serpent_Info, public BlockCipherDocumentation 25 | { 26 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 27 | { 28 | public: 29 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 30 | 31 | protected: 32 | FixedSizeSecBlock m_key; 33 | }; 34 | 35 | class CRYPTOPP_NO_VTABLE Enc : public Base 36 | { 37 | public: 38 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 39 | }; 40 | 41 | class CRYPTOPP_NO_VTABLE Dec : public Base 42 | { 43 | public: 44 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 45 | }; 46 | 47 | public: 48 | typedef BlockCipherFinal Encryption; 49 | typedef BlockCipherFinal Decryption; 50 | }; 51 | 52 | typedef Serpent::Encryption SerpentEncryption; 53 | typedef Serpent::Decryption SerpentDecryption; 54 | 55 | NAMESPACE_END 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /ProjectHex/crypto/sha3.cpp: -------------------------------------------------------------------------------- 1 | // sha3.cpp - modified by Wei Dai from Ronny Van Keer's public domain 2 | // Keccak-simple.c. All modifications here are placed in the 3 | // public domain by Wei Dai. 4 | // Keccack core function moved to keccakc.cpp in AUG 2018 5 | // by Jeffrey Walton. Separating the core file allows both 6 | // SHA3 and Keccack to share the core implementation. 7 | 8 | /* 9 | The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, 10 | Michael Peeters and Gilles Van Assche. For more information, feedback or 11 | questions, please refer to our website: http://keccak.noekeon.org/ 12 | 13 | Implementation by Ronny Van Keer, hereby denoted as "the implementer". 14 | 15 | To the extent possible under law, the implementer has waived all copyright 16 | and related or neighboring rights to the source code in this file. 17 | http://creativecommons.org/publicdomain/zero/1.0/ 18 | */ 19 | 20 | #include "pch.h" 21 | #include "sha3.h" 22 | 23 | NAMESPACE_BEGIN(CryptoPP) 24 | 25 | // The Keccak core function 26 | extern void KeccakF1600(word64 *state); 27 | 28 | NAMESPACE_END 29 | 30 | NAMESPACE_BEGIN(CryptoPP) 31 | 32 | void SHA3::Update(const byte *input, size_t length) 33 | { 34 | CRYPTOPP_ASSERT(!(input == NULLPTR && length != 0)); 35 | if (length == 0) { return; } 36 | 37 | size_t spaceLeft; 38 | while (length >= (spaceLeft = r() - m_counter)) 39 | { 40 | if (spaceLeft) 41 | xorbuf(m_state.BytePtr() + m_counter, input, spaceLeft); 42 | KeccakF1600(m_state); 43 | input += spaceLeft; 44 | length -= spaceLeft; 45 | m_counter = 0; 46 | } 47 | 48 | if (length) 49 | xorbuf(m_state.BytePtr() + m_counter, input, length); 50 | m_counter += (unsigned int)length; 51 | } 52 | 53 | void SHA3::Restart() 54 | { 55 | memset(m_state, 0, m_state.SizeInBytes()); 56 | m_counter = 0; 57 | } 58 | 59 | void SHA3::TruncatedFinal(byte *hash, size_t size) 60 | { 61 | CRYPTOPP_ASSERT(hash != NULLPTR); 62 | ThrowIfInvalidTruncatedSize(size); 63 | 64 | m_state.BytePtr()[m_counter] ^= 0x06; 65 | m_state.BytePtr()[r()-1] ^= 0x80; 66 | KeccakF1600(m_state); 67 | std::memcpy(hash, m_state, size); 68 | Restart(); 69 | } 70 | 71 | NAMESPACE_END 72 | -------------------------------------------------------------------------------- /ProjectHex/crypto/shacal2.h: -------------------------------------------------------------------------------- 1 | // shacal.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file shacal2.h 4 | /// \brief Classes for the SHACAL-2 block cipher 5 | /// \since Crypto++ 5.2, Intel SHA since Crypto++ 6.0 6 | 7 | #ifndef CRYPTOPP_SHACAL2_H 8 | #define CRYPTOPP_SHACAL2_H 9 | 10 | #include "seckey.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief SHACAL2 block cipher information 16 | struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHACAL-2";} 19 | }; 20 | 21 | /// \brief SHACAL2 block cipher 22 | /// \since Crypto++ 5.2, Intel SHA since Crypto++ 6.0 23 | /// \sa SHACAL-2 24 | class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation 25 | { 26 | /// \brief SHACAL2 block cipher transformation functions 27 | /// \details Provides implementation common to encryption and decryption 28 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 29 | { 30 | public: 31 | std::string AlgorithmProvider() const; 32 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 33 | 34 | protected: 35 | FixedSizeAlignedSecBlock m_key; 36 | 37 | static const word32 K[64]; 38 | }; 39 | 40 | /// \brief SHACAL2 block cipher transformation functions 41 | /// \details Encryption transformation 42 | class CRYPTOPP_NO_VTABLE Enc : public Base 43 | { 44 | public: 45 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 46 | }; 47 | 48 | /// \brief SHACAL2 block cipher transformation functions 49 | /// \details Decryption transformation 50 | class CRYPTOPP_NO_VTABLE Dec : public Base 51 | { 52 | public: 53 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 54 | }; 55 | 56 | public: 57 | typedef BlockCipherFinal Encryption; 58 | typedef BlockCipherFinal Decryption; 59 | }; 60 | 61 | typedef SHACAL2::Encryption SHACAL2Encryption; 62 | typedef SHACAL2::Decryption SHACAL2Decryption; 63 | 64 | NAMESPACE_END 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /ProjectHex/crypto/shake.cpp: -------------------------------------------------------------------------------- 1 | // shake.cpp - modified by Wei Dai from Ronny Van Keer's public domain 2 | // sha3-simple.c. All modifications here are placed in the 3 | // public domain by Wei Dai. 4 | // Keccack core function moved to keccakc.cpp in AUG 2018 5 | // by Jeffrey Walton. Separating the core file allows both 6 | // SHA3 and Keccack to share the core implementation. 7 | 8 | /* 9 | The SHAKE sponge function, designed by Guido Bertoni, Joan Daemen, 10 | Michael Peeters and Gilles Van Assche. For more information, feedback or 11 | questions, please refer to our website: http://keccak.noekeon.org/ 12 | 13 | Implementation by Ronny Van Keer, hereby denoted as "the implementer". 14 | 15 | To the extent possible under law, the implementer has waived all copyright 16 | and related or neighboring rights to the source code in this file. 17 | http://creativecommons.org/publicdomain/zero/1.0/ 18 | */ 19 | 20 | #include "pch.h" 21 | #include "shake.h" 22 | 23 | NAMESPACE_BEGIN(CryptoPP) 24 | 25 | // The Keccak core function 26 | extern void KeccakF1600(word64 *state); 27 | 28 | void SHAKE::Update(const byte *input, size_t length) 29 | { 30 | CRYPTOPP_ASSERT(!(input == NULLPTR && length != 0)); 31 | if (length == 0) { return; } 32 | 33 | size_t spaceLeft; 34 | while (length >= (spaceLeft = r() - m_counter)) 35 | { 36 | if (spaceLeft) 37 | xorbuf(m_state.BytePtr() + m_counter, input, spaceLeft); 38 | KeccakF1600(m_state); 39 | input += spaceLeft; 40 | length -= spaceLeft; 41 | m_counter = 0; 42 | } 43 | 44 | if (length) 45 | xorbuf(m_state.BytePtr() + m_counter, input, length); 46 | m_counter += (unsigned int)length; 47 | } 48 | 49 | void SHAKE::Restart() 50 | { 51 | memset(m_state, 0, m_state.SizeInBytes()); 52 | m_counter = 0; 53 | } 54 | 55 | void SHAKE::ThrowIfInvalidTruncatedSize(size_t size) const 56 | { 57 | if (size > UINT_MAX) 58 | throw InvalidArgument(std::string("HashTransformation: can't truncate a ") + 59 | IntToString(UINT_MAX) + " byte digest to " + IntToString(size) + " bytes"); 60 | } 61 | 62 | void SHAKE::TruncatedFinal(byte *hash, size_t size) 63 | { 64 | CRYPTOPP_ASSERT(hash != NULLPTR); 65 | ThrowIfInvalidTruncatedSize(size); 66 | 67 | m_state.BytePtr()[m_counter] ^= 0x1F; 68 | m_state.BytePtr()[r()-1] ^= 0x80; 69 | 70 | // FIPS 202, Algorithm 8, pp 18-19. 71 | while (size > 0) 72 | { 73 | KeccakF1600(m_state); 74 | 75 | const size_t segmentLen = STDMIN(size, (size_t)BlockSize()); 76 | std::memcpy(hash, m_state, segmentLen); 77 | 78 | hash += segmentLen; 79 | size -= segmentLen; 80 | } 81 | 82 | Restart(); 83 | } 84 | 85 | NAMESPACE_END 86 | -------------------------------------------------------------------------------- /ProjectHex/crypto/shark.h: -------------------------------------------------------------------------------- 1 | // shark.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file shark.h 4 | /// \brief Classes for the SHARK block cipher 5 | /// \since Crypto++ 2.1 6 | 7 | #ifndef CRYPTOPP_SHARK_H 8 | #define CRYPTOPP_SHARK_H 9 | 10 | #include "config.h" 11 | #include "seckey.h" 12 | #include "secblock.h" 13 | 14 | NAMESPACE_BEGIN(CryptoPP) 15 | 16 | /// \brief SHARK block cipher information 17 | /// \since Crypto++ 2.1 18 | struct SHARK_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<6, 2> 19 | { 20 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHARK-E";} 21 | }; 22 | 23 | /// \brief SHARK block cipher 24 | /// SHARK-E 25 | /// \since Crypto++ 2.1 26 | class SHARK : public SHARK_Info, public BlockCipherDocumentation 27 | { 28 | /// \brief SHARK block cipher default operation 29 | /// \since Crypto++ 2.1 30 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 31 | { 32 | public: 33 | void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶m); 34 | 35 | protected: 36 | unsigned int m_rounds; 37 | SecBlock m_roundKeys; 38 | }; 39 | 40 | /// \brief SHARK block cipher encryption operation 41 | /// \since Crypto++ 2.1 42 | class CRYPTOPP_NO_VTABLE Enc : public Base 43 | { 44 | public: 45 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 46 | 47 | // used by Base to do key setup 48 | void InitForKeySetup(); 49 | 50 | private: 51 | static const byte sbox[256]; 52 | static const word64 cbox[8][256]; 53 | }; 54 | 55 | /// \brief SHARK block cipher decryption operation 56 | /// \since Crypto++ 2.1 57 | class CRYPTOPP_NO_VTABLE Dec : public Base 58 | { 59 | public: 60 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 61 | 62 | private: 63 | static const byte sbox[256]; 64 | static const word64 cbox[8][256]; 65 | }; 66 | 67 | public: 68 | typedef BlockCipherFinal Encryption; 69 | typedef BlockCipherFinal Decryption; 70 | }; 71 | 72 | typedef SHARK::Encryption SHARKEncryption; 73 | typedef SHARK::Decryption SHARKDecryption; 74 | 75 | NAMESPACE_END 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /ProjectHex/crypto/simple.cpp: -------------------------------------------------------------------------------- 1 | // simple.cpp - originally written and placed in the public domain by Wei Dai 2 | 3 | #include "pch.h" 4 | 5 | #ifndef CRYPTOPP_IMPORTS 6 | 7 | #include "simple.h" 8 | 9 | NAMESPACE_BEGIN(CryptoPP) 10 | 11 | NAMESPACE_END 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /ProjectHex/crypto/sm3.h: -------------------------------------------------------------------------------- 1 | // sm3.h - written and placed in the public domain by Jeffrey Walton and Han Lulu 2 | // Based on the specification provided by Sean Shen and Xiaodong Lee. 3 | // Based on code by Krzysztof Kwiatkowski and Jack Lloyd. 4 | // Also see https://tools.ietf.org/html/draft-shen-sm3-hash. 5 | 6 | /// \file sm3.h 7 | /// \brief Classes for the SM3 hash function 8 | /// \details SM3 is a hash function designed by Xiaoyun Wang, et al. The hash is part of the 9 | /// Chinese State Cryptography Administration portfolio. 10 | /// \sa SM3 Hash Function and 11 | /// Reference implementation using OpenSSL. 12 | /// \since Crypto++ 6.0 13 | 14 | #ifndef CRYPTOPP_SM3_H 15 | #define CRYPTOPP_SM3_H 16 | 17 | #include "config.h" 18 | #include "iterhash.h" 19 | 20 | NAMESPACE_BEGIN(CryptoPP) 21 | 22 | /// \brief SM3 hash function 23 | /// \details SM3 is a hash function designed by Xiaoyun Wang, et al. The hash is part of the 24 | /// Chinese State Cryptography Administration portfolio. 25 | /// \sa SM3 Hash Function 26 | /// \since Crypto++ 6.0 27 | class SM3 : public IteratedHashWithStaticTransform 28 | { 29 | public: 30 | /// \brief Initialize state array 31 | /// \param state the state of the hash 32 | /// \details InitState sets a state array to SHA256 initial values 33 | /// \details Hashes which derive from IteratedHashWithStaticTransform provide static 34 | /// member functions InitState() and Transform(). External classes, like SEAL and MDC, 35 | /// can initialize state with a user provided key and operate the hash on the data 36 | /// with the user supplied state. 37 | static void InitState(HashWordType *state); 38 | 39 | /// \brief Operate the hash 40 | /// \param digest the state of the hash 41 | /// \param data the data to be digested 42 | /// \details Transform() operates the hash on data. When the call is invoked 43 | /// digest holds initial or current state. Upon return digest holds 44 | /// the hash or updated state. 45 | /// \details Hashes which derive from IteratedHashWithStaticTransform provide static 46 | /// member functions InitState() and Transform(). External classes, like SEAL and MDC, 47 | /// can initialize state with a user provided key and operate the hash on the data 48 | /// with the user supplied state. 49 | static void Transform(HashWordType *digest, const HashWordType *data); 50 | 51 | /// \brief The algorithm name 52 | /// \returns C-style string "SM3" 53 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() { return "SM3"; } 54 | 55 | protected: 56 | size_t HashMultipleBlocks(const HashWordType *input, size_t length); 57 | }; 58 | 59 | NAMESPACE_END 60 | 61 | #endif // CRYPTOPP_SM3_H 62 | -------------------------------------------------------------------------------- /ProjectHex/crypto/sosemanuk.h: -------------------------------------------------------------------------------- 1 | // sosemanuk.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file sosemanuk.h 4 | /// \brief Classes for Sosemanuk stream cipher 5 | /// \since Crypto++ 5.5 6 | 7 | #ifndef CRYPTOPP_SOSEMANUK_H 8 | #define CRYPTOPP_SOSEMANUK_H 9 | 10 | #include "strciphr.h" 11 | #include "secblock.h" 12 | 13 | // Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler 14 | // error with .intel_syntax, http://llvm.org/bugs/show_bug.cgi?id=24232 15 | #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM) 16 | # define CRYPTOPP_DISABLE_SOSEMANUK_ASM 1 17 | #endif 18 | 19 | NAMESPACE_BEGIN(CryptoPP) 20 | 21 | /// \brief Sosemanuk stream cipher information 22 | /// \since Crypto++ 5.5 23 | struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16> 24 | { 25 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Sosemanuk";} 26 | }; 27 | 28 | /// \brief Sosemanuk stream cipher implementation 29 | /// \since Crypto++ 5.5 30 | class SosemanukPolicy : public AdditiveCipherConcretePolicy, public SosemanukInfo 31 | { 32 | protected: 33 | std::string AlgorithmProvider() const; 34 | void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); 35 | void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); 36 | void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); 37 | bool CipherIsRandomAccess() const {return false;} 38 | #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 39 | unsigned int GetAlignment() const; 40 | unsigned int GetOptimalBlockSize() const; 41 | #endif 42 | 43 | FixedSizeSecBlock m_key; 44 | FixedSizeAlignedSecBlock m_state; 45 | }; 46 | 47 | /// \brief Sosemanuk stream cipher 48 | /// \details is a stream cipher developed by Come Berbain, Olivier Billet, Anne Canteaut, Nicolas Courtois, 49 | /// Henri Gilbert, Louis Goubin, Aline Gouget, Louis Granboulan, Cédric Lauradoux, Marine Minier, Thomas 50 | /// Pornin and Hervé Sibert. Sosemanuk is one of the final four Profile 1 (software) ciphers selected for 51 | /// the eSTREAM Portfolio. 52 | /// \sa Sosemanuk 53 | /// \since Crypto++ 5.5 54 | struct Sosemanuk : public SosemanukInfo, public SymmetricCipherDocumentation 55 | { 56 | typedef SymmetricCipherFinal >, SosemanukInfo> Encryption; 57 | typedef Encryption Decryption; 58 | }; 59 | 60 | NAMESPACE_END 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /ProjectHex/crypto/square.h: -------------------------------------------------------------------------------- 1 | // square.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file square.h 4 | /// \brief Classes for the Square block cipher 5 | 6 | #ifndef CRYPTOPP_SQUARE_H 7 | #define CRYPTOPP_SQUARE_H 8 | 9 | #include "seckey.h" 10 | #include "secblock.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief Square block cipher information 15 | /// \since Crypto++ 2.2 16 | struct Square_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, FixedRounds<8> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Square";} 19 | }; 20 | 21 | /// \brief Square block cipher 22 | /// \sa Square 23 | /// \since Crypto++ 2.2 24 | class Square : public Square_Info, public BlockCipherDocumentation 25 | { 26 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 27 | { 28 | public: 29 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 30 | 31 | protected: 32 | FixedSizeSecBlock m_roundkeys; 33 | }; 34 | 35 | class CRYPTOPP_NO_VTABLE Enc : public Base 36 | { 37 | public: 38 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 39 | private: 40 | static const byte Se[256]; 41 | static const word32 Te[4][256]; 42 | }; 43 | 44 | class CRYPTOPP_NO_VTABLE Dec : public Base 45 | { 46 | public: 47 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 48 | private: 49 | static const byte Sd[256]; 50 | static const word32 Td[4][256]; 51 | }; 52 | 53 | public: 54 | typedef BlockCipherFinal Encryption; 55 | typedef BlockCipherFinal Decryption; 56 | }; 57 | 58 | typedef Square::Encryption SquareEncryption; 59 | typedef Square::Decryption SquareDecryption; 60 | 61 | NAMESPACE_END 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /ProjectHex/crypto/stdcpp.h: -------------------------------------------------------------------------------- 1 | // stdcpp.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file stdcpp.h 4 | /// \brief Common C++ header files 5 | 6 | #ifndef CRYPTOPP_STDCPP_H 7 | #define CRYPTOPP_STDCPP_H 8 | 9 | #if _MSC_VER >= 1500 10 | #define _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY 11 | #include 12 | #endif 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | // http://connect.microsoft.com/VisualStudio/feedback/details/1600701/type-info-does-not-compile-with-has-exceptions-0 29 | #if defined(_MSC_VER) && (_MSC_VER < 1900) && defined(_HAS_EXCEPTIONS) && (_HAS_EXCEPTIONS == 0) 30 | namespace std { 31 | using ::type_info; 32 | } 33 | #endif 34 | 35 | // workaround needed for IBM XLC and debug heaps on AIX 36 | #if defined(_AIX) && (defined(__xlc__) || defined(__xlC__) || defined(__ibmxl__)) 37 | # if defined(__DEBUG_ALLOC__) 38 | namespace std { 39 | using ::_debug_memset; 40 | using ::_debug_memcpy; 41 | } 42 | # endif 43 | #endif 44 | 45 | // make_unchecked_array_iterator 46 | #if _MSC_VER >= 1600 47 | #include 48 | #endif 49 | 50 | #if defined(CRYPTOPP_CXX11_ATOMICS) 51 | #include 52 | #endif 53 | 54 | #if defined(CRYPTOPP_CXX11_SYNCHRONIZATION) 55 | #include 56 | #endif 57 | 58 | #if defined(CRYPTOPP_CXX11_RVALUES) 59 | # include 60 | #endif 61 | 62 | #include 63 | #include 64 | #include 65 | #include 66 | 67 | // It is 2019 and VS2017/Win10 still can't compile a 68 | // program that includes without making users 69 | // do something special. "Epic fail" comes to mind. 70 | // Also see https://github.com/weidai11/cryptopp/issues/781 71 | #ifndef _MSC_VER 72 | # include 73 | #endif 74 | 75 | // uintptr_t and ptrdiff_t 76 | #if defined(__SUNPRO_CC) 77 | # if (__SUNPRO_CC >= 0x5100) 78 | # include 79 | # endif 80 | #elif defined(_MSC_VER) 81 | # if (_MSC_VER >= 1700) 82 | # include 83 | # else 84 | # include 85 | # endif 86 | #elif (__cplusplus < 201103L) 87 | # include 88 | #endif 89 | 90 | // workaround needed on Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 91 | #ifdef CRYPTOPP_INCLUDE_VECTOR_CC 92 | # include 93 | #endif 94 | 95 | // C++Builder's standard library (Dinkumware) do not have C's global log() function 96 | // https://github.com/weidai11/cryptopp/issues/520 97 | #ifdef __BORLANDC__ 98 | using std::log; 99 | #endif 100 | 101 | #endif // CRYPTOPP_STDCPP_H 102 | -------------------------------------------------------------------------------- /ProjectHex/crypto/tiger.h: -------------------------------------------------------------------------------- 1 | // tiger.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file tiger.h 4 | /// \brief Classes for the Tiger message digest 5 | /// \since Crypto++ 2.1 6 | 7 | #ifndef CRYPTOPP_TIGER_H 8 | #define CRYPTOPP_TIGER_H 9 | 10 | #include "config.h" 11 | #include "iterhash.h" 12 | 13 | // Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler 14 | // error with .intel_syntax, http://llvm.org/bugs/show_bug.cgi?id=24232 15 | #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM) 16 | # define CRYPTOPP_DISABLE_TIGER_ASM 1 17 | #endif 18 | 19 | NAMESPACE_BEGIN(CryptoPP) 20 | 21 | /// \brief Tiger message digest 22 | /// \sa Tiger 23 | /// \since Crypto++ 2.1 24 | class Tiger : public IteratedHashWithStaticTransform 25 | { 26 | public: 27 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Tiger";} 28 | std::string AlgorithmProvider() const; 29 | 30 | static void InitState(HashWordType *state); 31 | static void Transform(word64 *digest, const word64 *data); 32 | void TruncatedFinal(byte *hash, size_t size); 33 | 34 | protected: 35 | static const word64 table[4*256+3]; 36 | }; 37 | 38 | NAMESPACE_END 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /ProjectHex/crypto/trunhash.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_TRUNHASH_H 2 | #define CRYPTOPP_TRUNHASH_H 3 | 4 | #include "cryptlib.h" 5 | 6 | NAMESPACE_BEGIN(CryptoPP) 7 | 8 | class NullHash : public HashTransformation 9 | { 10 | public: 11 | void Update(const byte *input, size_t length) 12 | {CRYPTOPP_UNUSED(input);CRYPTOPP_UNUSED(length);} 13 | unsigned int DigestSize() const 14 | {return 0;} 15 | void TruncatedFinal(byte *digest, size_t digestSize) 16 | {CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestSize);} 17 | bool TruncatedVerify(const byte *digest, size_t digestLength) 18 | {CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestLength);return true;} 19 | }; 20 | 21 | /// construct new HashModule with smaller DigestSize() from existing one 22 | template 23 | class TruncatedHashTemplate : public HashTransformation 24 | { 25 | public: 26 | TruncatedHashTemplate(T hm, unsigned int digestSize) 27 | : m_hm(hm), m_digestSize(digestSize) {} 28 | TruncatedHashTemplate(const byte *key, size_t keyLength, unsigned int digestSize) 29 | : m_hm(key, keyLength), m_digestSize(digestSize) {} 30 | TruncatedHashTemplate(size_t digestSize) 31 | : m_digestSize(digestSize) {} 32 | 33 | void Restart() 34 | {m_hm.Restart();} 35 | void Update(const byte *input, size_t length) 36 | {m_hm.Update(input, length);} 37 | unsigned int DigestSize() const {return m_digestSize;} 38 | void TruncatedFinal(byte *digest, size_t digestSize) 39 | {m_hm.TruncatedFinal(digest, digestSize);} 40 | bool TruncatedVerify(const byte *digest, size_t digestLength) 41 | {return m_hm.TruncatedVerify(digest, digestLength);} 42 | 43 | private: 44 | T m_hm; 45 | unsigned int m_digestSize; 46 | }; 47 | 48 | typedef TruncatedHashTemplate TruncatedHashModule; 49 | 50 | NAMESPACE_END 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /ProjectHex/crypto/ttmac.h: -------------------------------------------------------------------------------- 1 | // ttmac.h - written and placed in the public domain by Kevin Springle 2 | 3 | /// \file ttmac.h 4 | /// \brief Classes for the TTMAC message authentication code 5 | 6 | #ifndef CRYPTOPP_TTMAC_H 7 | #define CRYPTOPP_TTMAC_H 8 | 9 | #include "seckey.h" 10 | #include "iterhash.h" 11 | #include "secblock.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief TTMAC message authentication code information 16 | class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash 17 | { 18 | public: 19 | static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");} 20 | CRYPTOPP_CONSTANT(DIGESTSIZE=20) 21 | 22 | unsigned int DigestSize() const {return DIGESTSIZE;}; 23 | void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); 24 | void TruncatedFinal(byte *mac, size_t size); 25 | 26 | protected: 27 | static void Transform (word32 *digest, const word32 *X, bool last); 28 | void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, false);} 29 | void Init(); 30 | word32* StateBuf() {return m_digest;} 31 | 32 | FixedSizeSecBlock m_digest; 33 | FixedSizeSecBlock m_key; 34 | }; 35 | 36 | /// \brief Two-Track-MAC message authentication code 37 | /// \tparam T HashTransformation class 38 | /// \details 160-bit MAC with 160-bit key 39 | /// \sa MessageAuthenticationCode(), Two-Track-MAC 40 | DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal, TTMAC) 41 | 42 | NAMESPACE_END 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ProjectHex/crypto/twofish.h: -------------------------------------------------------------------------------- 1 | // twofish.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file twofish.h 4 | /// \brief Classes for the Twofish block cipher 5 | 6 | #ifndef CRYPTOPP_TWOFISH_H 7 | #define CRYPTOPP_TWOFISH_H 8 | 9 | #include "seckey.h" 10 | #include "secblock.h" 11 | 12 | NAMESPACE_BEGIN(CryptoPP) 13 | 14 | /// \brief Twofish block cipher information 15 | /// \since Crypto++ 3.1 16 | struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, FixedRounds<16> 17 | { 18 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Twofish";} 19 | }; 20 | 21 | /// \brief Twofish block cipher 22 | /// \sa Twofish 23 | /// \since Crypto++ 3.1 24 | class Twofish : public Twofish_Info, public BlockCipherDocumentation 25 | { 26 | class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl 27 | { 28 | public: 29 | void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); 30 | 31 | protected: 32 | static word32 h0(word32 x, const word32 *key, unsigned int kLen); 33 | static word32 h(word32 x, const word32 *key, unsigned int kLen); 34 | 35 | static const byte q[2][256]; 36 | static const word32 mds[4][256]; 37 | 38 | FixedSizeSecBlock m_k; 39 | FixedSizeSecBlock m_s; 40 | }; 41 | 42 | class CRYPTOPP_NO_VTABLE Enc : public Base 43 | { 44 | public: 45 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 46 | }; 47 | 48 | class CRYPTOPP_NO_VTABLE Dec : public Base 49 | { 50 | public: 51 | void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 52 | }; 53 | 54 | public: 55 | typedef BlockCipherFinal Encryption; 56 | typedef BlockCipherFinal Decryption; 57 | }; 58 | 59 | typedef Twofish::Encryption TwofishEncryption; 60 | typedef Twofish::Decryption TwofishDecryption; 61 | 62 | NAMESPACE_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /ProjectHex/crypto/vs2005.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/crypto/vs2005.zip -------------------------------------------------------------------------------- /ProjectHex/crypto/wake.h: -------------------------------------------------------------------------------- 1 | // wake.h - originally written and placed in the public domain by Wei Dai 2 | 3 | /// \file wake.h 4 | /// \brief Classes for WAKE stream cipher 5 | 6 | #ifndef CRYPTOPP_WAKE_H 7 | #define CRYPTOPP_WAKE_H 8 | 9 | #include "seckey.h" 10 | #include "secblock.h" 11 | #include "strciphr.h" 12 | 13 | NAMESPACE_BEGIN(CryptoPP) 14 | 15 | /// \brief WAKE stream cipher information 16 | /// \tparam B Endianness of the stream cipher 17 | /// \since Crypto++ 1.0 18 | template 19 | struct WAKE_OFB_Info : public FixedKeyLength<32> 20 | { 21 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";} 22 | }; 23 | 24 | class CRYPTOPP_NO_VTABLE WAKE_Base 25 | { 26 | protected: 27 | word32 M(word32 x, word32 y); 28 | void GenKey(word32 k0, word32 k1, word32 k2, word32 k3); 29 | 30 | word32 t[257]; 31 | word32 r3, r4, r5, r6; 32 | }; 33 | 34 | /// \brief WAKE stream cipher operation 35 | /// \tparam B Endianness of the stream cipher 36 | /// \since Crypto++ 1.0 37 | template 38 | class CRYPTOPP_NO_VTABLE WAKE_Policy : public AdditiveCipherConcretePolicy, protected WAKE_Base 39 | { 40 | protected: 41 | void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); 42 | // OFB 43 | void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); 44 | bool CipherIsRandomAccess() const {return false;} 45 | }; 46 | 47 | /// \brief WAKE stream cipher 48 | /// \tparam B Endianness of the stream cipher 49 | /// \since Crypto++ 1.0 50 | template 51 | struct WAKE_OFB : public WAKE_OFB_Info, public SymmetricCipherDocumentation 52 | { 53 | typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, WAKE_OFB_Info > Encryption; 54 | typedef Encryption Decryption; 55 | }; 56 | 57 | NAMESPACE_END 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /ProjectHex/crypto/whrlpool.h: -------------------------------------------------------------------------------- 1 | // whrlpool.h - originally modified by Kevin Springle from Paulo Barreto and Vincent Rijmen's 2 | // public domain code, whirlpool.c. Updated to Whirlpool version 3.0, optimized 3 | // and SSE version added by WD. All modifications are placed in the public domain. 4 | 5 | #ifndef CRYPTOPP_WHIRLPOOL_H 6 | #define CRYPTOPP_WHIRLPOOL_H 7 | 8 | /// \file whrlpool.h 9 | /// \brief Classes for the Whirlpool message digest 10 | /// \details Crypto++ provides version 3.0 of the Whirlpool algorithm. 11 | /// This version of the algorithm was submitted for ISO standardization. 12 | 13 | #include "config.h" 14 | #include "iterhash.h" 15 | 16 | // Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler 17 | // error with .intel_syntax, http://llvm.org/bugs/show_bug.cgi?id=24232 18 | #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM) 19 | # define CRYPTOPP_DISABLE_WHIRLPOOL_ASM 1 20 | #endif 21 | 22 | NAMESPACE_BEGIN(CryptoPP) 23 | 24 | /// \brief Whirlpool message digest 25 | /// \details Crypto++ provides version 3.0 of the Whirlpool algorithm. 26 | /// This version of the algorithm was submitted for ISO standardization. 27 | /// \since Crypto++ 5.2 28 | /// \sa Whirlpool 29 | class Whirlpool : public IteratedHashWithStaticTransform 30 | { 31 | public: 32 | CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Whirlpool";} 33 | std::string AlgorithmProvider() const; 34 | 35 | static void InitState(HashWordType *state); 36 | static void Transform(word64 *digest, const word64 *data); 37 | void TruncatedFinal(byte *hash, size_t size); 38 | }; 39 | 40 | NAMESPACE_END 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ProjectHex/crypto/words.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_WORDS_H 2 | #define CRYPTOPP_WORDS_H 3 | 4 | #include "config.h" 5 | #include "misc.h" 6 | 7 | NAMESPACE_BEGIN(CryptoPP) 8 | 9 | inline size_t CountWords(const word *X, size_t N) 10 | { 11 | while (N && X[N-1]==0) 12 | N--; 13 | return N; 14 | } 15 | 16 | inline void SetWords(word *r, word a, size_t n) 17 | { 18 | for (size_t i=0; i> (WORD_BITS-shiftBits); 78 | } 79 | return carry; 80 | } 81 | 82 | inline word ShiftWordsRightByBits(word *r, size_t n, unsigned int shiftBits) 83 | { 84 | CRYPTOPP_ASSERT (shiftBits0; i--) 88 | { 89 | u = r[i-1]; 90 | r[i-1] = (u >> shiftBits) | carry; 91 | carry = u << (WORD_BITS-shiftBits); 92 | } 93 | return carry; 94 | } 95 | 96 | inline void ShiftWordsLeftByWords(word *r, size_t n, size_t shiftWords) 97 | { 98 | shiftWords = STDMIN(shiftWords, n); 99 | if (shiftWords) 100 | { 101 | for (size_t i=n-1; i>=shiftWords; i--) 102 | r[i] = r[i-shiftWords]; 103 | SetWords(r, 0, shiftWords); 104 | } 105 | } 106 | 107 | inline void ShiftWordsRightByWords(word *r, size_t n, size_t shiftWords) 108 | { 109 | shiftWords = STDMIN(shiftWords, n); 110 | if (shiftWords) 111 | { 112 | for (size_t i=0; i+shiftWordsPutWord16(RoundUpToMultipleOf(word16(cmf*256+flags), word16(31))); 29 | } 30 | 31 | void ZlibCompressor::ProcessUncompressedData(const byte *inString, size_t length) 32 | { 33 | m_adler32.Update(inString, length); 34 | } 35 | 36 | void ZlibCompressor::WritePoststreamTail() 37 | { 38 | FixedSizeSecBlock adler32; 39 | m_adler32.Final(adler32); 40 | AttachedTransformation()->Put(adler32, 4); 41 | } 42 | 43 | unsigned int ZlibCompressor::GetCompressionLevel() const 44 | { 45 | static const unsigned int deflateToCompressionLevel[] = {0, 1, 1, 1, 2, 2, 2, 2, 2, 3}; 46 | return deflateToCompressionLevel[GetDeflateLevel()]; 47 | } 48 | 49 | // ************************************************************* 50 | 51 | ZlibDecompressor::ZlibDecompressor(BufferedTransformation *attachment, bool repeat, int propagation) 52 | : Inflator(attachment, repeat, propagation), m_log2WindowSize(0) 53 | { 54 | } 55 | 56 | void ZlibDecompressor::ProcessPrestreamHeader() 57 | { 58 | m_adler32.Restart(); 59 | 60 | byte cmf; 61 | byte flags; 62 | 63 | if (!m_inQueue.Get(cmf) || !m_inQueue.Get(flags)) 64 | throw HeaderErr(); 65 | 66 | if ((cmf*256+flags) % 31 != 0) 67 | throw HeaderErr(); // if you hit this exception, you're probably trying to decompress invalid data 68 | 69 | if ((cmf & 0xf) != DEFLATE_METHOD) 70 | throw UnsupportedAlgorithm(); 71 | 72 | if (flags & FDICT_FLAG) 73 | throw UnsupportedPresetDictionary(); 74 | 75 | m_log2WindowSize = 8 + (cmf >> 4); 76 | } 77 | 78 | void ZlibDecompressor::ProcessDecompressedData(const byte *inString, size_t length) 79 | { 80 | AttachedTransformation()->Put(inString, length); 81 | m_adler32.Update(inString, length); 82 | } 83 | 84 | void ZlibDecompressor::ProcessPoststreamTail() 85 | { 86 | FixedSizeSecBlock adler32; 87 | if (m_inQueue.Get(adler32, 4) != 4) 88 | throw Adler32Err(); 89 | if (!m_adler32.Verify(adler32)) 90 | throw Adler32Err(); 91 | } 92 | 93 | NAMESPACE_END 94 | -------------------------------------------------------------------------------- /ProjectHex/crypto/zlib.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTOPP_ZLIB_H 2 | #define CRYPTOPP_ZLIB_H 3 | 4 | #include "cryptlib.h" 5 | #include "adler32.h" 6 | #include "zdeflate.h" 7 | #include "zinflate.h" 8 | 9 | NAMESPACE_BEGIN(CryptoPP) 10 | 11 | /// ZLIB Compressor (RFC 1950) 12 | class ZlibCompressor : public Deflator 13 | { 14 | public: 15 | ZlibCompressor(BufferedTransformation *attachment=NULLPTR, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true) 16 | : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible) {} 17 | ZlibCompressor(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULLPTR) 18 | : Deflator(parameters, attachment) {} 19 | 20 | unsigned int GetCompressionLevel() const; 21 | 22 | protected: 23 | void WritePrestreamHeader(); 24 | void ProcessUncompressedData(const byte *string, size_t length); 25 | void WritePoststreamTail(); 26 | 27 | Adler32 m_adler32; 28 | }; 29 | 30 | /// ZLIB Decompressor (RFC 1950) 31 | class ZlibDecompressor : public Inflator 32 | { 33 | public: 34 | typedef Inflator::Err Err; 35 | class HeaderErr : public Err {public: HeaderErr() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: header decoding error") {}}; 36 | class Adler32Err : public Err {public: Adler32Err() : Err(DATA_INTEGRITY_CHECK_FAILED, "ZlibDecompressor: ADLER32 check error") {}}; 37 | class UnsupportedAlgorithm : public Err {public: UnsupportedAlgorithm() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: unsupported algorithm") {}}; 38 | class UnsupportedPresetDictionary : public Err {public: UnsupportedPresetDictionary() : Err(INVALID_DATA_FORMAT, "ZlibDecompressor: unsupported preset dictionary") {}}; 39 | 40 | /// \brief Construct a ZlibDecompressor 41 | /// \param attachment a \ BufferedTransformation to attach to this object 42 | /// \param repeat decompress multiple compressed streams in series 43 | /// \param autoSignalPropagation 0 to turn off MessageEnd signal 44 | ZlibDecompressor(BufferedTransformation *attachment = NULLPTR, bool repeat = false, int autoSignalPropagation = -1); 45 | unsigned int GetLog2WindowSize() const {return m_log2WindowSize;} 46 | 47 | private: 48 | unsigned int MaxPrestreamHeaderSize() const {return 2;} 49 | void ProcessPrestreamHeader(); 50 | void ProcessDecompressedData(const byte *string, size_t length); 51 | unsigned int MaxPoststreamTailSize() const {return 4;} 52 | void ProcessPoststreamTail(); 53 | 54 | unsigned int m_log2WindowSize; 55 | Adler32 m_adler32; 56 | }; 57 | 58 | NAMESPACE_END 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ProjectHex/curl/Makefile.am: -------------------------------------------------------------------------------- 1 | #*************************************************************************** 2 | # _ _ ____ _ 3 | # Project ___| | | | _ \| | 4 | # / __| | | | |_) | | 5 | # | (__| |_| | _ <| |___ 6 | # \___|\___/|_| \_\_____| 7 | # 8 | # Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. 9 | # 10 | # This software is licensed as described in the file COPYING, which 11 | # you should have received as part of this distribution. The terms 12 | # are also available at https://curl.haxx.se/docs/copyright.html. 13 | # 14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | # copies of the Software, and permit persons to whom the Software is 16 | # furnished to do so, under the terms of the COPYING file. 17 | # 18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | # KIND, either express or implied. 20 | # 21 | ########################################################################### 22 | pkginclude_HEADERS = \ 23 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \ 24 | typecheck-gcc.h system.h urlapi.h 25 | 26 | pkgincludedir= $(includedir)/curl 27 | 28 | CHECKSRC = $(CS_$(V)) 29 | CS_0 = @echo " RUN " $@; 30 | CS_1 = 31 | CS_ = $(CS_0) 32 | 33 | checksrc: 34 | $(CHECKSRC)@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) 35 | 36 | if CURLDEBUG 37 | # for debug builds, we scan the sources on all regular make invokes 38 | all-local: checksrc 39 | endif 40 | -------------------------------------------------------------------------------- /ProjectHex/curl/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/curl/libcurl.lib -------------------------------------------------------------------------------- /ProjectHex/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_MPRINTF_H 2 | #define CURLINC_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | #include /* needed for FILE */ 27 | #include "curl.h" /* for CURL_EXTERN */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | CURL_EXTERN int curl_mprintf(const char *format, ...); 34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 37 | const char *format, ...); 38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 42 | const char *format, va_list args); 43 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* CURLINC_MPRINTF_H */ 51 | -------------------------------------------------------------------------------- /ProjectHex/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_STDCHEADERS_H 2 | #define CURLINC_STDCHEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread(void *, size_t, size_t, FILE *); 28 | size_t fwrite(const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* CURLINC_STDCHEADERS_H */ 34 | -------------------------------------------------------------------------------- /ProjectHex/hashlib/md5.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/hashlib/md5.cpp -------------------------------------------------------------------------------- /ProjectHex/hashlib/md5.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/hashlib/md5.h -------------------------------------------------------------------------------- /ProjectHex/hashlib/md5wrapper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/hashlib/md5wrapper.cpp -------------------------------------------------------------------------------- /ProjectHex/hashlib/md5wrapper.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/hashlib/md5wrapper.h -------------------------------------------------------------------------------- /ProjectHex/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][Debug##Default] 2 | Pos=141,9 3 | Size=400,400 4 | Collapsed=0 5 | 6 | [Window][Unknown] 7 | Pos=116,181 8 | Size=688,480 9 | Collapsed=0 10 | 11 | [Window][##background] 12 | Pos=0,0 13 | Size=1920,1080 14 | Collapsed=0 15 | 16 | [Window][Rust] 17 | Pos=186,310 18 | Size=590,315 19 | Collapsed=0 20 | 21 | [Window][VALORANT] 22 | Pos=607,434 23 | Size=590,315 24 | Collapsed=0 25 | 26 | -------------------------------------------------------------------------------- /ProjectHex/others/auth.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | extern bool IsValid; 5 | 6 | class program 7 | { 8 | public: 9 | static void login(std::string key, std::string userid, std::string pid); 10 | 11 | 12 | 13 | }; -------------------------------------------------------------------------------- /ProjectHex/others/hwid.cpp: -------------------------------------------------------------------------------- 1 | #include "hwid.h" 2 | #include 3 | #pragma warning (disable: 4474) 4 | #pragma warning (disable: 4172) 5 | static std::string to_bitchonly(const std::wstring& str, const std::locale& loc = std::locale{}) 6 | { 7 | std::vector buf(str.size()); 8 | std::use_facet>(loc).narrow(str.data(), str.data() + str.size(), '?', buf.data()); 9 | 10 | return std::string(buf.data(), buf.size()); 11 | } 12 | std::string hwid::get_hardware_id(const std::string id) 13 | { 14 | HANDLE h_token = nullptr; 15 | if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &h_token)) 16 | { 17 | GetLastError(); 18 | return nullptr; 19 | } 20 | DWORD dw_buffer_size = 0; 21 | if (!GetTokenInformation(h_token, TokenUser, nullptr, 0, &dw_buffer_size) && (GetLastError() != 22 | ERROR_INSUFFICIENT_BUFFER)) 23 | { 24 | GetLastError(); 25 | CloseHandle(h_token); 26 | h_token = nullptr; 27 | return nullptr; 28 | } 29 | std::vector buffer; 30 | buffer.resize(dw_buffer_size); 31 | const auto p_token_user = reinterpret_cast(&buffer[0]); 32 | if (!GetTokenInformation(h_token, TokenUser, p_token_user, dw_buffer_size, &dw_buffer_size)) 33 | { 34 | GetLastError(); 35 | 36 | CloseHandle(h_token); 37 | h_token = nullptr; 38 | 39 | return nullptr; 40 | } 41 | if (!IsValidSid(p_token_user->User.Sid)) 42 | { 43 | CloseHandle(h_token); 44 | h_token = nullptr; 45 | 46 | return nullptr; 47 | } 48 | CloseHandle(h_token); 49 | h_token = nullptr; 50 | LPSTR psz_sid = nullptr; 51 | if (!ConvertSidToStringSidA(p_token_user->User.Sid, &psz_sid)) 52 | { 53 | return nullptr; 54 | } 55 | std::string psz_sid_str(psz_sid); 56 | psz_sid_str += id; 57 | return std::string(psz_sid_str); 58 | } -------------------------------------------------------------------------------- /ProjectHex/others/hwid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | class hwid 9 | { 10 | public: 11 | 12 | 13 | static std::string get_hardware_id(const std::string id); 14 | 15 | }; -------------------------------------------------------------------------------- /ProjectHex/others/program.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | class main 9 | { 10 | public: 11 | 12 | 13 | static void program(); 14 | static void spoof(); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /ProjectHex/prediction.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct PredictCtx 4 | { 5 | Vector StartPos; 6 | Vector TargetPos; 7 | Vector TargetVel; 8 | float BulletSpeed; 9 | float BulletGravity; 10 | 11 | Vector2D AimAngles; 12 | }; 13 | 14 | Vector ExtrapolatePos(const PredictCtx& Ctx, float Time) 15 | { 16 | return Ctx.TargetPos + (Ctx.TargetVel * Time); 17 | } 18 | 19 | bool OptimalPitch(const PredictCtx& Ctx, const Vector2D& Dir2D, float* OutPitch) 20 | { 21 | float Vel = Ctx.BulletSpeed, Grav = Ctx.BulletGravity, DirX = Dir2D.x, DirY = Dir2D.y; 22 | float Root = Vel * Vel * Vel * Vel - Grav * (Grav * DirX * DirX + 2.f * DirY * Vel * Vel); 23 | if (Root >= 0.f) { *OutPitch = atanf((Vel * Vel - sqrt(Root)) / (Grav * DirX)); return true; } 24 | return false; 25 | } 26 | 27 | bool SolveTrajectory(PredictCtx& Ctx, const Vector& ExtrPos, float* TravelTime) 28 | { 29 | Vector Dir = ExtrPos - Ctx.StartPos; 30 | Vector2D Dir2D = { sqrtf(Dir.x * Dir.x + Dir.y * Dir.y), Dir.z }; 31 | 32 | float CurPitch; 33 | if (!OptimalPitch(Ctx, Dir2D, &CurPitch)) 34 | { 35 | return false; 36 | } 37 | 38 | *TravelTime = Dir2D.x / (cosf(CurPitch) * Ctx.BulletSpeed); 39 | Ctx.AimAngles.y = atan2f(Dir.y, Dir.x); 40 | Ctx.AimAngles.x = CurPitch; 41 | return true; 42 | } 43 | 44 | bool BulletPredict(PredictCtx& Ctx) 45 | { 46 | float MAX_TIME = 1.f, TIME_STEP = (1.f / 256.f); 47 | for (float CurrentTime = 0.f; CurrentTime <= MAX_TIME; CurrentTime += TIME_STEP) 48 | { 49 | float TravelTime; 50 | Vector ExtrPos = ExtrapolatePos(Ctx, CurrentTime); 51 | if (!SolveTrajectory(Ctx, ExtrPos, &TravelTime)) 52 | { 53 | return false; 54 | } 55 | 56 | if (TravelTime < CurrentTime) 57 | { 58 | Ctx.AimAngles = { -RAD2DEG(Ctx.AimAngles.x), RAD2DEG(Ctx.AimAngles.y) }; 59 | return true; 60 | } 61 | } 62 | return false; 63 | } -------------------------------------------------------------------------------- /ProjectHex/program.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | class main 9 | { 10 | public: 11 | 12 | 13 | static void program(); 14 | static void spoof(); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /ProjectHex/vars.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /ProjectHex/vector.h: -------------------------------------------------------------------------------- 1 | class Vector3 2 | { 3 | public: 4 | Vector3() : x(0.f), y(0.f), z(0.f) 5 | { 6 | 7 | } 8 | 9 | Vector3(float _x, float _y, float _z) : x(_x), y(_y), z(_z) 10 | { 11 | 12 | } 13 | ~Vector3() 14 | { 15 | 16 | } 17 | 18 | float x; 19 | float y; 20 | float z; 21 | 22 | inline float Dot(Vector3 v) 23 | { 24 | return x * v.x + y * v.y + z * v.z; 25 | } 26 | 27 | inline float Distance(Vector3 v) 28 | { 29 | return float(sqrtf(powf(v.x - x, 2.0) + powf(v.y - y, 2.0) + powf(v.z - z, 2.0))); 30 | } 31 | 32 | Vector3 operator+(Vector3 v) 33 | { 34 | return Vector3(x + v.x, y + v.y, z + v.z); 35 | } 36 | 37 | Vector3 operator-(Vector3 v) 38 | { 39 | return Vector3(x - v.x, y - v.y, z - v.z); 40 | } 41 | inline float Length() 42 | { 43 | return sqrtf((x * x) + (y * y) + (z * z)); 44 | } 45 | 46 | }; 47 | 48 | struct Vector2 49 | { 50 | public: 51 | float x; 52 | float y; 53 | inline Vector2() : x(0), y(0) {} 54 | inline Vector2(float x, float y) : x(x), y(y) {} 55 | inline float Distance(Vector2 v) 56 | { 57 | return sqrtf(((v.x - x) * (v.x - x) + (v.y - y) * (v.y - y))); 58 | } 59 | inline Vector2 operator+(const Vector2& v) const 60 | { 61 | return Vector2(x + v.x, y + v.y); 62 | } 63 | inline Vector2 operator-(const Vector2& v) const 64 | { 65 | return Vector2(x - v.x, y - v.y); 66 | } 67 | }; -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/Color.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/Color.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/Driver.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/Driver.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/Main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/Main.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\vc142.pdb 2 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\vc142.idb 3 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\protect.obj 4 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\main.obj 5 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\driver.obj 6 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\imgui_widgets.obj 7 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\imgui_impl_win32.obj 8 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\imgui_impl_dx9.obj 9 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\imgui_draw.obj 10 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\imgui_demo.obj 11 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\imgui.obj 12 | c:\users\mia\source\repos\projecthex\x64\debug\projecthex.exe 13 | c:\users\mia\source\repos\projecthex\x64\debug\projecthex.ilk 14 | c:\users\mia\source\repos\projecthex\x64\debug\projecthex.pdb 15 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.obj 16 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.tlog\cl.command.1.tlog 17 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.tlog\cl.read.1.tlog 18 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.tlog\cl.write.1.tlog 19 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.tlog\link.command.1.tlog 20 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.tlog\link.read.1.tlog 21 | c:\users\mia\source\repos\projecthex\projecthex\x64\debug\projecthex.tlog\link.write.1.tlog 22 | -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.exe.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | C:\Users\Mia\source\repos\ProjectHex\x64\Debug\ProjectHex.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.log: -------------------------------------------------------------------------------- 1 |  Main.cpp 2 | ProjectHex.vcxproj -> C:\Users\Mia\source\repos\ProjectHex\x64\Debug\ProjectHex.exe 3 | -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/ProjectHex.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29333:TargetPlatformVersion=10.0.19041.0: 2 | Debug|x64|C:\Users\Mia\source\repos\ProjectHex\| 3 | -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/ProjectHex.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/ProjectHex.vcxproj.FileListAbsolute.txt -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/Protect.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/Protect.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/imgui.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/imgui.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/imgui_demo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/imgui_demo.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/imgui_draw.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/imgui_draw.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/imgui_impl_dx9.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/imgui_impl_dx9.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/imgui_impl_win32.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/imgui_impl_win32.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/imgui_widgets.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/imgui_widgets.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/vc142.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/vc142.idb -------------------------------------------------------------------------------- /ProjectHex/x64/Debug/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Debug/vc142.pdb -------------------------------------------------------------------------------- /ProjectHex/x64/Release/Driver.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/Driver.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/Hook.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/Hook.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/Main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/Main.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | c:\users\-\downloads\projecthex\projecthex\x64\release\vc142.pdb 2 | c:\users\-\downloads\projecthex\projecthex\x64\release\protect.obj 3 | c:\users\-\downloads\projecthex\projecthex\x64\release\main.obj 4 | c:\users\-\downloads\projecthex\projecthex\x64\release\imgui_widgets.obj 5 | c:\users\-\downloads\projecthex\projecthex\x64\release\imgui_impl_win32.obj 6 | c:\users\-\downloads\projecthex\projecthex\x64\release\imgui_impl_dx9.obj 7 | c:\users\-\downloads\projecthex\projecthex\x64\release\imgui_draw.obj 8 | c:\users\-\downloads\projecthex\projecthex\x64\release\imgui_demo.obj 9 | c:\users\-\downloads\projecthex\projecthex\x64\release\imgui.obj 10 | c:\users\-\downloads\projecthex\projecthex\x64\release\driver.obj 11 | c:\users\-\downloads\projecthex\x64\release\projecthex.ipdb 12 | c:\users\-\downloads\projecthex\x64\release\projecthex.iobj 13 | 14 | c:\users\-\downloads\projecthex\projecthex\x64\release\color.obj 15 | c:\users\-\downloads\projecthex\projecthex\x64\release\font.obj 16 | c:\users\-\downloads\projecthex\projecthex\x64\release\fonts.obj 17 | c:\users\-\downloads\projecthex\projecthex\x64\release\math.obj 18 | c:\users\-\downloads\projecthex\x64\release\projecthex.pdb 19 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\cl.command.1.tlog 20 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\cl.read.1.tlog 21 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\cl.write.1.tlog 22 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\link.command.1.tlog 23 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\link.read.1.tlog 24 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\link.write.1.tlog 25 | c:\users\-\downloads\projecthex\projecthex\x64\release\projecthex.tlog\projecthex.write.1u.tlog 26 | -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.exe.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | C:\Users\Cameron\Desktop\seinsoul val\x64\Release\ProjectHex.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/ProjectHex.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29333:TargetPlatformVersion=10.0.18362.0: 2 | Release|x64|C:\Users\Cameron\Desktop\seinsoul val\| 3 | -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/ProjectHex.write.1u.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/ProjectHex.write.1u.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /ProjectHex/x64/Release/ProjectHex.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/ProjectHex.vcxproj.FileListAbsolute.txt -------------------------------------------------------------------------------- /ProjectHex/x64/Release/Protect.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/Protect.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/auth.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/auth.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/crypto.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/crypto.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/hwid.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/hwid.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/imgui.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/imgui.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/imgui_demo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/imgui_demo.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/imgui_draw.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/imgui_draw.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/imgui_impl_dx9.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/imgui_impl_dx9.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/imgui_impl_win32.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/imgui_impl_win32.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/imgui_widgets.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/imgui_widgets.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/md5.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/md5.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/md5wrapper.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/md5wrapper.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/print.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/print.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/program.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/program.obj -------------------------------------------------------------------------------- /ProjectHex/x64/Release/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trash-code/valorant-external/4ff88e4bd534d68522f7c0e9e63eba3d136eca97/ProjectHex/x64/Release/vc142.pdb -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # valorant-external 2 | 3 | public valorant source hack esp+aimbot 4 | base: xFirstPromise 5 | EFI drv: TheCruZ 6 | https://www.unknowncheats.me/forum/apex-legends/405983-direct-efi-aimbot-glow-hack.html 7 | --------------------------------------------------------------------------------