From 77b52da44b263df4884be2f35f885d8edccbb6fa Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 19 Dec 2018 00:13:24 +1300 Subject: added new loader project :) merry christmas --- csgo-loader/csgo-client/Client.cpp | 55 + csgo-loader/csgo-client/Login/RemoteLogin.cpp | 75 + csgo-loader/csgo-client/Login/RemoteLogin.hpp | 78 + csgo-loader/csgo-client/Networking/TCPClient.cpp | 102 + csgo-loader/csgo-client/Networking/TCPClient.hpp | 39 + .../csgo-client/RemoteCode/RemoteProcess.cpp | 47 + .../csgo-client/RemoteCode/RemoteProcess.hpp | 91 + csgo-loader/csgo-client/Security/Encryption.cpp | 581 +++++ csgo-loader/csgo-client/Security/Encryption.hpp | 89 + csgo-loader/csgo-client/Security/FnvHash.hpp | 92 + .../csgo-client/Security/SyscallManager.cpp | 149 ++ .../csgo-client/Security/SyscallManager.hpp | 65 + .../UserExperience/MoneybotShared/color.hpp | 287 +++ .../UserExperience/MoneybotShared/d3d.cpp | 335 +++ .../UserExperience/MoneybotShared/d3d.hpp | 126 ++ .../UserExperience/MoneybotShared/d3d_sprite.cpp | 13 + .../UserExperience/MoneybotShared/d3d_sprite.hpp | 107 + .../UserExperience/MoneybotShared/input_system.cpp | 523 +++++ .../UserExperience/MoneybotShared/input_system.hpp | 177 ++ .../UserExperience/MoneybotShared/math.hpp | 60 + .../csgo-client/UserExperience/MoneybotShared/ui.h | 121 ++ .../UserExperience/MoneybotShared/ui_base_item.h | 164 ++ .../UserExperience/MoneybotShared/ui_button.h | 56 + .../UserExperience/MoneybotShared/ui_checkbox.h | 68 + .../MoneybotShared/ui_color_picker.h | 201 ++ .../UserExperience/MoneybotShared/ui_draw.h | 160 ++ .../UserExperience/MoneybotShared/ui_dropdown.h | 217 ++ .../MoneybotShared/ui_dropdown_item.h | 15 + .../UserExperience/MoneybotShared/ui_form.h | 130 ++ .../UserExperience/MoneybotShared/ui_key_picker.h | 164 ++ .../UserExperience/MoneybotShared/ui_label.h | 18 + .../UserExperience/MoneybotShared/ui_menu.h | 108 + .../UserExperience/MoneybotShared/ui_progressbar.h | 44 + .../UserExperience/MoneybotShared/ui_render.h | 57 + .../UserExperience/MoneybotShared/ui_slider.h | 165 ++ .../UserExperience/MoneybotShared/ui_tab_manager.h | 224 ++ .../MoneybotShared/ui_text_input.cpp | 86 + .../UserExperience/MoneybotShared/ui_text_input.h | 38 + .../UserExperience/MoneybotShared/util.hpp | 85 + .../UserExperience/MoneybotShared/window.cpp | 160 ++ .../UserExperience/MoneybotShared/window.hpp | 62 + .../csgo-client/UserExperience/UserInterface.cpp | 65 + .../csgo-client/UserExperience/UserInterface.hpp | 63 + csgo-loader/csgo-client/csgo-client.vcxproj | 196 ++ .../csgo-client/csgo-client.vcxproj.filters | 154 ++ csgo-loader/csgo-loader.sln | 41 + csgo-loader/csgo-server/Login/RemoteLogin.cpp | 51 + csgo-loader/csgo-server/Login/RemoteLogin.hpp | 61 + csgo-loader/csgo-server/Networking/TCPServer.cpp | 124 ++ csgo-loader/csgo-server/Networking/TCPServer.hpp | 87 + csgo-loader/csgo-server/Networking/WebSocket.cpp | 44 + csgo-loader/csgo-server/Networking/WebSocket.hpp | 37 + csgo-loader/csgo-server/RemoteCode/FileReader.cpp | 0 csgo-loader/csgo-server/RemoteCode/FileReader.hpp | 1 + csgo-loader/csgo-server/Security/Encryption.cpp | 581 +++++ csgo-loader/csgo-server/Security/Encryption.hpp | 89 + csgo-loader/csgo-server/Server.cpp | 33 + csgo-loader/csgo-server/csgo-server.vcxproj | 152 ++ .../csgo-server/csgo-server.vcxproj.filters | 52 + .../themida-sdk/include/SecureEngineCustomVMs.h | 338 +++ .../SecureEngineCustomVMs_BorlandC_inline.h | 402 ++++ .../include/SecureEngineCustomVMs_GNU_inline.h | 1694 +++++++++++++++ .../include/SecureEngineCustomVMs_ICL_inline.h | 1694 +++++++++++++++ .../include/SecureEngineCustomVMs_LCC_inline.h | 402 ++++ .../include/SecureEngineCustomVMs_VC_inline.h | 1694 +++++++++++++++ csgo-loader/themida-sdk/include/ThemidaSDK.h | 2265 ++++++++++++++++++++ csgo-loader/themida-sdk/lib/SecureEngineSDK32.lib | Bin 0 -> 211136 bytes csgo-loader/themida-sdk/lib/SecureEngineSDK64.lib | Bin 0 -> 199752 bytes 68 files changed, 15754 insertions(+) create mode 100644 csgo-loader/csgo-client/Client.cpp create mode 100644 csgo-loader/csgo-client/Login/RemoteLogin.cpp create mode 100644 csgo-loader/csgo-client/Login/RemoteLogin.hpp create mode 100644 csgo-loader/csgo-client/Networking/TCPClient.cpp create mode 100644 csgo-loader/csgo-client/Networking/TCPClient.hpp create mode 100644 csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp create mode 100644 csgo-loader/csgo-client/RemoteCode/RemoteProcess.hpp create mode 100644 csgo-loader/csgo-client/Security/Encryption.cpp create mode 100644 csgo-loader/csgo-client/Security/Encryption.hpp create mode 100644 csgo-loader/csgo-client/Security/FnvHash.hpp create mode 100644 csgo-loader/csgo-client/Security/SyscallManager.cpp create mode 100644 csgo-loader/csgo-client/Security/SyscallManager.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/color.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.cpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.cpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.cpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_base_item.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_button.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_checkbox.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_color_picker.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_draw.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown_item.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_form.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_key_picker.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_label.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_menu.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_progressbar.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_render.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_slider.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_tab_manager.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.cpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.h create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/util.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp create mode 100644 csgo-loader/csgo-client/UserExperience/MoneybotShared/window.hpp create mode 100644 csgo-loader/csgo-client/UserExperience/UserInterface.cpp create mode 100644 csgo-loader/csgo-client/UserExperience/UserInterface.hpp create mode 100644 csgo-loader/csgo-client/csgo-client.vcxproj create mode 100644 csgo-loader/csgo-client/csgo-client.vcxproj.filters create mode 100644 csgo-loader/csgo-loader.sln create mode 100644 csgo-loader/csgo-server/Login/RemoteLogin.cpp create mode 100644 csgo-loader/csgo-server/Login/RemoteLogin.hpp create mode 100644 csgo-loader/csgo-server/Networking/TCPServer.cpp create mode 100644 csgo-loader/csgo-server/Networking/TCPServer.hpp create mode 100644 csgo-loader/csgo-server/Networking/WebSocket.cpp create mode 100644 csgo-loader/csgo-server/Networking/WebSocket.hpp create mode 100644 csgo-loader/csgo-server/RemoteCode/FileReader.cpp create mode 100644 csgo-loader/csgo-server/RemoteCode/FileReader.hpp create mode 100644 csgo-loader/csgo-server/Security/Encryption.cpp create mode 100644 csgo-loader/csgo-server/Security/Encryption.hpp create mode 100644 csgo-loader/csgo-server/Server.cpp create mode 100644 csgo-loader/csgo-server/csgo-server.vcxproj create mode 100644 csgo-loader/csgo-server/csgo-server.vcxproj.filters create mode 100644 csgo-loader/themida-sdk/include/SecureEngineCustomVMs.h create mode 100644 csgo-loader/themida-sdk/include/SecureEngineCustomVMs_BorlandC_inline.h create mode 100644 csgo-loader/themida-sdk/include/SecureEngineCustomVMs_GNU_inline.h create mode 100644 csgo-loader/themida-sdk/include/SecureEngineCustomVMs_ICL_inline.h create mode 100644 csgo-loader/themida-sdk/include/SecureEngineCustomVMs_LCC_inline.h create mode 100644 csgo-loader/themida-sdk/include/SecureEngineCustomVMs_VC_inline.h create mode 100644 csgo-loader/themida-sdk/include/ThemidaSDK.h create mode 100644 csgo-loader/themida-sdk/lib/SecureEngineSDK32.lib create mode 100644 csgo-loader/themida-sdk/lib/SecureEngineSDK64.lib (limited to 'csgo-loader') diff --git a/csgo-loader/csgo-client/Client.cpp b/csgo-loader/csgo-client/Client.cpp new file mode 100644 index 0000000..077b14b --- /dev/null +++ b/csgo-loader/csgo-client/Client.cpp @@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include + +#define LOCAL_IP 0x0100007F // '127.0.0.1' +#define SERVER_IP 0xE53CA523 // Hexadecimal representation of the server IP, obtained by inet_addr() +#define SERVER_PORT 0xF2C // Hexadecimal representation of the server port. + +int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) { + if(!Syscalls->Start()) + ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator."); + + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; + + std::thread WindowThread([] { + if(!UserInterface->Start()) + ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator."); + + UserInterface->RunUiFrame(); + }); WindowThread.detach(); + + // Allow the window to start, etc. + Sleep(2000); + + Networking::TCPClient Client; + + if(!Client.Start(LOCAL_IP, SERVER_PORT)) + ERROR_ASSERT("[000F:0002A000] Server did not accept the connection."); + + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_LOG_IN; + + while(UserInterface->m_Data.m_ExecutionState != UserExperience::EXECUTION_WAITING) { + Sleep(1); + } + + Login::RemoteLoginTransaction Transaction; + Transaction.Start(UserInterface->m_Data.m_Username, UserInterface->m_Data.m_Password); + + ByteArray RawLoginHeader = Transaction.GetHeader(); + Client.SendBytes(RawLoginHeader); + + ByteArray RawServerResponse = Client.ReceiveBytes(); + if(!Transaction.TranslateResponse(RawServerResponse)) { + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_ERROR; + } + else { + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_CHOOSE; + } + + // TODO: Add game selection. + + while(1) { if(GetAsyncKeyState(VK_END) & 0x8000) break; Sleep(1); } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Login/RemoteLogin.cpp b/csgo-loader/csgo-client/Login/RemoteLogin.cpp new file mode 100644 index 0000000..45f7953 --- /dev/null +++ b/csgo-loader/csgo-client/Login/RemoteLogin.cpp @@ -0,0 +1,75 @@ +#include +#include + +// Change this whenever a major client update is made. +// NOTE: You must change this on the server as well. +#define CURRENT_CLIENT_HEADER 0xDEADBEEF + +namespace Login { + void RemoteLoginTransaction::Start(const char *Username, const char *Password) { + // Initialise the header with the client header. + m_Header.m_ClientHeader = CURRENT_CLIENT_HEADER; + + // Initialise the header with the username and password. + strcpy_s< 128 >(m_Header.m_Username, Username); + strcpy_s< 128 >(m_Header.m_Password, Password); + + // Initialise the header with the Hardware ID. + m_Header.m_HardwareId = GetHardwareId(); + + // TODO: Verify integrity of system. + m_Header.m_IntegrityBit1 = 0; // 0 for integrity passed, random bit for failure + m_Header.m_IntegrityBit2 = 0; + m_Header.m_IntegrityBit3 = 0; + + // The checksum bit, the server will check this first to detect possible tampering. + m_Header.m_IntegrityBit4 = m_Header.m_IntegrityBit1 + | m_Header.m_IntegrityBit2 + | m_Header.m_IntegrityBit3; + } + + // TODO: Hardware ID check. + ByteArray RemoteLoginTransaction::DoWmiQuery(const char *Query) { + ByteArray Response{}; + + return Response; + } + + uint32_t RemoteLoginTransaction::GetHardwareId() { + return 123456789; + } + + bool RemoteLoginTransaction::TranslateResponse(ByteArray &RawResponse) { + RemoteLoginResponse ServerResponse = *reinterpret_cast(&RawResponse[0]); + + switch(ServerResponse) { + case RemoteLoginResponse::ACCESS_SPECIAL_USER: + // Allow the user to load special access cheats. + UserInterface->m_Data.m_SpecialAccess = true; + case RemoteLoginResponse::ACCESS_AUTHORISED: + return true; + case RemoteLoginResponse::OUTDATED_CLIENT: + INFO_ASSERT("[000A:%08x] Your client is outdated.\nPlease download the latest client at 'moneybot.cc'.", m_Header.m_HardwareId); + break; + case RemoteLoginResponse::INTEGRITY_FAILURE: + INFO_ASSERT("[000F:%08x] Failed to verify session.\nPlease contact an administrator.", m_Header.m_HardwareId); + break; + case RemoteLoginResponse::USER_BANNED: + INFO_ASSERT("[000D:%08x] Your account is banned.\nPlease contact 'admin@moneybot.cc' for additional information.", m_Header.m_HardwareId); + break; + case RemoteLoginResponse::INVALID_HARDWARE: + UserInterface->m_Data.m_Error = UserExperience::ERROR_INVALID_HWID; + //INFO_ASSERT("[000C:%08x] Hardware ID mismatch.\nPlease contact an administrator to request a hardware ID reset.", m_Header.m_HardwareId); + break; + case RemoteLoginResponse::INVALID_CREDENTIALS: + UserInterface->m_Data.m_Error = UserExperience::ERROR_SHADOW_BAN; + //INFO_ASSERT("[000C:%08x] Your credentials are invalid. Please check your spelling and try again.", m_Header.m_HardwareId ^ RemoteLoginResponse::INVALID_CREDENTIALS); + break; + case RemoteLoginResponse::NO_SUBSCRIPTION: + INFO_ASSERT("[000G:%08x] No active subscription found.", m_Header.m_HardwareId ^ RemoteLoginResponse::NO_SUBSCRIPTION); + break; + } + + return false; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Login/RemoteLogin.hpp b/csgo-loader/csgo-client/Login/RemoteLogin.hpp new file mode 100644 index 0000000..e543d27 --- /dev/null +++ b/csgo-loader/csgo-client/Login/RemoteLogin.hpp @@ -0,0 +1,78 @@ +#pragma once + +#include +#include +#include + +using ByteArray = std::vector; + +namespace Login { + // Login header that is sent over to the server + struct RemoteLoginHeader { + // The first four bytes are encoded by the client. + // This will carry the client version which can be checked. + uint32_t m_ClientHeader; + + // The username is raw text. + // TODO: Hash the password client-side. + char m_Username[128]; + char m_Password[128]; + + // This will provide the hardware ID of the machine. + uint32_t m_HardwareId; + + // These fields will be set according + // to security check results. + uint8_t m_IntegrityBit1; // Detour detected on NTDLL function + uint8_t m_IntegrityBit2; // Detour detected on dummy function + uint8_t m_IntegrityBit3; // Virtual machine/Debugger detected + uint8_t m_IntegrityBit4; // m_IntegrityBit1 | m_IntegrityBit2 | m_IntegrityBit3 (checksum) + }; + + // Possible server responses + // The hardware ID is encoded (XORed with the message ID) within the message for + // shadow ban/forum ban purposes. :) + enum RemoteLoginResponse : uint8_t { + OUTDATED_CLIENT = 'A', // '[000A:{HWID}] Your client is outdated. Please download the latest client at 'moneybot.cc'.' + ACCESS_AUTHORISED = 'B', // Allows the user to continue with injection. + INVALID_CREDENTIALS = 'C', // '[000C:{HWID}] Your credentials are invalid. Please check your spelling and try again.' + USER_BANNED = 'D', // '[000D:{HWID}] Your account is banned. Please contact 'admin@moneybot.cc' for additional information.' + INVALID_HARDWARE = 'E', // '[000E:{HWID}] Please contact an administrator to request a hardware ID reset.' + INTEGRITY_FAILURE = 'F', // '[000F:{HWID}] Failed to verify session. Please contact an administrator.' AKA the 'shadow ban', blacklists user from loader but not from forums. + NO_SUBSCRIPTION = 'G', // '[000G:{HWID}] No active subscription.' + ACCESS_SPECIAL_USER = 'H', // Allows the user to continue, sets the m_SpecialAccess var + }; + + // Runs the security checks and creates the login header to send to the server. + class RemoteLoginTransaction { + RemoteLoginHeader m_Header; + + public: + // Initialises the header. + void Start(const char *Username, const char *Password); + + // Obtains the hardware ID of the current machine in use. + uint32_t GetHardwareId(); + + // Queries the WMI for data. + ByteArray DoWmiQuery(const char *Query); + + // Translates server response, determines whether or not the + // user can access the client. NOTE: Server will drop the client if + // the response is not ACCESS_AUTHORISED. + bool TranslateResponse(ByteArray &RawResponse); + + ByteArray GetHeader() { + ByteArray Header; + + // Copy header to the ByteArray. + Header.insert( + Header.begin(), + (uint8_t *)&m_Header, + (uint8_t *)&m_Header + sizeof RemoteLoginHeader + ); + + return Header; + } + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Networking/TCPClient.cpp b/csgo-loader/csgo-client/Networking/TCPClient.cpp new file mode 100644 index 0000000..3bdea21 --- /dev/null +++ b/csgo-loader/csgo-client/Networking/TCPClient.cpp @@ -0,0 +1,102 @@ +#include +#include + +namespace Networking { + // We will only receive up to 256 bytes per cycle. + constexpr int BufferSize = 256; + + void TCPClient::SendRawBytes(ByteArray &Bytes) { + // Send data. + int32_t Result = send(m_Socket, (char *)Bytes.data(), (int)Bytes.size(), 0); + + if(Result == -1) + INFO_ASSERT("[000F:00002B00] Server closed the connection suddenly."); + } + + ByteArray TCPClient::ReceiveRawBytes() { + ByteArray ReceivedBytes; + uint8_t RecvBuffer[BufferSize]; + + // Attempt to receive a packet. + while(true) { + int32_t Received = recv(m_Socket, (char*)RecvBuffer, BufferSize, 0); + + // No more bytes left to receive. + if(Received < 0) + break; + + // Emplace all received bytes. + for(int n = 0; n < Received; ++n) { + ReceivedBytes.push_back(RecvBuffer[n]); + } + + // No more bytes left to receive. + if(Received < BufferSize) + break; + } + + return ReceivedBytes; + } + + void TCPClient::SendBytes(ByteArray &Bytes) { + // Encrypt outgoing data. + ByteArray Encrypted = m_Encryption.Encrypt(Bytes); + + SendRawBytes(Encrypted); + } + + ByteArray TCPClient::ReceiveBytes() { + ByteArray ReceivedBytes = ReceiveRawBytes(); + + // Decrypt incoming data. + ByteArray Decrypted = m_Encryption.Decrypt(ReceivedBytes); + + return Decrypted; + } + + bool TCPClient::Start(uint32_t ServerAddress, uint16_t ServerPort) { + const int32_t version = 0x101; + + // Initialise WinSocks. + if(WSAStartup(version, &m_WinSocks)) + return false; + + // Create an IPv4 socket. + m_Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if(m_Socket == INVALID_SOCKET) + return false; + + // Set up client context. + m_Context.sin_addr.s_addr = ServerAddress; + m_Context.sin_family = AF_INET; + m_Context.sin_port = htons(ServerPort); + + // Attempt connection. + if(connect(m_Socket, (sockaddr *)&m_Context, sizeof m_Context)) + return false; + + // Allow the socket to time-out. + timeval timeout; + timeout.tv_sec = 5; + + if(setsockopt(m_Socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof timeout) == INVALID_SOCKET) + return false; + + if(setsockopt(m_Socket, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof timeout) == INVALID_SOCKET) + return false; + + // Initialise encryption wrapper. + ByteArray EncryptionKey = ReceiveRawBytes(); + m_Encryption.Start(EncryptionKey); + + return true; + } + + void TCPClient::Kill() { + if(m_Socket) + closesocket(m_Socket); + + WSACleanup(); + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Networking/TCPClient.hpp b/csgo-loader/csgo-client/Networking/TCPClient.hpp new file mode 100644 index 0000000..f057cdc --- /dev/null +++ b/csgo-loader/csgo-client/Networking/TCPClient.hpp @@ -0,0 +1,39 @@ +#pragma once + +// For encryption wrappers. +#include + +// WinSocks +#include +#pragma comment(lib, "ws2_32.lib") + +// std::min +#include + +namespace Networking { + // A TCPClient is essentially the same as the TCPConnection counterpart on the server, + // however, it independently handles connection. + class TCPClient { + WSADATA m_WinSocks; + SOCKET m_Socket; + sockaddr_in m_Context; + Wrapper::Encryption m_Encryption; + + public: + TCPClient() = default; + + // Connects to a remote server. + // Also handles the initial handshake between server and client. + bool Start(uint32_t ServerAddress, uint16_t ServerPort); + + // Kills the client. + void Kill(); + + // Wrappers for sending/receiving data. + void SendRawBytes(ByteArray &Bytes); + ByteArray ReceiveRawBytes(); + + void SendBytes(ByteArray &Bytes); + ByteArray ReceiveBytes(); + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp b/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp new file mode 100644 index 0000000..7397c7d --- /dev/null +++ b/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp @@ -0,0 +1,47 @@ +#include + +namespace RemoteCode { + // RemoteModule implementation + RemoteModule::RemoteModule(HANDLE Module, RemoteProcess &Process) : + m_Module(Module) { + // Read information about module. + MODULEINFO ModuleInfo{}; + if(!K32GetModuleInformation(Process, (HMODULE)Module, &ModuleInfo, sizeof ModuleInfo)) + return; + + // Read module data. + m_ModuleData.reserve(ModuleInfo.SizeOfImage); + Process.Read(ModuleInfo.lpBaseOfDll, m_ModuleData.data(), m_ModuleData.size()); + } + + uintptr_t RemoteModule::Scan(ByteArray &Data) { + if(m_ModuleData.empty()) + return uintptr_t{}; + + // We have a valid file (?) + uint8_t *Buffer = m_ModuleData.data(); + + if(!Buffer || *(uint16_t *)Buffer != IMAGE_DOS_SIGNATURE) + return uintptr_t{}; + + // Read PE information. + IMAGE_DOS_HEADER *DosHeader = (IMAGE_DOS_HEADER *)Buffer; + IMAGE_NT_HEADERS *NtHeaders = (IMAGE_NT_HEADERS *)(Buffer + DosHeader->e_lfanew); + + if(NtHeaders->Signature != IMAGE_NT_SIGNATURE) + return uintptr_t{}; + + // Find signature. + ByteArray::iterator Iterator = std::search( + m_ModuleData.begin(), + m_ModuleData.end(), + Data.begin(), + Data.end() + ); + + return (uintptr_t)std::distance(m_ModuleData.begin(), Iterator); + } + + // RemoteProcess implementation + +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/RemoteCode/RemoteProcess.hpp b/csgo-loader/csgo-client/RemoteCode/RemoteProcess.hpp new file mode 100644 index 0000000..b1c716b --- /dev/null +++ b/csgo-loader/csgo-client/RemoteCode/RemoteProcess.hpp @@ -0,0 +1,91 @@ +#pragma once + +#include +#include + +#include +#include + +namespace RemoteCode { + // The module wrapper. + class RemoteProcess; + class RemoteModule { + HANDLE m_Module; + int32_t m_SizeOfModule; + + // All the module data will be read upon class initialisation. + ByteArray m_ModuleData; + + public: + // The constructor (reads all module data into m_ModuleData). + RemoteModule(HANDLE Module, RemoteProcess &Process); + + // TODO: Add support for wild-cards (not currently implemented) + uintptr_t Scan(ByteArray &Pattern); + + // Allow us to access the module by just passing the + // handle as a parameter. + operator HANDLE() { return m_Module; } + operator HINSTANCE() { return (HINSTANCE)m_Module; } + }; + + // The process wrapper. + class RemoteProcess { + HANDLE m_Process; + int32_t m_ProcessId; + + // Exposing the syscalls in a convenient way to use with templating. + void ReadMemoryWrapper_Internal(void *Address, void *Data, size_t SizeOfData); + void WriteMemoryWrapper_Internal(void *Address, void *Data, size_t SizeOfData); + + public: + RemoteProcess() = default; + + // For portability, will ignore exceptions. + RemoteProcess(const char *ProcessName) { + Start(ProcessName); + } + + // Release the handle when the process goes out of scope. + ~RemoteProcess() { + if(m_Process) + CloseHandle(m_Process); + } + + // Find the process ID and initialise the process. + bool Start(const char *ProcessName); + + // Writes to the process memory. + template + void Write(void *Address, T Data) { + WriteMemoryWrapper_Internal(Address, (void *)&Data, sizeof T); + } + + void Write(void *Address, uint8_t *Data, size_t SizeOfData) { + WriteMemoryWrapper_Internal(Address, (void *)Data, SizeOfData); + } + + // Reads from the process memory. + template + T Read(void *Address) { + T Buffer{}; + ReadMemoryWrapper_Internal(Address, (void *)&Buffer, sizeof T); + + return Buffer; + } + + void Read(void *Address, uint8_t *Data, size_t SizeOfData) { + ReadMemoryWrapper_Internal(Address, (void *)Data, SizeOfData); + } + + // Allocates a memory region in the process. + void *Allocate(size_t AllocationSize); + + // Finds a module in the process. + RemoteModule FindModule(const char *ModuleName); + + // Allow us to access the process by just passing the + // handle as a parameter. + operator HANDLE() { return m_Process; } + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Security/Encryption.cpp b/csgo-loader/csgo-client/Security/Encryption.cpp new file mode 100644 index 0000000..7d4fd05 --- /dev/null +++ b/csgo-loader/csgo-client/Security/Encryption.cpp @@ -0,0 +1,581 @@ +#include + +#define FE(x) (((x) << 1) ^ ((((x)>>7) & 1) * 0x1b)) +#define FD(x) (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0)) + +#define KEY_SIZE 32 +#define NUM_ROUNDS 14 + +namespace Wrapper { + // Constants used for the AES256 algorithm. + uint8_t sbox[256] = { + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, + 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, + 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, + 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, + 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, + 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, + 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, + 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, + 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, + 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, + 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, + 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, + 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, + 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, + 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, + 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, + 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 + }; + + uint8_t sboxinv[256] = { + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, + 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, + 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, + 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, + 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, + 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, + 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, + 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, + 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, + 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, + 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, + 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, + 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, + 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, + 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, + 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d + }; + + // Implementation of the AES256 encryption algorithm. + unsigned char rj_xtime(unsigned char x); + + Aes256::Aes256(const ByteArray& key) + : m_key(ByteArray(key.size() > KEY_SIZE ? KEY_SIZE : key.size(), 0)) + , m_salt(ByteArray(KEY_SIZE - m_key.size(), 0)) + , m_rkey(ByteArray(KEY_SIZE, 0)) + , m_buffer_pos(0) + , m_remainingLength(0) + , m_decryptInitialized(false) { + for(ByteArray::size_type i = 0; i < m_key.size(); ++i) + m_key[i] = key[i]; + } + + Aes256::~Aes256() { + } + + ByteArray::size_type Aes256::encrypt(const ByteArray& key, const ByteArray& plain, ByteArray& encrypted) { + Aes256 aes(key); + + aes.encrypt_start(plain.size(), encrypted); + aes.encrypt_continue(plain, encrypted); + aes.encrypt_end(encrypted); + + return encrypted.size(); + } + + ByteArray::size_type Aes256::encrypt(const ByteArray& key, const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted) { + Aes256 aes(key); + + aes.encrypt_start(plain_length, encrypted); + aes.encrypt_continue(plain, plain_length, encrypted); + aes.encrypt_end(encrypted); + + return encrypted.size(); + } + + ByteArray::size_type Aes256::decrypt(const ByteArray& key, const ByteArray& encrypted, ByteArray& plain) { + Aes256 aes(key); + + aes.decrypt_start(encrypted.size()); + aes.decrypt_continue(encrypted, plain); + aes.decrypt_end(plain); + + return plain.size(); + } + + ByteArray::size_type Aes256::decrypt(const ByteArray& key, const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain) { + Aes256 aes(key); + + aes.decrypt_start(encrypted_length); + aes.decrypt_continue(encrypted, encrypted_length, plain); + aes.decrypt_end(plain); + + return plain.size(); + } + + ByteArray::size_type Aes256::encrypt_start(const ByteArray::size_type plain_length, ByteArray& encrypted) { + m_remainingLength = plain_length; + + // Generate salt + ByteArray::iterator it = m_salt.begin(), itEnd = m_salt.end(); + while(it != itEnd) + *(it++) = (rand() & 0xFF); + + // Calculate padding + ByteArray::size_type padding = 0; + if(m_remainingLength % BLOCK_SIZE != 0) + padding = (BLOCK_SIZE - (m_remainingLength % BLOCK_SIZE)); + m_remainingLength += padding; + + // Add salt + encrypted.insert(encrypted.end(), m_salt.begin(), m_salt.end()); + m_remainingLength += m_salt.size(); + + // Add 1 bytes for padding size + encrypted.push_back(padding & 0xFF); + ++m_remainingLength; + + // Reset buffer + m_buffer_pos = 0; + + return encrypted.size(); + } + + ByteArray::size_type Aes256::encrypt_continue(const ByteArray& plain, ByteArray& encrypted) { + ByteArray::const_iterator it = plain.begin(), itEnd = plain.end(); + + while(it != itEnd) { + m_buffer[m_buffer_pos++] = *(it++); + + check_and_encrypt_buffer(encrypted); + } + + return encrypted.size(); + } + + ByteArray::size_type Aes256::encrypt_continue(const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted) { + ByteArray::size_type i = 0; + + while(i < plain_length) { + m_buffer[m_buffer_pos++] = plain[i++]; + + check_and_encrypt_buffer(encrypted); + } + + return encrypted.size(); + } + + void Aes256::check_and_encrypt_buffer(ByteArray& encrypted) { + if(m_buffer_pos == BLOCK_SIZE) { + encrypt(m_buffer); + + for(m_buffer_pos = 0; m_buffer_pos < BLOCK_SIZE; ++m_buffer_pos) { + encrypted.push_back(m_buffer[m_buffer_pos]); + --m_remainingLength; + } + + m_buffer_pos = 0; + } + } + + ByteArray::size_type Aes256::encrypt_end(ByteArray& encrypted) { + if(m_buffer_pos > 0) { + while(m_buffer_pos < BLOCK_SIZE) + m_buffer[m_buffer_pos++] = 0; + + encrypt(m_buffer); + + for(m_buffer_pos = 0; m_buffer_pos < BLOCK_SIZE; ++m_buffer_pos) { + encrypted.push_back(m_buffer[m_buffer_pos]); + --m_remainingLength; + } + + m_buffer_pos = 0; + } + + return encrypted.size(); + } + + void Aes256::encrypt(unsigned char* buffer) { + unsigned char i, rcon; + + copy_key(); + add_round_key(buffer, 0); + for(i = 1, rcon = 1; i < NUM_ROUNDS; ++i) { + sub_bytes(buffer); + shift_rows(buffer); + mix_columns(buffer); + if(!(i & 1)) + expand_enc_key(&rcon); + add_round_key(buffer, i); + } + sub_bytes(buffer); + shift_rows(buffer); + expand_enc_key(&rcon); + add_round_key(buffer, i); + } + + ByteArray::size_type Aes256::decrypt_start(const ByteArray::size_type encrypted_length) { + unsigned char j; + + m_remainingLength = encrypted_length; + + // Reset salt + for(j = 0; j < m_salt.size(); ++j) + m_salt[j] = 0; + m_remainingLength -= m_salt.size(); + + // Reset buffer + m_buffer_pos = 0; + + m_decryptInitialized = false; + + return m_remainingLength; + } + + ByteArray::size_type Aes256::decrypt_continue(const ByteArray& encrypted, ByteArray& plain) { + ByteArray::const_iterator it = encrypted.begin(), itEnd = encrypted.end(); + + while(it != itEnd) { + m_buffer[m_buffer_pos++] = *(it++); + + check_and_decrypt_buffer(plain); + } + + return plain.size(); + } + + ByteArray::size_type Aes256::decrypt_continue(const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain) { + ByteArray::size_type i = 0; + + while(i < encrypted_length) { + m_buffer[m_buffer_pos++] = encrypted[i++]; + + check_and_decrypt_buffer(plain); + } + + return plain.size(); + } + + void Aes256::check_and_decrypt_buffer(ByteArray& plain) { + if(!m_decryptInitialized && m_buffer_pos == m_salt.size() + 1) { + unsigned char j; + ByteArray::size_type padding; + + // Get salt + for(j = 0; j < m_salt.size(); ++j) + m_salt[j] = m_buffer[j]; + + // Get padding + padding = (m_buffer[j] & 0xFF); + m_remainingLength -= padding + 1; + + // Start decrypting + m_buffer_pos = 0; + + m_decryptInitialized = true; + } + else if(m_decryptInitialized && m_buffer_pos == BLOCK_SIZE) { + decrypt(m_buffer); + + for(m_buffer_pos = 0; m_buffer_pos < BLOCK_SIZE; ++m_buffer_pos) + if(m_remainingLength > 0) { + plain.push_back(m_buffer[m_buffer_pos]); + --m_remainingLength; + } + + m_buffer_pos = 0; + } + } + + ByteArray::size_type Aes256::decrypt_end(ByteArray& plain) { + return plain.size(); + } + + void Aes256::decrypt(unsigned char* buffer) { + unsigned char i, rcon = 1; + + copy_key(); + for(i = NUM_ROUNDS / 2; i > 0; --i) + expand_enc_key(&rcon); + + add_round_key(buffer, NUM_ROUNDS); + shift_rows_inv(buffer); + sub_bytes_inv(buffer); + + for(i = NUM_ROUNDS, rcon = 0x80; --i;) { + if((i & 1)) + expand_dec_key(&rcon); + add_round_key(buffer, i); + mix_columns_inv(buffer); + shift_rows_inv(buffer); + sub_bytes_inv(buffer); + } + add_round_key(buffer, i); + } + + void Aes256::expand_enc_key(unsigned char* rc) { + unsigned char i; + + m_rkey[0] = m_rkey[0] ^ sbox[m_rkey[29]] ^ (*rc); + m_rkey[1] = m_rkey[1] ^ sbox[m_rkey[30]]; + m_rkey[2] = m_rkey[2] ^ sbox[m_rkey[31]]; + m_rkey[3] = m_rkey[3] ^ sbox[m_rkey[28]]; + *rc = FE(*rc); + + for(i = 4; i < 16; i += 4) { + m_rkey[i] = m_rkey[i] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + m_rkey[16] = m_rkey[16] ^ sbox[m_rkey[12]]; + m_rkey[17] = m_rkey[17] ^ sbox[m_rkey[13]]; + m_rkey[18] = m_rkey[18] ^ sbox[m_rkey[14]]; + m_rkey[19] = m_rkey[19] ^ sbox[m_rkey[15]]; + + for(i = 20; i < 32; i += 4) { + m_rkey[i] = m_rkey[i] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + } + + void Aes256::expand_dec_key(unsigned char* rc) { + unsigned char i; + + for(i = 28; i > 16; i -= 4) { + m_rkey[i + 0] = m_rkey[i + 0] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + + m_rkey[16] = m_rkey[16] ^ sbox[m_rkey[12]]; + m_rkey[17] = m_rkey[17] ^ sbox[m_rkey[13]]; + m_rkey[18] = m_rkey[18] ^ sbox[m_rkey[14]]; + m_rkey[19] = m_rkey[19] ^ sbox[m_rkey[15]]; + + for(i = 12; i > 0; i -= 4) { + m_rkey[i + 0] = m_rkey[i + 0] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + + *rc = FD(*rc); + m_rkey[0] = m_rkey[0] ^ sbox[m_rkey[29]] ^ (*rc); + m_rkey[1] = m_rkey[1] ^ sbox[m_rkey[30]]; + m_rkey[2] = m_rkey[2] ^ sbox[m_rkey[31]]; + m_rkey[3] = m_rkey[3] ^ sbox[m_rkey[28]]; + } + + void Aes256::sub_bytes(unsigned char* buffer) { + unsigned char i = KEY_SIZE / 2; + + while(i--) + buffer[i] = sbox[buffer[i]]; + } + + void Aes256::sub_bytes_inv(unsigned char* buffer) { + unsigned char i = KEY_SIZE / 2; + + while(i--) + buffer[i] = sboxinv[buffer[i]]; + } + + void Aes256::copy_key() { + ByteArray::size_type i; + + for(i = 0; i < m_key.size(); ++i) + m_rkey[i] = m_key[i]; + for(i = 0; i < m_salt.size(); ++i) + m_rkey[i + m_key.size()] = m_salt[i]; + } + + void Aes256::add_round_key(unsigned char* buffer, const unsigned char round) { + unsigned char i = KEY_SIZE / 2; + + while(i--) + buffer[i] ^= m_rkey[(round & 1) ? i + 16 : i]; + } + + void Aes256::shift_rows(unsigned char* buffer) { + unsigned char i, j, k, l; /* to make it potentially parallelable :) */ + + i = buffer[1]; + buffer[1] = buffer[5]; + buffer[5] = buffer[9]; + buffer[9] = buffer[13]; + buffer[13] = i; + + j = buffer[10]; + buffer[10] = buffer[2]; + buffer[2] = j; + + k = buffer[3]; + buffer[3] = buffer[15]; + buffer[15] = buffer[11]; + buffer[11] = buffer[7]; + buffer[7] = k; + + l = buffer[14]; + buffer[14] = buffer[6]; + buffer[6] = l; + } + + void Aes256::shift_rows_inv(unsigned char* buffer) { + unsigned char i, j, k, l; /* same as above :) */ + + i = buffer[1]; + buffer[1] = buffer[13]; + buffer[13] = buffer[9]; + buffer[9] = buffer[5]; + buffer[5] = i; + + j = buffer[2]; + buffer[2] = buffer[10]; + buffer[10] = j; + + k = buffer[3]; + buffer[3] = buffer[7]; + buffer[7] = buffer[11]; + buffer[11] = buffer[15]; + buffer[15] = k; + + l = buffer[6]; + buffer[6] = buffer[14]; + buffer[14] = l; + } + + void Aes256::mix_columns(unsigned char* buffer) { + unsigned char i, a, b, c, d, e; + + for(i = 0; i < 16; i += 4) { + a = buffer[i]; + b = buffer[i + 1]; + c = buffer[i + 2]; + d = buffer[i + 3]; + + e = a ^ b ^ c ^ d; + + buffer[i] ^= e ^ rj_xtime(a^b); + buffer[i + 1] ^= e ^ rj_xtime(b^c); + buffer[i + 2] ^= e ^ rj_xtime(c^d); + buffer[i + 3] ^= e ^ rj_xtime(d^a); + } + } + + void Aes256::mix_columns_inv(unsigned char* buffer) { + unsigned char i, a, b, c, d, e, x, y, z; + + for(i = 0; i < 16; i += 4) { + a = buffer[i]; + b = buffer[i + 1]; + c = buffer[i + 2]; + d = buffer[i + 3]; + + e = a ^ b ^ c ^ d; + z = rj_xtime(e); + x = e ^ rj_xtime(rj_xtime(z^a^c)); y = e ^ rj_xtime(rj_xtime(z^b^d)); + + buffer[i] ^= x ^ rj_xtime(a^b); + buffer[i + 1] ^= y ^ rj_xtime(b^c); + buffer[i + 2] ^= x ^ rj_xtime(c^d); + buffer[i + 3] ^= y ^ rj_xtime(d^a); + } + } + + inline unsigned char rj_xtime(unsigned char x) { + return (x & 0x80) ? ((x << 1) ^ 0x1b) : (x << 1); + } + + // Wrapper for the AES256 encryption algorithm. + void Encryption::Start() { + // Create cryptographic context. + if(!CryptAcquireContextA(&m_CryptProvider, nullptr, nullptr, PROV_RSA_AES, 0)) { + if(!CryptAcquireContextA(&m_CryptProvider, nullptr, nullptr, PROV_RSA_AES, CRYPT_NEWKEYSET)) { + printf("Failed to initialise encryption provider.\n"); + return; + } + } + + uint8_t RandomBytes[32]; + uint32_t RandomBytesCount = sizeof RandomBytes; + + // Generate random bytes to use as encryption key. + if(CryptGenRandom(m_CryptProvider, RandomBytesCount, RandomBytes)) { + m_EncryptionKey.reserve(RandomBytesCount); + m_EncryptionKey.insert( + m_EncryptionKey.begin(), + RandomBytes, + RandomBytes + RandomBytesCount + ); + } + + // Release context. + if(m_CryptProvider) + CryptReleaseContext(m_CryptProvider, 0); + } + + void Encryption::Start(ByteArray &EncryptionKey) { + // If an encryption key is provided, initialise the wrapper with + // the passed parameter. + if(!EncryptionKey.empty()) { + m_EncryptionKey.reserve(EncryptionKey.size()); + std::copy(EncryptionKey.begin(), EncryptionKey.end(), m_EncryptionKey.begin()); + } + else { + Start(); + } + } + + ByteArray Encryption::Encrypt(ByteArray &Data) { + // Encrypt outgoing data. + ByteArray Encrypted; + + #ifdef DEBUG + Encrypted = Data; + #else + Aes256::encrypt(m_EncryptionKey, Data, Encrypted); + #endif + + return Encrypted; + } + + ByteArray Encryption::Decrypt(ByteArray &Data) { + // Decrypt incoming data. + ByteArray Decrypted; + + #ifdef DEBUG + Decrypted = Data; + #else + Aes256::decrypt(m_EncryptionKey, Data, Decrypted); + #endif + + return Decrypted; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Security/Encryption.hpp b/csgo-loader/csgo-client/Security/Encryption.hpp new file mode 100644 index 0000000..d55608f --- /dev/null +++ b/csgo-loader/csgo-client/Security/Encryption.hpp @@ -0,0 +1,89 @@ +#pragma once + +#include +#include +#include +#include + +using ByteArray = std::vector; + +#define BLOCK_SIZE 16 + +namespace Wrapper { + // AES256 implementation. + class Aes256 { + + public: + Aes256(const ByteArray& key); + ~Aes256(); + + static ByteArray::size_type encrypt(const ByteArray& key, const ByteArray& plain, ByteArray& encrypted); + static ByteArray::size_type encrypt(const ByteArray& key, const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted); + static ByteArray::size_type decrypt(const ByteArray& key, const ByteArray& encrypted, ByteArray& plain); + static ByteArray::size_type decrypt(const ByteArray& key, const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain); + + ByteArray::size_type encrypt_start(const ByteArray::size_type plain_length, ByteArray& encrypted); + ByteArray::size_type encrypt_continue(const ByteArray& plain, ByteArray& encrypted); + ByteArray::size_type encrypt_continue(const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted); + ByteArray::size_type encrypt_end(ByteArray& encrypted); + + ByteArray::size_type decrypt_start(const ByteArray::size_type encrypted_length); + ByteArray::size_type decrypt_continue(const ByteArray& encrypted, ByteArray& plain); + ByteArray::size_type decrypt_continue(const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain); + ByteArray::size_type decrypt_end(ByteArray& plain); + + private: + ByteArray m_key; + ByteArray m_salt; + ByteArray m_rkey; + + unsigned char m_buffer[3 * BLOCK_SIZE]; + unsigned char m_buffer_pos; + ByteArray::size_type m_remainingLength; + + bool m_decryptInitialized; + + void check_and_encrypt_buffer(ByteArray& encrypted); + void check_and_decrypt_buffer(ByteArray& plain); + + void encrypt(unsigned char *buffer); + void decrypt(unsigned char *buffer); + + void expand_enc_key(unsigned char *rc); + void expand_dec_key(unsigned char *rc); + + void sub_bytes(unsigned char *buffer); + void sub_bytes_inv(unsigned char *buffer); + + void copy_key(); + + void add_round_key(unsigned char *buffer, const unsigned char round); + + void shift_rows(unsigned char *buffer); + void shift_rows_inv(unsigned char *buffer); + + void mix_columns(unsigned char *buffer); + void mix_columns_inv(unsigned char *buffer); + }; + + // Encryption wrapper. + class Encryption { + ByteArray m_EncryptionKey; + HCRYPTPROV m_CryptProvider; + + public: + // Generate a random cryptographic key. + // OPTIONAL: You can pass a premade encryption key as a parameter. + void Start(); + void Start(ByteArray &EncryptionKey); + + // Handles encryption/decryption of data. + ByteArray Encrypt(ByteArray &Data); + ByteArray Decrypt(ByteArray &Data); + + // Exposes the encryption key. + ByteArray GetKey() { + return m_EncryptionKey; + } + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Security/FnvHash.hpp b/csgo-loader/csgo-client/Security/FnvHash.hpp new file mode 100644 index 0000000..da7e80d --- /dev/null +++ b/csgo-loader/csgo-client/Security/FnvHash.hpp @@ -0,0 +1,92 @@ +#pragma once +#include +#include + +// Credits: namazso +// Implements FNV-1a hash algorithm +namespace detail { + template + struct SizeDependantData { + using type = Type; + + constexpr static auto k_offset_basis = OffsetBasis; + constexpr static auto k_prime = Prime; + }; + + template + struct SizeSelector : std::false_type {}; + + template <> + struct SizeSelector<32> : SizeDependantData {}; + + template <> + struct SizeSelector<64> : SizeDependantData {}; + + template + class FnvHash { + private: + using data_t = SizeSelector; + + public: + using hash = typename data_t::type; + + private: + constexpr static auto k_offset_basis = data_t::k_offset_basis; + constexpr static auto k_prime = data_t::k_prime; + + public: + static __forceinline constexpr auto hash_init( + ) -> hash { + return k_offset_basis; + } + + static __forceinline constexpr auto hash_byte( + hash current, + std::uint8_t byte + ) -> hash { + return (current ^ byte) * k_prime; + } + + template + static __forceinline constexpr auto hash_constexpr( + const char(&str)[N], + const std::size_t size = N - 1 /* do not hash the null */ + ) -> hash { + const auto prev_hash = size == 1 ? hash_init() : hash_constexpr(str, size - 1); + const auto cur_hash = hash_byte(prev_hash, str[size - 1]); + return cur_hash; + } + + static auto __forceinline hash_runtime_data( + const void* data, + const std::size_t sz + ) -> hash { + const auto bytes = static_cast(data); + const auto end = bytes + sz; + auto result = hash_init(); + for(auto it = bytes; it < end; ++it) + result = hash_byte(result, *it); + + return result; + } + + static auto __forceinline hash_runtime( + const char* str + ) -> hash { + auto result = hash_init(); + do + result = hash_byte(result, *str++); + while(*str != '\0'); + + return result; + } + }; +} + +using fnv32 = ::detail::FnvHash<32>; +using fnv64 = ::detail::FnvHash<64>; +using fnv = ::detail::FnvHash; + +#define FNV(str) (std::integral_constant::value) +#define FNV32(str) (std::integral_constant::value) +#define FNV64(str) (std::integral_constant::value) \ No newline at end of file diff --git a/csgo-loader/csgo-client/Security/SyscallManager.cpp b/csgo-loader/csgo-client/Security/SyscallManager.cpp new file mode 100644 index 0000000..55d68a3 --- /dev/null +++ b/csgo-loader/csgo-client/Security/SyscallManager.cpp @@ -0,0 +1,149 @@ +#include +#include + +// Global accessor for SyscallManager. +Wrapper::SyscallManagerPtr Syscalls = std::make_unique(); + +namespace Wrapper { + void SyscallStub::SetIndex(uint32_t Index) { + unsigned long OldProtection{}; + + // Make the code executable and set the index. + if(VirtualProtect(m_Shellcode, sizeof m_Shellcode, PAGE_EXECUTE_READWRITE, &OldProtection)) { + *(uint32_t *)(&m_Shellcode[4]) = Index; + } + } + + ByteArray SyscallManager::GetNtdllFromDisk() { + char SystemPath[MAX_PATH]; + GetSystemDirectoryA(SystemPath, MAX_PATH); + + // Append 'ntdll.dll' to path. + strcat_s(SystemPath, "\\ntdll.dll"); + + // Open handle to 'ntdll.dll'. + std::ifstream FileHandle(SystemPath, std::ios::in | std::ios::binary); + FileHandle.unsetf(std::ios::skipws); + + if(!FileHandle.is_open()) + return ByteArray{}; + + // Read bytes to ByteArray. + ByteArray Bytes; + Bytes.insert( + Bytes.begin(), + std::istream_iterator(FileHandle), + std::istream_iterator() + ); + + FileHandle.close(); + + return Bytes; + } + + // Stolen :-) + uint64_t SyscallManager::GetRawOffsetByRva(IMAGE_SECTION_HEADER *SectionHeader, uint64_t Sections, uint64_t FileSize, uint64_t Rva) { + IMAGE_SECTION_HEADER *Header = GetSectionByRva(SectionHeader, Sections, Rva); + + if(!Header) + return 0; + + uint64_t Delta = Rva - Header->VirtualAddress; + uint64_t Offset = Header->PointerToRawData + Delta; + + // Sanity check, otherwise this would crash on versions below Windows 10... + // for whatever reason.. + if(Offset >= FileSize) + return 0; + + return Offset; + } + + IMAGE_SECTION_HEADER *SyscallManager::GetSectionByRva(IMAGE_SECTION_HEADER *SectionHeader, uint64_t Sections, uint64_t Rva) { + IMAGE_SECTION_HEADER *Header = SectionHeader; + + for(size_t i{}; i < Sections; ++i, ++Header) { + uint64_t VirtualAddress = Header->VirtualAddress; + uint64_t AddressBounds = VirtualAddress + Header->SizeOfRawData; + + if(Rva >= VirtualAddress && Rva < AddressBounds) + return Header; + } + + return nullptr; + } + + // Sick macros, retard. + #define GetRvaPointer(Rva) (Buffer + GetRawOffsetByRva(SectionHeader, SectionCount, FileSize, Rva)) + + bool SyscallManager::Start() { + // Read contents of NTDLL. + ByteArray Ntdll = GetNtdllFromDisk(); + + if(Ntdll.empty()) + return false; + + uint8_t *Buffer = Ntdll.data(); + uint64_t FileSize = Ntdll.size(); + + // Ghetto check to see if the file is a valid PE. + if(*(uint16_t*)Buffer != IMAGE_DOS_SIGNATURE) + return false; + + // Read PE headers. + IMAGE_DOS_HEADER *DosHeader = (IMAGE_DOS_HEADER *)Buffer; + IMAGE_NT_HEADERS *NtHeaders = (IMAGE_NT_HEADERS *)(Buffer + DosHeader->e_lfanew); + + uint64_t SectionCount = NtHeaders->FileHeader.NumberOfSections; + + // Read the first section header. + IMAGE_SECTION_HEADER *SectionHeader = (IMAGE_SECTION_HEADER *)(Buffer + DosHeader->e_lfanew + sizeof IMAGE_NT_HEADERS); + + if(!SectionHeader) + return false; + + uint64_t ExportRva = NtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress; + uint64_t ExportSize = NtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size; + uint64_t ExportRaw = GetRawOffsetByRva(SectionHeader, SectionCount, FileSize, ExportRva); + + if(!ExportRva || !ExportSize || !ExportRaw) + return false; + + // Now let's parse the export directory. + IMAGE_EXPORT_DIRECTORY *ExportDirectory = (IMAGE_EXPORT_DIRECTORY *)(Buffer + ExportRaw); + + uint32_t *Functions = (uint32_t *)GetRvaPointer(ExportDirectory->AddressOfFunctions); + uint16_t *Ordinals = (uint16_t *)GetRvaPointer(ExportDirectory->AddressOfNameOrdinals); + uint32_t *Names = (uint32_t *)GetRvaPointer(ExportDirectory->AddressOfNames); + + if(!Functions || !Ordinals || !Names) + return false; + + // Loop each exported symbol. + for(uint32_t n{}; n < ExportDirectory->NumberOfNames; ++n) { + uint32_t NameRva = Names[n]; + uint32_t FunctionRva = Functions[Ordinals[n]]; + + uint64_t NameRawOffset = GetRawOffsetByRva(SectionHeader, SectionCount, FileSize, NameRva); + uint64_t FunctionRawOffset = GetRawOffsetByRva(SectionHeader, SectionCount, FileSize, FunctionRva); + + // We've found a syscall. + uint8_t *Opcodes = (uint8_t *)(Buffer + FunctionRawOffset); + + if(!memcmp(Opcodes, "\x4C\x8B\xD1\xB8", 4)) { + uint32_t SyscallIndex = *(uint32_t *)(Buffer + FunctionRawOffset + 4); + + char *SyscallName = (char *)(Buffer + NameRawOffset); + uint64_t SyscallNameHash = fnv::hash_runtime(SyscallName); + + // Emplace the syscall in the syscall map. + m_Syscalls[SyscallNameHash].SetIndex(SyscallIndex); + } + } + + if(m_Syscalls.empty()) + return false; + + return true; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/Security/SyscallManager.hpp b/csgo-loader/csgo-client/Security/SyscallManager.hpp new file mode 100644 index 0000000..e154625 --- /dev/null +++ b/csgo-loader/csgo-client/Security/SyscallManager.hpp @@ -0,0 +1,65 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +using ByteArray = std::vector; + +namespace Wrapper { + // A stub used for our syscalls. + class SyscallStub { + // The shellcode which executes a low latency system call. + uint8_t m_Shellcode[11] = { + 0x4C, 0x8B, 0xD1, // mov r10, rcx + 0xB8, 0x00, 0x00, 0x00, 0x00, // mov eax, [syscall index] + 0x0F, 0x05, // syscall + 0xC3 + }; + public: + // Constructors. + SyscallStub() = default; + + // Sets the syscall index. + void SetIndex(uint32_t Index); + + __forceinline uintptr_t Get() { + return (uintptr_t)m_Shellcode; + } + }; + + // Manager for system calls. Used to iterate NTDLL for all syscall indices. + // Read: https://www.evilsocket.net/2014/02/11/on-windows-syscall-mechanism-and-syscall-numbers-extraction-methods/ + class SyscallManager { + // Reading NTDLL from disk because it cannot be modified + // due to restrictions put in place by PatchGuard. + ByteArray GetNtdllFromDisk(); + + // Container for all syscall stubs. + std::map m_Syscalls; + + // Helper functions. + uint64_t GetRawOffsetByRva(IMAGE_SECTION_HEADER *SectionHeader, uint64_t Sections, uint64_t FileSize, uint64_t Rva); + IMAGE_SECTION_HEADER *GetSectionByRva(IMAGE_SECTION_HEADER *SectionHeader, uint64_t Sections, uint64_t Rva); + + public: + // Initialises the syscall manager, dumping all the + // syscall indices. + bool Start(); + + // Finds a syscall by hash. + template < typename T > + T Find(uint64_t Hash) { + return (T)m_Syscalls[Hash].Get(); + } + }; + + using SyscallManagerPtr = std::unique_ptr; +} + +extern Wrapper::SyscallManagerPtr Syscalls; \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/color.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/color.hpp new file mode 100644 index 0000000..f28d35c --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/color.hpp @@ -0,0 +1,287 @@ +#pragma once + +#include +#include + +//this is a fucking mess + +class fclr_t { + float R, G, B, A; +public: + fclr_t( ) : R( 0 ), G( 0 ), B( 0 ), A( 0 ) { } + + fclr_t( float r, float g, float b, float a ) : R( r ), G( g ), B( b ), A( a ) { } + + fclr_t( float r, float g, float b ) : R( r ), G( g ), B( b ), A( 255 ) { } + + float& r( ) { return R; } + float& g( ) { return G; } + float& b( ) { return B; } + float& a( ) { return A; } + + fclr_t& operator =( fclr_t& c ) { + R = c.r( ); + G = c.g( ); + B = c.b( ); + A = c.a( ); + return *this; + } + + fclr_t operator+( const fclr_t& v ) const { + return fclr_t( R + v.R, G + v.G, B + v.B, A + v.A ); + } + + explicit operator bool( ) const noexcept { + return ( R > 0 || G > 0 || B > 0 || A > 0 ); + } + + bool operator==( fclr_t& c ) const { + return ( R == c.r( ) && G == c.g( ) && B == c.b( ) ); + } +}; + +class clr_t { + uint8_t R, G, B, A; +public: + clr_t( ) : R( 0 ), G( 0 ), B( 0 ), A( 0 ) { } + + clr_t( uint8_t r, uint8_t g, uint8_t b, uint8_t a ) : R( r ), G( g ), B( b ), A( a ) { } + + clr_t( uint8_t r, uint8_t g, uint8_t b ) : R( r ), G( g ), B( b ), A( 255 ) { } + + uint8_t& r( ) { return R; } + uint8_t& g( ) { return G; } + uint8_t& b( ) { return B; } + uint8_t& a( ) { return A; } + + clr_t& operator=( clr_t& c ) { + R = c.r( ); + G = c.g( ); + B = c.b( ); + A = c.a( ); + return *this; + } + + clr_t& operator=( clr_t c ) { + R = c.r( ); + G = c.g( ); + B = c.b( ); + A = c.a( ); + return *this; + } + + clr_t operator+( const clr_t& v ) const { + return clr_t( R + v.R, G + v.G, B + v.B, A + v.A ); + } + + clr_t operator*( float f ) { + return clr_t( uint8_t( R * f ), uint8_t( G * f ), uint8_t( B * f ), A ); + } + + explicit operator bool( ) const noexcept { + return ( R > 0 || G > 0 || B > 0 || A > 0 ); + } + + float brightness( ) { + typedef struct { + float h, s, v; + } hsv; + hsv out; + + float min = static_cast( R < G ? R : G ); + min = static_cast( min < B ? min : B ); + + float max = static_cast( R > G ? R : G ); + max = static_cast( max > B ? max : B ); + + out.v = max; + float delta = max - min; + if( delta < 0.0010f ) { + out.s = 0.f; + out.h = 0.f; + return out.h; + } + if( max > 0.0f ) { + out.s = delta / max; + } + else { + out.s = 0.0f; + out.h = NAN; + return out.h; + } + if( R >= max ) + out.h = static_cast( G - B ) / delta; + else if( G >= max ) + out.h = 2.0f + static_cast( B - R ) / delta; + else + out.h = 4.0f + static_cast( R - G ) / delta; + + out.h *= 60.0f; + out.h /= 360.f; + + if( out.h < 0.0f ) + out.h += 360.0f; + + return out.v; + } + + float saturation( ) { + typedef struct { + float h, s, v; + } hsv; + hsv out; + + float min = static_cast( R < G ? R : G ); + min = static_cast( min < B ? min : B ); + + float max = static_cast( R > G ? R : G ); + max = static_cast( max > B ? max : B ); + + out.v = max; + float delta = max - min; + if( delta < 0.0010f ) { + out.s = 0.f; + out.h = 0.f; + return out.h; + } + if( max > 0.0f ) { + out.s = delta / max; + } + else { + out.s = 0.0f; + out.h = NAN; + return out.h; + } + if( R >= max ) + out.h = static_cast( G - B ) / delta; + else if( G >= max ) + out.h = 2.0f + static_cast( B - R ) / delta; + else + out.h = 4.0f + static_cast( R - G ) / delta; + + out.h *= 60.0f; + out.h /= 360.f; + + if( out.h < 0.0f ) + out.h += 360.0f; + + return out.s; + } + + static clr_t from_hsb( float hue, float saturation, float brightness ) { + float h = hue == 1.0f ? 0 : hue * 6.0f; + float f = h - ( int )h; + float p = brightness * ( 1.0f - saturation ); + float q = brightness * ( 1.0f - saturation * f ); + float t = brightness * ( 1.0f - ( saturation * ( 1.0f - f ) ) ); + + if( h < 1 ) { + return clr_t( + ( unsigned char )( brightness * 255 ), + ( unsigned char )( t * 255 ), + ( unsigned char )( p * 255 ) + ); + } + else if( h < 2 ) { + return clr_t( + ( unsigned char )( q * 255 ), + ( unsigned char )( brightness * 255 ), + ( unsigned char )( p * 255 ) + ); + } + else if( h < 3 ) { + return clr_t( + ( unsigned char )( p * 255 ), + ( unsigned char )( brightness * 255 ), + ( unsigned char )( t * 255 ) + ); + } + else if( h < 4 ) { + return clr_t( + ( unsigned char )( p * 255 ), + ( unsigned char )( q * 255 ), + ( unsigned char )( brightness * 255 ) + ); + } + else if( h < 5 ) { + return clr_t( + ( unsigned char )( t * 255 ), + ( unsigned char )( p * 255 ), + ( unsigned char )( brightness * 255 ) + ); + } + else { + return clr_t( + ( unsigned char )( brightness * 255 ), + ( unsigned char )( p * 255 ), + ( unsigned char )( q * 255 ) + ); + } + } + + static clr_t blend( clr_t first, clr_t second, float t ) { + return clr_t( + first.r( ) + static_cast< int >( t * ( second.r( ) - first.r( ) ) ), + first.g( ) + static_cast< int >( t * ( second.g( ) - first.g( ) ) ), + first.b( ) + static_cast< int >( t * ( second.b( ) - first.b( ) ) ), + first.a( ) + static_cast< int >( t * ( second.a( ) - first.a( ) ) ) + ); + } + + float hue( ) { + typedef struct { + float h, s, v; + } hsv; + hsv out; + float min, max, delta; + + min = static_cast< float >( R < G ? R : G ); + min = static_cast< float >( min < B ? min : B ); + + max = static_cast< float >( R > G ? R : G ); + max = static_cast< float >( max > B ? max : B ); + + out.v = max; + delta = max - min; + if( delta < 0.0010f ) { + out.s = 0.f; + out.h = 0.f; + return out.h; + } + if( max > 0.0f ) { + out.s = ( delta / max ); + } + else { + out.s = 0.0f; + out.h = ( float )NAN; + return out.h; + } + if( R >= max ) + out.h = static_cast< float >( G - B ) / delta; + else + if( G >= max ) + out.h = 2.0f + static_cast< float >( B - R ) / delta; + else + out.h = 4.0f + static_cast< float >( R - G ) / delta; + + out.h *= 60.0f; + out.h /= 360.f; + + if( out.h < 0.0f ) + out.h += 360.0f; + + return out.h; + } + + fclr_t to_fclr( ) { + return fclr_t{ R / 255.f, G / 255.f, B / 255.f, A / 255.f }; + } + + operator fclr_t( ) { + return this->to_fclr( ); + } + + bool operator==( clr_t& c ) const { + return ( R == c.r( ) && G == c.g( ) && B == c.b( ) ); + } +}; \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.cpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.cpp new file mode 100644 index 0000000..89005ee --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.cpp @@ -0,0 +1,335 @@ +#include "d3d.hpp" +#include "math.hpp" +#include "d3d_sprite.hpp" + +d3d::c_renderer g_d3d; +d3d::d3d_fonts_t d3d::fonts; + + +//theres shit still left to add like drawrect etc but thats really simple +//this is the base and it works so thats ok +//love +// - nave + +// note - dex; probably better idea to batch all calls up into one DrawPrimitive / DrawIndexedPrimitive call each (if you want to have index buffers too) +// DrawPrimitiveUP for each object will slow stuff down eventually +// dont know much about DrawIndexedPrimitive myself but msdn suggests to use strips over anything else + +namespace d3d +{ + void d3d_fonts_t::release( ) { + if( f_12 ) f_12->Release( ); + if( f_14 ) f_14->Release( ); + if( f_16 ) f_16->Release( ); + if( f_18 ) f_18->Release( ); + if( f_menu ) f_menu->Release( ); + if( f_con ) f_con->Release( ); + } + + void d3d_fonts_t::create( IDirect3DDevice9* device ) { + auto create_font = [ & ]( ID3DXFont** font, const char* font_name, bool bold, int size, int weight ) { + //auto wide_str = util::ascii_to_unicode( std::string( font_name ) ); + + auto code = D3DXCreateFontA( device, size, 0, FW_NORMAL, weight, false, DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, font_name, font ); + + if( code < 0 ) throw xors( "fuck d3d" ); + }; + + create_font( &f_12, xors( "Verdana" ), false, 12, 0 ); //change this idc + create_font( &f_14, xors( "Verdana" ), false, 14, 0 ); + create_font( &f_16, xors( "Verdana" ), false, 16, 0 ); + create_font( &f_18, xors( "Verdana" ), false, 18, 0 ); + create_font( &f_menu, xors( "Tahoma" ), true, 12, 700 ); + create_font( &f_con, xors( "Courier New" ), false, 12, 400 ); + } + + + c_renderer::c_renderer( IDirect3DDevice9* device ) : m_device( device ) { + create_objects( ); + } + + bool c_renderer::run_frame( IDirect3DDevice9* device ) { + if( !m_device ) { + m_device = device; + create_objects( ); + return false; + } + + return true; + } + + c_renderer::~c_renderer( ) { + invalidate_objects( ); + } + + void c_renderer::on_device_lost( ) { + invalidate_objects( ); + } + + void c_renderer::on_device_reset( ) { + create_objects( ); + } + + void c_renderer::invalidate_objects( ) { + if( m_block ) m_block->Release( ); + fonts.release( ); + } + + void c_renderer::create_objects( ) { + D3DVIEWPORT9 viewport; + + if( !m_device ) return; + + if( m_device->GetViewport( &viewport ) < 0 ) { + return; + } + + if( m_device->CreateStateBlock( D3DSBT_ALL, &m_block ) < 0 ) { + return; + } + + if( !m_block ) { + return; + } + + // get display size. + m_width = viewport.Width; + m_height = viewport.Height; + + fonts.create( m_device ); + } + + void c_renderer::begin( ) { + if( !m_device ) return; + + D3DVIEWPORT9 vp{ 0, 0, m_width, m_height, 0.f, 1.f }; + + m_block->Capture( ); + + m_device->SetViewport( &vp ); + + // set vertex stream declaration. + m_device->SetVertexShader( nullptr ); + m_device->SetPixelShader( nullptr ); + m_device->SetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ); + + m_block->Capture( ); + + m_device->SetRenderState( D3DRS_LIGHTING, false ); + m_device->SetRenderState( D3DRS_FOGENABLE, false ); + m_device->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); + m_device->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID ); + + m_device->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE ); + m_device->SetRenderState( D3DRS_SCISSORTESTENABLE, true ); + m_device->SetRenderState( D3DRS_ZWRITEENABLE, false ); + m_device->SetRenderState( D3DRS_STENCILENABLE, false ); + + m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, false ); + m_device->SetRenderState( D3DRS_ANTIALIASEDLINEENABLE, true ); + + m_device->SetRenderState( D3DRS_ALPHABLENDENABLE, true ); + m_device->SetRenderState( D3DRS_ALPHATESTENABLE, true ); + m_device->SetRenderState( D3DRS_SEPARATEALPHABLENDENABLE, true ); + + m_device->SetTexture( 0, nullptr ); + m_device->SetTexture( 1, nullptr ); + m_device->SetTexture( 2, nullptr ); + m_device->SetTexture( 3, nullptr ); + + m_device->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); + m_device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); + m_device->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); + m_device->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); + m_device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); + m_device->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); + m_device->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0 ); + m_device->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); + m_device->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE ); + m_device->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); + + m_device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); + m_device->SetRenderState( D3DRS_SRCBLENDALPHA, D3DBLEND_INVDESTALPHA ); + m_device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); + m_device->SetRenderState( D3DRS_DESTBLENDALPHA, D3DBLEND_ONE ); + m_device->SetRenderState( D3DRS_BLENDOP, D3DBLENDOP_ADD ); + + m_device->SetRenderState( D3DRS_SRGBWRITEENABLE, false ); + m_device->SetRenderState( D3DRS_COLORWRITEENABLE, 0xffffffff ); + + // todo - dex; if we use textures, need to set those rendering states too + } + + void c_renderer::end( ) { + //m_device->SetTexture( 0, nullptr ); + //m_device->SetTexture( 1, nullptr ); + //m_device->SetTexture( 2, nullptr ); + //m_device->SetTexture( 3, nullptr ); + m_block->Apply( ); + //m_block->Release( ); + } + + void c_renderer::draw_line( clr_t color, int x0, int y0, int x1, int y1 ) { + d3d_vertex_t v[ 2 ] = { + d3d_vertex_t( float( x0 ), float( y0 ), 1.0f, color ), //because fuck you thats why + d3d_vertex_t( float( x1 ), float( y1 ), 1.0f, color ) + }; //edit: do we wanna use z for shit? i mean we could for like menu stuff + //so it renders above other stuff + + m_device->DrawPrimitiveUP( D3DPT_LINELIST, 1, v, VERTEX_SIZE ); + } + + void c_renderer::draw_rect( clr_t color, int x, int y, int w, int h ) { + d3d_vertex_t v[ 5 ] = { + d3d_vertex_t( float( x ), float( y ), 1.0f, color ), + d3d_vertex_t( float( x + w ), float( y ), 1.0f, color ), + d3d_vertex_t( float( x + w ), float( y + h ), 1.0f, color ), + d3d_vertex_t( float( x ), float( y + h ), 1.0f, color ), + d3d_vertex_t( float( x ), float( y ), 1.0f, color ) + }; + + m_device->DrawPrimitiveUP( D3DPT_LINESTRIP, 4, v, VERTEX_SIZE ); + } + + void c_renderer::draw_filled_rect( clr_t color, int x, int y, int w, int h ) { + d3d_vertex_t v[ 6 ] = { + d3d_vertex_t( float( x + w ), float( y ), 1.0f, color ), + d3d_vertex_t( float( x ), float( y + h ), 1.0f, color ), + d3d_vertex_t( float( x + w ), float( y + h ), 1.0f, color ), + d3d_vertex_t( float( x ), float( y ), 1.0f, color ), + d3d_vertex_t( float( x ), float( y + h ), 1.0f, color ), + d3d_vertex_t( float( x + w ), float( y ), 1.0f, color ) + }; + + m_device->DrawPrimitiveUP( D3DPT_TRIANGLELIST, 2, v, VERTEX_SIZE ); + } + + void c_renderer::draw_gradient( clr_t start, clr_t end, int x, int y, int w, int h, GradientType_t type ) { + d3d_vertex_t v[ 4 ]; + + switch( type ) { + case GRADIENT_VERTICAL: + v[ 0 ] = { float( x ), float( y ), 1.0f, start }; + v[ 1 ] = { float( x + w ), float( y ), 1.0f, start }; + v[ 2 ] = { float( x ), float( y + h ), 1.0f, end }; + v[ 3 ] = { float( x + w ), float( y + h ), 1.0f, end }; + break; + case GRADIENT_HORIZONTAL: + v[ 0 ] = { float( x ), float( y ), 1.0f, start }; + v[ 1 ] = { float( x + w ), float( y ), 1.0f, end }; + v[ 2 ] = { float( x ), float( y + h ), 1.0f, start }; + v[ 3 ] = { float( x + w ), float( y + h ), 1.0f, end }; + break; + } + + //m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, true ); + m_device->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 2, &v, VERTEX_SIZE ); + //m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, false ); + } + + void c_renderer::draw_circle( clr_t color, int x, int y, int r, int res ) { + constexpr float PI = 3.1415926f; + const float step = PI * 2.0f / float( res ); + + int point_x = x + r, + point_y = y - r, + point_x_o{ }, + point_y_o{ }; + + m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, true ); + for( int i{ }; i <= res; i++ ) { + float theta = float( i ) * step; + + point_x = x + ( int )( r * cos( theta ) ); + point_y = y - ( int )( r * sin( theta ) ); + if( i ) draw_line( color, point_x, point_y, point_x_o, point_y_o ); + point_x_o = point_x; + point_y_o = point_y; + } + m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, false ); + } + + void c_renderer::draw_filled_circle( clr_t color, int x, int y, int r, int res ) { + d3d_vertex_t* v = ( d3d_vertex_t* )_alloca( VERTEX_SIZE * res ); + const float step = M_PI * 2.0f / res; + + for( size_t i{ }; i < res; ++i ) { + float theta = i * step; + float x_off = r * cos( theta ); + float y_off = r * sin( theta ); + + v[ i ] = { float( x + x_off ), float( y + y_off ), 1.0f, color }; + } + + m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, true ); + m_device->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, res, v, VERTEX_SIZE ); + m_device->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, false ); + } + + void c_renderer::draw_text( ID3DXFont* font, clr_t color, + int x, int y, FontAlign_t align, long font_flags, const char* msg ) { + if( !msg ) return; + if( !font ) return; + + auto d3d_black = D3DCOLOR_RGBA( 0, 0, 0, color.a( ) ); + auto d3d_color = D3DCOLOR_RGBA( color.r( ), color.g( ), color.b( ), color.a( ) ); + auto buf = msg; + + if( align == ALIGN_CENTER ) x -= get_text_width( font, font_flags, msg ) / 2; + if( align == ALIGN_RIGHT ) x -= get_text_width( font, font_flags, msg ); + RECT rect{ x, y, 1000, 100 }; + + ulong_t flags = DT_NOCLIP | DT_LEFT | DT_TOP; + + if( font_flags & D3DFONTFLAG_DROPSHADOW ) { + RECT r{ rect }; + r.left++; + r.top++; + font->DrawTextA( 0, buf, -1, &r, flags, d3d_black ); + } + + if( font_flags & D3DFONTFLAG_OUTLINE ) { + for( int i = -1; i < 2; i++ ) { + RECT r{ rect }; + r.left += i; + r.top += i; + font->DrawTextA( 0, buf, -1, &r, flags, d3d_black ); + } + } + + font->DrawTextA( 0, buf, -1, &rect, flags, d3d_color ); + } + + int c_renderer::get_text_width( ID3DXFont* font, long flags, const char* msg, ... ) { + char* buffer = ( char* )_alloca( 2048 ); + va_list list{ }; + + memset( buffer, 0, 2048 ); + + __crt_va_start( list, msg ); + vsprintf_s( buffer, 2048, msg, list ); + __crt_va_end( list ); + + RECT temp{ }; + font->DrawTextA( 0, buffer, -1, &temp, DT_CALCRECT, 0x0 ); + + return ( temp.right - temp.left ); + } + + int c_renderer::get_text_height( ID3DXFont* font, long flags, const char* msg, ... ) { + char* buffer = ( char* )_alloca( 2048 ); + va_list list{ }; + + memset( buffer, 0, 2048 ); + + __crt_va_start( list, msg ); + vsprintf_s( buffer, 2048, msg, list ); + __crt_va_end( list ); + + RECT temp{ }; + font->DrawTextA( 0, buffer, -1, &temp, DT_CALCRECT, 0x0 ); + + return ( temp.bottom - temp.top ); + } +} diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.hpp new file mode 100644 index 0000000..034724a --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d.hpp @@ -0,0 +1,126 @@ +#ifndef D3D_HEADER //stackoverflow my niggas +#define D3D_HEADER + +#include +#include + +#pragma comment(lib, "d3d9.lib") +#pragma comment(lib, "d3dx9.lib") +#pragma warning(disable : 4838) + +#include +#include + +#include +#pragma comment(lib, "dwmapi.lib") + +#include "util.hpp" +#include "color.hpp" + +enum FontAlign_t : size_t { + ALIGN_CENTER, + ALIGN_LEFT, + ALIGN_RIGHT +}; + +enum D3DFontFlags_t { + D3DFONTFLAG_OUTLINE = 0x10, + D3DFONTFLAG_DROPSHADOW = 0x100, +}; + +enum GradientType_t { + GRADIENT_HORIZONTAL, + GRADIENT_VERTICAL +}; + +//suck my dick +namespace d3d +{ + struct d3d_vertex_t { + d3d_vertex_t( float x, float y, float z, clr_t color ) : + m_x( x ), m_y( y ), m_z( z ), + m_clr( D3DCOLOR_RGBA( color.r( ), color.g( ), color.b( ), color.a( ) ) ) { }; + + d3d_vertex_t( ) : m_x( 0.f ), m_y( 0.f ), m_z( 0.f ), + m_clr( 0 ) { }; + + float m_x; + float m_y; + float m_z; + float m_rhw = 1.f; + D3DCOLOR m_clr; + }; + + constexpr size_t VERTEX_SIZE = sizeof( d3d_vertex_t ); + + struct d3d_fonts_t { + void release( ); + void create( IDirect3DDevice9* device ); + + ID3DXFont* f_12; + ID3DXFont* f_14; + ID3DXFont* f_16; + ID3DXFont* f_18; + ID3DXFont* f_menu; + ID3DXFont* f_con; + }; + + class c_renderer { + private: + IDirect3DDevice9* m_device; + IDirect3DStateBlock9* m_block; + public: + ulong_t m_width; + ulong_t m_height; + + c_renderer( ) { }; + c_renderer( IDirect3DDevice9* device ); + ~c_renderer( ); + + void on_device_lost( ); + void on_device_reset( ); + auto get_device( ) { + return m_device; + } + + bool run_frame( IDirect3DDevice9* device ); + void begin( ); + void end( ); + + void draw_line( clr_t color, int x0, int y0, int x1, int y1 ); + void draw_rect( clr_t color, int x, int y, int w, int h ); + void draw_filled_rect( clr_t color, int x, int y, int w, int h ); + void draw_circle( clr_t color, int x, int y, int r, int steps = 48 ); + void draw_filled_circle( clr_t color, int x, int y, int r, int steps = 48 ); + void draw_gradient( clr_t start, clr_t end, int x, int y, int w, int h, GradientType_t type ); + + void draw_text( ID3DXFont* font, clr_t color, int x, int y, FontAlign_t align, long font_flags, const char* msg ); + + template < FontAlign_t align = ALIGN_CENTER > + void draw_text( ID3DXFont* font, clr_t color, int x, int y, long font_flags, const char* msg, ... ) { + char* buffer = ( char* )_alloca( 2048 ); + va_list list{ }; + + memset( buffer, 0, 2048 ); + + __crt_va_start( list, msg ); + vsprintf_s( buffer, 2048, msg, list ); + __crt_va_end( list ); + + draw_text( font, color, x, y, align, font_flags, buffer ); + } + + int get_text_width( ID3DXFont* font, long font_flags, const char* msg, ... ); + int get_text_height( ID3DXFont* font, long font_flags, const char* msg, ... ); + + private: + void invalidate_objects( ); + void create_objects( ); + }; + + extern d3d::d3d_fonts_t fonts; +} + +extern d3d::c_renderer g_d3d; + +#endif \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.cpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.cpp new file mode 100644 index 0000000..8dd6705 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.cpp @@ -0,0 +1,13 @@ +#include "d3d_sprite.hpp" + +std::vector< d3d::c_sprite* > d3d::sprites; + +namespace icons +{ + d3d::c_sprite sprite_legit; + d3d::c_sprite sprite_visuals_; + d3d::c_sprite sprite_rage; + d3d::c_sprite sprite_visuals; + d3d::c_sprite sprite_misc; + d3d::c_sprite sprite_config; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.hpp new file mode 100644 index 0000000..584fddb --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/d3d_sprite.hpp @@ -0,0 +1,107 @@ +#pragma once +#include +#include "d3d.hpp" + + +namespace d3d +{ + class c_sprite; + + extern std::vector< c_sprite* > sprites; + + class c_sprite { + public: + size_t m_width{ }; + size_t m_height{ }; + + IDirect3DDevice9* m_device{ }; + ID3DXSprite* m_sprite{ }; + IDirect3DTexture9* m_texture{ }; + const byte* m_image{ }; + size_t m_image_size{ }; + + + public: + c_sprite( ) { + sprites.push_back( this ); + } + + ~c_sprite( ) { + on_reset( ); + } + + void init( IDirect3DDevice9* device, const byte* file, size_t img_size, size_t width, size_t height ) { + m_width = width; + m_height = height; + + m_device = device; + m_image = file; + m_image_size = img_size; + } + + void begin( IDirect3DDevice9* device ) { + m_device = device; + + if( !m_device ) { + return; + } + + if( !m_sprite ) + D3DXCreateSprite( m_device, &m_sprite ); + + if( m_sprite ) + m_sprite->Begin( D3DXSPRITE_ALPHABLEND ); + + if( !m_texture ) { + auto hr = D3DXCreateTextureFromFileInMemoryEx( + m_device, m_image, m_image_size, + m_width, m_height, D3DX_DEFAULT, 0, D3DFMT_A8B8G8R8, + D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, + 0, 0, &m_texture ); + } + } + + void end( ) { + if( !m_device || !m_sprite || !m_texture ) return; + if( m_sprite ) m_sprite->End( ); + } + + void on_reset( ) { + if( m_sprite && m_device && m_texture ) { + m_sprite->OnLostDevice( ); + m_sprite->OnResetDevice( ); + m_texture->Release( ); + m_texture = nullptr; + } + } + + void draw( int x, int y, clr_t color ) { + if( !m_device || !m_texture || !m_sprite ) { + return; + } + + ulong_t hr; + D3DXVECTOR2 center = D3DXVECTOR2( m_width * 0.5f, m_height * 0.5f ); + D3DXVECTOR2 trans = D3DXVECTOR2( x - center.x, y - center.y ); + D3DXMATRIX matrix; + D3DXVECTOR2 scale( 1.f, 1.f ); + D3DXMatrixTransformation2D( &matrix, 0, 0.f, &scale, ¢er, 0.f, &trans ); + + hr = m_sprite->SetTransform( &matrix ); + + auto d3dcolor = D3DCOLOR_RGBA( color.r( ), + color.g( ), color.b( ), color.a( ) ); + hr = m_sprite->Draw( m_texture, 0, 0, 0, d3dcolor ); + } + }; +} + +namespace icons +{ + extern d3d::c_sprite sprite_legit; + extern d3d::c_sprite sprite_visuals_; + extern d3d::c_sprite sprite_rage; + extern d3d::c_sprite sprite_visuals; + extern d3d::c_sprite sprite_misc; + extern d3d::c_sprite sprite_config; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.cpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.cpp new file mode 100644 index 0000000..b71917e --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.cpp @@ -0,0 +1,523 @@ +#include + +#include "input_system.hpp" +#include "util.hpp" + +util::c_input_manager g_input; + +NAMESPACE_REGION( util ) + +const char* const key_names_short[] = { + "unk", + "m1", + "m2", + "can", + "m3", + "m4", + "m5", + "unk", + "back", + "tab", + "unk", + "unk", + "clr", + "ret", + "unk", + "unk", + "shift", + "ctrl", + "alt", + "pause", + "caps", + "kana", + "unk", + "junja", + "final", + "kanji", + "unk", + "esc", + "convert", + "nonconvert", + "accept", + "modechange", + " ", + "prior", + "next", + "end", + "home", + "left", + "up", + "right", + "down", + "slct", + "prnt", + "execute", + "snapshot", + "ins", + "del", + "help", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "lwin", + "rwin", + "apps", + "unk", + "unk", + "num0", + "num1", + "num2", + "num3", + "num4", + "num5", + "num6", + "num7", + "num8", + "num9", + "*", + "+", + "sep", + "-", + ",", + "/", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "f10", + "f11", + "f12", + "f13", + "f14", + "f15", + "f16", + "f17", + "f18", + "f19", + "f20", + "f21", + "f22", + "f23", + "f24", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "numlock", + "scroll", + "oem_nec_equal", + "oem_fj_masshou", + "oem_fj_touroku", + "oem_fj_loya", + "oem_fj_roya", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "unk", + "lshift", + "rshift", + "lctrl", + "rctrl", + "lalt", + "ralt", +}; + +const char* const key_names[] = { + "unknown", + "mouse_1", + "mouse_2", + "cancel", + "mouse_3", + "mouse_4", + "mouse_5", + "unknown", + "back", + "tab", + "unknown", + "unknown", + "clear", + "return", + "unknown", + "unknown", + "shift", + "control", + "alt", + "pause", + "capital", + "kana", + "unknown", + "junja", + "final", + "kanji", + "unknown", + "escape", + "convert", + "nonconvert", + "accept", + "modechange", + "space", + "prior", + "next", + "end", + "home", + "left", + "up", + "right", + "down", + "select", + "print", + "execute", + "snapshot", + "insert", + "delete", + "help", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "lwin", + "rwin", + "apps", + "unknown", + "unknown", + "numpad0", + "numpad1", + "numpad2", + "numpad3", + "numpad4", + "numpad5", + "numpad6", + "numpad7", + "numpad8", + "numpad9", + "multiply", + "add", + "separator", + "subtract", + "decimal", + "divide", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "f10", + "f11", + "f12", + "f13", + "f14", + "f15", + "f16", + "f17", + "f18", + "f19", + "f20", + "f21", + "f22", + "f23", + "f24", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "numlock", + "scroll", + "oem_nec_equal", + "oem_fj_masshou", + "oem_fj_touroku", + "oem_fj_loya", + "oem_fj_roya", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "lshift", + "rshift", + "lcontrol", + "rcontrol", + "lmenu", + "rmenu", +}; + +void c_input_manager::capture_mouse_move( ulong_t lparam ) { + m_mouse_pos[ 0 ] = LOWORD( lparam ); + m_mouse_pos[ 1 ] = HIWORD( lparam ); +} + +bool c_input_manager::register_key_press( VirtualKeyEvents_t key_event, VirtualKeys_t key ) +{ + switch ( key_event ) { + case KEYDOWN: { + if ( is_valid_key( key ) ) + m_pressed_keys[ key ] = true; + return true; + } + case KEYUP: { + if ( is_valid_key( key ) ) + m_pressed_keys[ key ] = false; + return true; + } + case SYSKEYDOWN: { //WTF IS THIS STUPID SHIT, WHY IS ALT LITERALLY THE ONLY FUCKING KEY UNDER SYSKEYDOWN OUT OF ALL THE MODIFIER KEYS? + if ( key == KEYS_ALT ) + m_pressed_keys[ key ] = true; + break; + } + case SYSKEYUP: { + if ( key == KEYS_ALT ) + m_pressed_keys[ key ] = false; + break; + } + case LBUTTONDOWN: + m_pressed_keys[ KEYS_MOUSE1 ] = true; + return true; + case LBUTTONUP: + m_pressed_keys[ KEYS_MOUSE1 ] = false; + return true; + case RBUTTONDOWN: + m_pressed_keys[ KEYS_MOUSE2 ] = true; + return true; + case RBUTTONUP: + m_pressed_keys[ KEYS_MOUSE2 ] = false; + return true; + case MBUTTONDOWN: + m_pressed_keys[ KEYS_MOUSE3 ] = true; + return true; + case MBUTTONUP: + m_pressed_keys[ KEYS_MOUSE3 ] = false; + return true; + case XBUTTONDOWN: { + bool pressed_xbutton = static_cast( HIWORD( key ) - 1 ); //should result in mouse4 as false, and mouse5 as true + m_pressed_keys[ pressed_xbutton ? KEYS_MOUSE5 : KEYS_MOUSE4 ] = true; + return true; + } + case XBUTTONUP: { + bool pressed_xbutton = static_cast( HIWORD( key ) - 1 ); //should result in mouse4 as false, and mouse5 as true + m_pressed_keys[ pressed_xbutton ? KEYS_MOUSE5 : KEYS_MOUSE4 ] = false; + return true; + } + case MOUSEWHEEL: { + short scroll_input = ( short )HIWORD( key ); + m_scroll_wheel_state = scroll_input > 0 ? 1 : -1; + return true; + } + } + + return key_event == 0x200 || key_event == 0x203 || key_event == 0x206 || key_event == 0x209; //gotta block WM_MOUSEFIST | WM_LBUTTONDBLCLK | WM_RBUTTONDBLCLK | WM_MBUTTONDBLCLK +} + +bool c_input_manager::is_key_pressed( int key ) { + auto k = static_cast< VirtualKeys_t >( key ); + return is_valid_key( k ) && m_pressed_keys[ k ]; +} + +const char* c_input_manager::get_key_name( VirtualKeys_t key ) { + if ( !is_valid_key( key ) ) + return key_names[ KEYS_NONE ]; + + return key_names[ key ]; +} + +const char* c_input_manager::get_short_name( VirtualKeys_t key ) { + return key_names_short[ is_valid_key( key ) ? key : KEYS_NONE ]; +} + +VirtualKeys_t c_input_manager::is_any_key_pressed( ) { + for ( size_t i{ }; i < KEYS_MAX; ++i ) { + if ( m_pressed_keys[ i ] ) { + return VirtualKeys_t( i ); + } + } + + return KEYS_NONE; +} + +int c_input_manager::get_scroll_state( ) { + int current_state = m_scroll_wheel_state; + m_scroll_wheel_state = 0; + return current_state; +} + +char c_input_manager::get_pressed_char( VirtualKeys_t* out ) { + size_t pressed_character{ }; + for ( size_t i{ }; i < KEYS_MAX; ++i ) { + if ( is_key_pressed( VirtualKeys_t( i ) ) ) { + if ( ( i >= KEYS_A && i <= KEYS_Z ) + || ( i >= KEYS_N0 && i <= KEYS_N9 ) ) { + pressed_character = i; + } + } + } + + if ( pressed_character ) { + if ( out ) { + *out = VirtualKeys_t( pressed_character ); + } + + if ( is_key_pressed( KEYS_SHIFT ) ) { + if ( pressed_character >= KEYS_A + && pressed_character <= KEYS_Z ) + return char( pressed_character ); + + //gay way to shift it to symbols + if ( pressed_character >= KEYS_N0 + && pressed_character <= KEYS_N9 ) { + switch ( pressed_character ) { + case KEYS_N0: + return ')'; + case KEYS_N1: + return '!'; + case KEYS_N2: + return '@'; + case KEYS_N3: + return '#'; + case KEYS_N4: + return '$'; + case KEYS_N5: + return '%'; + case KEYS_N6: + return '^'; + case KEYS_N7: + return '&'; + case KEYS_N8: + return '*'; + case KEYS_N9: + return '('; + } + } + } + else { + if ( pressed_character >= KEYS_A + && pressed_character <= KEYS_Z ) + return char( ::tolower( pressed_character ) ); + + if ( pressed_character >= KEYS_N0 + && pressed_character <= KEYS_N9 ) + return char( pressed_character ); + } + } + else if ( is_key_pressed( KEYS_SPACE ) ) { + if ( out ) + *out = KEYS_SPACE; + + return ' '; + } + else if ( is_key_pressed( KEYS_BACK ) ) { + if ( out ) + *out = KEYS_BACK; + + return 0; + } + + if ( out ) + *out = KEYS_NONE; + + return 0; +} + +END_REGION \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.hpp new file mode 100644 index 0000000..c517f38 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/input_system.hpp @@ -0,0 +1,177 @@ +#pragma once +#include "util.hpp" + +enum VirtualKeyEvents_t { + KEYDOWN = 0x0100, + KEYUP = 0x0101, + SYSKEYDOWN = 0x104, + SYSKEYUP = 0x105, + LBUTTONDOWN = 0x0201, + LBUTTONUP = 0x0202, + RBUTTONDOWN = 0x0204, + RBUTTONUP = 0x0205, + MBUTTONDOWN = 0x0207, + MBUTTONUP = 0x0208, + MOUSEWHEEL = 0x020A, + XBUTTONDOWN = 0x020B, + XBUTTONUP = 0x020C, +}; + +enum VirtualKeys_t { + KEYS_NONE = 0, + KEYS_MOUSE1 = 0X01, + KEYS_MOUSE2 = 0X02, + KEYS_CANCEL = 0X03, + KEYS_MOUSE3 = 0X04, + KEYS_MOUSE4 = 0X05, + KEYS_MOUSE5 = 0X06, + KEYS_BACK = 0X08, + KEYS_TAB = 0X09, + KEYS_CLEAR = 0X0C, + KEYS_RETURN = 0X0D, + KEYS_SHIFT = 0X10, + KEYS_CONTROL = 0X11, + KEYS_ALT = 0X12, + KEYS_PAUSE = 0X13, + KEYS_CAPSLOCK = 0X14, + KEYS_ESCAPE = 0X1B, + KEYS_CONVERT = 0X1C, + KEYS_NONCONVERT = 0X1D, + KEYS_ACCEPT = 0X1E, + KEYS_MODECHANGE = 0X1F, + KEYS_SPACE = 0X20, + KEYS_PRIOR = 0X21, + KEYS_NEXT = 0X22, + KEYS_END = 0X23, + KEYS_HOME = 0X24, + KEYS_LEFT = 0X25, + KEYS_UP = 0X26, + KEYS_RIGHT = 0X27, + KEYS_DOWN = 0X28, + KEYS_SELECT = 0X29, + KEYS_PRINT = 0X2A, + KEYS_EXECUTE = 0X2B, + KEYS_SNAPSHOT = 0X2C, + KEYS_INSERT = 0X2D, + KEYS_DELETE = 0X2E, + KEYS_HELP = 0X2F, + KEYS_N0 = 0X30, + KEYS_N1 = 0X31, + KEYS_N2 = 0X32, + KEYS_N3 = 0X33, + KEYS_N4 = 0X34, + KEYS_N5 = 0X35, + KEYS_N6 = 0X36, + KEYS_N7 = 0X37, + KEYS_N8 = 0X38, + KEYS_N9 = 0X39, + KEYS_A = 0X41, + KEYS_B = 0X42, + KEYS_C = 0X43, + KEYS_D = 0X44, + KEYS_E = 0X45, + KEYS_F = 0X46, + KEYS_G = 0X47, + KEYS_H = 0X48, + KEYS_I = 0X49, + KEYS_J = 0X4A, + KEYS_K = 0X4B, + KEYS_L = 0X4C, + KEYS_M = 0X4D, + KEYS_N = 0X4E, + KEYS_O = 0X4F, + KEYS_P = 0X50, + KEYS_Q = 0X51, + KEYS_R = 0X52, + KEYS_S = 0X53, + KEYS_T = 0X54, + KEYS_U = 0X55, + KEYS_V = 0X56, + KEYS_W = 0X57, + KEYS_X = 0X58, + KEYS_Y = 0X59, + KEYS_Z = 0X5A, + KEYS_LEFTWINDOWS = 0X5B, + KEYS_RIGHTWINDOWS = 0X5C, + KEYS_APPLICATION = 0X5D, + KEYS_NUMPAD0 = 0X60, + KEYS_NUMPAD1 = 0X61, + KEYS_NUMPAD2 = 0X62, + KEYS_NUMPAD3 = 0X63, + KEYS_NUMPAD4 = 0X64, + KEYS_NUMPAD5 = 0X65, + KEYS_NUMPAD6 = 0X66, + KEYS_NUMPAD7 = 0X67, + KEYS_NUMPAD8 = 0X68, + KEYS_NUMPAD9 = 0X69, + KEYS_MULTIPLY = 0X6A, + KEYS_ADD = 0X6B, + KEYS_SEPARATOR = 0X6C, + KEYS_SUBTRACT = 0X6D, + KEYS_DECIMAL = 0X6E, + KEYS_DIVIDE = 0X6F, + KEYS_F1 = 0X70, + KEYS_F2 = 0X71, + KEYS_F3 = 0X72, + KEYS_F4 = 0X73, + KEYS_F5 = 0X74, + KEYS_F6 = 0X75, + KEYS_F7 = 0X76, + KEYS_F8 = 0X77, + KEYS_F9 = 0X78, + KEYS_F10 = 0X79, + KEYS_F11 = 0X7A, + KEYS_F12 = 0X7B, + KEYS_NUMLOCK = 0X90, + KEYS_SCROLLLOCK = 0X91, + KEYS_LEFTSHIFT = 0XA0, + KEYS_RIGHTSHIFT = 0XA1, + KEYS_LEFTCONTROL = 0XA2, + KEYS_RIGHTCONTROL = 0XA3, + KEYS_LEFTMENU = 0XA4, + KEYS_RIGHTMENU = 0XA5, + KEYS_PERIOD = 0xBE, + KEYS_MAX = 0XA6, + KEYS_LAST = 0xfe +}; + +namespace util +{ + class c_input_manager { + bool m_pressed_keys[ KEYS_MAX ]; + int m_mouse_pos[ 2 ]; + int m_scroll_wheel_state; + public: + void capture_mouse_move( ulong_t lparam ); + + //registers a key press from wndproc + bool register_key_press( VirtualKeyEvents_t key_event, VirtualKeys_t key ); + + //checks if the key is pressed + bool is_key_pressed( int key ); + + //returns the first found key pressed, or KEY_NONE if none are + VirtualKeys_t is_any_key_pressed( ); + + //returns the last scroll state and resets it to 0 + int get_scroll_state( ); + + //returns the key's name + const char* get_key_name( VirtualKeys_t key ); + const char* get_short_name( VirtualKeys_t key ); + + //returns the first found currently pressed key + char get_pressed_char( VirtualKeys_t* pressed_key = nullptr ); + + //check if a key is valid + inline bool is_valid_key( VirtualKeys_t key ) { return key > KEYS_NONE && key < KEYS_MAX; } + + //get cursor pos + inline void get_cursor_pos( int& x, int& y ) { + x = m_mouse_pos[ 0 ]; + y = m_mouse_pos[ 1 ]; + } + }; +} + +extern util::c_input_manager g_input; \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp new file mode 100644 index 0000000..bebe7d5 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/math.hpp @@ -0,0 +1,60 @@ +#pragma once +#include +#include "util.hpp" + +static constexpr long double M_PI = 3.14159265358979323846f; +static constexpr long double M_RADPI = 57.295779513082f; +static constexpr long double M_PIRAD = 0.01745329251f; +static constexpr float M_PI_F = ( ( float )( M_PI ) ); +__forceinline float RAD2DEG( float x ) { return( ( float )( x ) * ( float )( 180.f / M_PI_F ) ); } +__forceinline float DEG2RAD( float x ) { return( ( float )( x ) * ( float )( M_PI_F / 180.f ) ); } + +namespace { + //make a random generator and seed it with a p random number + static std::random_device rd; + static std::mt19937 gen( rd( ) ); +} + +NAMESPACE_REGION( math ) + +#undef min +#undef max + +template < typename t > +t min( const t& t1, const t& t2 ) { + return t1 < t2 ? t1 : t2; +} + +template < typename t, typename... ts_ > +t min( const t& t1, const t& t2, ts_&&... ts ) { + return t1 < t2 ? + min( t1, std::forward< ts_ >( ts )... ) : + min( t2, std::forward< ts_ >( ts )... ); +} + +template < typename t > +t max( const t& t1, const t& t2 ) { + return t1 > t2 ? t1 : t2; +} + +template < typename t, typename... ts_ > +t max( const t& t1, const t& t2, ts_&&... ts ) { + return t1 > t2 ? + max( t1, std::forward< ts_ >( ts )... ) : + max( t2, std::forward< ts_ >( ts )... ); +} + +// todo - dex; make 2 random generator funcs here, this one only works for floats normally + +template < typename t > __forceinline t random_number( t min, t max ) { + if constexpr( !std::is_integral_v< t > ) { + std::uniform_real_distribution< t > dist( min, max ); + return dist( gen ); + } + else { + std::uniform_int_distribution< t > dist( min, max ); + return dist( gen ); + } +} + +END_REGION \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h new file mode 100644 index 0000000..661ef1f --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h @@ -0,0 +1,121 @@ +#pragma once + +#include "ui_base_item.h" +#include "ui_menu.h" +#include "ui_form.h" +#include "ui_render.h" +#include "ui_checkbox.h" +#include "ui_tab_manager.h" +#include "ui_slider.h" +#include "ui_dropdown.h" +#include "ui_key_picker.h" +#include "ui_button.h" +#include "ui_color_picker.h" +#include "ui_label.h" +#include "ui_text_input.h" +#include "ui_progressbar.h" + +namespace ui { + auto menu = std::make_shared< ui::c_menu >(0, 0, 500, 400, "moneybot $", ""); + + static void render() { + static bool was_setup = false; + if(!was_setup) { + menu = std::make_shared< ui::c_menu >(0, 0, 450, 375, "moneybot $", ""); + + //auto login_form = menu->add_item(std::make_shared< ui::c_form >(120, 20, 190, 115, "login")); { + // login_form->add_item(std::make_shared< ui::base_item >(0, 0, 0, 3)); + // login_form->add_item(std::make_shared< ui::c_button >(15, 0, 140, 18, "submit", []() { + // /* + // execute your code to log in here + // */ + // })); + //} + + auto wait_form = menu->add_item(std::make_shared(120, 20, 190, 115, "please wait")); + { + wait_form->add_item(std::make_shared(33, 35, "waiting for response...")); + } + wait_form->set_cond([] { + return UserInterface->m_Data.m_ExecutionState == UserExperience::EXECUTION_WAITING; + }); + + auto error_form = menu->add_item(std::make_shared(120, 20, 190, 115, "error")); + { + error_form->add_item(std::make_shared(25, 15, "contact an administrator."))->set_cond([] { + return UserInterface->m_Data.m_Error == UserExperience::ERROR_SHADOW_BAN; + }); + error_form->add_item(std::make_shared(30, 15, "hardware id mismatch."))->set_cond([] { + return UserInterface->m_Data.m_Error == UserExperience::ERROR_INVALID_HWID; + }); + error_form->add_item(std::make_shared(28, 15, "failed to verify session."))->set_cond([] { + return UserInterface->m_Data.m_Error == UserExperience::ERROR_GENERIC_ERROR; + }); + + error_form->add_item(std::make_shared(15, 20, 140, 20, "okay", [] { + ExitProcess(0); + })); + } + error_form->set_cond([] { + return UserInterface->m_Data.m_ExecutionState == UserExperience::EXECUTION_ERROR; + }); + + auto login_form = menu->add_item(std::make_shared(120, 20, 190, 135, "log in")); + { + login_form->add_item(std::make_shared< ui::c_text_input >(15, 0, 140, "username:", 128, UserInterface->m_Data.m_Username, false)); + login_form->add_item(std::make_shared< ui::c_text_input >(15, 0, 140, "password:", 128, UserInterface->m_Data.m_Password, true)); + + login_form->add_item(std::make_shared(15, 0, "warning: caps lock is on!"))->set_cond([] { + return GetKeyState(VK_CAPITAL); + }); + + login_form->add_item(std::make_shared(0, 0, 0, 3))->set_cond([] { + return !GetKeyState(VK_CAPITAL); + }); + + login_form->add_item(std::make_shared(15, 0, 140, 20, "log in", [] { + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; + })); + } + login_form->set_cond([] { + return UserInterface->m_Data.m_ExecutionState == UserExperience::EXECUTION_LOG_IN; + }); + + auto choose_form = menu->add_item(std::make_shared(120, 20, 190, 115, "select a cheat")); + { + // Change these if you want to. + static std::vector> m_beta_items{ + { "cs:go (release)", 0 }, + { "cs:go (beta)", 1 }, + { "cs:go (debug)", 2 }, + }; + + static std::vector> m_normal_items{ + { "cs:go", 0 }, + }; + + choose_form->add_item(std::make_shared>(15, 0, 140, "cheat selection:", &UserInterface->m_Data.m_SelectedGame, &m_beta_items))->set_cond([] { + return UserInterface->m_Data.m_SpecialAccess; + }); + choose_form->add_item(std::make_shared>(15, 0, 140, "cheat selection:", &UserInterface->m_Data.m_SelectedGame, &m_normal_items))->set_cond([] { + return !UserInterface->m_Data.m_SpecialAccess; + }); + + choose_form->add_item(std::make_shared(0, 0, 0, 3)); + + choose_form->add_item(std::make_shared(15, 0, 140, 20, "inject", [] { + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; + })); + } + choose_form->set_cond([] { + return UserInterface->m_Data.m_ExecutionState == UserExperience::EXECUTION_CHOOSE; + }); + + + was_setup = true; + } + else { + render_item(menu.get()); + } + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_base_item.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_base_item.h new file mode 100644 index 0000000..f33a21e --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_base_item.h @@ -0,0 +1,164 @@ +#pragma once +#include +#include +#include + +#include "ui_draw.h" + +namespace ui +{ + //the offset between each item + constexpr int ITEM_OFFSET = 5; + + class base_item : public std::enable_shared_from_this< base_item > { + public: + base_item( ) { } + base_item( int x, int y, int w, int h, const char* name = nullptr ) : + m_x( x ), m_y( y ), m_width( w ), m_height( h ) { + if( name ) { + strcpy_s< 256 >( m_text, name ); + } + } + + virtual void render( ) { }; + virtual bool is_hovered( ) { return false; } + virtual bool is_form( ) const { return false; } + + virtual void reset( ) { + m_y_offset = 0; + } + + virtual int get_total_height( ) const { + return m_height; + } + + void set_y_offset( int offset ) { + m_y_offset = offset; + } + + int get_y_offset( ) const { + return m_y_offset; + } + + auto add_item( std::shared_ptr< base_item > item ) { + item.get( )->m_parent = shared_from_this( ); + m_items.emplace( m_items.begin( ), item ); + + return item; + } + + auto& get_items( ) { return m_items; } + auto get_parent( ) { return m_parent; } + + virtual int x( ) const { return m_x; } + virtual int y( ) const { return m_y; } + virtual int w( ) const { return m_width; } + virtual int h( ) const { return m_height; } + + void set_x( int x ) { m_x = x; } + void set_y( int y ) { m_y = y; } + + void set_width( int w ) { m_width = w; } + void set_height( int h ) { m_height = h; } + + bool get_visible( ) const { + if( m_cond && !m_cond( ) ) { + return false; + } + + return m_visible; + } + + void set_cond( std::function< bool( ) > func ) { + m_cond = func; + } + + void set_visible( bool vis ) { m_visible = vis; } + void set_text( const char* text ) { + strcpy_s< 256 >( m_text, text ); + } + auto get_text( ) const { + return m_text; + } + + std::shared_ptr< base_item > find_item( const char* name ) { + if( !m_items.empty( ) ) { + for( auto& it : m_items ) { + if( it->get_text( ) && !strcmp( it->get_text( ), name ) ) { + return it; + } + + auto it_find = it->find_item( name ); + if( it_find != it ) return it_find; + } + } + + return shared_from_this( ); + } + + auto get_top_parent( ) { + for( auto parent = m_parent; ; + parent = parent->get_parent( ) ) { + if( !parent->get_parent( ) ) { + return parent; + } + } + + return shared_from_this( ); + } + + int get_relative_x( ) { + int x = m_x; + for( auto parent = get_parent( ); !!parent; + parent = parent->get_parent( ) ) { + x += parent->x( ); + } + + return x; + } + + int get_relative_y( ) { + int y = m_y + get_y_offset( ); + for( auto parent = get_parent( ); !!parent; + parent = parent->get_parent( ) ) { + y += parent->y( ) + parent->get_y_offset( ); + } + + return y; + } + + void set_disabled( bool disabled ) { + m_disabled = disabled; + + for( auto& it : m_items ) { + it->set_disabled( disabled ); + } + } + + void set_disabled_callbacks( bool disabled ) { + auto top = get_top_parent( ); + + top->set_disabled( disabled ); + + m_disabled = false; + } + + protected: + int m_x{ }; + int m_y{ }; + + int m_width{ }; + int m_height{ }; + + //current y position for rendering + int m_y_offset{ }; + + bool m_visible = true; + bool m_disabled = false; + char m_text[ 256 ]{ }; + + std::shared_ptr< base_item > m_parent; + std::vector< std::shared_ptr< base_item > > m_items; + std::function< bool( ) > m_cond; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_button.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_button.h new file mode 100644 index 0000000..022fc67 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_button.h @@ -0,0 +1,56 @@ +#pragma once + +#include + +#include "ui_base_item.h" + +namespace ui +{ + class c_button : public base_item { + public: + c_button( int x, int y, int w, int h, const char* name, std::function< void( ) > fn ) : + base_item( x, y, w, h, name ), m_fn( fn ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int x = get_relative_x( ); + int y = get_relative_y( ); + int h = m_height; + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + + return mouse_x >= x && mouse_x <= x + m_width + && mouse_y >= y && mouse_y <= y + h; + } + + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + + ui_draw_rect( x, y, m_width, m_height, ui_get_disabled_col( ) ); + ui_draw_outlined_rect( x - 1, y - 1, m_width + 1, m_height + 1, + is_hovered( ) ? ui_get_text_col( ) : ui_get_accent_col( ) ); + + if ( is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + ui_draw_rect( x, y, m_width, m_height, ui_get_bg_col( ) ); + if ( !m_mouse_held ) { + m_fn( ); + } + m_mouse_held = true; + } + else { + m_mouse_held = false; + } + + ui_draw_string( x + m_width / 2, y + 2, true, ui_get_text_col( ), m_text ); + } + + protected: + std::function< void( ) > m_fn; + bool m_mouse_held{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_checkbox.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_checkbox.h new file mode 100644 index 0000000..50cad1c --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_checkbox.h @@ -0,0 +1,68 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_checkbox : public base_item { + public: + c_checkbox( int x, int y, const char* txt, bool* setting ) : + base_item( x, y, 16, 16, txt ), m_setting( setting ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + int rel_x = get_relative_x( ); + int rel_y = get_relative_y( ); + + return mouse_x >= rel_x && mouse_x <= rel_x + m_width + && mouse_y >= rel_y && mouse_y <= rel_y + m_height; + } + + inline void render_checkbox( const int& x, const int& y ) { + clr_t col = ui_get_bg_col( ); + if ( is_hovered( ) ) { + col = *m_setting ? ui_get_accent_col( ) * 0.8f : ui_get_bg_col( ) * 1.3f; + } + else if ( *m_setting ) { + col = ui_get_accent_col( ); + } + + ui_draw_rect( x, y, m_width, m_height, ui_get_disabled_col( ) ); + ui_draw_rect( x + 1, y + 1, m_width - 2, m_height - 2, col ); + + //ui_draw_outlined_rect( x, y, m_width, m_height, ui_get_accent_col( ) ); + } + + inline void input( ) { + bool mouse_presesed = g_input.is_key_pressed( KEYS_MOUSE1 ); + + if ( is_hovered( ) && mouse_presesed ) { + if ( !m_mouse_held ) { + *m_setting = !*m_setting; + } + m_mouse_held = true; + } + else { + m_mouse_held = false; + } + } + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + + render_checkbox( x, y ); + input( ); + + + ui_draw_string( x + m_width + 6, y + 2, false, ui_get_text_col( ), m_text ); + } + + protected: + bool* m_setting; + bool m_mouse_held{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_color_picker.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_color_picker.h new file mode 100644 index 0000000..2711d29 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_color_picker.h @@ -0,0 +1,201 @@ +#pragma once + +#include "ui_base_item.h" +#include "d3d.hpp" + +namespace ui +{ + class c_color_picker : public base_item { + static constexpr int BOX_WIDTH = 106; + static constexpr int BOX_HEIGHT = 125; + public: + c_color_picker( int x, int y, int w, const char* name, clr_t* setting ) : + base_item( x, y, w, 4, name ), m_setting( setting ), + m_has_text( true ) { } + + c_color_picker( int x, int y, int w, clr_t* setting ) : + base_item( x, y, w, 8, xors( "COLOR_PICKER" ) ), m_setting( setting ), + m_has_text( false ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int x = get_relative_x( ); + int y = get_relative_y( ); + + int cursor_x, cursor_y; + ui_get_cursor_pos( cursor_x, cursor_y ); + + if ( m_has_text ) y += 12; + + if ( !m_active ) { + return cursor_x >= x && cursor_x <= x + m_width + && cursor_y >= y && cursor_y <= y + m_height; + } + + return cursor_x >= x && cursor_x <= x + BOX_WIDTH + 23 + && cursor_y >= y && cursor_y <= y + BOX_HEIGHT + 2; + } + + virtual int get_total_height( ) const override { + return m_has_text ? ( m_height + 12 ) : m_height; + } + + void input( ) { + bool active_backup = m_active; + bool active_changed = false; + + if ( is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + if ( !m_active ) { + m_mouse_held = true; + } + + m_active = true; + } + else if ( m_active && !is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + m_active = false; + } + else { + m_mouse_held = false; + } + + active_changed = active_backup != m_active; + if ( active_changed ) { + set_disabled_callbacks( m_active ); + } + + m_hue = m_setting->hue( ); + if ( m_hue > 1.0f ) { + m_hue -= 359.f; + } + + m_saturation = m_setting->saturation( ); + m_brightness = m_setting->brightness( ) / 255.f; + m_alpha = m_setting->a( ); + } + + void output( ) { + *m_setting = clr_t::from_hsb( m_hue, m_saturation, m_brightness ); + m_setting->a( ) = m_alpha; + } + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + + if ( m_has_text ) { + ui_draw_string( x + 2, y, false, ui_get_text_col( ), m_text ); + y += 12; + } + + input( ); + + if ( m_active ) { + RECT old_rect; + g_d3d.get_device( )->GetScissorRect( &old_rect ); + + RECT new_rect{ + x - 1, y - 1, + x + BOX_WIDTH + 22, + y + BOX_HEIGHT + 2 + }; + + g_d3d.get_device( )->SetScissorRect( &new_rect ); + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + clr_t bg_col( 0, 0, 0, 90 ); + ui_draw_rect( x, y, BOX_WIDTH + 20, BOX_HEIGHT, bg_col ); + ui_draw_outlined_rect( x - 1, y - 1, BOX_WIDTH + 22, BOX_HEIGHT + 2, ui_get_accent_col( ) ); + + for ( int i{ }; i < 100; i += 3 ) { + for ( int i2{ }; i2 < 100; i2 += 3 ) { + ui_draw_rect( x + i + 1, y + i2 + 1, 3, 3, + clr_t::from_hsb( m_hue, float( i2 ) * 0.01f, float( i ) * 0.01f ) ); + } + } + + if ( g_input.is_key_pressed( KEYS_MOUSE1 ) && !m_mouse_held + && mouse_x > x && mouse_x <= x + 100 + && mouse_y > y && mouse_y <= y + 100 ) { + + int mouse_x_c = std::clamp( mouse_x, x, x + 100 ); + int mouse_y_c = std::clamp( mouse_y, y, y + 100 ); + + int delta_y = std::clamp( mouse_y_c - y, 0, 100 ); + int delta_x = std::clamp( mouse_x_c - x, 0, 100 ); + + m_saturation = float( delta_y ) * 0.01f; + m_brightness = float( delta_x ) * 0.01f; + } + + auto is_hue_slider_hovered = [&]( ) -> bool { + return mouse_x > x + 110 && mouse_x < x + 122 + && mouse_y > y && mouse_y < y + 100; + }; + + auto draw_slider_hue = [&]( ) { + for ( int i{ }; i < 100; ++i ) { + auto cur_col = clr_t::from_hsb( float( i ) * 0.01f, m_saturation, m_brightness ); + + ui_draw_rect( x + 110, y + i + 1, 12, 2, cur_col ); + } + + ui_draw_outlined_rect( x + 109, y + int( m_hue * 100.f ) + 1, 14, 3, + is_hue_slider_hovered( ) ? ui_get_text_col( ) : ui_get_disabled_col( ) ); + }; + + auto is_alpha_slider_hovered = [&]( ) -> bool { + return mouse_x > x + 1 && mouse_x < x + 122 + && mouse_y > y + 110 && mouse_y < y + 124; + }; + + auto draw_slider_alpha = [&]( ) { + for ( int i{ 121 }; i >= 0; --i ) { + auto col = *m_setting; + col.a( ) = ( int )( float( i ) * 255.f / 121.f ); + + ui_draw_rect( x + i + 1, y + 110, 1, 12, col ); + } + + int a_pos = ( int )( float( m_alpha ) * 121.f / 255.f ); + ui_draw_outlined_rect( x + 1 + a_pos, y + 109, 3, 14, + is_alpha_slider_hovered( ) ? ui_get_text_col( ) : ui_get_disabled_col( ) ); + }; + + draw_slider_hue( ); + if ( is_hue_slider_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + int delta = std::clamp( mouse_y - y, 0, 100 ); + m_hue = float( delta ) * 0.01f; + } + + draw_slider_alpha( ); + if ( is_alpha_slider_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + int delta = std::clamp( mouse_x - x, 0, 121 ); + m_alpha = ( int )( float( delta ) * 255.f / 121.f ); + } + + output( ); + + g_d3d.get_device( )->SetScissorRect( &old_rect ); + } + else { + if ( is_hovered( ) ) { + ui_draw_rect( x - 1, y - 1, m_width + 2, m_height + 2, ui_get_text_col( ) ); + } + ui_draw_rect( x, y, m_width, m_height, *m_setting ); + } + } + + protected: + clr_t* m_setting = nullptr; + bool m_active = false; + bool m_mouse_held = false; + float m_saturation = 1.0f; + float m_brightness = 1.0f; + float m_hue = 0.f; + uint8_t m_alpha = 255; + bool m_has_text = false; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_draw.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_draw.h new file mode 100644 index 0000000..46c91de --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_draw.h @@ -0,0 +1,160 @@ +#pragma once +#include + +#include "color.hpp" +#include "d3d.hpp" +#include "d3d_sprite.hpp" +#include "input_system.hpp" +#include "window.hpp" + +namespace ui +{ + /*__forceinline auto ui_get_background_texture( ) { + static auto buffer = std::make_shared< byte[ 512 ] >( ); + static auto color = D3DCOLOR_RGBA( 27, 27, 27, 233 ); + static auto color_bright = D3DCOLOR_RGBA( 31, 31, 31, 255 ); + static IDirect3DTexture9* texture; + + if ( !texture ) { + for ( int i = 0; i < 512; i += 4 ) { + *( ulong_t* )( uintptr_t( buffer.get( ) ) + i ) = !( i % 12 ) ? color : color_bright; + } + + D3DXCreateTextureFromFileInMemory( g_d3d.get_device( ), buffer.get( ), 512, &texture ); + } + + return texture; + }*/ + + static float anim_time{ }; + + __forceinline void set_animtime( float animtime ) { + anim_time = animtime; + } + + __forceinline void setup_sprites( IDirect3DDevice9* device ) { + //fuck msvc + //icons::sprite_legit.init( device, icons::legit_icon, icons::legit_size, 66, 66 ); + //icons::sprite_visuals_.init( device, icons::legit_icon, icons::legit_size, 66, 66 ); + //icons::sprite_rage.init( device, icons::rage_icon, icons::rage_size, 66, 66 ); + //icons::sprite_visuals.init( device, icons::raw::visuals_raw, icons::visuals_size, 66, 66 ); + //icons::sprite_misc.init( device, icons::misc_icon, icons::misc_size, 66, 66 ); + //icons::sprite_config.init( device, icons::config_icon, icons::config_size, 66, 66 ); + } + + __forceinline clr_t ui_get_accent_col( ) { + static const clr_t col_start = clr_t( 231, 105, 105, 255 ); + static const clr_t col_end = clr_t( 0xf4, 0x7c, 0xa8, 255 ); + + clr_t col = clr_t::blend( col_start, col_end, anim_time ); + + return col; + } + + __forceinline clr_t& ui_get_disabled_col( ) { + static clr_t col = clr_t( 61, 61, 61, 255 ); + return col; + } + + __forceinline clr_t& ui_get_bg_col( ) { + static clr_t col = clr_t( 24, 25, 27, 255 ); + return col; + } + + __forceinline clr_t& ui_get_text_col( ) { + static clr_t col = clr_t( 221, 221, 221, 255 ); + return col; + } + + __forceinline void ui_draw_gradient( int x, int y, int w, int h, clr_t start, + clr_t end, GradientType_t type = GRADIENT_HORIZONTAL ) { + + g_d3d.draw_gradient( start, end, x, y, w, h, type ); + } + + __forceinline void ui_draw_line( int x, int y, int x1, int y1, clr_t color ) { + g_d3d.draw_line( color, x, y, x1, y1 ); + } + + __forceinline void ui_draw_rect( int x, int y, int w, int h, clr_t color ) { + g_d3d.draw_filled_rect( color, x, y, w, h ); + } + + __forceinline void ui_draw_outlined_rect( int x, int y, int w, int h, clr_t color ) { + g_d3d.draw_rect( color, x, y, w, h ); + } + + __forceinline void ui_draw_circle( int x, int y, int r, clr_t color, int res = 48 ) { + g_d3d.draw_circle( color, x, y, r, res ); + } + + __forceinline void ui_draw_filled_circle( int x, int y, int r, clr_t color, int res = 48 ) { + g_d3d.draw_filled_circle( color, x, y, r, res ); + } + + __forceinline void ui_draw_string( int x, int y, bool center, clr_t color, const char* str, ... ) { + char buf[ 2048 ]{ }; + va_list list{ }; + + __crt_va_start( list, str ); + vsprintf_s( buf, 2048, str, list ); + __crt_va_end( list ); + + g_d3d.draw_text( d3d::fonts.f_menu, color, x, y, + center ? ALIGN_CENTER : ALIGN_LEFT, D3DFONTFLAG_DROPSHADOW, buf ); + } + + __forceinline void ui_get_text_size( int& w, int& h, const char* text, ... ) { + char* buf = ( char* )_alloca( 2048 ); + va_list list{ }; + + __crt_va_start( list, text ); + vsprintf_s( buf, 2048, text, list ); + __crt_va_end( list ); + + w = g_d3d.get_text_width( d3d::fonts.f_menu, 0, buf ); + h = g_d3d.get_text_height( d3d::fonts.f_menu, 0, buf ); + } + + __forceinline void ui_get_cursor_pos( int& x, int& y ) { + POINT p; + GetCursorPos( &p ); + ScreenToClient( g_window.get_hwnd( ), &p ); + x = p.x; y = p.y; + } + + __forceinline float ui_get_frametime( ) { + return 0.0152f; + //return g_csgo.m_frametime; + } + + __forceinline void ui_draw_cursor( ) { + const clr_t black( 0, 0, 0, 255 ), accent( ui_get_accent_col( ) ); + int x, y; + ui_get_cursor_pos( x, y ); + + + for ( int i{ }; i <= 9; ++i ) { + ui_draw_line( x, y, x + i, y + 11, accent ); + } + + for ( int i{ }; i <= 7; ++i ) { + ui_draw_line( x, y + 9 + i, x + i, y + 9, accent ); + } + + for ( int i{ }; i <= 3; ++i ) { + ui_draw_line( x + 6 + i, y + 11, x, y + i, accent ); + } + + ui_draw_line( x + 5, y + 11, x + 8, y + 18, accent ); + ui_draw_line( x + 4, y + 11, x + 7, y + 18, accent ); + + ui_draw_line( x, y, x, y + 17, black ); + ui_draw_line( x, y + 17, x + 3, y + 14, black ); + ui_draw_line( x + 4, y + 14, x + 7, y + 19, black ); + ui_draw_line( x + 7, y + 18, x + 9, y + 18, black ); + ui_draw_line( x + 10, y + 18, x + 7, y + 12, black ); + ui_draw_line( x + 7, y + 12, x + 11, y + 12, black ); + ui_draw_line( x + 11, y + 12, x, y, black ); + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown.h new file mode 100644 index 0000000..ea626bc --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown.h @@ -0,0 +1,217 @@ +#pragma once +#include "ui_dropdown_item.h" + +namespace ui +{ + template < typename t = int > + class c_dropdown : public base_item { + public: + c_dropdown( int x, int y, int w, const char* name, t* setting, + std::vector< dropdowns::dropdown_item_t< t > >* items, size_t max_items = 8 ) : + base_item( x, y, w, 16, name ), m_dropdown_items( items ), m_setting( setting ), + m_max_items( max_items ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int x = get_relative_x( ); + int y = get_relative_y( ) + 12; + int h = m_height; + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + + return mouse_x >= x && mouse_x <= x + m_width + && mouse_y >= y && mouse_y <= y + h; + } + + inline bool is_any_item_hovered( ) { + if ( m_disabled || !m_active ) return false; + + int x = get_relative_x( ); + int y = get_relative_y( ) + m_height + 12; + int h = m_height * ( std::min< size_t >( + m_dropdown_items->size( ), m_max_items ) ); + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + + return mouse_x >= x && mouse_x <= x + m_width + && mouse_y >= y && mouse_y <= y + h; + } + + virtual int get_total_height( ) const override { + return m_height + 13; + } + + void draw_box( const int& x, const int& y, const char* str, bool hovered = false ) { + ui_draw_rect( x, y, m_width, m_height, hovered ? ui_get_disabled_col( ) : ui_get_bg_col( ) ); + ui_draw_line( x, y + m_height, x + m_width, y + m_height, ui_get_accent_col( ) ); + + ui_draw_string( x + m_width / 2, y + 2, true, ui_get_text_col( ), str ); + } + + void update_value( ) { + for ( auto& it : *m_dropdown_items ) { + if ( it.m_value == *m_setting ) { + m_selected_item = ⁢ + } + } + } + + void draw_items( const int& x, const int& y ) { + auto& items = *m_dropdown_items; + auto it = &items.front( ); + int offset = m_height + 1; + int hovered = 0; + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + auto is_hovered = [ & ] ( int y_offset ) { + return mouse_x >= x && mouse_x <= x + m_width + && mouse_y >= y + y_offset && mouse_y <= y + y_offset + m_height; + }; + + + for ( size_t i = items.size( ) > m_max_items ? m_curr_scroll : 0; + i < std::min< size_t >( m_dropdown_items->size( ), m_max_items + m_curr_scroll ); + ++i, offset += m_height + 1 + ) { + it = &items.at( i ); + + draw_box( x, y + offset, it->m_name ); + + if ( is_hovered( offset ) ) { + hovered = offset; + if ( g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + m_selected_item = it; + *m_setting = it->m_value; + m_active = false; + m_enable_time = GetTickCount( ) * 0.001f + 0.220f; + m_enable_next_frame = true; + } + } + } + + if ( hovered ) { + ui_draw_outlined_rect( x - 1, y - 1 + hovered, + m_width + 1, m_height + 1, ui_get_text_col( ) ); + } + } + + void input( ) { + bool active_backup = m_active; + bool active_changed = false; + + if ( is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + if ( !m_mouse_held ) { + m_active = !m_active; + } + m_mouse_held = true; + } + else if ( !is_any_item_hovered( ) ) { + m_mouse_held = false; + } + + if ( !is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) && !is_any_item_hovered( ) ) { + m_active = false; + } + + if ( GetTickCount( ) * 0.001f > m_enable_time && m_enable_next_frame ) { + set_disabled_callbacks( false ); + m_enable_next_frame = false; + } + + + active_changed = m_active != active_backup; + //disable input on all items + if ( active_changed ) { + if ( !m_active ) { + m_enable_time = GetTickCount( ) * 0.001f + 0.220f; + m_enable_next_frame = true; + } + else { + set_disabled_callbacks( true ); + } + } + + if ( m_selected_item ) { + *m_setting = m_selected_item->m_value; + } + + if ( m_active && m_dropdown_items->size( ) > m_max_items ) { + int scroll_input = g_input.get_scroll_state( ); + + if ( m_curr_scroll > 0 || scroll_input < 0 ) //we dont want scroll to loop around from 0 to max + m_curr_scroll -= scroll_input; //because positive is scroll up, we gotta flip it + + if ( m_curr_scroll > m_dropdown_items->size( ) - m_max_items ) + m_curr_scroll = m_dropdown_items->size( ) - m_max_items; + } + } + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + + bool restore = false; + RECT prev_rect{ }; + + if ( m_active ) { + restore = true; + g_d3d.get_device( )->GetScissorRect( &prev_rect ); + + RECT new_rect{ + prev_rect.left, + prev_rect.top, + g_d3d.m_width, + g_d3d.m_height, + }; + + g_d3d.get_device( )->SetScissorRect( &new_rect ); + + draw_items( x, y + 11 ); + + + //draw scrollbar + size_t total_items = m_dropdown_items->size( ); + if ( total_items > m_max_items ) { + const size_t height = ( m_height + 1 ) * m_max_items; + const float slider_step = ( float )( height ) / float( total_items - m_max_items + 1 ); + + size_t slider_pos = static_cast< size_t >( slider_step * m_curr_scroll ); + ui_draw_rect( x + m_width - 1, y + slider_pos + m_height + 13, 2, ( int )slider_step, ui_get_accent_col( ) ); + } + } + + update_value( ); + input( ); + + ui_draw_string( x + 2, y, false, ui_get_text_col( ), m_text ); + ui_draw_rect( x, y + 13, m_width, m_height, ui_get_disabled_col( ) ); + ui_draw_outlined_rect( x - 1, y + 12, m_width + 1, m_height + 1, + is_hovered( ) || m_active ? ui_get_text_col( ) : ui_get_accent_col( ) ); + + if ( m_selected_item ) { + ui_draw_string( x + m_width / 2, y + 14, true, ui_get_text_col( ), m_selected_item->m_name ); + } + + if( restore ) { + g_d3d.get_device( )->SetScissorRect( &prev_rect ); + } + } + + protected: + std::vector< dropdowns::dropdown_item_t< t > >* m_dropdown_items{ }; + dropdowns::dropdown_item_t< t >* m_selected_item{ }; + bool m_active = false; + bool m_mouse_held = false; + t* m_setting{ }; + size_t m_max_items{ }; + size_t m_curr_scroll{ }; + float m_enable_time{ }; + int m_enable_next_frame{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown_item.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown_item.h new file mode 100644 index 0000000..88f7d4b --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_dropdown_item.h @@ -0,0 +1,15 @@ +#pragma once + +#include "ui_base_item.h" + +namespace ui +{ + namespace dropdowns + { + template < typename t = int > + struct dropdown_item_t { + const char* m_name; + t m_value; + }; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_form.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_form.h new file mode 100644 index 0000000..2fdf6e7 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_form.h @@ -0,0 +1,130 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_form : public base_item { + public: + c_form( int x, int y, int w, int h, const char* name, int max_h = 0 ) : + base_item( x, y, w, h, name ), m_dynamic( !h ), m_max_height( max_h ) { }; + + virtual int x( ) const override { + return m_x + 10; + } + + virtual int y( ) const override { + return m_y + m_scroll_offset + 9; + } + + virtual bool is_form( ) const override { + return true; + } + + virtual bool is_hovered( ) override { + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + int x = get_relative_x( ); + int y = get_relative_y( ); + + return mouse_x > x && mouse_x < x + w( ) + && mouse_y > y && mouse_y < y + h( ); + } + + inline void update_size( ) { + if ( !m_dynamic ) return; + + int total_height{ ITEM_OFFSET * 2 }; + for ( auto& it : m_items ) { + if ( it->get_visible( ) ) { + auto item_height = it->get_total_height( ) + ITEM_OFFSET; + if( m_max_height && total_height + item_height > m_max_height ) { + total_height = m_max_height; + break; + } + total_height += it->get_total_height( ) + ITEM_OFFSET; + } + } + + m_height = total_height; + } + + virtual int get_total_height( ) const override { + return m_height + 5; + } + + int get_total_item_height( ) { + int total_height{ ITEM_OFFSET * 2 }; + for( auto& it : m_items ) { + if( it->get_visible( ) ) { + auto item_height = it->get_total_height( ) + ITEM_OFFSET; + total_height += it->get_total_height( ) + ITEM_OFFSET; + } + } + + return total_height; + } + + void input( ) { + if( m_max_height && get_total_item_height( ) > m_max_height ) { + if( !m_disabled && is_hovered( ) ) { + auto scroll_state = g_input.get_scroll_state( ); + if( !!scroll_state && m_was_hovered ) { + scroll_state > 0 ? m_scroll_offset += 13 : m_scroll_offset -= 13; + } + m_scroll_offset = std::clamp( m_scroll_offset, -( get_total_item_height( ) - m_height + 3 ), 0 ); + } + } + else { + m_scroll_offset = 0; + } + } + + virtual void render( ) override { + update_size( ); + input( ); + int x = get_relative_x( ); + int y = get_relative_y( ); + + int text_w, text_h; + ui_get_text_size( text_w, text_h, m_text ); + + for( int i{ }; i < 8; ++i ) { + clr_t col = ui_get_bg_col( ) * ( 0.72f + i * 0.04f ); + ui_draw_rect( x, y + i, m_width, m_height - i * 2, col ); + } + + ui_draw_outlined_rect( x, y, m_width, m_height, ui_get_accent_col( ) ); + + if( m_max_height && get_total_item_height( ) > m_height ) { + const size_t height = get_total_height( ) - 20; + const float delta = ( float )( get_total_item_height( ) - height + 1 ); + const float slider_step = ( ( float )( height ) / delta ); + const float slider_height = slider_step * 13.f; + + size_t slider_pos = static_cast< size_t >( slider_step * m_scroll_offset ); + ui_draw_rect( x + m_width - 7, y + 8, 4, height, ui_get_disabled_col( ) ); + ui_draw_rect( x + m_width - 7, y - slider_pos + 8, 4, ( int )slider_height + 1, ui_get_accent_col( ) ); + } + + if( is_hovered( ) != m_was_hovered ) { + bool backup = m_disabled; + if( !backup ) { + set_disabled( !is_hovered( ) ); + } + m_disabled = backup; + } + + ui_draw_line( x + 3, y, x + text_w + 1, y, ui_get_bg_col( ) ); + ui_draw_string( x + 3, y - 7, false, ui_get_text_col( ), m_text ); + + m_was_hovered = is_hovered( ); + } + + protected: + bool m_dynamic{ }; + bool m_was_hovered{ }; + int m_max_height{ }; + int m_scroll_offset{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_key_picker.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_key_picker.h new file mode 100644 index 0000000..03aed84 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_key_picker.h @@ -0,0 +1,164 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_key_picker : public base_item { + public: + c_key_picker( int x, int y, int w, const char* name, int* setting ) : + base_item( x, y, w, 16, name ), m_setting( setting ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int x = get_relative_x( ); + int y = get_relative_y( ) + 12; + int h = m_height; + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + + return mouse_x >= x && mouse_x <= x + m_width + && mouse_y >= y && mouse_y <= y + h; + } + + virtual int get_total_height( ) const override { + return m_height + 12; + } + + void input( ) { + bool active_backup = m_active; + bool active_changed = false; + + if ( is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + if ( !m_mouse_held ) { + m_active = true; + } + m_mouse_held = true; + } + + if ( g_input.is_key_pressed( KEYS_ESCAPE ) ) { + m_active = false; + *m_setting = KEYS_NONE; + } + + if ( m_active && !m_mouse_held ) { + int key = g_input.is_any_key_pressed( ); + if ( key != KEYS_NONE ) { + *m_setting = key; + m_active = false; + } + } + + active_changed = active_backup != m_active; + if ( active_changed ) { + set_disabled_callbacks( m_active ); + } + } + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + + input( ); + + ui_draw_string( x + 2, y, false, ui_get_text_col( ), m_text ); + ui_draw_rect( x, y + 13, m_width, m_height, ui_get_disabled_col( ) ); + ui_draw_outlined_rect( x - 1, y + 12, m_width + 1, m_height + 1, + is_hovered( ) || m_active ? ui_get_text_col( ) : ui_get_accent_col( ) ); + + ui_draw_string( x + m_width / 2, y + 14, true, ui_get_text_col( ), + g_input.get_key_name( ( VirtualKeys_t )*m_setting ) ); + } + + protected: + int* m_setting{ }; + bool m_active{ }; + bool m_mouse_held{ }; + }; + + //skEeT PiCkErS + class c_key_picker_small : public base_item { + public: + c_key_picker_small( int x, int y, int* setting ) : + base_item( x, y, 0, 0, xors( "KEY_PICKER" ) ), m_setting( setting ) { } + + virtual int get_total_height( ) const override { + const char* name = g_input.get_short_name( ( VirtualKeys_t )*m_setting ); + int w, h; + ui_get_text_size( w, h, name ); + + return h; + } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + const char* name = g_input.get_short_name( ( VirtualKeys_t )*m_setting ); + int x = get_relative_x( ); + int y = get_relative_y( ); + int mouse_x, mouse_y; + int w, h; + + ui_get_text_size( w, h, "[%s]", name ); + ui_get_cursor_pos( mouse_x, mouse_y ); + + return mouse_x >= x - w && mouse_x <= x + && mouse_y >= y && mouse_y <= y + h; + } + + void input( ) { + + bool active_backup = m_active; + bool active_changed = false; + + if ( g_input.is_key_pressed( KEYS_ESCAPE ) ) { + m_active = false; + *m_setting = KEYS_NONE; + } + + if ( m_active && !m_mouse_held ) { + int key = g_input.is_any_key_pressed( ); + if ( key != KEYS_NONE ) { + *m_setting = key; + m_active = false; + } + } + + if ( is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + if ( !m_mouse_held ) { + m_active = true; + } + m_mouse_held = true; + } + else { + m_mouse_held = false; + } + + active_changed = active_backup != m_active; + if ( active_changed ) { + set_disabled_callbacks( m_active ); + } + } + + virtual void render( ) override { + const char* name = g_input.get_short_name( ( VirtualKeys_t )*m_setting ); + int x = get_relative_x( ); + int y = get_relative_y( ); + + int w, h; + ui_get_text_size( w, h, "[%s]", name ); + + input( ); + + ui_draw_string( x - w, y, false, is_hovered( ) || m_active ? + ui_get_accent_col( ) : ui_get_text_col( ), "[%s]", name ); + } + + protected: + int* m_setting; + bool m_active{ }; + bool m_mouse_held{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_label.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_label.h new file mode 100644 index 0000000..9df46b5 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_label.h @@ -0,0 +1,18 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_label : public base_item { + public: + c_label( int x, int y, const char* text ) : + base_item( x, y, 0, 16, text ) { } + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + + ui_draw_string( x + 2, y + 2, false, ui_get_text_col( ), m_text ); + } + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_menu.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_menu.h new file mode 100644 index 0000000..cc76fb1 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_menu.h @@ -0,0 +1,108 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_menu : public base_item { + public: + c_menu( int start_x, int start_y, int width, + int height, const char* name, const char* right_text = nullptr ) : + base_item( start_x, start_y, width, height, name ), + m_right_text( right_text ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + return mouse_x >= m_x && mouse_x <= m_x + w( ) + && mouse_y >= m_y && mouse_y <= m_y + 19; + } + + virtual int y( ) const override { + return m_y + 19; + } + + inline void input( ) { + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + bool mouse_clicked = g_input.is_key_pressed( KEYS_MOUSE1 ); + bool window_hovered = GetActiveWindow( ) == g_window.get_hwnd( ); + + RECT cur_rect{ }; + GetWindowRect( g_window.get_hwnd( ), &cur_rect ); + + POINT p{ cur_rect.left, cur_rect.top }; + ScreenToClient( g_window.get_hwnd( ), &p ); + + if( !window_hovered ) { + m_mouse_held = false; + mouse_clicked = false; + return; + } + + if ( is_hovered( ) ) { + m_mouse_held = true; + } + + if ( !mouse_clicked ) { + m_mouse_held = is_hovered( ); + } + + if ( m_mouse_held && !mouse_clicked ) { + m_drag_offset_y = mouse_y - p.y; + m_drag_offset_x = mouse_x - p.x; + } + + if ( m_mouse_held && mouse_clicked ) { + int new_x = mouse_x - m_drag_offset_x + cur_rect.left; + int new_y = mouse_y - m_drag_offset_y + cur_rect.top; + + MoveWindow( g_window.get_hwnd( ), new_x, new_y, 451, 376, true ); + } + } + + virtual void render( ) override { + constexpr auto top_height = 19; + + input( ); + + //draw a c00l shadow + ui_draw_outlined_rect( m_x, m_y + 1, m_width + 1, m_height, clr_t( 0, 0, 0, 166 ) ); + + ui_draw_rect( m_x + 1, m_y + 1, m_width - 1, top_height - 2, ui_get_bg_col( ) * 1.2f ); + if( is_hovered( ) ) { + ui_draw_rect( m_x + 1, m_y + 1, m_width - 1, top_height - 2, clr_t( 61, 61, 61 ) ); + } + + for( int i{ }; i < 8; ++i ) { + clr_t col = ui_get_bg_col( ) * ( 0.72f + i * 0.04f ); + ui_draw_rect( m_x, m_y + i + top_height - 1, m_width, m_height - i * 2 - top_height + 1, col ); + } + ui_draw_outlined_rect( m_x, m_y, m_width, m_height, ui_get_accent_col( ) ); + + if( m_right_text ) { + ui_draw_string( m_x + 5, m_y + 4, false, ui_get_text_col( ), m_text ); + + int width, height; + ui_get_text_size( width, height, m_right_text ); + + ui_draw_string( m_x + m_width - 5 - width, m_y + 4, false, ui_get_text_col( ), m_right_text ); + } + else { + ui_draw_string( m_x + m_width / 2, m_y + 4, true, ui_get_text_col( ), m_text ); + } + } + + void set_right_text(const char *text) { + m_right_text = text; + } + + protected: + int m_drag_offset_x{ }; + int m_drag_offset_y{ }; + bool m_mouse_held{ }; + const char* m_right_text{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_progressbar.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_progressbar.h new file mode 100644 index 0000000..33bcf65 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_progressbar.h @@ -0,0 +1,44 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_progress_bar : public base_item { + public: + c_progress_bar( int x, int y, int w, float* progress ) : + base_item( x, y, w, 4, xors( "PROGRESS_BAR" ) ), + m_progress( progress ) { } + + + virtual void render( ) override { + static const clr_t col_start = clr_t( 231, 105, 105, 255 ); + static const clr_t col_end = clr_t( 0xf4, 0x7c, 0xa8, 255 ); + + int x = get_relative_x( ); + int y = get_relative_y( ); + + ui_draw_rect( x, y, m_width, m_height, ui_get_disabled_col( ) ); + + if( *m_progress > 0.001f ) { + int fill = *m_progress * m_width; + + bool reverse = false; + for( int i{ }; i < fill; ++i ) { + float progress = std::fmod( float( i ) / fill - ( anim_time ), 1.f ); + if( progress == 1.0f ) reverse = true; + if( reverse ) { + progress = 1.0f - progress; + } + + clr_t col = clr_t::blend( col_start, col_end, progress ); + + + ui_draw_rect( x + i, y, 1, m_height, col ); + } + } + } + + private: + float* m_progress; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_render.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_render.h new file mode 100644 index 0000000..6dd27cc --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_render.h @@ -0,0 +1,57 @@ +#pragma once + +#include "ui_base_item.h" + +namespace ui +{ + //recursively render all items + static void render_item( base_item* item, int offset = 0, bool allow_rect = true ) { + if ( !item->get_visible( ) ) return; + + item->reset( ); + item->render( ); + bool reset = false; + RECT original; + + if( allow_rect && item->is_form( ) ) { + auto device = g_d3d.get_device( ); + device->GetScissorRect( &original ); + + auto x = item->get_relative_x( ); + auto y = item->get_relative_y( ); + + RECT new_rect{ + x, + y + 4, + x + item->w( ), + y + item->get_total_height( ) - 7 + }; + + device->SetScissorRect( &new_rect ); + reset = true; + } + + if ( item->get_items( ).size( ) ) { + //madr0fl + int* height_offset = ( int* )_alloca( sizeof( int ) * item->get_items( ).size( ) ); + int cur_offset = 0; + for ( int i = ( int )item->get_items( ).size( ) - 1; i >= 0; --i ) { + auto& cur_item = item->get_items( )[ i ]; + height_offset[ i ] = cur_offset; + cur_offset += cur_item->get_visible( ) ? cur_item->get_total_height( ) + ITEM_OFFSET : 0; + } + + int i{ }; + for ( auto& it : item->get_items( ) ) { + item->set_y_offset( height_offset[ i ] ); + render_item( it.get( ), height_offset[ i ], !reset && allow_rect ); + ++i; + } + } + + if( reset ) { + auto device = g_d3d.get_device( ); + device->SetScissorRect( &original ); + } + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_slider.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_slider.h new file mode 100644 index 0000000..0e55a73 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_slider.h @@ -0,0 +1,165 @@ +#pragma once + +#include "ui_base_item.h" + +namespace ui +{ + template < typename t > + class c_slider : public base_item { + public: + c_slider( int x, int y, int w, t min, t max, const char* text, t* setting, t full, const char* suffix = 0 ) : + base_item( x, y, w, 5, text ), m_setting( setting ), m_suffix( suffix ), + m_min( float( min ) ), m_max( float( max ) ), m_full( full ), m_has_text( true ) { }; + + c_slider( int x, int y, int w, t min, t max, const char* text, t* setting, const char* suffix = 0 ) : + base_item( x, y, w, 5, text ), m_setting( setting ), m_suffix( suffix ), + m_min( float( min ) ), m_max( float( max ) ), m_full( max ), m_has_text( true ) { }; + + c_slider( int x, int y, int w, t min, t max, t* setting, const char* suffix = 0 ) : + base_item( x, y, w, 5, nullptr ), m_setting( setting ), m_suffix( suffix ), + m_min( float( min ) ), m_max( float( max ) ), m_full( max ), m_has_text( false ) { } + + virtual bool is_hovered( ) override { + if ( m_disabled ) return false; + + int x = get_relative_x( ); + int y = get_relative_y( ) + ( m_has_text ? 11 : 2 ); + + int mouse_x, mouse_y; + ui_get_cursor_pos( mouse_x, mouse_y ); + + if( !m_has_text ) { + x += 4; + return mouse_x >= x && mouse_x <= x + m_width - 8 + && mouse_y >= y && mouse_y <= y + m_height + 2; + } + + return mouse_x >= x - 1 && mouse_x <= x + m_width + 1 + && mouse_y >= y && mouse_y <= y + m_height + 2; + } + + void input( ) { + bool mouse_clicked = g_input.is_key_pressed( KEYS_MOUSE1 ); + bool hovered = is_hovered( ); + float progress = 0.f; + int x = get_relative_x( ); + int y = get_relative_y( ) + 2; + int mouse_x, mouse_y; + + *m_setting = ( t )( std::clamp< float >( *m_setting, m_min, m_max ) ); + ui_get_cursor_pos( mouse_x, mouse_y ); + + if ( hovered && mouse_clicked ) { + + float progress{ }; + + if( m_has_text ) { + progress = std::clamp< float >( float( mouse_x - x ) / ( m_width - 3 ), 0.f, 1.0f ); + } + else { + progress = std::clamp< float >( float( mouse_x - x - 4 ) / ( m_width - 10 ), 0.f, 1.0f ); + } + + *m_setting = progress == 1.0f ? m_full : ( t )( ( ( m_max - m_min ) * progress ) + m_min ); + } + + if( !m_has_text ) { + bool y_hover = mouse_y >= y && mouse_y <= y + m_height + 1; + + bool minus_hovered = mouse_x >= x - 1 && mouse_x <= x + 3 && y_hover; + bool plus_hovered = mouse_x >= x + m_width - 2 && mouse_x <= x + m_width + 2 && y_hover; + + if( mouse_clicked ) { + if( !m_mouse_held ) { + if( !std::is_floating_point< t >::value ) { + if( minus_hovered ) *m_setting -= ( t )1; + if( plus_hovered ) *m_setting += ( t )1; + } + else if( m_max - m_min <= 2.0f ) { + if( minus_hovered ) *m_setting -= ( t )0.1f; + if( plus_hovered ) *m_setting += ( t )0.1f; + } + } + + m_mouse_held = true; + } + else { + m_mouse_held = false; + } + } + }; + + void draw_slider( int x, int y ) { + float val = float( *m_setting ); + float progress = ( val - m_min ) / ( m_max - m_min ); + + ui_draw_rect( x, y, m_width, m_height, ui_get_disabled_col( ) ); + + ui_draw_rect( x, y, ( int )( ( m_width - 3 ) * progress ), m_height, ui_get_accent_col( ) ); + ui_draw_rect( x + ( int )( ( m_width - 3 ) * progress ), y, 3, m_height, + is_hovered( ) ? ui_get_text_col( ) : ui_get_accent_col( ) * 0.7f ); + } + + void draw_slider_small( int x, int y ) { + float val = float( *m_setting ); + float progress = ( val - m_min ) / ( m_max - m_min ); + x -= 1; //i couldnt be fucked + + ui_draw_rect( x + 5, y, m_width - 8, m_height, ui_get_disabled_col( ) ); + + ui_draw_rect( x + 5, y, ( int )( ( m_width - 10 ) * progress ), m_height, ui_get_accent_col( ) ); + ui_draw_rect( x + ( int )( ( m_width - 10 ) * progress ) + 3, y, 3, m_height, + is_hovered( ) ? ui_get_text_col( ) : ui_get_accent_col( ) * 0.7f ); + + ui_draw_string( x, y - 3, false, ui_get_text_col( ), "-" ); + ui_draw_string( x + m_width - 2, y - 3, false, ui_get_text_col( ), "+" ); + + char val_str[ 12 ]; + if( m_suffix ) + sprintf_s( val_str, 12, t( 0.1f ) == t( 0 ) ? "%d %s" : "%0.2f %s", *m_setting, m_suffix ); + else + sprintf_s( val_str, 12, t( 0.1f ) == t( 0 ) ? "%d" : "%0.2f", *m_setting ); + + ui_draw_string( x + ( int )( ( m_width - 8 ) * progress ) + 3, y + 2, true, ui_get_text_col( ), val_str ); + } + + virtual int get_total_height( ) const override { + return m_height + ( m_has_text ? 12 : 6 ); + } + + virtual void render( ) override { + int x = get_relative_x( ); + int y = get_relative_y( ); + int text_w, text_h; + char val[ 12 ]; + + input( ); + + //weird hacky fix for floating point vars + if ( m_suffix ) + sprintf_s( val, 12, t( 0.1f ) == t( 0 ) ? "%d %s" : "%0.2f %s", *m_setting, m_suffix ); + else + sprintf_s( val, 12, t( 0.1f ) == t( 0 ) ? "%d" : "%0.2f", *m_setting ); + + if( m_has_text ) { + ui_draw_string( x + 2, y, false, ui_get_text_col( ), m_text ); + ui_get_text_size( text_w, text_h, val ); + ui_draw_string( x + m_width - text_w - 1, y, false, ui_get_text_col( ), val ); + draw_slider( x, y + 12 ); + } + else { + draw_slider_small( x, y + 2 ); + } + } + + + protected: + t* m_setting; + t m_full; + float m_min; + float m_max; + bool m_has_text = true; + const char* m_suffix; + bool m_mouse_held = false; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_tab_manager.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_tab_manager.h new file mode 100644 index 0000000..cf8dff6 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_tab_manager.h @@ -0,0 +1,224 @@ +#pragma once +#include "ui_base_item.h" + + + +namespace ui +{ + namespace { + constexpr int BUTTON_WIDTH = 120; + constexpr int BUTTON_HEIGHT = 80; + + constexpr int SUBTAB_HEIGHT = 25; + } + + class c_tab_sheet : public base_item { + public: + c_tab_sheet( const char* tab_name ) : + base_item( 0, 0, 0, 0, tab_name ), + m_fade_progress( 0 ) { }; + + c_tab_sheet( const char* tab_name, d3d::c_sprite* sprite ) : + base_item( 0, 0, 0, 0, tab_name ), m_sprite( sprite ), + m_fade_progress( 0.f ) { }; + + virtual void render( ) override { }; + virtual bool is_hovered( ) override { + return false; + }; + + public: + float m_fade_progress{ }; + d3d::c_sprite* m_sprite{ }; + }; + + + class c_tab_manager : public base_item { + public: + c_tab_manager( ) : base_item( BUTTON_WIDTH + 11, 0, 0, 0, + xors( "TAB_MANAGER" ) ) { }; + + virtual bool is_hovered( ) override { + return false; + } + + inline void scale_button_fade( c_tab_sheet* item, bool hovered ) { + if ( hovered ) { + constexpr float frequency = 1.f / 0.3f; + const float step = ui_get_frametime( ) * frequency; + + item->m_fade_progress = std::clamp( item->m_fade_progress + step, 0.f, 0.8f ); + } + else { + item->m_fade_progress = 0.f; + } + } + + auto get_selected_tab( ) { + return m_selected_tab; + } + + void draw_tab_button( decltype( m_parent )& button, int start, bool hovered ) { + auto item = ( c_tab_sheet* )button.get( ); + auto text = item->get_text( ); + auto parent_x = m_parent->x( ) + 5; + auto parent_y = m_parent->y( ) + 5; + int item_height = BUTTON_HEIGHT; + + scale_button_fade( item, hovered ); + + ui_draw_rect( parent_x, parent_y + start, BUTTON_WIDTH + 1, + item_height + 1, ui_get_bg_col( ) ); + + ui_draw_line( parent_x + BUTTON_WIDTH - 8, parent_y + start - 1, + parent_x + BUTTON_WIDTH - 8, parent_y + start + BUTTON_HEIGHT + 2, + ui_get_disabled_col( ) ); + + if( hovered ) { + ui_draw_line( parent_x + BUTTON_WIDTH - 8, parent_y + start - 1, + parent_x + BUTTON_WIDTH - 8, parent_y + start + BUTTON_HEIGHT + 2, + ui_get_accent_col( ) * ( item->m_fade_progress + 0.2f ) * 0.8f ); + } + + if( item->m_sprite ) { + auto sprite_color = hovered ? ui_get_text_col( ) * ( ( item->m_fade_progress + 0.3f ) * 0.7f ) : ui_get_disabled_col( ); + item->m_sprite->draw( parent_x + ( BUTTON_WIDTH - 8 ) / 2 - 2, + parent_y + BUTTON_HEIGHT / 2 + start, sprite_color ); + } + } + + inline bool is_button_hovered( int start ) { + auto item_x = m_parent->x( ) + 5; + auto item_y = m_parent->y( ) + 5 + start; + int item_height = BUTTON_HEIGHT; + int mouse_x, mouse_y; + + ui_get_cursor_pos( mouse_x, mouse_y ); + + return mouse_x >= item_x && mouse_x <= item_x + BUTTON_WIDTH - 8 + && mouse_y >= item_y && mouse_y <= item_y + item_height; + } + + virtual void render( ) override { + if ( !m_items.empty( ) ) { + int cur_y{ 10 }; + for ( auto& it : m_items ) { + it->set_visible( false ); + bool hovered = is_button_hovered( cur_y ); + if ( g_input.is_key_pressed( KEYS_MOUSE1 ) && hovered ) { + //fix items that disable input mess it up when changing tabs + set_disabled_callbacks( false ); + m_selected_tab = it; + } + + draw_tab_button( it, cur_y, hovered || it == m_selected_tab ); + cur_y += BUTTON_HEIGHT + 4; + } + } + + if ( !m_selected_tab ) { + m_selected_tab = m_items.front( ); + } + + m_selected_tab->set_visible( true ); + } + + protected: + decltype( m_parent ) m_selected_tab{ }; + }; + + + class c_subtab_manager : public base_item { + public: + c_subtab_manager( ) : base_item( 0, 35, 0, 5, + xors( "SUBTAB_MANAGER" ) ) { } + + virtual bool is_hovered( ) override { return false; } + + int get_button_width( ) { + int width = get_top_parent( )->w( ) - BUTTON_WIDTH - 26; + + if ( !m_items.empty( ) ) + return ( int )std::ceilf( float( width ) / float( m_items.size( ) ) ); + + return width; + } + + inline void scale_button_fade( c_tab_sheet* item, bool hovered ) { + if ( hovered ) { + constexpr float frequency = 1.f / 0.3f; + const float step = ui_get_frametime( ) * frequency; + + item->m_fade_progress = std::clamp( item->m_fade_progress + step, 0.f, 0.8f ); + } + else { + item->m_fade_progress = 0.f; + } + } + + auto get_selected_tab( ) { + return m_selected_tab; + } + + void render_button( decltype( m_parent )& button, int start, bool hovered ) { + auto item = ( c_tab_sheet* )button.get( ); + auto item_x = get_relative_x( ) + start - 2; + auto item_y = get_relative_y( ) + 3 - m_y; + auto width = get_button_width( ); + + scale_button_fade( item, hovered ); + clr_t tab_clr = ui_get_disabled_col( ); + + //ui_draw_rect( item_x, item_y, get_button_width( ), SUBTAB_HEIGHT, ui_get_bg_col( ) ); + ui_draw_rect( item_x + 1, item_y + SUBTAB_HEIGHT - 2, width, 2, tab_clr ); + if ( hovered ) { + clr_t col = ui_get_accent_col( ); + col.a( ) *= item->m_fade_progress; + ui_draw_rect( item_x + 1, item_y + SUBTAB_HEIGHT - 2, width, 2, col ); + } + + ui_draw_string( item_x + width / 2, item_y + 4, true, ui_get_text_col( ), item->get_text( ) ); + } + + bool is_button_hovered( decltype( m_parent )& button, int start ) { + int item_x = get_relative_x( ) + start - 2; + int item_y = get_relative_y( ) + 3 - m_y - 3; + int item_w = get_button_width( ); + int mouse_x, mouse_y; + + ui_get_cursor_pos( mouse_x, mouse_y ); + + return mouse_x >= item_x && mouse_x <= item_x + item_w && + mouse_y >= item_y && mouse_y <= item_y + SUBTAB_HEIGHT; + } + + virtual void render( ) override { + if ( !m_items.empty( ) ) { + int start = 2; + int width = get_button_width( ); + + for ( auto& it : m_items ) { + it->set_visible( false ); + bool hovered = is_button_hovered( it, start ); + if ( g_input.is_key_pressed( KEYS_MOUSE1 ) && hovered ) { + //fix items that disable input mess it up when changing tabs + set_disabled_callbacks( false ); + m_selected_tab = it; + } + + render_button( it, start, hovered || it == m_selected_tab ); + start += width; + } + + if ( !m_selected_tab ) { + m_selected_tab = m_items.front( ); + } + + m_selected_tab->set_visible( true ); + } + } + + protected: + decltype( m_parent ) m_selected_tab; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.cpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.cpp new file mode 100644 index 0000000..db1ec7c --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.cpp @@ -0,0 +1,86 @@ +#include "ui_text_input.h" +#include + +#include + +void ui::c_text_input::render( ) { + if( is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + if( !m_was_held ) { + m_active ^= 1; + } + m_was_held = true; + } + else { + m_was_held = false; + } + + if( m_active ) { + if( !is_hovered( ) && g_input.is_key_pressed( KEYS_MOUSE1 ) ) { + m_active = false; + } + + float current_time = GetTickCount( ) * 0.001f; + size_t length = strlen( m_text_ptr ); + + for( size_t i{ }; i < 0xfe; ++i ) { + if( g_input.is_key_pressed( i ) ) { + float delta_time = current_time - m_last_key_input[ i ]; + if( fabs( delta_time ) > 0.2f ) { + if( i == KEYS_BACK ) { + m_text_ptr[ length - 1 ] = 0; + m_last_key_input[ i ] = current_time; + continue; + } + + if( i == KEYS_RETURN ) { + m_active = false; + break; + } + + m_key_states[ i ] = 0xf0; + wchar_t pressed_char; + const auto scan = MapVirtualKeyA( i, 2 ); + auto ret = ToAscii( i, scan, ( BYTE* )m_key_states, ( LPWORD )&pressed_char, 1 ); + + if( ret == 1 ) { + if( length < m_text_len ) { + m_text_ptr[ length ] = ( char )( pressed_char ); + m_text_ptr[ length + 1 ] = 0; + } + } + m_last_key_input[ i ] = current_time; + } + } + else { + m_last_key_input[ i ] = 0.f; + m_key_states[ i ] = 0; + } + } + + if( g_input.is_key_pressed( KEYS_RETURN ) ) { + m_active = false; + } + } + + int x = get_relative_x( ); + int y = get_relative_y( ); + + ui_draw_string( x + 2, y, false, ui_get_text_col( ), m_text ); + y += 12; + + ui_draw_rect( x - 1, y - 1, m_width + 2, m_height + 2, + ( is_hovered( ) || m_active ) ? ui_get_text_col( ) : ui_get_accent_col( ) ); + ui_draw_rect( x, y, m_width, m_height, ui_get_disabled_col( ) ); + + if( !m_hidden ) + ui_draw_string( x + 2, y + 3, false, ui_get_text_col( ), m_active ? "%s_" : "%s", m_text_ptr ); + else { + std::string str; + str.append( strlen( m_text_ptr ), '*' ); + + if( m_active ) + str += '_'; + + ui_draw_string( x + 2, y + 3, false, ui_get_text_col( ), str.c_str( ) ); + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.h new file mode 100644 index 0000000..243c40b --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui_text_input.h @@ -0,0 +1,38 @@ +#pragma once +#include "ui_base_item.h" + +namespace ui +{ + class c_text_input : public base_item { + public: + c_text_input( int x, int y, int w, const char* name, size_t max_chars, char* str, bool hidden = false ) : + base_item( x, y, w, 16, name ), m_text_len( max_chars ), m_text_ptr( str ), m_hidden( hidden ) { + } + + virtual bool is_hovered( ) override { + int cursor_x, cursor_y; + ui_get_cursor_pos( cursor_x, cursor_y ); + + int x = get_relative_x( ); + int y = get_relative_y( ) + 12; + + return cursor_x >= x && cursor_x <= x + m_width + && cursor_y >= y && cursor_y <= y + m_height; + } + + virtual int get_total_height( ) const override { + return m_height + 12; + } + + virtual void render( ) override; + + protected: + bool m_was_held{ }; + char* m_text_ptr{ }; + size_t m_text_len{ }; + bool m_active{ }; + float m_last_key_input[ KEYS_LAST ]{ }; + uint8_t m_key_states[ 256 ]{ }; + bool m_hidden{ }; + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/util.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/util.hpp new file mode 100644 index 0000000..f3d2ae3 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/util.hpp @@ -0,0 +1,85 @@ +#pragma once +#include +#include +#include + +#define xors( s ) s + +#define NAMESPACE_REGION( x ) namespace x { +#define END_REGION } + +extern int TIME_TO_TICKS( float dt ); +extern float TICKS_TO_TIME( int tick ); +extern float TICK_INTERVAL( ); + +//WEE WOO WEE WOO ITS THE DWORD POLICE +using ulong_t = unsigned long; +using uword_t = unsigned short; + +class IClientEntity; +class CTraceFilter; +class CGameTrace; +class vec3_t; +class vec2_t; + +NAMESPACE_REGION( util ) + +typedef std::unique_ptr< void, void( ) > unique_handle; + +template < typename t > +struct reverse_iterable { + reverse_iterable( t&& it ) : + iterable( it ) { } + + t& iterable; + inline auto begin( ) { + return std::rbegin( iterable ); + } + + inline auto end( ) { + return std::rend( iterable ); + } +}; + +template< typename t > +reverse_iterable< t > +reverse_iterator( t&& iter ) { + return reverse_iterable< t >{ iter }; +} + +template < typename fn > __forceinline fn get_vfunc( void* classbase, int index ) { + if( !classbase ) return fn{ }; + return ( fn )( *( uintptr_t** )classbase )[ index ]; +} + +template < size_t index, typename ret, class ... args_ > +__forceinline ret get_vfunc( void* thisptr, args_... args ) { + using fn = ret( __thiscall* )( void*, args_... ); + + auto fn_ptr = ( fn )( *( uintptr_t** )thisptr )[ index ]; + return fn_ptr( thisptr, args... ); +} + +__forceinline std::string unicode_to_ascii( const std::wstring& unicode ) { + std::string ascii_str( unicode.begin( ), unicode.end( ) ); + return ascii_str; +} + +__forceinline std::wstring ascii_to_unicode( const std::string& ascii ) { + std::wstring unicode_str( ascii.begin( ), ascii.end( ) ); + return unicode_str; +} + +template < typename integer > +__forceinline auto to_hex_str( const integer& w, + size_t hex_len = sizeof( integer ) << 1 ) { + constexpr char* hex_digits = xors( "0123456789abcdef" ); + std::string rc( hex_len, 0 ); + + for( size_t i{ }, j{ ( hex_len - 1 ) * 4 }; i < hex_len; ++i, j -= 4 ) + rc[ i ] = hex_digits[ ( w >> j ) & 0x0f ]; + + return rc; +} + +END_REGION \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp new file mode 100644 index 0000000..a05cba6 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.cpp @@ -0,0 +1,160 @@ +#pragma once +#include "window.hpp" +#include "d3d.hpp" +#include "math.hpp" + +d3d::c_window g_window; + +namespace d3d +{ + c_window::c_window() { m_size[0] = 451; m_size[1] = 376; generate_random_name(); } //ugh + c_window::~c_window( ) { } + + void c_window::generate_random_name() { + static const char alphanum[] = + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz"; + + int i = 0; + for(; i < math::random_number(16, 31); ++i) { + m_window_name[i] = alphanum[rand() % (sizeof(alphanum) - 1)]; + } + + m_window_name[++i] = 0; + } + + LRESULT __stdcall c_window::window_procedure( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { + if( msg == WM_MOUSEMOVE ) { + g_input.capture_mouse_move( lparam ); + } + + g_input.register_key_press( ( VirtualKeyEvents_t )( msg ), VirtualKeys_t( wparam ) ); + + switch( msg ) { + case WM_SIZE: + if( g_window.m_d3d_device && wparam != SIZE_MINIMIZED ) { + g_window.m_present_params.BackBufferWidth = LOWORD( lparam ); + g_window.m_present_params.BackBufferHeight = HIWORD( lparam ); + + g_d3d.on_device_lost( ); + auto result = g_window.m_d3d_device->Reset( &g_window.m_present_params ); + g_d3d.on_device_reset( ); + } + return 0; + case WM_SYSCOMMAND: + if( ( wparam & 0xfff0 ) == SC_KEYMENU ) //disable alt thing + return 0; + break; + + + case WM_DESTROY: + ExitProcess(0); + } + + return DefWindowProc( hwnd, msg, wparam, lparam ); + } + + bool c_window::create( ) { + m_wc.cbSize = sizeof( WNDCLASSEX ); + m_wc.style = CS_VREDRAW | CS_HREDRAW; + m_wc.lpfnWndProc = window_procedure; + m_wc.cbClsExtra = 0; + m_wc.cbWndExtra = 0; + m_wc.hInstance = 0; + m_wc.hIcon = LoadIcon( 0, IDI_APPLICATION ); + m_wc.hCursor = LoadCursor( 0, IDC_ARROW ); + m_wc.lpszMenuName = 0; + m_wc.lpszClassName = m_window_name; + m_wc.hIconSm = LoadIcon( 0, IDI_APPLICATION ); + + //m_wc.hbrBackground = ( HBRUSH )( RGB( 0, 0, 0 ) ); + + RegisterClassEx( &m_wc ); + + m_hwnd = CreateWindowExA( WS_EX_TRANSPARENT, m_window_name, m_window_name, WS_POPUP, + CW_USEDEFAULT, CW_USEDEFAULT, m_size[ 0 ], m_size[ 1 ], nullptr, nullptr, nullptr, 0 ); + + if( !m_hwnd ) { + return false; + } + + //SetLayeredWindowAttributes( m_hwnd, RGB( 0, 0, 0 ), 0, ULW_COLORKEY ); + //SetLayeredWindowAttributes( m_hwnd, RGB( 0, 0, 0 ), 255, LWA_ALPHA ); + ShowWindow( m_hwnd, SW_SHOWDEFAULT ); + UpdateWindow( m_hwnd ); + + //MARGINS margin = { -1, -1, -1, -1 }; + //DwmExtendFrameIntoClientArea( m_hwnd, &margin ); + + MoveWindow( m_hwnd, 20, 20, m_size[ 0 ], m_size[ 1 ], true ); + + return init_d3d( ); + } + + bool c_window::init_d3d( ) { + if( !( m_d3d = Direct3DCreate9( D3D_SDK_VERSION ) ) ) { + UnregisterClass(m_window_name, m_wc.hInstance ); + return false; + } + + ZeroMemory( &m_present_params, sizeof( m_present_params ) ); + + m_present_params.Windowed = true; + m_present_params.SwapEffect = D3DSWAPEFFECT_DISCARD; + m_present_params.BackBufferFormat = D3DFMT_A8R8G8B8; + m_present_params.hDeviceWindow = m_hwnd; + m_present_params.EnableAutoDepthStencil = true; + m_present_params.AutoDepthStencilFormat = D3DFMT_D16; + m_present_params.MultiSampleType = D3DMULTISAMPLE_NONE; + m_present_params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; + m_present_params.BackBufferCount = 1; + m_present_params.BackBufferWidth = m_size[ 0 ]; + m_present_params.BackBufferHeight = m_size[ 1 ]; + + if( m_d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &m_present_params, &m_d3d_device ) < 0 ) { + m_d3d->Release( ); + UnregisterClass(m_window_name, m_wc.hInstance ); + return false; + } + + return true; + } + + void c_window::on_frame( ) { + while( m_msg.message != WM_QUIT ) { + if( PeekMessage( &m_msg, 0, 0, 0, PM_REMOVE ) ) { + TranslateMessage( &m_msg ); + DispatchMessage( &m_msg ); + + continue; + } + + if( m_d3d_device ) { + auto device_state = m_d3d_device->TestCooperativeLevel( ); + if( device_state != D3D_OK ) { + g_d3d.on_device_lost( ); + m_d3d_device->Reset( &m_present_params ); + g_d3d.on_device_reset( ); + } + + + if( m_d3d_device->BeginScene( ) >= 0 ) { + for( auto& onframe : m_onframe_vec ) { + if( onframe ) { + onframe( ); + } + } + //m_d3d_device->SetRenderState( D3DRS_ZENABLE, false ); + //m_d3d_device->SetRenderState( D3DRS_ALPHABLENDENABLE, false ); + //m_d3d_device->SetRenderState( D3DRS_SCISSORTESTENABLE, false ); + m_d3d_device->EndScene( ); + } + + m_d3d_device->Present( nullptr, nullptr, nullptr, nullptr ); + Sleep( 1 ); + } + } + } +} + diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.hpp b/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.hpp new file mode 100644 index 0000000..54cc6a9 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/window.hpp @@ -0,0 +1,62 @@ +#pragma once +#include +#include + +#pragma comment(lib, "d3d9.lib") +#pragma comment(lib, "d3dx9.lib") + +#include +#include + +#include +#pragma comment(lib, "dwmapi.lib") +#pragma comment(lib, "winmm.lib") + +#include + +#include "input_system.hpp" + +namespace d3d +{ + typedef void( *on_frame_fn )( ); + + class c_window { + char m_window_name[32]; + public: + c_window( ); + ~c_window( ); + + void generate_random_name(); + + bool create( ); + void on_frame( ); + void add_on_frame( on_frame_fn fn ) { + m_onframe_vec.push_back( fn ); + } + + HWND get_hwnd( ) { return m_hwnd; } + + private: + bool init_d3d( ); + + public: + static LRESULT __stdcall window_procedure( HWND, UINT, WPARAM, LPARAM ); + + private: + HWND m_hwnd{ }; + int m_size[ 2 ]{ }; + + WNDCLASSEX m_wc{ }; + MSG m_msg{ }; + + public: + LPDIRECT3DDEVICE9 m_d3d_device{ }; + D3DPRESENT_PARAMETERS m_present_params{ }; + LPDIRECT3D9 m_d3d{ }; + + private: + std::vector< on_frame_fn > m_onframe_vec; + }; +} + +extern d3d::c_window g_window; \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/UserInterface.cpp b/csgo-loader/csgo-client/UserExperience/UserInterface.cpp new file mode 100644 index 0000000..f8f465f --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/UserInterface.cpp @@ -0,0 +1,65 @@ +#include + +#include +#include +#include + +// Global accessor for the user interface. +UserExperience::UserInterfacePtr UserInterface = std::make_unique(); + +namespace UserExperience { + void OnDirectXFrame() { + if(g_d3d.run_frame(g_window.m_d3d_device)) { + g_d3d.begin(); + for(auto& it : d3d::sprites) { + it->begin(g_window.m_d3d_device); + } + + static auto last_time = GetTickCount() * 0.001f; + auto cur_time = GetTickCount() * 0.001f; + + auto deltatime = cur_time - last_time; + + last_time = cur_time; + + constexpr float anim_step = 1.0f / 15.f; + static float anim_time = 0.f; + static bool flip = false; + if(anim_time == 1.0f) { + flip = true; + } + if(anim_time == 0.f) { + flip = false; + } + + if(flip) anim_time = std::clamp(anim_time - anim_step * deltatime, 0.f, 1.0f); + else anim_time = std::clamp(anim_time + anim_step * deltatime, 0.f, 1.0f); + + ui::set_animtime(anim_time); + ui::render(); + + RECT cur_rect{ }; + GetWindowRect(g_window.get_hwnd(), &cur_rect); + + g_d3d.end(); + for(auto& it : d3d::sprites) { + it->end(); + } + } + } + + bool UserInterface::Start() { + bool result = g_window.create(); + + if(result) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + g_window.add_on_frame(&OnDirectXFrame); + } + + return result; + } + + void UserInterface::RunUiFrame() { + g_window.on_frame(); + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/UserInterface.hpp b/csgo-loader/csgo-client/UserExperience/UserInterface.hpp new file mode 100644 index 0000000..332b042 --- /dev/null +++ b/csgo-loader/csgo-client/UserExperience/UserInterface.hpp @@ -0,0 +1,63 @@ +#pragma once + +#include +#include +#include +#include + +namespace UserExperience { + // Execution states define a moment in the execution of the loader. + // These may be changed externally by other threads. + enum ExecutionState : uint16_t { + EXECUTION_WAITING, // Displays the message 'please wait...'. + EXECUTION_ERROR, // Displays an error. + EXECUTION_LOG_IN, // Displays the log-in dialog. + EXECUTION_CHOOSE // Displays the game selection dialog. + }; + + enum ErrorReason : uint16_t { + ERROR_GENERIC_ERROR, + ERROR_INVALID_HWID, + ERROR_SHADOW_BAN + }; + + // Structure that holds global data that will be used by the UI. + struct UserExperienceData { + // Holds the current execution state of the loader. + ExecutionState m_ExecutionState = EXECUTION_WAITING; + + // Holds the username/password combo entered in the UI. + char m_Username[128]; + char m_Password[128]; + + // Does the user have special access? + bool m_SpecialAccess = false; + + // Holds the selected game. + int32_t m_SelectedGame = 0; + + // Holds the current error message. + ErrorReason m_Error = ERROR_GENERIC_ERROR; + }; + + // User experience handler. + class UserInterface { + public: + UserExperienceData m_Data; + + // Creates a window. + bool Start(); + + // Creates an UI thread, call only once. + void RunUiFrame(); + }; + + using UserInterfacePtr = std::unique_ptr; +} + +extern UserExperience::UserInterfacePtr UserInterface; + +// Sick macros, retard. + +#define ERROR_ASSERT(Error, ...) { char Buffer[1024 * 16]; sprintf_s(Buffer, sizeof Buffer, Error, __VA_ARGS__); MessageBoxA(0, Buffer, "", MB_ICONERROR); ExitProcess(0); } +#define INFO_ASSERT(Error, ...) { char Buffer[1024 * 16]; sprintf_s(Buffer, sizeof Buffer, Error, __VA_ARGS__); MessageBoxA(0, Buffer, "", MB_OK); ExitProcess(0); } diff --git a/csgo-loader/csgo-client/csgo-client.vcxproj b/csgo-loader/csgo-client/csgo-client.vcxproj new file mode 100644 index 0000000..9dc8b61 --- /dev/null +++ b/csgo-loader/csgo-client/csgo-client.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15.0 + {084F93FE-7F05-446D-8403-B5903F9C72DE} + csgoclient + 10.0.17763.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)bin\$(Configuration)\ + $(SolutionDir)build\$(Configuration)\Client\ + $(ExecutablePath) + $(SolutionDir)themida-sdk\include;$(DXSDK_DIR)\Include;$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); + $(SolutionDir)themida-sdk\lib;$(DXSDK_DIR)\Lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + + + $(SolutionDir)bin\$(Configuration)\ + $(SolutionDir)build\$(Configuration)\Client\ + $(ExecutablePath) + $(SolutionDir)themida-sdk\include;$(DXSDK_DIR)\Include;$(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); + $(SolutionDir)themida-sdk\lib;$(DXSDK_DIR)\Lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + + + + Level3 + Disabled + true + true + + + + + Level4 + Disabled + true + true + _WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN;NOMINMAX;DEBUG;_MBCS;%(PreprocessorDefinitions) + true + stdcpp17 + 4100;4189;4244;4267;4522;4714;4838; + + + RequireAdministrator + Windows + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + Level4 + MaxSpeed + true + true + true + true + _WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN;NOMINMAX;_MBCS;%(PreprocessorDefinitions) + true + stdcpp17 + 4100;4189;4244;4267;4522;4714;4838; + + + true + true + RequireAdministrator + Windows + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/csgo-loader/csgo-client/csgo-client.vcxproj.filters b/csgo-loader/csgo-client/csgo-client.vcxproj.filters new file mode 100644 index 0000000..2040b2b --- /dev/null +++ b/csgo-loader/csgo-client/csgo-client.vcxproj.filters @@ -0,0 +1,154 @@ + + + + + {c0b87a42-5f8c-4ec7-919a-16b441abdd94} + + + {3e8f141d-613e-4d66-ac05-291558658254} + + + {98ddda7c-73be-42b5-b886-54a50b15fa4d} + + + {3c9a9cd2-82c3-4375-b31a-5a520499c3c4} + + + {b7c1f216-0875-4f2f-80b1-ae8effd88227} + + + {d0ee88e4-0de5-4beb-9117-d57c25848e4e} + + + + + + Security + + + Networking + + + Login + + + Security + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience + + + RemoteCode + + + + + Security + + + Networking + + + Login + + + Security + + + Security + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience\MoneybotShared + + + UserExperience + + + RemoteCode + + + \ No newline at end of file diff --git a/csgo-loader/csgo-loader.sln b/csgo-loader/csgo-loader.sln new file mode 100644 index 0000000..00c0fe1 --- /dev/null +++ b/csgo-loader/csgo-loader.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.106 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csgo-client", "csgo-client\csgo-client.vcxproj", "{084F93FE-7F05-446D-8403-B5903F9C72DE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csgo-server", "csgo-server\csgo-server.vcxproj", "{97FAC435-B009-4571-AE91-31DC52D47598}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Debug|x64.ActiveCfg = Debug|x64 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Debug|x64.Build.0 = Debug|x64 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Debug|x86.ActiveCfg = Debug|Win32 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Debug|x86.Build.0 = Debug|Win32 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Release|x64.ActiveCfg = Release|x64 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Release|x64.Build.0 = Release|x64 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Release|x86.ActiveCfg = Release|Win32 + {084F93FE-7F05-446D-8403-B5903F9C72DE}.Release|x86.Build.0 = Release|Win32 + {97FAC435-B009-4571-AE91-31DC52D47598}.Debug|x64.ActiveCfg = Debug|x64 + {97FAC435-B009-4571-AE91-31DC52D47598}.Debug|x64.Build.0 = Debug|x64 + {97FAC435-B009-4571-AE91-31DC52D47598}.Debug|x86.ActiveCfg = Debug|Win32 + {97FAC435-B009-4571-AE91-31DC52D47598}.Debug|x86.Build.0 = Debug|Win32 + {97FAC435-B009-4571-AE91-31DC52D47598}.Release|x64.ActiveCfg = Release|x64 + {97FAC435-B009-4571-AE91-31DC52D47598}.Release|x64.Build.0 = Release|x64 + {97FAC435-B009-4571-AE91-31DC52D47598}.Release|x86.ActiveCfg = Release|Win32 + {97FAC435-B009-4571-AE91-31DC52D47598}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1511A0FE-9AB1-4526-BDF9-E3B0D4B0FBB1} + EndGlobalSection +EndGlobal diff --git a/csgo-loader/csgo-server/Login/RemoteLogin.cpp b/csgo-loader/csgo-server/Login/RemoteLogin.cpp new file mode 100644 index 0000000..880c072 --- /dev/null +++ b/csgo-loader/csgo-server/Login/RemoteLogin.cpp @@ -0,0 +1,51 @@ +#include + +#define EXPECTED_CLIENT_HEADER 0xDEADBEEF + +namespace Login { + bool RemoteLoginServer::Start(ByteArray &RawLoginHeader) { + if(RawLoginHeader.empty()) + return false; + + // Epic direct casts :---DDDD + m_Header = *reinterpret_cast(&RawLoginHeader[0]); + return true; + } + + RemoteLoginResponse RemoteLoginServer::GetLoginResponse() { + // The header seems to be wrong, tell the client to update. + if(m_Header.m_ClientHeader != EXPECTED_CLIENT_HEADER) + return RemoteLoginResponse::OUTDATED_CLIENT; + + // TODO: Check login, HWID, bans with websockets. + + // User failed to obtain HWID? + if(!m_Header.m_HardwareId) { + // TODO: Shadow ban the user. + + //return RemoteLoginResponse::INVALID_HARDWARE; + } + + // Checksum validation. + uint8_t Checksum = m_Header.m_IntegrityBit1 + | m_Header.m_IntegrityBit2 + | m_Header.m_IntegrityBit3; + + if(Checksum || Checksum != m_Header.m_IntegrityBit4) { + // TODO: Shadow ban the user. + return RemoteLoginResponse::INTEGRITY_FAILURE; + } + + // Assume that they are authorised to use the cheat. + return RemoteLoginResponse::ACCESS_SPECIAL_USER; + } + + ByteArray RemoteLoginServer::GetResponse() { + // The way the server handles data transmission is homosexual. + // That is the only reason this autism is here. + ByteArray Response; + Response.push_back(GetLoginResponse()); + + return Response; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Login/RemoteLogin.hpp b/csgo-loader/csgo-server/Login/RemoteLogin.hpp new file mode 100644 index 0000000..36b7252 --- /dev/null +++ b/csgo-loader/csgo-server/Login/RemoteLogin.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include +#include +#include + +using ByteArray = std::vector; + +namespace Login { + // Login header that is sent over to the server + struct RemoteLoginHeader { + // The first four bytes are encoded by the client. + // This will carry the client version which can be checked. + uint32_t m_ClientHeader; + + // The username is raw text. + // TODO: Hash the password client-side. + char m_Username[128]; + char m_Password[128]; + + // This will provide the hardware ID of the machine. + uint32_t m_HardwareId; + + // These fields will be set according + // to security check results. + uint8_t m_IntegrityBit1; // Detour detected on NTDLL function + uint8_t m_IntegrityBit2; // Detour detected on dummy function + uint8_t m_IntegrityBit3; // Virtual machine/Debugger detected + uint8_t m_IntegrityBit4; // m_IntegrityBit1 | m_IntegrityBit2 | m_IntegrityBit3 (checksum) + }; + + // Possible server responses + // The hardware ID is encoded (XORed with the message ID) within the message for + // shadow ban/forum ban purposes. :) + enum RemoteLoginResponse : uint8_t { + OUTDATED_CLIENT = 'A', // '[000A:{HWID}] Your client is outdated. Please download the latest client at 'moneybot.cc'.' + ACCESS_AUTHORISED = 'B', // Allows the user to continue with injection. + INVALID_CREDENTIALS = 'C', // '[000C:{HWID}] Your credentials are invalid. Please check your spelling and try again.' + USER_BANNED = 'D', // '[000D:{HWID}] Your account is banned. Please contact 'admin@moneybot.cc' for additional information.' + INVALID_HARDWARE = 'E', // '[000E:{HWID}] Please contact an administrator to request a hardware ID reset.' + INTEGRITY_FAILURE = 'F', // '[000F:{HWID}] Failed to verify session. Please contact an administrator.' AKA the 'shadow ban', blacklists user from loader but not from forums. + NO_SUBSCRIPTION = 'G', // '[000G:{HWID}] No active subscription.' + ACCESS_SPECIAL_USER = 'H', // Allows the user to continue, sets the m_SpecialAccess var + }; + // Implementation of the server (handles login bullshit). + class RemoteLoginServer { + RemoteLoginHeader m_Header; + + // Polls the server for data, responds with whether or not the client + // is allowed to use the cheat. + RemoteLoginResponse GetLoginResponse(); + + public: + // Initialises the login header. + bool Start(ByteArray &RawLoginHeader); + + ByteArray GetResponse(); + + // TODO: Implement shadow banning based on IP and HWID. + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Networking/TCPServer.cpp b/csgo-loader/csgo-server/Networking/TCPServer.cpp new file mode 100644 index 0000000..725bf1a --- /dev/null +++ b/csgo-loader/csgo-server/Networking/TCPServer.cpp @@ -0,0 +1,124 @@ +#include + +namespace Networking { + void TCPConnection::Close() { + printf("[<=] %s disconnected!\n", m_IpAddress); + + if(m_Socket) + closesocket(m_Socket); + } + + // We will only receive up to 256 bytes per cycle. + constexpr int BufferSize = 256; + + void TCPConnection::SendRawBytes(ByteArray &Bytes) { + // Send data. + int32_t Result = send(m_Socket, (char *)Bytes.data(), (int)Bytes.size(), 0); + + printf("[=>] Sending %zd bytes to %s.\n", Bytes.size(), m_IpAddress); + + if(Result == -1) + printf("[=>] Failed to send %zd bytes to %s. (Socket %04Ix)\n", Bytes.size(), m_IpAddress, m_Socket); + } + + ByteArray TCPConnection::ReceiveRawBytes() { + ByteArray ReceivedBytes; + uint8_t RecvBuffer[BufferSize]; + + // Attempt to receive a packet. + while(true) { + int32_t Received = recv(m_Socket, (char*)RecvBuffer, BufferSize, 0); + + // No more bytes left to receive. + if(Received < 0) + break; + + // Emplace all received bytes. + for(int n = 0; n < Received; ++n) { + ReceivedBytes.push_back(RecvBuffer[n]); + } + + // No more bytes left to receive. + if(Received < BufferSize) + break; + } + + printf("[<=] Received %zd bytes from %s.\n", ReceivedBytes.size(), m_IpAddress); + + return ReceivedBytes; + } + + void TCPConnection::SendBytes(ByteArray &Bytes) { + // Encrypt outgoing data. + ByteArray Encrypted = m_Encryption.Encrypt(Bytes); + + SendRawBytes(Encrypted); + } + + ByteArray TCPConnection::ReceiveBytes() { + ByteArray ReceivedBytes = ReceiveRawBytes(); + + // Decrypt incoming data. + ByteArray Decrypted = m_Encryption.Decrypt(ReceivedBytes); + + return Decrypted; + } + + bool TCPServer::Start(uint16_t ServerPort) { + const int32_t version = 0x101; + + // Initialise WinSocks. + if(WSAStartup(version, &m_WinSocks)) + return false; + + // Create an IPv4 socket. + m_Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if(m_Socket == INVALID_SOCKET) + return false; + + // Set up server context. + m_Context.sin_addr.s_addr = INADDR_ANY; + m_Context.sin_family = AF_INET; + m_Context.sin_port = htons(ServerPort); + + int32_t Bind = bind(m_Socket, (sockaddr *)&m_Context, sizeof sockaddr_in); + + if(Bind == INVALID_SOCKET) + return false; + + // Start listening. + printf("[INFO] Server listening on port %d.\n", ServerPort); + listen(m_Socket, 1); + + return true; + } + + void TCPServer::AcceptConnection() { + sockaddr_in IncomingConnection; + int32_t AddressLength = sizeof IncomingConnection; + + // Accept the incoming connection. + SOCKET IncomingSocket = accept(m_Socket, (sockaddr *)&IncomingConnection, &AddressLength); + + if(IncomingSocket != INVALID_SOCKET) { + Wrapper::Encryption Encryption; + + // Initialise encryption context. + Encryption.Start(); + + // Attempt handshake with client. + TCPConnection Connection(IncomingSocket, inet_ntoa(IncomingConnection.sin_addr), Encryption); + + ByteArray EncryptionKey = Connection.GetEncryptionKey(); + Connection.SendRawBytes(EncryptionKey); + + // Detach a thread to handle the connection. + std::thread thread([&] { + m_ConnectionHandler(Connection); + Connection.Close(); + }); + thread.detach(); + } + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Networking/TCPServer.hpp b/csgo-loader/csgo-server/Networking/TCPServer.hpp new file mode 100644 index 0000000..adb6e7c --- /dev/null +++ b/csgo-loader/csgo-server/Networking/TCPServer.hpp @@ -0,0 +1,87 @@ +#pragma once + +// For encryption wrappers. +#include + +// WinSocks +#include +#pragma comment(lib, "ws2_32.lib") + +// std::function +#include + +// std::min +#include + +// std::thread +#include + +namespace Networking { + // Base connection class, used to handle multiple connections in a thread-based model. + class TCPConnection { + SOCKET m_Socket; + Wrapper::Encryption m_Encryption; + const char *m_IpAddress; + public: + // Initialiser for TCPConnection class. + TCPConnection(SOCKET Connection, const char *IpAddress, Wrapper::Encryption &RSA) : + m_Encryption(RSA), m_Socket(Connection), m_IpAddress(IpAddress) { + printf("[=>] %s connected!\n", IpAddress); + } + + // Release the connection once it goes out of scope. + void Close(); + + // Wrappers for sending/receiving data. + void SendRawBytes(ByteArray &Bytes); + ByteArray ReceiveRawBytes(); + + void SendBytes(ByteArray &Bytes); + ByteArray ReceiveBytes(); + + // Overload for getting the socket, in case we need to expose it. + SOCKET operator()() { + return m_Socket; + } + + // Expose the encryption key for the connection. + ByteArray GetEncryptionKey() { + return m_Encryption.GetKey(); + } + }; + + // Basic TCP server. Supports custom connection handling (pass a lambda to the handler list). + using ConnectionHandler = std::function; + + class TCPServer { + WSADATA m_WinSocks; + SOCKET m_Socket; + sockaddr_in m_Context; + + // Connection handlers, will be called sequentially upon connection. + ConnectionHandler m_ConnectionHandler; + + public: + // Default constructor, nothing needed for now. + TCPServer() = default; + + // Handle destruction of server once it goes out of scope. + ~TCPServer() { + // If we have a socket, close it. + if(m_Socket) + closesocket(m_Socket); + + // Close WSA context. + WSACleanup(); + } + + // Handle the creation and handling of TCPServer connections. + bool Start(uint16_t ServerPort); + void AcceptConnection(); + + // Overload for adding connection handlers, C# style support for events. + void operator+=(std::function Function) { + m_ConnectionHandler = Function; + } + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Networking/WebSocket.cpp b/csgo-loader/csgo-server/Networking/WebSocket.cpp new file mode 100644 index 0000000..755e89b --- /dev/null +++ b/csgo-loader/csgo-server/Networking/WebSocket.cpp @@ -0,0 +1,44 @@ +#include + +namespace Networking { + // Initialises a basic HTTP socket. + bool WebSocket::Start(const char *Address, const char *Username, const char *Password) { + m_Internet = InternetOpenA("none", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0); + + if(!m_Internet) + return false; + + m_Address = InternetConnectA(m_Internet, Address, INTERNET_DEFAULT_HTTPS_PORT, Username, Password, INTERNET_SERVICE_HTTP, 0, 0); + + if(!m_Address) + return false; + + return true; + } + + // Receives a response from a request. + ByteArray WebSocket::Request(const char *File, const char *Header, ByteArray &Data) { + ByteArray Response; + InternetHandle WebRequest = HttpOpenRequestA(m_Address, "POST", File, 0, 0, 0, INTERNET_FLAG_SECURE | INTERNET_FLAG_KEEP_CONNECTION, 0); + + // Make connection request. + bool Sent = HttpSendRequestA(WebRequest, Header, (DWORD)strlen(Header), Data.data(), (DWORD)Data.size()); + + if(Sent) { + DWORD ReceivedSize{}; + + uint8_t *Block = (uint8_t *)malloc(4096); + + // Read response. + while(InternetReadFile(WebRequest, Block, 4096, &ReceivedSize)) { + for(size_t n{}; n < std::min< int >(4096, ReceivedSize); ++n) { + Response.push_back(Block[n]); + } + } + + free(Block); + } + + return Response; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Networking/WebSocket.hpp b/csgo-loader/csgo-server/Networking/WebSocket.hpp new file mode 100644 index 0000000..f503913 --- /dev/null +++ b/csgo-loader/csgo-server/Networking/WebSocket.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include +#include +#include + +#pragma comment(lib, "wininet.lib") + +using ByteArray = std::vector; + +namespace Networking { + // Whenever the handle goes out of scope, it will automatically be released. + class InternetHandle { + HINTERNET m_Internet; + public: + InternetHandle() = default; + InternetHandle(HINTERNET Internet) : + m_Internet(Internet) { } + + ~InternetHandle() { + InternetCloseHandle(m_Internet); + } + + operator HINTERNET() { return m_Internet; }; + }; + + class WebSocket { + InternetHandle m_Internet; + InternetHandle m_Address; + + public: + bool Start(const char *Address, const char *Username, const char *Password); + ByteArray Request(const char *File, const char *Header, ByteArray &Data); + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/RemoteCode/FileReader.cpp b/csgo-loader/csgo-server/RemoteCode/FileReader.cpp new file mode 100644 index 0000000..e69de29 diff --git a/csgo-loader/csgo-server/RemoteCode/FileReader.hpp b/csgo-loader/csgo-server/RemoteCode/FileReader.hpp new file mode 100644 index 0000000..50e9667 --- /dev/null +++ b/csgo-loader/csgo-server/RemoteCode/FileReader.hpp @@ -0,0 +1 @@ +#pragma once diff --git a/csgo-loader/csgo-server/Security/Encryption.cpp b/csgo-loader/csgo-server/Security/Encryption.cpp new file mode 100644 index 0000000..94b9ee7 --- /dev/null +++ b/csgo-loader/csgo-server/Security/Encryption.cpp @@ -0,0 +1,581 @@ +#include + +#define FE(x) (((x) << 1) ^ ((((x)>>7) & 1) * 0x1b)) +#define FD(x) (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0)) + +#define KEY_SIZE 32 +#define NUM_ROUNDS 14 + +namespace Wrapper { + // Constants used for the AES256 algorithm. + uint8_t sbox[256] = { + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, + 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, + 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, + 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, + 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, + 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, + 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, + 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, + 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, + 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, + 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, + 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, + 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, + 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, + 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, + 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, + 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 + }; + + uint8_t sboxinv[256] = { + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, + 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, + 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, + 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, + 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, + 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, + 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, + 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, + 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, + 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, + 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, + 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, + 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, + 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, + 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, + 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d + }; + + // Implementation of the AES256 encryption algorithm. + unsigned char rj_xtime(unsigned char x); + + Aes256::Aes256(const ByteArray& key) + : m_key(ByteArray(key.size() > KEY_SIZE ? KEY_SIZE : key.size(), 0)) + , m_salt(ByteArray(KEY_SIZE - m_key.size(), 0)) + , m_rkey(ByteArray(KEY_SIZE, 0)) + , m_buffer_pos(0) + , m_remainingLength(0) + , m_decryptInitialized(false) { + for(ByteArray::size_type i = 0; i < m_key.size(); ++i) + m_key[i] = key[i]; + } + + Aes256::~Aes256() { + } + + ByteArray::size_type Aes256::encrypt(const ByteArray& key, const ByteArray& plain, ByteArray& encrypted) { + Aes256 aes(key); + + aes.encrypt_start(plain.size(), encrypted); + aes.encrypt_continue(plain, encrypted); + aes.encrypt_end(encrypted); + + return encrypted.size(); + } + + ByteArray::size_type Aes256::encrypt(const ByteArray& key, const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted) { + Aes256 aes(key); + + aes.encrypt_start(plain_length, encrypted); + aes.encrypt_continue(plain, plain_length, encrypted); + aes.encrypt_end(encrypted); + + return encrypted.size(); + } + + ByteArray::size_type Aes256::decrypt(const ByteArray& key, const ByteArray& encrypted, ByteArray& plain) { + Aes256 aes(key); + + aes.decrypt_start(encrypted.size()); + aes.decrypt_continue(encrypted, plain); + aes.decrypt_end(plain); + + return plain.size(); + } + + ByteArray::size_type Aes256::decrypt(const ByteArray& key, const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain) { + Aes256 aes(key); + + aes.decrypt_start(encrypted_length); + aes.decrypt_continue(encrypted, encrypted_length, plain); + aes.decrypt_end(plain); + + return plain.size(); + } + + ByteArray::size_type Aes256::encrypt_start(const ByteArray::size_type plain_length, ByteArray& encrypted) { + m_remainingLength = plain_length; + + // Generate salt + ByteArray::iterator it = m_salt.begin(), itEnd = m_salt.end(); + while(it != itEnd) + *(it++) = (rand() & 0xFF); + + // Calculate padding + ByteArray::size_type padding = 0; + if(m_remainingLength % BLOCK_SIZE != 0) + padding = (BLOCK_SIZE - (m_remainingLength % BLOCK_SIZE)); + m_remainingLength += padding; + + // Add salt + encrypted.insert(encrypted.end(), m_salt.begin(), m_salt.end()); + m_remainingLength += m_salt.size(); + + // Add 1 bytes for padding size + encrypted.push_back(padding & 0xFF); + ++m_remainingLength; + + // Reset buffer + m_buffer_pos = 0; + + return encrypted.size(); + } + + ByteArray::size_type Aes256::encrypt_continue(const ByteArray& plain, ByteArray& encrypted) { + ByteArray::const_iterator it = plain.begin(), itEnd = plain.end(); + + while(it != itEnd) { + m_buffer[m_buffer_pos++] = *(it++); + + check_and_encrypt_buffer(encrypted); + } + + return encrypted.size(); + } + + ByteArray::size_type Aes256::encrypt_continue(const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted) { + ByteArray::size_type i = 0; + + while(i < plain_length) { + m_buffer[m_buffer_pos++] = plain[i++]; + + check_and_encrypt_buffer(encrypted); + } + + return encrypted.size(); + } + + void Aes256::check_and_encrypt_buffer(ByteArray& encrypted) { + if(m_buffer_pos == BLOCK_SIZE) { + encrypt(m_buffer); + + for(m_buffer_pos = 0; m_buffer_pos < BLOCK_SIZE; ++m_buffer_pos) { + encrypted.push_back(m_buffer[m_buffer_pos]); + --m_remainingLength; + } + + m_buffer_pos = 0; + } + } + + ByteArray::size_type Aes256::encrypt_end(ByteArray& encrypted) { + if(m_buffer_pos > 0) { + while(m_buffer_pos < BLOCK_SIZE) + m_buffer[m_buffer_pos++] = 0; + + encrypt(m_buffer); + + for(m_buffer_pos = 0; m_buffer_pos < BLOCK_SIZE; ++m_buffer_pos) { + encrypted.push_back(m_buffer[m_buffer_pos]); + --m_remainingLength; + } + + m_buffer_pos = 0; + } + + return encrypted.size(); + } + + void Aes256::encrypt(unsigned char* buffer) { + unsigned char i, rcon; + + copy_key(); + add_round_key(buffer, 0); + for(i = 1, rcon = 1; i < NUM_ROUNDS; ++i) { + sub_bytes(buffer); + shift_rows(buffer); + mix_columns(buffer); + if(!(i & 1)) + expand_enc_key(&rcon); + add_round_key(buffer, i); + } + sub_bytes(buffer); + shift_rows(buffer); + expand_enc_key(&rcon); + add_round_key(buffer, i); + } + + ByteArray::size_type Aes256::decrypt_start(const ByteArray::size_type encrypted_length) { + register unsigned char j; + + m_remainingLength = encrypted_length; + + // Reset salt + for(j = 0; j < m_salt.size(); ++j) + m_salt[j] = 0; + m_remainingLength -= m_salt.size(); + + // Reset buffer + m_buffer_pos = 0; + + m_decryptInitialized = false; + + return m_remainingLength; + } + + ByteArray::size_type Aes256::decrypt_continue(const ByteArray& encrypted, ByteArray& plain) { + ByteArray::const_iterator it = encrypted.begin(), itEnd = encrypted.end(); + + while(it != itEnd) { + m_buffer[m_buffer_pos++] = *(it++); + + check_and_decrypt_buffer(plain); + } + + return plain.size(); + } + + ByteArray::size_type Aes256::decrypt_continue(const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain) { + ByteArray::size_type i = 0; + + while(i < encrypted_length) { + m_buffer[m_buffer_pos++] = encrypted[i++]; + + check_and_decrypt_buffer(plain); + } + + return plain.size(); + } + + void Aes256::check_and_decrypt_buffer(ByteArray& plain) { + if(!m_decryptInitialized && m_buffer_pos == m_salt.size() + 1) { + register unsigned char j; + ByteArray::size_type padding; + + // Get salt + for(j = 0; j < m_salt.size(); ++j) + m_salt[j] = m_buffer[j]; + + // Get padding + padding = (m_buffer[j] & 0xFF); + m_remainingLength -= padding + 1; + + // Start decrypting + m_buffer_pos = 0; + + m_decryptInitialized = true; + } + else if(m_decryptInitialized && m_buffer_pos == BLOCK_SIZE) { + decrypt(m_buffer); + + for(m_buffer_pos = 0; m_buffer_pos < BLOCK_SIZE; ++m_buffer_pos) + if(m_remainingLength > 0) { + plain.push_back(m_buffer[m_buffer_pos]); + --m_remainingLength; + } + + m_buffer_pos = 0; + } + } + + ByteArray::size_type Aes256::decrypt_end(ByteArray& plain) { + return plain.size(); + } + + void Aes256::decrypt(unsigned char* buffer) { + unsigned char i, rcon = 1; + + copy_key(); + for(i = NUM_ROUNDS / 2; i > 0; --i) + expand_enc_key(&rcon); + + add_round_key(buffer, NUM_ROUNDS); + shift_rows_inv(buffer); + sub_bytes_inv(buffer); + + for(i = NUM_ROUNDS, rcon = 0x80; --i;) { + if((i & 1)) + expand_dec_key(&rcon); + add_round_key(buffer, i); + mix_columns_inv(buffer); + shift_rows_inv(buffer); + sub_bytes_inv(buffer); + } + add_round_key(buffer, i); + } + + void Aes256::expand_enc_key(unsigned char* rc) { + register unsigned char i; + + m_rkey[0] = m_rkey[0] ^ sbox[m_rkey[29]] ^ (*rc); + m_rkey[1] = m_rkey[1] ^ sbox[m_rkey[30]]; + m_rkey[2] = m_rkey[2] ^ sbox[m_rkey[31]]; + m_rkey[3] = m_rkey[3] ^ sbox[m_rkey[28]]; + *rc = FE(*rc); + + for(i = 4; i < 16; i += 4) { + m_rkey[i] = m_rkey[i] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + m_rkey[16] = m_rkey[16] ^ sbox[m_rkey[12]]; + m_rkey[17] = m_rkey[17] ^ sbox[m_rkey[13]]; + m_rkey[18] = m_rkey[18] ^ sbox[m_rkey[14]]; + m_rkey[19] = m_rkey[19] ^ sbox[m_rkey[15]]; + + for(i = 20; i < 32; i += 4) { + m_rkey[i] = m_rkey[i] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + } + + void Aes256::expand_dec_key(unsigned char* rc) { + unsigned char i; + + for(i = 28; i > 16; i -= 4) { + m_rkey[i + 0] = m_rkey[i + 0] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + + m_rkey[16] = m_rkey[16] ^ sbox[m_rkey[12]]; + m_rkey[17] = m_rkey[17] ^ sbox[m_rkey[13]]; + m_rkey[18] = m_rkey[18] ^ sbox[m_rkey[14]]; + m_rkey[19] = m_rkey[19] ^ sbox[m_rkey[15]]; + + for(i = 12; i > 0; i -= 4) { + m_rkey[i + 0] = m_rkey[i + 0] ^ m_rkey[i - 4]; + m_rkey[i + 1] = m_rkey[i + 1] ^ m_rkey[i - 3]; + m_rkey[i + 2] = m_rkey[i + 2] ^ m_rkey[i - 2]; + m_rkey[i + 3] = m_rkey[i + 3] ^ m_rkey[i - 1]; + } + + *rc = FD(*rc); + m_rkey[0] = m_rkey[0] ^ sbox[m_rkey[29]] ^ (*rc); + m_rkey[1] = m_rkey[1] ^ sbox[m_rkey[30]]; + m_rkey[2] = m_rkey[2] ^ sbox[m_rkey[31]]; + m_rkey[3] = m_rkey[3] ^ sbox[m_rkey[28]]; + } + + void Aes256::sub_bytes(unsigned char* buffer) { + register unsigned char i = KEY_SIZE / 2; + + while(i--) + buffer[i] = sbox[buffer[i]]; + } + + void Aes256::sub_bytes_inv(unsigned char* buffer) { + register unsigned char i = KEY_SIZE / 2; + + while(i--) + buffer[i] = sboxinv[buffer[i]]; + } + + void Aes256::copy_key() { + ByteArray::size_type i; + + for(i = 0; i < m_key.size(); ++i) + m_rkey[i] = m_key[i]; + for(i = 0; i < m_salt.size(); ++i) + m_rkey[i + m_key.size()] = m_salt[i]; + } + + void Aes256::add_round_key(unsigned char* buffer, const unsigned char round) { + register unsigned char i = KEY_SIZE / 2; + + while(i--) + buffer[i] ^= m_rkey[(round & 1) ? i + 16 : i]; + } + + void Aes256::shift_rows(unsigned char* buffer) { + register unsigned char i, j, k, l; /* to make it potentially parallelable :) */ + + i = buffer[1]; + buffer[1] = buffer[5]; + buffer[5] = buffer[9]; + buffer[9] = buffer[13]; + buffer[13] = i; + + j = buffer[10]; + buffer[10] = buffer[2]; + buffer[2] = j; + + k = buffer[3]; + buffer[3] = buffer[15]; + buffer[15] = buffer[11]; + buffer[11] = buffer[7]; + buffer[7] = k; + + l = buffer[14]; + buffer[14] = buffer[6]; + buffer[6] = l; + } + + void Aes256::shift_rows_inv(unsigned char* buffer) { + register unsigned char i, j, k, l; /* same as above :) */ + + i = buffer[1]; + buffer[1] = buffer[13]; + buffer[13] = buffer[9]; + buffer[9] = buffer[5]; + buffer[5] = i; + + j = buffer[2]; + buffer[2] = buffer[10]; + buffer[10] = j; + + k = buffer[3]; + buffer[3] = buffer[7]; + buffer[7] = buffer[11]; + buffer[11] = buffer[15]; + buffer[15] = k; + + l = buffer[6]; + buffer[6] = buffer[14]; + buffer[14] = l; + } + + void Aes256::mix_columns(unsigned char* buffer) { + register unsigned char i, a, b, c, d, e; + + for(i = 0; i < 16; i += 4) { + a = buffer[i]; + b = buffer[i + 1]; + c = buffer[i + 2]; + d = buffer[i + 3]; + + e = a ^ b ^ c ^ d; + + buffer[i] ^= e ^ rj_xtime(a^b); + buffer[i + 1] ^= e ^ rj_xtime(b^c); + buffer[i + 2] ^= e ^ rj_xtime(c^d); + buffer[i + 3] ^= e ^ rj_xtime(d^a); + } + } + + void Aes256::mix_columns_inv(unsigned char* buffer) { + register unsigned char i, a, b, c, d, e, x, y, z; + + for(i = 0; i < 16; i += 4) { + a = buffer[i]; + b = buffer[i + 1]; + c = buffer[i + 2]; + d = buffer[i + 3]; + + e = a ^ b ^ c ^ d; + z = rj_xtime(e); + x = e ^ rj_xtime(rj_xtime(z^a^c)); y = e ^ rj_xtime(rj_xtime(z^b^d)); + + buffer[i] ^= x ^ rj_xtime(a^b); + buffer[i + 1] ^= y ^ rj_xtime(b^c); + buffer[i + 2] ^= x ^ rj_xtime(c^d); + buffer[i + 3] ^= y ^ rj_xtime(d^a); + } + } + + inline unsigned char rj_xtime(unsigned char x) { + return (x & 0x80) ? ((x << 1) ^ 0x1b) : (x << 1); + } + + // Wrapper for the AES256 encryption algorithm. + void Encryption::Start() { + // Create cryptographic context. + if(!CryptAcquireContextA(&m_CryptProvider, nullptr, nullptr, PROV_RSA_AES, 0)) { + if(!CryptAcquireContextA(&m_CryptProvider, nullptr, nullptr, PROV_RSA_AES, CRYPT_NEWKEYSET)) { + printf("Failed to initialise encryption provider.\n"); + return; + } + } + + uint8_t RandomBytes[32]; + uint32_t RandomBytesCount = sizeof RandomBytes; + + // Generate random bytes to use as encryption key. + if(CryptGenRandom(m_CryptProvider, RandomBytesCount, RandomBytes)) { + m_EncryptionKey.reserve(RandomBytesCount); + m_EncryptionKey.insert( + m_EncryptionKey.begin(), + RandomBytes, + RandomBytes + RandomBytesCount + ); + } + + // Release context. + if(m_CryptProvider) + CryptReleaseContext(m_CryptProvider, 0); + } + + void Encryption::Start(ByteArray &EncryptionKey) { + // If an encryption key is provided, initialise the wrapper with + // the passed parameter. + if(!EncryptionKey.empty()) { + m_EncryptionKey.reserve(EncryptionKey.size()); + std::copy(EncryptionKey.begin(), EncryptionKey.end(), m_EncryptionKey.begin()); + } + else { + Start(); + } + } + + ByteArray Encryption::Encrypt(ByteArray &Data) { + // Encrypt outgoing data. + ByteArray Encrypted; + + #ifdef DEBUG + Encrypted = Data; + #else + Aes256::encrypt(m_EncryptionKey, Data, Encrypted); + #endif + + return Encrypted; + } + + ByteArray Encryption::Decrypt(ByteArray &Data) { + // Decrypt incoming data. + ByteArray Decrypted; + + #ifdef DEBUG + Decrypted = Data; + #else + Aes256::decrypt(m_EncryptionKey, Data, Decrypted); + #endif + + return Decrypted; + } +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Security/Encryption.hpp b/csgo-loader/csgo-server/Security/Encryption.hpp new file mode 100644 index 0000000..d55608f --- /dev/null +++ b/csgo-loader/csgo-server/Security/Encryption.hpp @@ -0,0 +1,89 @@ +#pragma once + +#include +#include +#include +#include + +using ByteArray = std::vector; + +#define BLOCK_SIZE 16 + +namespace Wrapper { + // AES256 implementation. + class Aes256 { + + public: + Aes256(const ByteArray& key); + ~Aes256(); + + static ByteArray::size_type encrypt(const ByteArray& key, const ByteArray& plain, ByteArray& encrypted); + static ByteArray::size_type encrypt(const ByteArray& key, const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted); + static ByteArray::size_type decrypt(const ByteArray& key, const ByteArray& encrypted, ByteArray& plain); + static ByteArray::size_type decrypt(const ByteArray& key, const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain); + + ByteArray::size_type encrypt_start(const ByteArray::size_type plain_length, ByteArray& encrypted); + ByteArray::size_type encrypt_continue(const ByteArray& plain, ByteArray& encrypted); + ByteArray::size_type encrypt_continue(const unsigned char* plain, const ByteArray::size_type plain_length, ByteArray& encrypted); + ByteArray::size_type encrypt_end(ByteArray& encrypted); + + ByteArray::size_type decrypt_start(const ByteArray::size_type encrypted_length); + ByteArray::size_type decrypt_continue(const ByteArray& encrypted, ByteArray& plain); + ByteArray::size_type decrypt_continue(const unsigned char* encrypted, const ByteArray::size_type encrypted_length, ByteArray& plain); + ByteArray::size_type decrypt_end(ByteArray& plain); + + private: + ByteArray m_key; + ByteArray m_salt; + ByteArray m_rkey; + + unsigned char m_buffer[3 * BLOCK_SIZE]; + unsigned char m_buffer_pos; + ByteArray::size_type m_remainingLength; + + bool m_decryptInitialized; + + void check_and_encrypt_buffer(ByteArray& encrypted); + void check_and_decrypt_buffer(ByteArray& plain); + + void encrypt(unsigned char *buffer); + void decrypt(unsigned char *buffer); + + void expand_enc_key(unsigned char *rc); + void expand_dec_key(unsigned char *rc); + + void sub_bytes(unsigned char *buffer); + void sub_bytes_inv(unsigned char *buffer); + + void copy_key(); + + void add_round_key(unsigned char *buffer, const unsigned char round); + + void shift_rows(unsigned char *buffer); + void shift_rows_inv(unsigned char *buffer); + + void mix_columns(unsigned char *buffer); + void mix_columns_inv(unsigned char *buffer); + }; + + // Encryption wrapper. + class Encryption { + ByteArray m_EncryptionKey; + HCRYPTPROV m_CryptProvider; + + public: + // Generate a random cryptographic key. + // OPTIONAL: You can pass a premade encryption key as a parameter. + void Start(); + void Start(ByteArray &EncryptionKey); + + // Handles encryption/decryption of data. + ByteArray Encrypt(ByteArray &Data); + ByteArray Decrypt(ByteArray &Data); + + // Exposes the encryption key. + ByteArray GetKey() { + return m_EncryptionKey; + } + }; +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/Server.cpp b/csgo-loader/csgo-server/Server.cpp new file mode 100644 index 0000000..ca6deb4 --- /dev/null +++ b/csgo-loader/csgo-server/Server.cpp @@ -0,0 +1,33 @@ +#include +#include + +void ConnectionHandler(Networking::TCPConnection &Connection) { + Login::RemoteLoginServer LoginServer; + + ByteArray RawLoginHeader = Connection.ReceiveBytes(); + LoginServer.Start(RawLoginHeader); + + ByteArray RawServerResponse = LoginServer.GetResponse(); + Connection.SendBytes(RawServerResponse); +} + +int main() { + Networking::TCPServer Server; + + // Create an instance of the TCP server. + if(!Server.Start(3884)) { + printf("[FAIL] Failed to initialise server. (%08lx)\n", WSAGetLastError()); + system("pause"); + return 1; + } + + // Add a connection handler to the server. + Server += ConnectionHandler; + + // Accept incoming connections. + while(true) { + Server.AcceptConnection(); + } + + return 0; +} \ No newline at end of file diff --git a/csgo-loader/csgo-server/csgo-server.vcxproj b/csgo-loader/csgo-server/csgo-server.vcxproj new file mode 100644 index 0000000..c0fcbca --- /dev/null +++ b/csgo-loader/csgo-server/csgo-server.vcxproj @@ -0,0 +1,152 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + 15.0 + {97FAC435-B009-4571-AE91-31DC52D47598} + csgoserver + 10.0.17763.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)bin\$(Configuration)\ + $(SolutionDir)build\$(Configuration)\Server\ + $(ExecutablePath) + $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + $(SolutionDir)bin\$(Configuration)\ + $(SolutionDir)build\$(Configuration)\Server\ + $(ExecutablePath) + $(ProjectDir);$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + + Level3 + Disabled + true + true + + + + + Level4 + Disabled + true + true + _WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN;NOMINMAX;DEBUG;_MBCS;%(PreprocessorDefinitions) + + + RequireAdministrator + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + Level4 + MaxSpeed + true + true + true + true + _WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN;NOMINMAX;_MBCS;%(PreprocessorDefinitions) + + + true + true + RequireAdministrator + + + + + + \ No newline at end of file diff --git a/csgo-loader/csgo-server/csgo-server.vcxproj.filters b/csgo-loader/csgo-server/csgo-server.vcxproj.filters new file mode 100644 index 0000000..bc0886a --- /dev/null +++ b/csgo-loader/csgo-server/csgo-server.vcxproj.filters @@ -0,0 +1,52 @@ + + + + + {6fc0b232-87f4-4bf9-97d9-d5ee1ffb9b0b} + + + {46b100eb-f5b1-44c7-9641-582e95387060} + + + {b75e08e0-f7fb-4fc5-971f-31573fd5f41a} + + + {bdd26646-f9bb-42f8-8ba3-f9ab232e1d9d} + + + + + + Security + + + Networking + + + Login + + + Networking + + + RemoteCode + + + + + Security + + + Networking + + + Login + + + Networking + + + RemoteCode + + + \ No newline at end of file diff --git a/csgo-loader/themida-sdk/include/SecureEngineCustomVMs.h b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs.h new file mode 100644 index 0000000..fd35011 --- /dev/null +++ b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs.h @@ -0,0 +1,338 @@ +/****************************************************************************** + * Header: SecureEngineCustomVMs.h + * Description: Definitions for Custom VMs in SecureEngine + * + * Author/s: Oreans Technologies + * (c) 2015 Oreans Technologies + * + * --- File generated automatically from Oreans VM Generator (16/6/2015) --- + ******************************************************************************/ + +// *********************************************** +// Definition of macros as function names +// *********************************************** + + #ifdef __cplusplus + extern "C" { + #endif + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000100_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000100_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000103_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000103_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000101_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000101_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000104_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000104_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000102_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000102_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000105_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000105_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000106_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000106_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000107_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000107_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000108_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000108_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000109_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000109_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000110_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000110_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000111_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000111_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000112_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000112_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000113_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000113_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000114_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000114_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000115_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000115_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000116_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000116_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000117_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000117_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000118_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000118_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000119_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000119_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000120_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000120_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000121_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000121_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000122_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000122_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000123_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000123_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000134_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000134_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000135_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000135_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000136_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000136_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000137_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000137_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000138_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000138_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000139_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000139_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000146_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000146_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000147_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000147_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000148_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000148_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000149_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000149_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000150_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000150_End(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000151_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION CustomVM00000151_End(void); + +DLL_IMPORT void STDCALL_CONVENTION Mutate_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION Mutate_End(void); + +DLL_IMPORT void STDCALL_CONVENTION Mutate_Start(void); + +DLL_IMPORT void STDCALL_CONVENTION Mutate_End(void); + +#ifdef __cplusplus +} +#endif + + +// *********************************************** +// x64 definition as function names +// *********************************************** + +#if defined(PLATFORM_X64) && !defined(X64_INSERT_VIA_INLINE) + +#define VM_TIGER_WHITE_START CustomVM00000103_Start(); +#define VM_TIGER_WHITE_END CustomVM00000103_End(); + +#define VM_TIGER_RED_START CustomVM00000104_Start(); +#define VM_TIGER_RED_END CustomVM00000104_End(); + +#define VM_TIGER_BLACK_START CustomVM00000105_Start(); +#define VM_TIGER_BLACK_END CustomVM00000105_End(); + +#define VM_FISH_WHITE_START CustomVM00000107_Start(); +#define VM_FISH_WHITE_END CustomVM00000107_End(); + +#define VM_FISH_RED_START CustomVM00000109_Start(); +#define VM_FISH_RED_END CustomVM00000109_End(); + +#define VM_FISH_BLACK_START CustomVM00000111_Start(); +#define VM_FISH_BLACK_END CustomVM00000111_End(); + +#define VM_PUMA_WHITE_START CustomVM00000113_Start(); +#define VM_PUMA_WHITE_END CustomVM00000113_End(); + +#define VM_PUMA_RED_START CustomVM00000115_Start(); +#define VM_PUMA_RED_END CustomVM00000115_End(); + +#define VM_PUMA_BLACK_START CustomVM00000117_Start(); +#define VM_PUMA_BLACK_END CustomVM00000117_End(); + +#define VM_SHARK_WHITE_START CustomVM00000119_Start(); +#define VM_SHARK_WHITE_END CustomVM00000119_End(); + +#define VM_SHARK_RED_START CustomVM00000121_Start(); +#define VM_SHARK_RED_END CustomVM00000121_End(); + +#define VM_SHARK_BLACK_START CustomVM00000123_Start(); +#define VM_SHARK_BLACK_END CustomVM00000123_End(); + +#define VM_DOLPHIN_WHITE_START CustomVM00000135_Start(); +#define VM_DOLPHIN_WHITE_END CustomVM00000135_End(); + +#define VM_DOLPHIN_RED_START CustomVM00000137_Start(); +#define VM_DOLPHIN_RED_END CustomVM00000137_End(); + +#define VM_DOLPHIN_BLACK_START CustomVM00000139_Start(); +#define VM_DOLPHIN_BLACK_END CustomVM00000139_End(); + +#define VM_EAGLE_WHITE_START CustomVM00000147_Start(); +#define VM_EAGLE_WHITE_END CustomVM00000147_End(); + +#define VM_EAGLE_RED_START CustomVM00000149_Start(); +#define VM_EAGLE_RED_END CustomVM00000149_End(); + +#define VM_EAGLE_BLACK_START CustomVM00000151_Start(); +#define VM_EAGLE_BLACK_END CustomVM00000151_End(); + +#define VM_MUTATE_ONLY_START Mutate_Start(); +#define VM_MUTATE_ONLY_END Mutate_End(); + +#define CUSTOM_VMS_DEFINED + +#endif + + +// *********************************************** +// x32 definition as function names +// *********************************************** + +#if defined(PLATFORM_X32) && !defined(X32_INSERT_VIA_INLINE) + +#define VM_TIGER_WHITE_START CustomVM00000100_Start(); +#define VM_TIGER_WHITE_END CustomVM00000100_End(); + +#define VM_TIGER_RED_START CustomVM00000101_Start(); +#define VM_TIGER_RED_END CustomVM00000101_End(); + +#define VM_TIGER_BLACK_START CustomVM00000102_Start(); +#define VM_TIGER_BLACK_END CustomVM00000102_End(); + +#define VM_FISH_WHITE_START CustomVM00000106_Start(); +#define VM_FISH_WHITE_END CustomVM00000106_End(); + +#define VM_FISH_RED_START CustomVM00000108_Start(); +#define VM_FISH_RED_END CustomVM00000108_End(); + +#define VM_FISH_BLACK_START CustomVM00000110_Start(); +#define VM_FISH_BLACK_END CustomVM00000110_End(); + +#define VM_PUMA_WHITE_START CustomVM00000112_Start(); +#define VM_PUMA_WHITE_END CustomVM00000112_End(); + +#define VM_PUMA_RED_START CustomVM00000114_Start(); +#define VM_PUMA_RED_END CustomVM00000114_End(); + +#define VM_PUMA_BLACK_START CustomVM00000116_Start(); +#define VM_PUMA_BLACK_END CustomVM00000116_End(); + +#define VM_SHARK_WHITE_START CustomVM00000118_Start(); +#define VM_SHARK_WHITE_END CustomVM00000118_End(); + +#define VM_SHARK_RED_START CustomVM00000120_Start(); +#define VM_SHARK_RED_END CustomVM00000120_End(); + +#define VM_SHARK_BLACK_START CustomVM00000122_Start(); +#define VM_SHARK_BLACK_END CustomVM00000122_End(); + +#define VM_DOLPHIN_WHITE_START CustomVM00000134_Start(); +#define VM_DOLPHIN_WHITE_END CustomVM00000134_End(); + +#define VM_DOLPHIN_RED_START CustomVM00000136_Start(); +#define VM_DOLPHIN_RED_END CustomVM00000136_End(); + +#define VM_DOLPHIN_BLACK_START CustomVM00000138_Start(); +#define VM_DOLPHIN_BLACK_END CustomVM00000138_End(); + +#define VM_EAGLE_WHITE_START CustomVM00000146_Start(); +#define VM_EAGLE_WHITE_END CustomVM00000146_End(); + +#define VM_EAGLE_RED_START CustomVM00000148_Start(); +#define VM_EAGLE_RED_END CustomVM00000148_End(); + +#define VM_EAGLE_BLACK_START CustomVM00000150_Start(); +#define VM_EAGLE_BLACK_END CustomVM00000150_End(); + +#define VM_MUTATE_ONLY_START Mutate_Start(); +#define VM_MUTATE_ONLY_END Mutate_End(); + +#define CUSTOM_VMS_DEFINED + +#endif + + +// *********************************************** +// x32/x64 definition as inline assembly +// *********************************************** + +#ifndef CUSTOM_VMS_DEFINED + +#ifdef __BORLANDC__ + #include "SecureEngineCustomVMs_BorlandC_inline.h" +#endif + +#ifdef __GNUC__ + #include "SecureEngineCustomVMs_GNU_inline.h" +#endif + +#ifdef __ICL + #include "SecureEngineCustomVMs_ICL_inline.h" +#endif + +#ifdef __LCC__ + #include "SecureEngineCustomVMs_LCC_inline.h" +#endif + +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) + #include "SecureEngineCustomVMs_VC_inline.h" +#endif + +#endif diff --git a/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_BorlandC_inline.h b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_BorlandC_inline.h new file mode 100644 index 0000000..9ba7f5a --- /dev/null +++ b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_BorlandC_inline.h @@ -0,0 +1,402 @@ +/****************************************************************************** + * Header: SecureEngineCustomVMs_BorlandC_inline.h + * Description: Borland C++ inline assembly macros definitions + * + * Author/s: Oreans Technologies + * (c) 2015 Oreans Technologies + * + * --- File generated automatically from Oreans VM Generator (16/6/2015) --- + ******************************************************************************/ + +/*********************************************** + * Definition as inline assembly + ***********************************************/ + +#ifdef PLATFORM_X32 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x64, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF4, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x65, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF5, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x66, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF6, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6A, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFA, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6C, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFC, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6E, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFE, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x70, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x72, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x02, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x74, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x04, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x76, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x06, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x78, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x08, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x7A, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0A, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x86, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x16, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x88, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x18, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x8A, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x1A, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x92, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x22, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x94, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x24, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x96, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x26, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x11, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#endif + +#ifdef PLATFORM_X64 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x67, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF7, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x68, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF8, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x69, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF9, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6B, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFB, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6D, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFD, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6F, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFF, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x71, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x01, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x73, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x03, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x75, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x05, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x77, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x07, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x79, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x09, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x7B, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0B, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x87, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x17, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x89, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x19, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x8B, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x1B, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x93, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x23, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x95, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x25, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x97, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x27, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x11, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); +#endif + +#endif + diff --git a/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_GNU_inline.h b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_GNU_inline.h new file mode 100644 index 0000000..68fb50e --- /dev/null +++ b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_GNU_inline.h @@ -0,0 +1,1694 @@ +/****************************************************************************** + * Header: SecureEngineCustomVMs_GNU_inline.h + * Description: GNU C inline assembly macros definitions + * + * Author/s: Oreans Technologies + * (c) 2015 Oreans Technologies + * + * --- File generated automatically from Oreans VM Generator (16/6/2015) --- + ******************************************************************************/ + +/*********************************************** + * Definition as inline assembly + ***********************************************/ + +#ifdef PLATFORM_X32 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x64\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xF4\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x65\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xF5\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x66\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xF6\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x6A\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xFA\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x6C\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xFC\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x6E\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xFE\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x70\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x00\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x72\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x02\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x74\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x04\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x76\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x06\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x78\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x08\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x7A\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0A\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x86\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x16\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x88\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x18\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x8A\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x1A\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x92\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x22\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x94\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x24\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x96\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x26\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x10\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x11\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#endif + +#ifdef PLATFORM_X64 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x67\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xF7\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x68\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xF8\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x69\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xF9\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x6B\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xFB\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x6D\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xFD\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x6F\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0xFF\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x71\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x01\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x73\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x03\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x75\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x05\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x77\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x07\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x79\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x09\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x7B\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0B\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x87\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x17\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x89\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x19\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x8B\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x1B\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x93\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x23\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x95\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x25\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x97\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x27\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x10\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END \ +__asm__ (".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x11\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"); +#endif + +#endif + diff --git a/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_ICL_inline.h b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_ICL_inline.h new file mode 100644 index 0000000..b0cda46 --- /dev/null +++ b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_ICL_inline.h @@ -0,0 +1,1694 @@ +/****************************************************************************** + * Header: SecureEngineCustomVMs_ICL_inline.h + * Description: ICL inline assembly macros definitions + * + * Author/s: Oreans Technologies + * (c) 2015 Oreans Technologies + * + * --- File generated automatically from Oreans VM Generator (16/6/2015) --- + ******************************************************************************/ + +/*********************************************** + * Definition as inline assembly + ***********************************************/ + +#ifdef PLATFORM_X32 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x64 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xF4 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x65 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xF5 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x66 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xF6 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x6A \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xFA \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x6C \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xFC \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x6E \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xFE \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x70 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x00 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x72 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x02 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x74 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x04 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x76 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x06 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x78 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x08 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x7A \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0A \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x86 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x16 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x88 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x18 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x8A \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x1A \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x92 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x22 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x94 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x24 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x96 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x26 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x10 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x11 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#endif + +#ifdef PLATFORM_X64 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x67 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xF7 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x68 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xF8 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x69 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xF9 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x6B \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xFB \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x6D \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xFD \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x6F \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0xFF \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x71 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x01 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x73 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x03 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x75 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x05 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x77 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x07 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x79 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x09 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x7B \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0B \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x87 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x17 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x89 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x19 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x8B \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x1B \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x93 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x23 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x95 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x25 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x97 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x27 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x10 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x11 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57\ + __asm __emit 0x4C\ + __asm __emit 0x20 \ + __asm __emit 0x20 +#endif + +#endif + diff --git a/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_LCC_inline.h b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_LCC_inline.h new file mode 100644 index 0000000..1aca4d9 --- /dev/null +++ b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_LCC_inline.h @@ -0,0 +1,402 @@ +/****************************************************************************** + * Header: SecureEngineCustomVMs_LCC_inline.h + * Description: LCC inline assembly macros definitions + * + * Author/s: Oreans Technologies + * (c) 2015 Oreans Technologies + * + * --- File generated automatically from Oreans VM Generator (16/6/2015) --- + ******************************************************************************/ + +/*********************************************** + * Definition as inline assembly + ***********************************************/ + +#ifdef PLATFORM_X32 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x64, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF4, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x65, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF5, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x66, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF6, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6A, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFA, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6C, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFC, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6E, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFE, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x70, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x72, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x02, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x74, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x04, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x76, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x06, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x78, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x08, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x7A, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0A, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x86, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x16, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x88, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x18, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x8A, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x1A, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x92, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x22, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x94, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x24, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x96, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x26, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x11, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#endif + +#ifdef PLATFORM_X64 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x67, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF7, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x68, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF8, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x69, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xF9, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6B, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFB, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6D, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFD, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x6F, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0xFF, 0x01, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x71, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x01, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x73, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x03, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x75, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x05, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x77, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x07, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x79, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x09, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x7B, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0B, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x87, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x17, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x89, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x19, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x8B, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x1B, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x93, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x23, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x95, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x25, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x97, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x27, 0x02, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x11, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); +#endif + +#endif + diff --git a/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_VC_inline.h b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_VC_inline.h new file mode 100644 index 0000000..c604bcc --- /dev/null +++ b/csgo-loader/themida-sdk/include/SecureEngineCustomVMs_VC_inline.h @@ -0,0 +1,1694 @@ +/****************************************************************************** + * Header: SecureEngineCustomVMs_VC_inline.h + * Description: VC inline assembly macros definitions + * + * Author/s: Oreans Technologies + * (c) 2015 Oreans Technologies + * + * --- File generated automatically from Oreans VM Generator (16/6/2015) --- + ******************************************************************************/ + +/*********************************************** + * Definition as inline assembly + ***********************************************/ + +#ifdef PLATFORM_X32 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x64 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xF4 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x65 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xF5 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x66 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xF6 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x6A \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xFA \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x6C \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xFC \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x6E \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xFE \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x70 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x00 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x72 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x02 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x74 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x04 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x76 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x06 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x78 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x08 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x7A \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0A \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x86 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x16 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x88 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x18 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x8A \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x1A \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x92 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x22 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x94 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x24 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x96 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x26 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x10 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x11 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#endif + +#ifdef PLATFORM_X64 + +#ifndef VM_TIGER_WHITE_START +#define VM_TIGER_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x67 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_WHITE_END +#define VM_TIGER_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xF7 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_RED_START +#define VM_TIGER_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x68 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_RED_END +#define VM_TIGER_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xF8 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_START +#define VM_TIGER_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x69 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_TIGER_BLACK_END +#define VM_TIGER_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xF9 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_START +#define VM_FISH_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x6B \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_WHITE_END +#define VM_FISH_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xFB \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_RED_START +#define VM_FISH_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x6D \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_RED_END +#define VM_FISH_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xFD \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_START +#define VM_FISH_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x6F \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_FISH_BLACK_END +#define VM_FISH_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0xFF \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_START +#define VM_PUMA_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x71 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_WHITE_END +#define VM_PUMA_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x01 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_RED_START +#define VM_PUMA_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x73 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_RED_END +#define VM_PUMA_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x03 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_START +#define VM_PUMA_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x75 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_PUMA_BLACK_END +#define VM_PUMA_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x05 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_START +#define VM_SHARK_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x77 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_WHITE_END +#define VM_SHARK_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x07 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_RED_START +#define VM_SHARK_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x79 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_RED_END +#define VM_SHARK_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x09 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_START +#define VM_SHARK_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x7B \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_SHARK_BLACK_END +#define VM_SHARK_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0B \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_START +#define VM_DOLPHIN_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x87 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_WHITE_END +#define VM_DOLPHIN_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x17 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_START +#define VM_DOLPHIN_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x89 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_RED_END +#define VM_DOLPHIN_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x19 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_START +#define VM_DOLPHIN_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x8B \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_DOLPHIN_BLACK_END +#define VM_DOLPHIN_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x1B \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_START +#define VM_EAGLE_WHITE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x93 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_WHITE_END +#define VM_EAGLE_WHITE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x23 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_START +#define VM_EAGLE_RED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x95 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_RED_END +#define VM_EAGLE_RED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x25 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_START +#define VM_EAGLE_BLACK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x97 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_EAGLE_BLACK_END +#define VM_EAGLE_BLACK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x27 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_START +#define VM_MUTATE_ONLY_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x10 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#ifndef VM_MUTATE_ONLY_END +#define VM_MUTATE_ONLY_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x11 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57\ + __asm _emit 0x4C\ + __asm _emit 0x20 \ + __asm _emit 0x20 +#endif + +#endif + diff --git a/csgo-loader/themida-sdk/include/ThemidaSDK.h b/csgo-loader/themida-sdk/include/ThemidaSDK.h new file mode 100644 index 0000000..01aaa92 --- /dev/null +++ b/csgo-loader/themida-sdk/include/ThemidaSDK.h @@ -0,0 +1,2265 @@ +/****************************************************************************** + Header: SecureEngineSDK.h + Description: SDK header definition for the C/C++ language + + Author/s: Oreans Technologies + (c) 2013 Oreans Technologies +*****************************************************************************/ + +#pragma once + + +// *********************************************** +// Cross Compiler definitions +// *********************************************** + +#ifdef __GNUC__ + #define DLL_IMPORT extern + #define STDCALL_CONVENTION +#else + #define DLL_IMPORT __declspec(dllimport) + #define STDCALL_CONVENTION __stdcall +#endif + + +// *********************************************** +// Specify platform +// *********************************************** + +#ifdef __GNUC__ + + #ifdef __x86_64__ + #define PLATFORM_X64 + #else + #define PLATFORM_X32 + #endif + +#else + + #ifdef _WIN64 + #define PLATFORM_X64 + #else + #define PLATFORM_X32 + #endif + +#endif + + +// *********************************************** +// Defines +// *********************************************** + +#ifdef __GNUC__ + +#define X32_INSERT_VIA_INLINE +#define X64_INSERT_VIA_INLINE + +#else + +#define X32_INSERT_VIA_INLINE +//#define X64_INSERT_VIA_INLINE + +#endif + + +// *********************************************** +// Include files +// *********************************************** + +#include "SecureEngineCustomVMs.h" + + +// *********************************************** +// Link with correct platform library +// *********************************************** + +#ifdef PLATFORM_X64 + #pragma comment(lib, "SecureEngineSDK64.lib") +#else + #pragma comment(lib, "SecureEngineSDK32.lib") +#endif + + +// *********************************************** +// Definition of macros as function names +// *********************************************** + + #ifdef __cplusplus + extern "C" { + #endif + + DLL_IMPORT void STDCALL_CONVENTION VMStart(void); + + DLL_IMPORT void STDCALL_CONVENTION VMEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION CodeReplaceStart(void); + + DLL_IMPORT void STDCALL_CONVENTION CodeReplaceEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION RegisteredStart(void); + + DLL_IMPORT void STDCALL_CONVENTION RegisteredEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION EncodeStart(void); + + DLL_IMPORT void STDCALL_CONVENTION EncodeEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION ClearStart(void); + + DLL_IMPORT void STDCALL_CONVENTION ClearEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION MutateStart(void); + + DLL_IMPORT void STDCALL_CONVENTION MutateEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION StrEncryptStart(void); + + DLL_IMPORT void STDCALL_CONVENTION StrEncryptEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION StrEncryptWStart(void); + + DLL_IMPORT void STDCALL_CONVENTION StrEncryptWEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION UnregisteredStart(void); + + DLL_IMPORT void STDCALL_CONVENTION UnregisteredEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION RegisteredVMStart(void); + + DLL_IMPORT void STDCALL_CONVENTION RegisteredVMEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION UnprotectedStart(void); + + DLL_IMPORT void STDCALL_CONVENTION UnprotectedEnd(void); + + DLL_IMPORT void STDCALL_CONVENTION SECheckProtection(int *user_var, int user_value); + + DLL_IMPORT void STDCALL_CONVENTION SECheckCodeIntegrity(int *user_var, int user_value); + + DLL_IMPORT void STDCALL_CONVENTION SECheckRegistration(int *user_var, int user_value); + + DLL_IMPORT void STDCALL_CONVENTION SECheckVirtualPC(int *user_var, int user_value); + + #ifdef __cplusplus + } + #endif + + +#ifdef PLATFORM_X64 + +// *********************************************** +// SecureEngine x64 macros definitions to keep +// compatibility with old x32 inline macros +// *********************************************** + + #define VM_START VMStart(); + #define VM_END VMEnd(); + #define VM_START_WITHLEVEL(x) VMStart(); + + #define CODEREPLACE_START CodeReplaceStart(); + #define CODEREPLACE_END CodeReplaceEnd(); + + #define REGISTERED_START RegisteredStart(); + #define REGISTERED_END RegisteredEnd(); + + #define ENCODE_START EncodeStart(); + #define ENCODE_END EncodeEnd(); + + #define MUTATE_START MutateStart(); + #define MUTATE_END MutateEnd(); + + #define STR_ENCRYPT_START StrEncryptStart(); + #define STR_ENCRYPT_END StrEncryptEnd(); + + #define STR_ENCRYPTW_START StrEncryptWStart(); + #define STR_ENCRYPTW_END StrEncryptWEnd(); + + #define UNREGISTERED_START UnregisteredStart(); + #define UNREGISTERED_END UnregisteredEnd(); + + #define CLEAR_START ClearStart(); + #define CLEAR_END ClearEnd(); + + #define REGISTEREDVM_START RegisteredVMStart(); + #define REGISTEREDVM_END RegisteredVMEnd(); + + #define UNPROTECTED_START UnprotectedStart(); + #define UNPROTECTED_END UnprotectedEnd(); + + #define CHECK_PROTECTION(var, val) SECheckProtection(&var, val); + #define CHECK_CODE_INTEGRITY(var, val) SECheckCodeIntegrity(&var, val); + #define CHECK_REGISTRATION(var, val) SECheckRegistration(&var, val); + #define CHECK_VIRTUAL_PC(var, val) SECheckVirtualPC(&var, val); + +#else + +// *********************************************** +// SecureEngine x32 inline macros definitions +// *********************************************** + + // Borland macros definitions + + #ifdef __BORLANDC__ + + #define REMOVE_BLOCK_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define REMOVE_BLOCK_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define CODEREPLACE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define CODEREPLACE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define REGISTERED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x02, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define REGISTERED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x03, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define ENCODE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x04, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define ENCODE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x05, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define CLEAR_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x06, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define CLEAR_END __emit__ (0xEB, 0x15, 0x57, 0x4C, 0x20, 0x20, 0x07, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x00, \ + 0x00, 0x00, 0x00); + + #define UNREGISTERED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x08, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define UNREGISTERED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x09, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define VM_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0C, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define VM_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0D, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define MUTATE_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define MUTATE_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x11, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define STR_ENCRYPT_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x12, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define STR_ENCRYPT_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x13, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define STR_ENCRYPTW_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x22, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define STR_ENCRYPTW_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x23, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define REGISTEREDVM_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0E, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define REGISTEREDVM_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0F, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define VM_START_WITHLEVEL(x) __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0C, 0x00, 0x00, 0x00, \ + 0x00, x, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define UNPROTECTED_START __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + #define UNPROTECTED_END __emit__ (0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x21, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20); + + #define CHECK_PROTECTION(var, val) \ + asm { \ + dw 0x10EB; \ + dd 0x091ab3167; \ + dd 0x08a8b717a; \ + dd 0x0bc117abd; \ + dd 0x0; \ + push val; \ + pop var; \ + dw 0x0CEB; \ + dd 0x0bc117abd; \ + dd 0x08a8b717a; \ + dd 0x091ab3167; \ +} + + #define CHECK_CODE_INTEGRITY(var, val) \ + asm { \ + dw 0x10EB; \ + dd 0x091ab3167; \ + dd 0x08a8b717a; \ + dd 0x0bc117abd; \ + dd 0x1; \ + push val; \ + pop var; \ + dw 0x0CEB; \ + dd 0x0bc117abd; \ + dd 0x08a8b717a; \ + dd 0x091ab3167; \ +} + + #define CHECK_REGISTRATION(var, val) \ + asm { \ + dw 0x10EB; \ + dd 0x091ab3167; \ + dd 0x08a8b717a; \ + dd 0x0bc117abd; \ + dd 0x2; \ + push val; \ + pop var; \ + dw 0x0CEB; \ + dd 0x0bc117abd; \ + dd 0x08a8b717a; \ + dd 0x091ab3167; \ +} + + #define CHECK_VIRTUAL_PC(var, val) \ + asm { \ + dw 0x10EB; \ + dd 0x091ab3167; \ + dd 0x08a8b717a; \ + dd 0x0bc117abd; \ + dd 0x3; \ + push val; \ + pop var; \ + dw 0x0CEB; \ + dd 0x0bc117abd; \ + dd 0x08a8b717a; \ + dd 0x091ab3167; \ +} + +#else +#ifdef __GNUC__ + + // GNUC (MinGW) Compatible compiler macros definitions + + #define NO_OPTIMIZATION __attribute__((optimize("O0"))) + + #define REMOVE_BLOCK_START \ + asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + + #define REMOVE_BLOCK_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + + #define CODEREPLACE_START \ + asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define CODEREPLACE_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + + #define REGISTERED_START \ + asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define REGISTERED_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x03\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define ENCODE_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x04\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define ENCODE_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x05\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define CLEAR_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x06\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define CLEAR_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x15\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x07\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ); + +#define UNREGISTERED_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x08\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define UNREGISTERED_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x09\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define VM_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0C\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define VM_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0D\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define MUTATE_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x10\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define MUTATE_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x11\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define STR_ENCRYPT_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x12\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define STR_ENCRYPT_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x13\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define STR_ENCRYPTW_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x22\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define STR_ENCRYPTW_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x23\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + + +#define REGISTEREDVM_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0E\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define REGISTEREDVM_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0F\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define VM_START_WITHLEVEL(x) \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x0C\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte $" #x "\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define UNPROTECTED_START \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + + +#define UNPROTECTED_END \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ".byte 0x21\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x57\n"\ + ".byte 0x4C\n"\ + ".byte 0x20\n"\ + ".byte 0x20\n"\ + ); + +#define CHECK_PROTECTION(var, val) \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + "push $" #val "\n"); \ + __asm__ ("pop %0" : "=m" (var):); \ + asm (".byte 0xEB\n"\ + ".byte 0x0C\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ); + +#define CHECK_CODE_INTEGRITY(var, val) \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x01\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + "push $" #val "\n"); \ + __asm__ ("pop %0" : "=m" (var):); \ + asm (".byte 0xEB\n"\ + ".byte 0x0C\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ); + +#define CHECK_REGISTRATION(var, val) \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x02\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + "push $" #val "\n"); \ + __asm__ ("pop %0" : "=m" (var):); \ + asm (".byte 0xEB\n"\ + ".byte 0x0C\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ); + +#define CHECK_VIRTUAL_PC(var, val) \ +asm ( ".byte 0xEB\n"\ + ".byte 0x10\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x03\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + ".byte 0x00\n"\ + "push $" #val "\n"); \ + __asm__ ("pop %0" : "=m" (var):); \ + asm (".byte 0xEB\n"\ + ".byte 0x0C\n"\ + ".byte 0xBD\n"\ + ".byte 0x7A\n"\ + ".byte 0x11\n"\ + ".byte 0xBC\n"\ + ".byte 0x7A\n"\ + ".byte 0x71\n"\ + ".byte 0x8B\n"\ + ".byte 0x8A\n"\ + ".byte 0x67\n"\ + ".byte 0x31\n"\ + ".byte 0xAB\n"\ + ".byte 0x91\n"\ + ); + +#else +#ifdef __ICL + +// ICL macros definitions + + #define REMOVE_BLOCK_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define REMOVE_BLOCK_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define CODEREPLACE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define CODEREPLACE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x01 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define REGISTERED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x02 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define REGISTERED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x03 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + + #define ENCODE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x04 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + + #define ENCODE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x05 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + + #define CLEAR_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x06 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + + #define CLEAR_END \ + __asm __emit 0xEB \ + __asm __emit 0x15 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x07 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 + + #define UNREGISTERED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x08 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define UNREGISTERED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x09 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define VM_START_WITHLEVEL(x) \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0C \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit x \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define VM_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0C \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define VM_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0D \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define MUTATE_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x10 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define MUTATE_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x11 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define STR_ENCRYPT_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x12 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define STR_ENCRYPT_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x13 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define STR_ENCRYPTW_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x22 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define STR_ENCRYPTW_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x23 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + + #define REGISTEREDVM_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0E \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define REGISTEREDVM_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x0F \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define UNPROTECTED_START \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + + #define UNPROTECTED_END \ + __asm __emit 0xEB \ + __asm __emit 0x10 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + __asm __emit 0x21 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x00 \ + __asm __emit 0x57 \ + __asm __emit 0x4C \ + __asm __emit 0x20 \ + __asm __emit 0x20 \ + +#else +#ifdef __LCC__ + +// LCC macros definitions + + #define REMOVE_BLOCK_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + #define REMOVE_BLOCK_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define CODEREPLACE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + #define CODEREPLACE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define REGISTERED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x02, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + #define REGISTERED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x03, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define ENCODE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x04, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + #define ENCODE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x05, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define CLEAR_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x06, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define CLEAR_END __asm__ (" .byte\t0xEB, 0x15, 0x57, 0x4C, 0x20, 0x20, 0x07, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20, 0x00, 0x00, \ + 0x00, 0x00, 0x00"); + + #define UNREGISTERED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x08, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + #define UNREGISTERED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x09, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define VM_START_WITHLEVEL(x) __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0C, 0x00, 0x00, 0x00, \ + 0x00, "x", 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define VM_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0C, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define VM_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0D, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define MUTATE_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define MUTATE_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x11, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define STR_ENCRYPT_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x12, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define STR_ENCRYPT_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x13, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define STR_ENCRYPT_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x22, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define STR_ENCRYPT_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x23, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define REGISTEREDVM_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0E, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define REGISTEREDVM_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x0F, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define UNPROTECTED_START __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + + #define UNPROTECTED_END __asm__ (" .byte\t0xEB, 0x10, 0x57, 0x4C, 0x20, 0x20, 0x21, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x57, 0x4C, 0x20, 0x20"); + +#else + + // Visual Studio macros definitions + + #define REMOVE_BLOCK_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define REMOVE_BLOCK_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define CODEREPLACE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define CODEREPLACE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define REGISTERED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + +#define REGISTERED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x03 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define ENCODE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x04 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define ENCODE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x05 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define CLEAR_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x06 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define CLEAR_END \ + __asm _emit 0xEB \ + __asm _emit 0x15 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x07 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 + + #define UNREGISTERED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x08 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + +#define UNREGISTERED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x09 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define VM_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0C \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define VM_START_WITHLEVEL(x) \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0C \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit x \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define VM_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0D \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define MUTATE_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x10 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define MUTATE_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x11 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define STR_ENCRYPT_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x12 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define STR_ENCRYPT_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x13 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define STR_ENCRYPTW_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x22 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define STR_ENCRYPTW_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x23 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + + #define REGISTEREDVM_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0E \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define REGISTEREDVM_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x0F \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + + #define UNPROTECTED_START \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define UNPROTECTED_END \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + __asm _emit 0x21 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x57 \ + __asm _emit 0x4C \ + __asm _emit 0x20 \ + __asm _emit 0x20 \ + + #define CHECK_PROTECTION(var, val) \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm push val \ + __asm pop var \ + __asm _emit 0xEB \ + __asm _emit 0x0C \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + + #define CHECK_CODE_INTEGRITY(var, val) \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x01 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm push val \ + __asm pop var \ + __asm _emit 0xEB \ + __asm _emit 0x0C \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + + #define CHECK_REGISTRATION(var, val) \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x02 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm push val \ + __asm pop var \ + __asm _emit 0xEB \ + __asm _emit 0x0C \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + + #define CHECK_VIRTUAL_PC(var, val) \ + __asm _emit 0xEB \ + __asm _emit 0x10 \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x03 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm _emit 0x00 \ + __asm push val \ + __asm pop var \ + __asm _emit 0xEB \ + __asm _emit 0x0C \ + __asm _emit 0xBD \ + __asm _emit 0x7A \ + __asm _emit 0x11 \ + __asm _emit 0xBC \ + __asm _emit 0x7A \ + __asm _emit 0x71 \ + __asm _emit 0x8B \ + __asm _emit 0x8A \ + __asm _emit 0x67 \ + __asm _emit 0x31 \ + __asm _emit 0xAB \ + __asm _emit 0x91 \ + + #endif + #endif +#endif +#endif +#endif diff --git a/csgo-loader/themida-sdk/lib/SecureEngineSDK32.lib b/csgo-loader/themida-sdk/lib/SecureEngineSDK32.lib new file mode 100644 index 0000000..07bdef1 Binary files /dev/null and b/csgo-loader/themida-sdk/lib/SecureEngineSDK32.lib differ diff --git a/csgo-loader/themida-sdk/lib/SecureEngineSDK64.lib b/csgo-loader/themida-sdk/lib/SecureEngineSDK64.lib new file mode 100644 index 0000000..6adc57c Binary files /dev/null and b/csgo-loader/themida-sdk/lib/SecureEngineSDK64.lib differ -- cgit v1.2.3