├── Cranium ├── pch.cpp ├── cryptolens │ ├── imports │ │ ├── curl │ │ │ ├── curl.h │ │ │ ├── isunreserved.hpp │ │ │ └── isunreserved.cpp │ │ ├── openssl │ │ │ ├── bn.h │ │ │ ├── evp.h │ │ │ ├── rsa.h │ │ │ └── ssl.h │ │ ├── windows │ │ │ ├── comdef.h │ │ │ ├── Wbemidl.h │ │ │ ├── Windows.h │ │ │ ├── atlconv.h │ │ │ ├── iphlpapi.h │ │ │ ├── wincrypt.h │ │ │ ├── winhttp.h │ │ │ └── atlsecurity.h │ │ ├── ArduinoJson5 │ │ │ ├── ArduinoJson │ │ │ │ ├── version.hpp │ │ │ │ ├── JsonPair.hpp │ │ │ │ ├── Data │ │ │ │ │ ├── JsonFloat.hpp │ │ │ │ │ ├── NonCopyable.hpp │ │ │ │ │ ├── JsonBufferAllocated.hpp │ │ │ │ │ ├── JsonVariantDefault.hpp │ │ │ │ │ ├── JsonInteger.hpp │ │ │ │ │ ├── ListNode.hpp │ │ │ │ │ ├── ReferenceType.hpp │ │ │ │ │ ├── JsonVariantContent.hpp │ │ │ │ │ ├── Encoding.hpp │ │ │ │ │ ├── JsonVariantAs.hpp │ │ │ │ │ ├── JsonVariantType.hpp │ │ │ │ │ ├── ListConstIterator.hpp │ │ │ │ │ ├── ListIterator.hpp │ │ │ │ │ ├── ValueSaver.hpp │ │ │ │ │ └── List.hpp │ │ │ │ ├── Polyfills │ │ │ │ │ ├── ctype.hpp │ │ │ │ │ ├── math.hpp │ │ │ │ │ ├── isInteger.hpp │ │ │ │ │ ├── alias_cast.hpp │ │ │ │ │ ├── attributes.hpp │ │ │ │ │ ├── isFloat.hpp │ │ │ │ │ ├── parseInteger.hpp │ │ │ │ │ └── parseFloat.hpp │ │ │ │ ├── TypeTraits │ │ │ │ │ ├── IsVariant.hpp │ │ │ │ │ ├── EnableIf.hpp │ │ │ │ │ ├── RemoveConst.hpp │ │ │ │ │ ├── IsFloatingPoint.hpp │ │ │ │ │ ├── RemoveReference.hpp │ │ │ │ │ ├── IsConst.hpp │ │ │ │ │ ├── IsSame.hpp │ │ │ │ │ ├── IsArray.hpp │ │ │ │ │ ├── IsChar.hpp │ │ │ │ │ ├── IsBaseOf.hpp │ │ │ │ │ ├── IsIntegral.hpp │ │ │ │ │ ├── IsSignedIntegral.hpp │ │ │ │ │ └── IsUnsignedIntegral.hpp │ │ │ │ ├── Serialization │ │ │ │ │ ├── DummyPrint.hpp │ │ │ │ │ ├── StaticStringBuilder.hpp │ │ │ │ │ ├── StreamPrintAdapter.hpp │ │ │ │ │ ├── JsonSerializer.hpp │ │ │ │ │ ├── DynamicStringBuilder.hpp │ │ │ │ │ ├── IndentedPrint.hpp │ │ │ │ │ ├── FloatParts.hpp │ │ │ │ │ ├── JsonSerializerImpl.hpp │ │ │ │ │ └── Prettyfier.hpp │ │ │ │ ├── JsonBufferImpl.hpp │ │ │ │ ├── JsonArrayImpl.hpp │ │ │ │ ├── JsonObjectImpl.hpp │ │ │ │ ├── JsonVariantBase.hpp │ │ │ │ ├── Deserialization │ │ │ │ │ ├── StringWriter.hpp │ │ │ │ │ └── Comments.hpp │ │ │ │ ├── StringTraits │ │ │ │ │ ├── StringTraits.hpp │ │ │ │ │ ├── ArduinoStream.hpp │ │ │ │ │ ├── StdStream.hpp │ │ │ │ │ ├── FlashString.hpp │ │ │ │ │ ├── CharPointer.hpp │ │ │ │ │ └── StdString.hpp │ │ │ │ ├── RawJson.hpp │ │ │ │ ├── compatibility.hpp │ │ │ │ ├── JsonVariantCasts.hpp │ │ │ │ ├── JsonVariantOr.hpp │ │ │ │ ├── JsonBuffer.hpp │ │ │ │ └── JsonVariantSubscripts.hpp │ │ │ ├── ArduinoJson.h │ │ │ └── ArduinoJson.hpp │ │ └── std │ │ │ └── optional │ ├── Cryptolens.lib │ ├── cryptolens_internals.hpp │ ├── core.hpp │ ├── base64.hpp │ ├── validators │ │ ├── TautologyValidator.hpp │ │ ├── CorrectKeyValidator.hpp │ │ ├── CorrectProductValidator.hpp │ │ ├── NotExpiredValidator_ctime.hpp │ │ ├── AndValidator.hpp │ │ ├── NotExpiredValidator_kernel32.hpp │ │ └── OnValidMachineValidator.hpp │ ├── api.hpp │ ├── MachineCodeComputer_static.hpp │ ├── Error.hpp │ ├── MachineCodeComputer_caching.hpp │ ├── ActivationData.hpp │ ├── LicenseKeyChecker.hpp │ ├── ActivateError.hpp │ ├── DataObject.hpp │ ├── ResponseParser_ArduinoJson5.hpp │ ├── Customer.hpp │ ├── RequestHandler_v20190401_to_v20180502.hpp │ ├── Configuration_Windows.hpp │ ├── Configuration_Unix.hpp │ ├── RawLicenseKey.hpp │ ├── SignatureVerifier_OpenSSL.hpp │ ├── SignatureVerifier_CryptoAPI.hpp │ ├── MachineCodeComputer_COM.hpp │ ├── RequestHandler_WinHTTP.hpp │ └── LicenseKey.hpp ├── minhook │ └── minhook.lib ├── veh.h ├── pch.h ├── detver.h ├── resource.h ├── manifest.rc ├── framework.h ├── gui │ ├── ImGui │ │ ├── imgui_impl_dx11.h │ │ └── imgui_impl_win32.h │ └── kiero.h ├── server.h ├── console.h ├── kismet.h ├── dllmain.cpp ├── Resource.rc ├── curlhooks.h ├── url.h ├── veh.cpp └── curlver.h ├── Chronite ├── NeoniteLogo.ico ├── includes │ ├── DiscordSDK │ │ ├── dllmain.cpp │ │ ├── connection.h │ │ ├── discord_register.h │ │ ├── backoff.h │ │ ├── msg_queue.h │ │ ├── rpc_connection.h │ │ ├── rapidjson │ │ │ ├── internal │ │ │ │ ├── swap.h │ │ │ │ ├── strfunc.h │ │ │ │ └── ieee754.h │ │ │ ├── cursorstreamwrapper.h │ │ │ ├── memorybuffer.h │ │ │ ├── ostreamwrapper.h │ │ │ └── memorystream.h │ │ └── discord_rpc.h │ ├── injection │ │ └── Injection.h │ ├── imgui │ │ ├── imgui_impl_dx9.h │ │ └── imgui_impl_win32.h │ └── framework.h ├── .gitignore ├── packages.config ├── resource.h ├── Backend │ ├── server │ │ ├── collections.h │ │ ├── common_public.h │ │ ├── common_core.h │ │ ├── creative.h │ │ ├── DefaultEngine.h │ │ └── DefaultRuntimeOptions.h │ └── server.h ├── Discord.h ├── Chronite.rc └── Frontend │ └── settings.h ├── .gitignore ├── LICENSE └── Neonite++.sln /Cranium/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/curl/curl.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/openssl/bn.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/comdef.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/openssl/evp.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/openssl/rsa.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/openssl/ssl.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/Wbemidl.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/Windows.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/atlconv.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/iphlpapi.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/wincrypt.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/winhttp.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/windows/atlsecurity.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Chronite/NeoniteLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoniteDev/NeonitePP/HEAD/Chronite/NeoniteLogo.ico -------------------------------------------------------------------------------- /Cranium/minhook/minhook.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoniteDev/NeonitePP/HEAD/Cranium/minhook/minhook.lib -------------------------------------------------------------------------------- /Cranium/cryptolens/Cryptolens.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeoniteDev/NeonitePP/HEAD/Cranium/cryptolens/Cryptolens.lib -------------------------------------------------------------------------------- /Cranium/veh.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace VEH { 4 | bool Init(); 5 | 6 | bool AddHook(void* Target, void* Detour); 7 | 8 | bool RemoveHook(void* Target); 9 | } 10 | -------------------------------------------------------------------------------- /Cranium/pch.h: -------------------------------------------------------------------------------- 1 | #ifndef PCH_H 2 | #define PCH_H 3 | 4 | #define CONSOLE 5 | //#define SSL_BYPASS 6 | #define HOOKS 7 | //#define INJECT_ASAP 8 | 9 | 10 | #include "framework.h" 11 | 12 | #endif // PCH_H 13 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // outsmart GCC's missing-declarations warning 4 | BOOL WINAPI DllMain(HMODULE, DWORD, LPVOID); 5 | 6 | BOOL WINAPI DllMain(HMODULE, DWORD, LPVOID) 7 | { 8 | return TRUE; 9 | } 10 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/curl/isunreserved.hpp: -------------------------------------------------------------------------------- 1 | namespace cryptolens_io { 2 | 3 | namespace v20190401 { 4 | 5 | namespace internal { 6 | 7 | bool Curl_isunreserved(unsigned char in); 8 | 9 | } // namespace internal 10 | 11 | } // namespace v20190401 12 | 13 | } // namespace cryptolens_io 14 | -------------------------------------------------------------------------------- /Cranium/cryptolens/cryptolens_internals.hpp: -------------------------------------------------------------------------------- 1 | namespace cryptolens_io { 2 | 3 | namespace v20190401 { 4 | 5 | namespace internal { 6 | 7 | int activate_parse_server_error_message(char const* server_response); 8 | 9 | } // namespace internal 10 | 11 | } // namespace v20190401 12 | 13 | } // namespace cryptolens_io 14 | -------------------------------------------------------------------------------- /Chronite/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | *.gch 7 | *.pch 8 | *.so 9 | *.dylib 10 | *.dll 11 | *.mod 12 | *.smod 13 | *.lai 14 | *.la 15 | *.a 16 | *.lib 17 | *.exe 18 | *.out 19 | *.app 20 | x64/ 21 | packages/ 22 | OLDBACKEND/ 23 | *.filters 24 | *.user 25 | .vs/ 26 | *.ipch 27 | *.db-wal 28 | *.db-shm 29 | *.opendb 30 | *.lib -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/version.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #define ARDUINOJSON_VERSION "5.13.5" 8 | #define ARDUINOJSON_VERSION_MAJOR 5 9 | #define ARDUINOJSON_VERSION_MINOR 13 10 | #define ARDUINOJSON_VERSION_REVISION 5 11 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef __cplusplus 8 | 9 | #include "ArduinoJson.hpp" 10 | 11 | using namespace ArduinoJson; 12 | 13 | #else 14 | 15 | #error ArduinoJson requires a C++ compiler, please change file extension to .cc or .cpp 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Chronite/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonPair.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonVariant.hpp" 8 | 9 | namespace ArduinoJson { 10 | 11 | // A key value pair for JsonObject. 12 | struct JsonPair { 13 | const char* key; 14 | JsonVariant value; 15 | }; 16 | } // namespace ArduinoJson 17 | -------------------------------------------------------------------------------- /Cranium/cryptolens/core.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ActivateError.hpp" 4 | #include "ActivationData.hpp" 5 | #include "api.hpp" 6 | #include "basic_Error.hpp" 7 | #include "basic_Cryptolens.hpp" 8 | #include "basic_SKM.hpp" 9 | #include "Customer.hpp" 10 | #include "DataObject.hpp" 11 | #include "LicenseKeyChecker.hpp" 12 | #include "LicenseKey.hpp" 13 | #include "LicenseKeyInformation.hpp" 14 | #include "RawLicenseKey.hpp" 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | *.gch 7 | *.pch 8 | *.so 9 | *.dylib 10 | *.dll 11 | *.mod 12 | *.smod 13 | *.lai 14 | *.la 15 | *.a 16 | *.lib 17 | *.exe 18 | *.out 19 | *.app 20 | x64/ 21 | bin/ 22 | .vs/ 23 | packages/ 24 | *.filters 25 | OLDBACKEND/ 26 | *.user 27 | .vs/Chronite/v16/Browse.VC.db 28 | .vs/Chronite/v16/.suo 29 | *.ipch 30 | *.db-wal 31 | *.db-shm 32 | *.opendb 33 | *.tlog 34 | *.pdb 35 | *.res 36 | *.log 37 | *.lib -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonFloat.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | #if ARDUINOJSON_USE_DOUBLE 13 | typedef double JsonFloat; 14 | #else 15 | typedef float JsonFloat; 16 | #endif 17 | } // namespace Internals 18 | } // namespace ArduinoJson 19 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/ctype.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | inline bool isdigit(char c) { 11 | return '0' <= c && c <= '9'; 12 | } 13 | 14 | inline bool issign(char c) { 15 | return '-' == c || c == '+'; 16 | } 17 | } // namespace Internals 18 | } // namespace ArduinoJson 19 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsVariant.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "IsBaseOf.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | class JsonVariantTag {}; 13 | 14 | template 15 | struct IsVariant : IsBaseOf {}; 16 | } // namespace Internals 17 | } // namespace ArduinoJson 18 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/math.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | template 10 | bool isNaN(T x) { 11 | return x != x; 12 | } 13 | 14 | template 15 | bool isInfinity(T x) { 16 | return x != 0.0 && x * 2 == x; 17 | } 18 | } // namespace Internals 19 | } // namespace ArduinoJson 20 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/isInteger.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "./ctype.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | inline bool isInteger(const char* s) { 13 | if (!s || !*s) return false; 14 | if (issign(*s)) s++; 15 | while (isdigit(*s)) s++; 16 | return *s == '\0'; 17 | } 18 | } // namespace Internals 19 | } // namespace ArduinoJson 20 | -------------------------------------------------------------------------------- /Chronite/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // File di inclusione generato con Microsoft Visual C++. 3 | // Utilizzato da NeoniteC++.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/connection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // This is to wrap the platform specific kinds of connect/read/write. 4 | 5 | #include 6 | #include 7 | 8 | // not really connectiony, but need per-platform 9 | int GetProcessId(); 10 | 11 | struct BaseConnection 12 | { 13 | static BaseConnection* Create(); 14 | static void Destroy(BaseConnection*&); 15 | bool isOpen{false}; 16 | bool Open(); 17 | bool Close(); 18 | bool Write(const void* data, size_t length); 19 | bool Read(void* data, size_t length); 20 | }; 21 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/EnableIf.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that return the type T if Condition is true. 11 | template 12 | struct EnableIf {}; 13 | 14 | template 15 | struct EnableIf { 16 | typedef T type; 17 | }; 18 | } // namespace Internals 19 | } // namespace ArduinoJson 20 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/RemoveConst.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that return the type T without the const modifier 11 | template 12 | struct RemoveConst { 13 | typedef T type; 14 | }; 15 | template 16 | struct RemoveConst { 17 | typedef T type; 18 | }; 19 | } // namespace Internals 20 | } // namespace ArduinoJson 21 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/DummyPrint.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A dummy Print implementation used in JsonPrintable::measureLength() 11 | class DummyPrint { 12 | public: 13 | size_t print(char) { 14 | return 1; 15 | } 16 | 17 | size_t print(const char* s) { 18 | return strlen(s); 19 | } 20 | }; 21 | } // namespace Internals 22 | } // namespace ArduinoJson 23 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsFloatingPoint.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "IsSame.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | // A meta-function that returns true if T is a floating point type 13 | template 14 | struct IsFloatingPoint { 15 | static const bool value = IsSame::value || IsSame::value; 16 | }; 17 | } // namespace Internals 18 | } // namespace ArduinoJson 19 | -------------------------------------------------------------------------------- /Cranium/cryptolens/base64.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "imports/std/optional" 6 | 7 | namespace cryptolens_io { 8 | 9 | namespace v20190401 { 10 | 11 | namespace internal { 12 | 13 | // Internal functions used by the library for dealing with messages 14 | // encoded with base64. 15 | 16 | int 17 | b64_pton(char const *src, unsigned char *target, size_t targsize); 18 | 19 | optional 20 | b64_decode(std::string const& b64); 21 | 22 | } // namespace internal 23 | 24 | } // namespace v20190401 25 | 26 | } // namespace cryptolens_io 27 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/RemoveReference.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that return the type T without the reference modifier. 11 | template 12 | struct RemoveReference { 13 | typedef T type; 14 | }; 15 | template 16 | struct RemoveReference { 17 | typedef T type; 18 | }; 19 | } // namespace Internals 20 | } // namespace ArduinoJson 21 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsConst.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that return the type T without the const modifier 11 | template 12 | struct IsConst { 13 | static const bool value = false; 14 | }; 15 | 16 | template 17 | struct IsConst { 18 | static const bool value = true; 19 | }; 20 | } // namespace Internals 21 | } // namespace ArduinoJson 22 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsSame.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that returns true if types T and U are the same. 11 | template 12 | struct IsSame { 13 | static const bool value = false; 14 | }; 15 | 16 | template 17 | struct IsSame { 18 | static const bool value = true; 19 | }; 20 | } // namespace Internals 21 | } // namespace ArduinoJson 22 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/NonCopyable.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A type that cannot be copied 11 | class NonCopyable { 12 | protected: 13 | NonCopyable() {} 14 | 15 | private: 16 | // copy constructor is private 17 | NonCopyable(const NonCopyable&); 18 | 19 | // copy operator is private 20 | NonCopyable& operator=(const NonCopyable&); 21 | }; 22 | } // namespace Internals 23 | } // namespace ArduinoJson 24 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonBufferImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "Deserialization/JsonParser.hpp" 8 | 9 | inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::createArray() { 10 | JsonArray *ptr = new (this) JsonArray(this); 11 | return ptr ? *ptr : JsonArray::invalid(); 12 | } 13 | 14 | inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::createObject() { 15 | JsonObject *ptr = new (this) JsonObject(this); 16 | return ptr ? *ptr : JsonObject::invalid(); 17 | } 18 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonBufferAllocated.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../JsonBuffer.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | class JsonBufferAllocated { 13 | public: 14 | void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() { 15 | if (!jsonBuffer) return NULL; 16 | return jsonBuffer->alloc(n); 17 | } 18 | 19 | void operator delete(void *, JsonBuffer *)throw(); 20 | }; 21 | } // namespace Internals 22 | } // namespace ArduinoJson 23 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonVariantDefault.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | template 11 | struct JsonVariantDefault { 12 | static T get() { 13 | return T(); 14 | } 15 | }; 16 | 17 | template 18 | struct JsonVariantDefault : JsonVariantDefault {}; 19 | 20 | template 21 | struct JsonVariantDefault : JsonVariantDefault {}; 22 | } // namespace Internals 23 | } // namespace ArduinoJson 24 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonInteger.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | #if ARDUINOJSON_USE_LONG_LONG 13 | typedef long long JsonInteger; 14 | typedef unsigned long long JsonUInt; 15 | #elif ARDUINOJSON_USE_INT64 16 | typedef __int64 JsonInteger; 17 | typedef unsigned _int64 JsonUInt; 18 | #else 19 | typedef long JsonInteger; 20 | typedef unsigned long JsonUInt; 21 | #endif 22 | } // namespace Internals 23 | } // namespace ArduinoJson 24 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/ListNode.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for NULL 8 | 9 | #include "JsonBufferAllocated.hpp" 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | // A node for a singly-linked list. 15 | // Used by List and its iterators. 16 | template 17 | struct ListNode : public Internals::JsonBufferAllocated { 18 | ListNode() throw() : next(NULL) {} 19 | 20 | ListNode *next; 21 | T content; 22 | }; 23 | } // namespace Internals 24 | } // namespace ArduinoJson 25 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsArray.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that return the type T without the const modifier 11 | template 12 | struct IsArray { 13 | static const bool value = false; 14 | }; 15 | template 16 | struct IsArray { 17 | static const bool value = true; 18 | }; 19 | template 20 | struct IsArray { 21 | static const bool value = true; 22 | }; 23 | } // namespace Internals 24 | } // namespace ArduinoJson 25 | -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/TautologyValidator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../basic_Error.hpp" 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | template 10 | class TautologyValidator_ { 11 | public: 12 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 13 | explicit 14 | #endif 15 | TautologyValidator_(basic_Error & e) {} 16 | 17 | void validate(basic_Error & e, Env & env) {} 18 | }; 19 | 20 | } // namespace v20190401 21 | 22 | namespace latest { 23 | 24 | template 25 | using TautologyValidator_ = ::cryptolens_io::v20190401::TautologyValidator_; 26 | 27 | } // namespace latest 28 | 29 | } // namespace cryptolens_io 30 | -------------------------------------------------------------------------------- /Cranium/detver.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Common version parameters. 4 | // 5 | // Microsoft Research Detours Package, Version 3.0 Build_316. 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | // 9 | 10 | #ifndef DETOURS_STRINGIFY 11 | #define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x) 12 | #define DETOURS_STRINGIFY_(x) #x 13 | #endif 14 | 15 | #define VER_FILEFLAGSMASK 0x3fL 16 | #define VER_FILEFLAGS 0x0L 17 | #define VER_FILEOS 0x00040004L 18 | #define VER_FILETYPE 0x00000002L 19 | #define VER_FILESUBTYPE 0x00000000L 20 | 21 | #define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS) 22 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsChar.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "IsSame.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | // A meta-function that returns true if T is a charater 13 | template 14 | struct IsChar { 15 | static const bool value = IsSame::value || 16 | IsSame::value || 17 | IsSame::value; 18 | }; 19 | 20 | template 21 | struct IsChar : IsChar {}; 22 | } // namespace Internals 23 | } // namespace ArduinoJson 24 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/ReferenceType.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A type that is meant to be used by reference only (JsonArray and JsonObject) 11 | class ReferenceType { 12 | public: 13 | bool operator==(const ReferenceType& other) const { 14 | // two JsonArray are equal if they are the same instance 15 | // (we don't compare the content) 16 | return this == &other; 17 | } 18 | 19 | bool operator!=(const ReferenceType& other) const { 20 | return this != &other; 21 | } 22 | }; 23 | } // namespace Internals 24 | } // namespace ArduinoJson 25 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/alias_cast.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include // for size_t 9 | #include "../Configuration.hpp" 10 | #include "../Polyfills/math.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | template 16 | struct alias_cast_t { 17 | union { 18 | F raw; 19 | T data; 20 | }; 21 | }; 22 | 23 | template 24 | T alias_cast(F raw_data) { 25 | alias_cast_t ac; 26 | ac.raw = raw_data; 27 | return ac.data; 28 | } 29 | 30 | } // namespace Internals 31 | } // namespace ArduinoJson 32 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "ArduinoJson/version.hpp" 8 | 9 | #include "ArduinoJson/DynamicJsonBuffer.hpp" 10 | #include "ArduinoJson/JsonArray.hpp" 11 | #include "ArduinoJson/JsonObject.hpp" 12 | #include "ArduinoJson/StaticJsonBuffer.hpp" 13 | 14 | #include "ArduinoJson/Deserialization/JsonParserImpl.hpp" 15 | #include "ArduinoJson/JsonArrayImpl.hpp" 16 | #include "ArduinoJson/JsonBufferImpl.hpp" 17 | #include "ArduinoJson/JsonObjectImpl.hpp" 18 | #include "ArduinoJson/JsonVariantImpl.hpp" 19 | #include "ArduinoJson/Serialization/JsonSerializerImpl.hpp" 20 | 21 | #include "ArduinoJson/compatibility.hpp" 22 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonArrayImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonArray.hpp" 8 | #include "JsonArraySubscript.hpp" 9 | #include "JsonObject.hpp" 10 | 11 | namespace ArduinoJson { 12 | 13 | inline JsonArray &JsonArray::createNestedArray() { 14 | if (!_buffer) return JsonArray::invalid(); 15 | JsonArray &array = _buffer->createArray(); 16 | add(array); 17 | return array; 18 | } 19 | 20 | inline JsonObject &JsonArray::createNestedObject() { 21 | if (!_buffer) return JsonObject::invalid(); 22 | JsonObject &object = _buffer->createObject(); 23 | add(object); 24 | return object; 25 | } 26 | } // namespace ArduinoJson 27 | -------------------------------------------------------------------------------- /Chronite/Backend/server/collections.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | inline json profile_collections = 4 | R"( 5 | { 6 | "created": "", 7 | "updated": "", 8 | "rvn": 1, 9 | "wipeNumber": 1, 10 | "accountId": "", 11 | "profileId": "collections", 12 | "version": "neonite++", 13 | "items": {}, 14 | "stats": { 15 | "attributes": {} 16 | } 17 | } 18 | )"_json; 19 | 20 | inline json pCollections() 21 | { 22 | boost::posix_time::ptime t = boost::posix_time::microsec_clock::universal_time(); 23 | auto date = to_iso_extended_string(t); 24 | date = date.substr(0, date.size() - 3) + "Z"; 25 | profile_collections["created"] = date; 26 | profile_collections["updated"] = date; 27 | profile_collections["accountId"] = name; 28 | return profile_collections; 29 | } 30 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/discord_register.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(DISCORD_DYNAMIC_LIB) 4 | #if defined(_WIN32) 5 | #if defined(DISCORD_BUILDING_SDK) 6 | #define DISCORD_EXPORT __declspec(dllexport) 7 | #else 8 | #define DISCORD_EXPORT __declspec(dllimport) 9 | #endif 10 | #else 11 | #define DISCORD_EXPORT __attribute__((visibility("default"))) 12 | #endif 13 | #else 14 | #define DISCORD_EXPORT 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | extern "C" 19 | { 20 | #endif 21 | 22 | DISCORD_EXPORT void Discord_Register(const char* applicationId, 23 | const char* command); 24 | DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, 25 | const char* steamId); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /Chronite/includes/injection/Injection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //https://guidedhacking.com/threads/manual-mapping-dll-injection-tutorial-how-to-manual-map.10009/ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using f_LoadLibraryA = HINSTANCE(WINAPI*)(const char* lpLibFilename); 10 | using f_GetProcAddress = UINT_PTR(WINAPI*)(HINSTANCE hModule, 11 | const char* lpProcName); 12 | using f_DLL_ENTRY_POINT = BOOL(WINAPI*)(void* hDll, DWORD dwReason, 13 | void* pReserved); 14 | 15 | struct MANUAL_MAPPING_DATA 16 | { 17 | f_LoadLibraryA pLoadLibraryA; 18 | f_GetProcAddress pGetProcAddress; 19 | HINSTANCE hMod; 20 | }; 21 | 22 | bool ManualMap(HANDLE hProc, const char* szDllFile); 23 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsBaseOf.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A meta-function that returns true if Derived inherits from TBase is an 11 | // integral type. 12 | template 13 | class IsBaseOf { 14 | protected: // <- to avoid GCC's "all member functions in class are private" 15 | typedef char Yes[1]; 16 | typedef char No[2]; 17 | 18 | static Yes &probe(const TBase *); 19 | static No &probe(...); 20 | 21 | public: 22 | enum { 23 | value = sizeof(probe(reinterpret_cast(0))) == sizeof(Yes) 24 | }; 25 | }; 26 | } // namespace Internals 27 | } // namespace ArduinoJson 28 | -------------------------------------------------------------------------------- /Chronite/Backend/server/common_public.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | inline json profile_public = 4 | R"( 5 | { 6 | "created": "", 7 | "updated": "", 8 | "rvn": 1, 9 | "wipeNumber": 1, 10 | "accountId": "", 11 | "profileId": "common_public", 12 | "version": "neonite++", 13 | "items": {}, 14 | "stats": { 15 | "attributes": { 16 | "banner_color": "", 17 | "homebase_name": "", 18 | "banner_icon": "" 19 | } 20 | } 21 | } 22 | )"_json; 23 | 24 | inline json pCommonPublic() 25 | { 26 | boost::posix_time::ptime t = boost::posix_time::microsec_clock::universal_time(); 27 | auto date = to_iso_extended_string(t); 28 | date = date.substr(0, date.size() - 3) + "Z"; 29 | profile_public["created"] = date; 30 | profile_public["updated"] = date; 31 | profile_public["accountId"] = name; 32 | return profile_public; 33 | } 34 | -------------------------------------------------------------------------------- /Cranium/cryptolens/api.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace cryptolens_io { 4 | 5 | namespace v20190401 { 6 | 7 | namespace api { 8 | 9 | struct main { }; 10 | 11 | struct experimental_v1 { }; 12 | 13 | namespace internal { 14 | 15 | struct main { }; 16 | 17 | } // namespace internal 18 | 19 | } // namespace api 20 | 21 | } // namespace v20190401 22 | 23 | namespace latest { 24 | 25 | namespace api { 26 | 27 | using ::cryptolens_io::v20190401::api::main; 28 | using ::cryptolens_io::v20190401::api::experimental_v1; 29 | 30 | } // namespace api 31 | 32 | } // namespace latest 33 | 34 | namespace v20180502 { 35 | 36 | namespace api { 37 | 38 | using ::cryptolens_io::v20190401::api::main; 39 | using ::cryptolens_io::v20190401::api::experimental_v1; 40 | 41 | } // namespace api 42 | 43 | } // namespace v20180502 44 | 45 | } // namespace cryptolens_io 46 | -------------------------------------------------------------------------------- /Chronite/Backend/server/common_core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | inline json profile_core = 4 | R"( 5 | { 6 | "_id": "", 7 | "created": "", 8 | "updated": "", 9 | "rvn": 1, 10 | "wipeNumber": 1, 11 | "accountId": "", 12 | "profileId": "common_core", 13 | "version": "neonitepp", 14 | "items": {}, 15 | "stats": { 16 | "attributes": { 17 | "mtx_affiliate": "neonite++", 18 | "current_mtx_platform": "EpicPC" 19 | } 20 | } 21 | } 22 | )"_json; 23 | 24 | inline json pCommonCore() 25 | { 26 | boost::posix_time::ptime t = boost::posix_time::microsec_clock::universal_time(); 27 | auto date = to_iso_extended_string(t); 28 | date = date.substr(0, date.size() - 3) + "Z"; 29 | profile_core["created"] = date; 30 | profile_core["updated"] = date; 31 | profile_core["_id"] = name; 32 | profile_core["accountId"] = name; 33 | return profile_core; 34 | } 35 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonObjectImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonArray.hpp" 8 | #include "JsonObject.hpp" 9 | #include "JsonObjectSubscript.hpp" 10 | 11 | namespace ArduinoJson { 12 | 13 | template 14 | inline JsonArray &JsonObject::createNestedArray_impl(TStringRef key) { 15 | if (!_buffer) return JsonArray::invalid(); 16 | JsonArray &array = _buffer->createArray(); 17 | set(key, array); 18 | return array; 19 | } 20 | 21 | template 22 | inline JsonObject &JsonObject::createNestedObject_impl(TStringRef key) { 23 | if (!_buffer) return JsonObject::invalid(); 24 | JsonObject &object = _buffer->createObject(); 25 | set(key, object); 26 | return object; 27 | } 28 | } // namespace ArduinoJson 29 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsIntegral.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "IsSame.hpp" 8 | #include "IsSignedIntegral.hpp" 9 | #include "IsUnsignedIntegral.hpp" 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | // A meta-function that returns true if T is an integral type. 15 | template 16 | struct IsIntegral { 17 | static const bool value = IsSignedIntegral::value || 18 | IsUnsignedIntegral::value || 19 | IsSame::value; 20 | // CAUTION: differs from std::is_integral as it doesn't include bool 21 | }; 22 | 23 | template 24 | struct IsIntegral : IsIntegral {}; 25 | } // namespace Internals 26 | } // namespace ArduinoJson 27 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonVariantBase.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonVariantCasts.hpp" 8 | #include "JsonVariantComparisons.hpp" 9 | #include "JsonVariantOr.hpp" 10 | #include "JsonVariantSubscripts.hpp" 11 | #include "Serialization/JsonPrintable.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | template 17 | class JsonVariantBase : public JsonPrintable, 18 | public JsonVariantCasts, 19 | public JsonVariantComparisons, 20 | public JsonVariantOr, 21 | public JsonVariantSubscripts, 22 | public JsonVariantTag {}; 23 | } // namespace Internals 24 | } // namespace ArduinoJson 25 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsSignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | #include "IsSame.hpp" 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | // A meta-function that returns true if T is an integral type. 14 | template 15 | struct IsSignedIntegral { 16 | static const bool value = 17 | IsSame::value || IsSame::value || 18 | IsSame::value || IsSame::value || 19 | #if ARDUINOJSON_USE_LONG_LONG 20 | IsSame::value || 21 | #endif 22 | #if ARDUINOJSON_USE_INT64 23 | IsSame::value || 24 | #endif 25 | false; 26 | }; 27 | } // namespace Internals 28 | } // namespace ArduinoJson 29 | -------------------------------------------------------------------------------- /Cranium/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | //{{NO_DEPENDENCIES}} 16 | // Microsoft Visual C++ generated include file. 17 | // Used by Resource.rc 18 | 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | #define _APS_NEXT_RESOURCE_VALUE 101 24 | #define _APS_NEXT_COMMAND_VALUE 40001 25 | #define _APS_NEXT_CONTROL_VALUE 1001 26 | #define _APS_NEXT_SYMED_VALUE 101 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #ifdef _MSC_VER // Visual Studio 8 | 9 | #define FORCE_INLINE // __forceinline causes C4714 when returning std::string 10 | #define NO_INLINE __declspec(noinline) 11 | #define DEPRECATED(msg) __declspec(deprecated(msg)) 12 | 13 | #elif defined(__GNUC__) // GCC or Clang 14 | 15 | #define FORCE_INLINE __attribute__((always_inline)) 16 | #define NO_INLINE __attribute__((noinline)) 17 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) 18 | #define DEPRECATED(msg) __attribute__((deprecated(msg))) 19 | #else 20 | #define DEPRECATED(msg) __attribute__((deprecated)) 21 | #endif 22 | 23 | #else // Other compilers 24 | 25 | #define FORCE_INLINE 26 | #define NO_INLINE 27 | #define DEPRECATED(msg) 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/StaticStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A Print implementation that allows to write in a char[] 11 | class StaticStringBuilder { 12 | public: 13 | StaticStringBuilder(char *buf, size_t size) : end(buf + size - 1), p(buf) { 14 | *p = '\0'; 15 | } 16 | 17 | size_t print(char c) { 18 | if (p >= end) return 0; 19 | *p++ = c; 20 | *p = '\0'; 21 | return 1; 22 | } 23 | 24 | size_t print(const char *s) { 25 | char *begin = p; 26 | while (p < end && *s) *p++ = *s++; 27 | *p = '\0'; 28 | return size_t(p - begin); 29 | } 30 | 31 | private: 32 | char *end; 33 | char *p; 34 | }; 35 | } // namespace Internals 36 | } // namespace ArduinoJson 37 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | #include "IsSame.hpp" 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | // A meta-function that returns true if T is an integral type. 14 | template 15 | struct IsUnsignedIntegral { 16 | static const bool value = 17 | IsSame::value || IsSame::value || 18 | IsSame::value || IsSame::value || 19 | #if ARDUINOJSON_USE_LONG_LONG 20 | IsSame::value || 21 | #endif 22 | #if ARDUINOJSON_USE_INT64 23 | IsSame::value || 24 | #endif 25 | false; 26 | }; 27 | } // namespace Internals 28 | } // namespace ArduinoJson 29 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonVariantContent.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonFloat.hpp" 8 | #include "JsonInteger.hpp" 9 | 10 | namespace ArduinoJson { 11 | 12 | // Forward declarations 13 | class JsonArray; 14 | class JsonObject; 15 | 16 | namespace Internals { 17 | // A union that defines the actual content of a JsonVariant. 18 | // The enum JsonVariantType determines which member is in use. 19 | union JsonVariantContent { 20 | JsonFloat asFloat; // used for double and float 21 | JsonUInt asInteger; // used for bool, char, short, int and longs 22 | const char* asString; // asString can be null 23 | JsonArray* asArray; // asArray cannot be null 24 | JsonObject* asObject; // asObject cannot be null 25 | }; 26 | } // namespace Internals 27 | } // namespace ArduinoJson 28 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/StreamPrintAdapter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | 9 | #if ARDUINOJSON_ENABLE_STD_STREAM 10 | 11 | #include 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | class StreamPrintAdapter { 17 | public: 18 | explicit StreamPrintAdapter(std::ostream& os) : _os(os) {} 19 | 20 | size_t print(char c) { 21 | _os << c; 22 | return 1; 23 | } 24 | 25 | size_t print(const char* s) { 26 | _os << s; 27 | return strlen(s); 28 | } 29 | 30 | private: 31 | // cannot be assigned 32 | StreamPrintAdapter& operator=(const StreamPrintAdapter&); 33 | 34 | std::ostream& _os; 35 | }; 36 | } // namespace Internals 37 | } // namespace ArduinoJson 38 | 39 | #endif // ARDUINOJSON_ENABLE_STD_STREAM 40 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/isFloat.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for strcmp 8 | #include "./ctype.hpp" 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | inline bool isFloat(const char* s) { 14 | if (!s) return false; 15 | 16 | if (!strcmp(s, "NaN")) return true; 17 | if (issign(*s)) s++; 18 | if (!strcmp(s, "Infinity")) return true; 19 | if (*s == '\0') return false; 20 | 21 | while (isdigit(*s)) s++; 22 | 23 | if (*s == '.') { 24 | s++; 25 | while (isdigit(*s)) s++; 26 | } 27 | 28 | if (*s == 'e' || *s == 'E') { 29 | s++; 30 | if (issign(*s)) s++; 31 | if (!isdigit(*s)) return false; 32 | while (isdigit(*s)) s++; 33 | } 34 | 35 | return *s == '\0'; 36 | } 37 | } // namespace Internals 38 | } // namespace ArduinoJson 39 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/backoff.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct Backoff 9 | { 10 | int64_t minAmount; 11 | int64_t maxAmount; 12 | int64_t current; 13 | int fails; 14 | std::mt19937_64 randGenerator; 15 | std::uniform_real_distribution<> randDistribution; 16 | 17 | double rand01() { return randDistribution(randGenerator); } 18 | 19 | Backoff(int64_t min, int64_t max) 20 | : minAmount(min) 21 | , maxAmount(max) 22 | , current(min) 23 | , fails(0) 24 | , randGenerator(static_cast(time(nullptr))) 25 | { 26 | } 27 | 28 | void reset() 29 | { 30 | fails = 0; 31 | current = minAmount; 32 | } 33 | 34 | int64_t nextDelay() 35 | { 36 | ++fails; 37 | int64_t delay = static_cast(static_cast(current) * 2.0 * rand01()); 38 | current = std::min(current + delay, maxAmount); 39 | return current; 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/parseInteger.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include "../Configuration.hpp" 10 | #include "./ctype.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | template 15 | T parseInteger(const char *s) { 16 | if (!s) return 0; // NULL 17 | 18 | if (*s == 't') return 1; // "true" 19 | 20 | T result = 0; 21 | bool negative_result = false; 22 | 23 | switch (*s) { 24 | case '-': 25 | negative_result = true; 26 | s++; 27 | break; 28 | case '+': 29 | s++; 30 | break; 31 | } 32 | 33 | while (isdigit(*s)) { 34 | result = T(result * 10 + T(*s - '0')); 35 | s++; 36 | } 37 | 38 | return negative_result ? T(~result + 1) : result; 39 | } 40 | } // namespace Internals 41 | } // namespace ArduinoJson 42 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/JsonSerializer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "JsonWriter.hpp" 8 | 9 | namespace ArduinoJson { 10 | 11 | class JsonArray; 12 | class JsonObject; 13 | class JsonVariant; 14 | 15 | namespace Internals { 16 | 17 | class JsonArraySubscript; 18 | template 19 | class JsonObjectSubscript; 20 | 21 | template 22 | class JsonSerializer { 23 | public: 24 | static void serialize(const JsonArray &, Writer &); 25 | static void serialize(const JsonArraySubscript &, Writer &); 26 | static void serialize(const JsonObject &, Writer &); 27 | template 28 | static void serialize(const JsonObjectSubscript &, Writer &); 29 | static void serialize(const JsonVariant &, Writer &); 30 | }; 31 | } // namespace Internals 32 | } // namespace ArduinoJson 33 | -------------------------------------------------------------------------------- /Cranium/manifest.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | 7 | VS_VERSION_INFO VERSIONINFO 8 | FILEVERSION 1, 0, 0, 0 9 | PRODUCTVERSION 1, 0, 0, 0 10 | { 11 | BLOCK "StringFileInfo" 12 | { 13 | BLOCK "040904b0" 14 | { 15 | VALUE "Comments", "Cranium" 16 | VALUE "CompanyName", "Neonite" 17 | 18 | VALUE "FileDescription", "Cranium" 19 | VALUE "FileVersion", "1.0.0.0" 20 | VALUE "InternalName", "Cranium" 21 | VALUE "LegalCopyright", "Cranium (c) by kemo#1337 (@xkem0x)" 22 | 23 | VALUE "OriginalFilename", "Cranium.dll" 24 | VALUE "ProductName", "Cranium" 25 | VALUE "ProductVersion", "1.0.0.0" 26 | } 27 | } 28 | BLOCK "VarFileInfo" 29 | { 30 | VALUE "Translation", 0x409, 1200 31 | } 32 | } -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Deserialization/StringWriter.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | template 11 | class StringWriter { 12 | public: 13 | class String { 14 | public: 15 | String(TChar** ptr) : _writePtr(ptr), _startPtr(*ptr) {} 16 | 17 | void append(char c) { 18 | *(*_writePtr)++ = TChar(c); 19 | } 20 | 21 | const char* c_str() const { 22 | *(*_writePtr)++ = 0; 23 | return reinterpret_cast(_startPtr); 24 | } 25 | 26 | private: 27 | TChar** _writePtr; 28 | TChar* _startPtr; 29 | }; 30 | 31 | StringWriter(TChar* buffer) : _ptr(buffer) {} 32 | 33 | String startString() { 34 | return String(&_ptr); 35 | } 36 | 37 | private: 38 | TChar* _ptr; 39 | }; 40 | } // namespace Internals 41 | } // namespace ArduinoJson 42 | -------------------------------------------------------------------------------- /Cranium/cryptolens/MachineCodeComputer_static.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "basic_Error.hpp" 6 | 7 | namespace cryptolens_io { 8 | 9 | namespace v20190401 { 10 | 11 | namespace errors { 12 | 13 | namespace MachineCodeComputer_static {} 14 | 15 | } // namespace errors 16 | 17 | /** 18 | */ 19 | class MachineCodeComputer_static 20 | { 21 | public: 22 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 23 | explicit 24 | #endif 25 | MachineCodeComputer_static(basic_Error & e) {} 26 | 27 | void 28 | set_machine_code(basic_Error & e, std::string machine_code); 29 | 30 | std::string 31 | get_machine_code(basic_Error & e); 32 | 33 | private: 34 | std::string machine_code_; 35 | }; 36 | 37 | } // namespace v20190401 38 | 39 | namespace latest { 40 | 41 | // TODO: errors namespace 42 | using MachineCodeComputer_static = ::cryptolens_io::v20190401::MachineCodeComputer_static; 43 | 44 | } // namespace latest 45 | 46 | } // namespace cryptolens_io 47 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/DynamicStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../StringTraits/StringTraits.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | // A Print implementation that allows to write in a String 13 | template 14 | class DynamicStringBuilder { 15 | public: 16 | DynamicStringBuilder(TString &str) : _str(str) {} 17 | 18 | size_t print(char c) { 19 | StringTraits::append(_str, c); 20 | return 1; 21 | } 22 | 23 | size_t print(const char *s) { 24 | size_t initialLen = _str.length(); 25 | StringTraits::append(_str, s); 26 | return _str.length() - initialLen; 27 | } 28 | 29 | private: 30 | DynamicStringBuilder &operator=(const DynamicStringBuilder &); 31 | 32 | TString &_str; 33 | }; 34 | } // namespace Internals 35 | } // namespace ArduinoJson 36 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/Encoding.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | class Encoding { 11 | public: 12 | // Optimized for code size on a 8-bit AVR 13 | static char escapeChar(char c) { 14 | const char *p = escapeTable(false); 15 | while (p[0] && p[1] != c) { 16 | p += 2; 17 | } 18 | return p[0]; 19 | } 20 | 21 | // Optimized for code size on a 8-bit AVR 22 | static char unescapeChar(char c) { 23 | const char *p = escapeTable(true); 24 | for (;;) { 25 | if (p[0] == '\0') return c; 26 | if (p[0] == c) return p[1]; 27 | p += 2; 28 | } 29 | } 30 | 31 | private: 32 | static const char *escapeTable(bool excludeIdenticals) { 33 | return &"\"\"\\\\b\bf\fn\nr\rt\t"[excludeIdenticals ? 4 : 0]; 34 | } 35 | }; 36 | } // namespace Internals 37 | } // namespace ArduinoJson 38 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonVariantAs.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // A metafunction that returns the type of the value returned by 11 | // JsonVariant::as() 12 | template 13 | struct JsonVariantAs { 14 | typedef T type; 15 | }; 16 | 17 | template <> 18 | struct JsonVariantAs { 19 | typedef const char* type; 20 | }; 21 | 22 | template <> 23 | struct JsonVariantAs { 24 | typedef JsonArray& type; 25 | }; 26 | 27 | template <> 28 | struct JsonVariantAs { 29 | typedef const JsonArray& type; 30 | }; 31 | 32 | template <> 33 | struct JsonVariantAs { 34 | typedef JsonObject& type; 35 | }; 36 | 37 | template <> 38 | struct JsonVariantAs { 39 | typedef const JsonObject& type; 40 | }; 41 | } // namespace Internals 42 | } // namespace ArduinoJson 43 | -------------------------------------------------------------------------------- /Cranium/cryptolens/Error.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "basic_Error.hpp" 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | class Error : public basic_Error { 10 | public: 11 | // Declarations below hide these methods inherited from the basic_Error class 12 | using basic_Error::get_subsystem; 13 | using basic_Error::get_reason; 14 | using basic_Error::get_extra; 15 | using basic_Error::reset; 16 | 17 | int get_subsystem() const noexcept { return get_subsystem(api::main()); } 18 | int get_reason() const noexcept { return get_reason(api::main()); } 19 | size_t get_extra() const noexcept { return get_extra(api::main()); } 20 | 21 | void reset() { reset(api::main()); } 22 | }; 23 | 24 | } // namespace v20190401 25 | 26 | namespace v20180502 { 27 | 28 | using Error = ::cryptolens_io::v20190401::Error; 29 | 30 | } // namespace v20180502 31 | 32 | namespace latest { 33 | 34 | using Error = ::cryptolens_io::v20190401::Error; 35 | 36 | } // namespace latest 37 | 38 | } // namespace cryptolens_io 39 | -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/CorrectKeyValidator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../api.hpp" 4 | #include "../basic_Error.hpp" 5 | 6 | namespace cryptolens_io { 7 | 8 | namespace v20190401 { 9 | 10 | template 11 | class CorrectKeyValidator_ { 12 | public: 13 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 14 | explicit 15 | #endif 16 | CorrectKeyValidator_(basic_Error & e) {} 17 | 18 | void 19 | validate(basic_Error & e, Env & env) { 20 | if (e) { return; } 21 | 22 | auto const& expected_key = env.get_key(); 23 | auto const& key = env.get_license_key_information().get_key(); 24 | 25 | if (key && key != expected_key) { 26 | e.set(api::main(), errors::Subsystem::Main, errors::Main::UNKNOWN_SERVER_REPLY); 27 | } 28 | } 29 | }; 30 | 31 | } // namespace v20190401 32 | 33 | namespace latest { 34 | 35 | template 36 | using CorrectKeyValidator_ = ::cryptolens_io::v20190401::CorrectKeyValidator_; 37 | 38 | } // namespace latest 39 | 40 | } // namespace cryptolens_io 41 | -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/CorrectProductValidator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../basic_Error.hpp" 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | template 10 | class CorrectProductValidator_ { 11 | public: 12 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 13 | explicit 14 | #endif 15 | CorrectProductValidator_(basic_Error & e) {} 16 | 17 | void 18 | validate(basic_Error & e, Env & env) { 19 | if (e) { return; } 20 | 21 | int expected_product_id = env.get_product_id(); 22 | int product_id = env.get_license_key_information().get_product_id(); 23 | 24 | if (product_id != expected_product_id) { 25 | e.set(api::main(), errors::Subsystem::Main, errors::Main::UNKNOWN_SERVER_REPLY); 26 | } 27 | } 28 | }; 29 | 30 | } // namespace v20190401 31 | 32 | namespace latest { 33 | 34 | template 35 | using CorrectProductValidator_ = ::cryptolens_io::v20190401::CorrectProductValidator_; 36 | 37 | } // namespace latest 38 | 39 | } // namespace cryptolens_io 40 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/msg_queue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // A simple queue. No locks, but only works with a single thread as producer and a single thread as 6 | // a consumer. Mutex up as needed. 7 | 8 | template 9 | class MsgQueue 10 | { 11 | ElementType queue_[QueueSize]; 12 | std::atomic_uint nextAdd_{0}; 13 | std::atomic_uint nextSend_{0}; 14 | std::atomic_uint pendingSends_{0}; 15 | 16 | public: 17 | MsgQueue() 18 | { 19 | } 20 | 21 | ElementType* GetNextAddMessage() 22 | { 23 | // if we are falling behind, bail 24 | if (pendingSends_.load() >= QueueSize) 25 | { 26 | return nullptr; 27 | } 28 | auto index = (nextAdd_++) % QueueSize; 29 | return &queue_[index]; 30 | } 31 | 32 | void CommitAdd() { ++pendingSends_; } 33 | 34 | bool HavePendingSends() const { return pendingSends_.load() != 0; } 35 | 36 | ElementType* GetNextSendMessage() 37 | { 38 | auto index = (nextSend_++) % QueueSize; 39 | return &queue_[index]; 40 | } 41 | 42 | void CommitSend() { --pendingSends_; } 43 | }; 44 | -------------------------------------------------------------------------------- /Chronite/Backend/server/creative.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | inline json profile_creative = 4 | R"( 5 | { 6 | "created": "", 7 | "updated": "", 8 | "rvn": 1, 9 | "wipeNumber": 1, 10 | "accountId": "", 11 | "profileId": "creative", 12 | "version": "neonite++", 13 | "items": {}, 14 | "stats": { 15 | "attributes": { 16 | "last_used_battlelab_file": "", 17 | "max_island_plots": 50, 18 | "publish_allowed": true, 19 | "support_code": "", 20 | "last_used_plot": "", 21 | "permissions": [], 22 | "creator_name": "", 23 | "publish_banned": false, 24 | "inventory_limit_bonus": 0 25 | } 26 | } 27 | } 28 | )"_json; 29 | 30 | inline json pCreative() 31 | { 32 | boost::posix_time::ptime t = boost::posix_time::microsec_clock::universal_time(); 33 | auto date = to_iso_extended_string(t); 34 | date = date.substr(0, date.size() - 3) + "Z"; 35 | profile_creative["created"] = date; 36 | profile_creative["updated"] = date; 37 | profile_creative["accountId"] = name; 38 | return profile_creative; 39 | } 40 | -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/NotExpiredValidator_ctime.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "../api.hpp" 6 | #include "../basic_Error.hpp" 7 | 8 | namespace cryptolens_io { 9 | 10 | namespace v20190401 { 11 | 12 | template 13 | class NotExpiredValidator_ctime_ { 14 | public: 15 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 16 | explicit 17 | #endif 18 | NotExpiredValidator_ctime_(basic_Error & e) {} 19 | 20 | void validate(basic_Error & e, Env & env) { 21 | std::uint64_t expires = env.get_license_key_information().get_expires(); 22 | 23 | auto current = std::time(NULL); 24 | if (current < 0 || expires < (std::uint64_t)current) { 25 | using namespace errors; 26 | e.set(api::main(), Subsystem::Main, Main::KEY_EXPIRED); 27 | } 28 | } 29 | 30 | private: 31 | }; 32 | 33 | } // namespace v20190401 34 | 35 | namespace latest { 36 | 37 | template 38 | using NotExpiredValidator_ctime_ = ::cryptolens_io::v20190401::NotExpiredValidator_ctime_; 39 | 40 | } // namespace latest 41 | 42 | } // namespace cryptolens_io 43 | -------------------------------------------------------------------------------- /Cranium/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define _WINSOCK_DEPRECATED_NO_WARNINGS 4 | #define _CRT_SECURE_NO_WARNINGS 5 | #define WIN32_LEAN_AND_MEAN 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | #include "gui/kiero.h" 26 | #include "gui/imgui/imgui.h" 27 | #include "gui/Imgui/imfilebrowser.h" 28 | #include "gui/imgui/imgui_impl_win32.h" 29 | #include "gui/imgui/imgui_impl_dx11.h" 30 | #include "xorstr.hpp" 31 | 32 | #define XOR(STR) xorstr(STR).crypt_get() 33 | 34 | #pragma comment(lib, "minhook/minhook.lib") 35 | #pragma comment(lib, "user32.lib") 36 | #pragma comment(lib, "winhttp.lib") 37 | #pragma comment(lib, "advapi32.lib") 38 | #pragma comment(lib, "ws2_32.lib") 39 | #include "minhook/MinHook.h" 40 | 41 | static bool showMenu = false; -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/AndValidator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../basic_Error.hpp" 4 | #include "TautologyValidator.hpp" 5 | 6 | namespace cryptolens_io { 7 | 8 | namespace v20190401 { 9 | 10 | template> 11 | class AndValidator_ { 12 | public: 13 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 14 | explicit 15 | #endif 16 | AndValidator_(basic_Error & e) : head(e), tail(e) {} 17 | 18 | void 19 | validate(basic_Error & e, Env & env) { 20 | // Should we add checks if e is in an error state? 21 | // This is not neccessary given that H and T correctly 22 | // checks e. But maybe just in case? 23 | 24 | head.validate(e, env); 25 | tail.validate(e, env); 26 | } 27 | 28 | private: 29 | H head; 30 | T tail; 31 | }; 32 | 33 | } // namespace v20190401 34 | 35 | namespace latest { 36 | 37 | template> 38 | using AndValidator_ = ::cryptolens_io::v20190401::AndValidator_; 39 | 40 | } // namespace latest 41 | 42 | } // namespace cryptolens_io 43 | -------------------------------------------------------------------------------- /Chronite/Discord.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include //We will use chrono for the elapsed time. 3 | 4 | //Discord SDK Stuff. 5 | #include "Frontend/util.h" 6 | 7 | static bool gInit, gRPC = true; 8 | DiscordRichPresence discordPresence; 9 | 10 | void SetupDiscord() 11 | { 12 | DiscordEventHandlers handlers; 13 | memset(&handlers, 0, sizeof(handlers)); 14 | Discord_Initialize("776056054818668544", &handlers, 1, "0"); 15 | } 16 | 17 | static void UpdateDiscord() 18 | { 19 | static int64_t StartTime = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); 20 | 21 | memset(&discordPresence, 0, sizeof(discordPresence)); 22 | discordPresence.state = "Using Neonite"; 23 | discordPresence.details = "In Launcher"; 24 | discordPresence.startTimestamp = StartTime; 25 | discordPresence.endTimestamp = NULL; 26 | discordPresence.largeImageKey = "big-image"; 27 | discordPresence.largeImageText = "Neonite"; 28 | discordPresence.instance = 1; 29 | 30 | Discord_UpdatePresence(&discordPresence); 31 | } 32 | 33 | void StartRPC() 34 | { 35 | SetupDiscord(); 36 | UpdateDiscord(); 37 | } 38 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/StringTraits/StringTraits.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include 8 | #include "../Configuration.hpp" 9 | #include "../TypeTraits/EnableIf.hpp" 10 | #include "../TypeTraits/IsBaseOf.hpp" 11 | #include "../TypeTraits/IsChar.hpp" 12 | #include "../TypeTraits/IsConst.hpp" 13 | #include "../TypeTraits/RemoveReference.hpp" 14 | 15 | namespace ArduinoJson { 16 | namespace Internals { 17 | 18 | template 19 | struct StringTraits { 20 | static const bool has_append = false; 21 | static const bool has_equals = false; 22 | }; 23 | 24 | template 25 | struct StringTraits : StringTraits {}; 26 | 27 | template 28 | struct StringTraits : StringTraits {}; 29 | } // namespace Internals 30 | } // namespace ArduinoJson 31 | 32 | #include "ArduinoStream.hpp" 33 | #include "CharPointer.hpp" 34 | #include "FlashString.hpp" 35 | #include "StdStream.hpp" 36 | #include "StdString.hpp" 37 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/JsonVariantType.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | class JsonArray; 9 | class JsonObject; 10 | 11 | namespace Internals { 12 | 13 | // Enumerated type to know the current type of a JsonVariant. 14 | // The value determines which member of JsonVariantContent is used. 15 | enum JsonVariantType { 16 | JSON_UNDEFINED, // JsonVariant has not been initialized 17 | JSON_UNPARSED, // JsonVariant contains an unparsed string 18 | JSON_STRING, // JsonVariant stores a const char* 19 | JSON_BOOLEAN, // JsonVariant stores a bool 20 | JSON_POSITIVE_INTEGER, // JsonVariant stores an JsonUInt 21 | JSON_NEGATIVE_INTEGER, // JsonVariant stores an JsonUInt that must be negated 22 | JSON_ARRAY, // JsonVariant stores a pointer to a JsonArray 23 | JSON_OBJECT, // JsonVariant stores a pointer to a JsonObject 24 | JSON_FLOAT // JsonVariant stores a JsonFloat 25 | }; 26 | } // namespace Internals 27 | } // namespace ArduinoJson 28 | -------------------------------------------------------------------------------- /Cranium/cryptolens/MachineCodeComputer_caching.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "basic_Error.hpp" 6 | 7 | namespace cryptolens_io { 8 | 9 | namespace v20190401 { 10 | 11 | namespace errors { 12 | 13 | namespace MachineCodeComputer_caching {} 14 | 15 | } // namespace errors 16 | 17 | /** 18 | */ 19 | template 20 | class MachineCodeComputer_caching 21 | { 22 | public: 23 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 24 | explicit 25 | #endif 26 | MachineCodeComputer_caching(basic_Error & e) 27 | : machine_code_() 28 | { 29 | MachineCodeComputer inner(e); 30 | machine_code_ = inner.get_machine_code(e); 31 | } 32 | 33 | std::string 34 | get_machine_code(basic_Error & e) { 35 | return machine_code_; 36 | } 37 | 38 | private: 39 | std::string machine_code_; 40 | }; 41 | 42 | } // namespace v20190401 43 | 44 | namespace latest { 45 | 46 | // TODO: errors namespace 47 | 48 | template 49 | using MachineCodeComputer_caching = ::cryptolens_io::v20190401::MachineCodeComputer_caching; 50 | 51 | } // namespace latest 52 | 53 | } // namespace cryptolens_io 54 | -------------------------------------------------------------------------------- /Cranium/cryptolens/ActivationData.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | // An immutable class representing an activated machine 10 | // for a given serial key 11 | class ActivationData { 12 | private: 13 | std::string mid_; 14 | std::string ip_; 15 | std::uint64_t time_; 16 | public: 17 | ActivationData 18 | ( std::string mid 19 | , std::string ip 20 | , std::uint64_t time 21 | ) 22 | : mid_(std::move(mid)) 23 | , ip_(std::move(ip)) 24 | , time_(time) 25 | { } 26 | 27 | // Returns the machine id 28 | std::string const& get_mid() const { return mid_; } 29 | 30 | // Returns the IP when the machine was activated the first time 31 | std::string const& get_ip() const { return ip_; } 32 | 33 | // Returns the time the machine was activated the first time 34 | std::uint64_t get_time() const { return time_; } 35 | }; 36 | 37 | } // namespace v20190401 38 | 39 | namespace v20180502 { 40 | 41 | using ::cryptolens_io::v20190401::ActivationData; 42 | 43 | } // namespace v20180502 44 | 45 | namespace latest { 46 | 47 | using ::cryptolens_io::v20190401::ActivationData; 48 | 49 | } // namespace latest 50 | 51 | } // namespace cryptolens_io 52 | -------------------------------------------------------------------------------- /Cranium/gui/ImGui/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for DirectX11 2 | // This needs to be used along with a Platform Binding (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | 8 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 9 | // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. 10 | // https://github.com/ocornut/imgui 11 | 12 | #pragma once 13 | 14 | struct ID3D11Device; 15 | struct ID3D11DeviceContext; 16 | 17 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 18 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 19 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 20 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 21 | 22 | // Use if you want to reset your rendering device without losing ImGui state. 23 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 24 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 25 | -------------------------------------------------------------------------------- /Cranium/cryptolens/LicenseKeyChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "LicenseKeyInformation.hpp" 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | class LicenseKeyInformation; 10 | 11 | class LicenseKeyChecker { 12 | bool status_; 13 | LicenseKeyInformation const* key_; 14 | 15 | public: 16 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 17 | explicit 18 | #endif 19 | LicenseKeyChecker(LicenseKeyInformation const* license_key); 20 | 21 | explicit operator bool() const; 22 | 23 | LicenseKeyChecker& has_feature(int feature); 24 | LicenseKeyChecker& has_not_feature(int feature); 25 | LicenseKeyChecker& has_expired(std::uint64_t now); 26 | LicenseKeyChecker& has_not_expired(std::uint64_t now); 27 | LicenseKeyChecker& is_blocked(); 28 | LicenseKeyChecker& is_not_blocked(); 29 | LicenseKeyChecker& is_on_right_machine(std::string const& machine_code); 30 | }; 31 | 32 | } // namespace v20190401 33 | 34 | namespace v20180502 { 35 | 36 | using LicenseKeyChecker = ::cryptolens_io::v20190401::LicenseKeyChecker; 37 | 38 | } // namespace v20180502 39 | 40 | namespace latest { 41 | 42 | using LicenseKeyChecker = ::cryptolens_io::v20190401::LicenseKeyChecker; 43 | 44 | } // namespace latest 45 | 46 | } // namespace cryptolens_io 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Neo License 2 | 3 | Copyright (c) 2020-2021 Kareem Olim (Kemo) 4 | 5 | All Rights Reserved. You are not allowed to redistribute this software, or use 6 | the software to build derivative works based upon without prior written permission. 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a verbatim 9 | copy of this software and associated documentation files (the "Software"), 10 | This software is open-source only for Educational Purposes, if you learn\copy-over anything from it you must give appropriate credit, 11 | provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner. 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /Cranium/cryptolens/ActivateError.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | class ActivateError : public std::exception { 10 | private: 11 | ActivateError(int reason); 12 | 13 | int reason_; 14 | public: 15 | static const int UNKNOWN_SERVER_REPLY = 0; 16 | static const int INVALID_ACCESS_TOKEN = 1; 17 | static const int ACCESS_DENIED = 2; 18 | static const int INCORRECT_INPUT_PARAMETER = 3; 19 | static const int PRODUCT_NOT_FOUND = 4; 20 | static const int KEY_NOT_FOUND = 5; 21 | static const int KEY_BLOCKED = 6; 22 | static const int DEVICE_LIMIT_REACHED = 7; 23 | 24 | static ActivateError from_reason(int reason); 25 | 26 | static ActivateError from_server_response(char const* server_response); 27 | 28 | int get_reason() const noexcept; 29 | 30 | virtual const char * what() const noexcept; 31 | }; 32 | 33 | } // namespace v20190401 34 | 35 | namespace v20180502 { 36 | 37 | using ::cryptolens_io::v20190401::ActivateError; 38 | 39 | } // namespace v20180502 40 | 41 | namespace latest { 42 | 43 | using ::cryptolens_io::v20190401::ActivateError; 44 | 45 | } // namespace latest 46 | 47 | } // namespace cryptolens_io 48 | -------------------------------------------------------------------------------- /Chronite/includes/imgui/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for DirectX9 2 | // This needs to be used along with a Platform Binding (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 6 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bits indices. 8 | 9 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 10 | // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. 11 | // https://github.com/ocornut/imgui 12 | 13 | #pragma once 14 | 15 | struct IDirect3DDevice9; 16 | 17 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 18 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 19 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 20 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 21 | 22 | // Use if you want to reset your rendering device without losing ImGui state. 23 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 24 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 25 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/ListConstIterator.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "ListNode.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | // A read-only forward itertor for List 13 | template 14 | class ListConstIterator { 15 | public: 16 | explicit ListConstIterator(const ListNode *node = NULL) : _node(node) {} 17 | 18 | const T &operator*() const { 19 | return _node->content; 20 | } 21 | const T *operator->() { 22 | return &_node->content; 23 | } 24 | 25 | bool operator==(const ListConstIterator &other) const { 26 | return _node == other._node; 27 | } 28 | 29 | bool operator!=(const ListConstIterator &other) const { 30 | return _node != other._node; 31 | } 32 | 33 | ListConstIterator &operator++() { 34 | if (_node) _node = _node->next; 35 | return *this; 36 | } 37 | 38 | ListConstIterator &operator+=(size_t distance) { 39 | while (_node && distance) { 40 | _node = _node->next; 41 | --distance; 42 | } 43 | return *this; 44 | } 45 | 46 | private: 47 | const ListNode *_node; 48 | }; 49 | } // namespace Internals 50 | } // namespace ArduinoJson 51 | -------------------------------------------------------------------------------- /Cranium/gui/ImGui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding for Windows (standard windows API for 32 and 64 bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core imgui) 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | 10 | #pragma once 11 | 12 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 13 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 14 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 15 | 16 | // Handler for Win32 messages, update mouse/keyboard data. 17 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 18 | // Intentionally commented out to avoid dragging dependencies on types. You can COPY this line into your .cpp code instead. 19 | /* 20 | IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 21 | */ 22 | -------------------------------------------------------------------------------- /Cranium/server.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "framework.h" 3 | 4 | void __stdcall ReadingThread(LPVOID param) 5 | { 6 | SOCKET s = reinterpret_cast(param); 7 | char Buffer[512]; 8 | 9 | while (true) { 10 | const int iResult = recv(s, Buffer, 512, 0); 11 | 12 | if (iResult <= 0) break; 13 | 14 | std::cout << "[SERVER] " << Buffer << std::endl; 15 | } 16 | } 17 | 18 | void ConnectServer() { 19 | 20 | WSADATA Winsockdata; 21 | 22 | const auto iWsaStartup = WSAStartup(MAKEWORD(2, 2), &Winsockdata); 23 | if (iWsaStartup != 0) 24 | { 25 | std::cout << "iWsaStartup Failed"; 26 | } 27 | 28 | const auto TCPClientSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); 29 | 30 | sockaddr_in TCPServerAdd; 31 | TCPServerAdd.sin_family = AF_INET; 32 | TCPServerAdd.sin_addr.s_addr = inet_addr("3.14.182.203"); 33 | TCPServerAdd.sin_port = htons(16087); 34 | 35 | connect(TCPClientSocket, reinterpret_cast(&TCPServerAdd), sizeof(TCPServerAdd)); 36 | printf("[CLIENT] Connected to the Server."); 37 | 38 | CreateThread(nullptr, 0, reinterpret_cast(&ReadingThread), reinterpret_cast(TCPClientSocket), 0, nullptr); 39 | 40 | char SenderBuffer[512]; 41 | 42 | wcstombs(SenderBuffer, L"Fortnite Connected to the Server.", 12); 43 | 44 | send(TCPClientSocket, SenderBuffer, strlen(SenderBuffer) + 1, 0); 45 | } -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/std/optional: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if __cplusplus < 201703L 4 | 5 | #include "../cryptolens/imports/optional-lite/optional.hpp" 6 | 7 | namespace cryptolens_io { 8 | 9 | namespace v20190401 { 10 | 11 | template 12 | using optional = ::nonstd::optional; 13 | 14 | using ::nonstd::make_optional; 15 | using ::nonstd::nullopt; 16 | 17 | } // namespace v20190401 18 | 19 | } // namespace cryptolens_io 20 | 21 | #else 22 | 23 | #include 24 | 25 | namespace cryptolens_io { 26 | 27 | namespace v20190401 { 28 | 29 | template 30 | using optional = std::optional; 31 | 32 | using std::make_optional; 33 | using std::nullopt; 34 | 35 | } // namespace v20190401 36 | 37 | } // namespace cryptolens_io 38 | 39 | #endif 40 | 41 | namespace cryptolens_io { 42 | 43 | namespace latest { 44 | 45 | template 46 | using optional = ::cryptolens_io::v20190401::optional; 47 | 48 | using ::cryptolens_io::v20190401::make_optional; 49 | using ::cryptolens_io::v20190401::nullopt; 50 | 51 | } // namespace latest 52 | 53 | namespace v20180502 { 54 | 55 | template 56 | using optional = ::cryptolens_io::v20190401::optional; 57 | 58 | using ::cryptolens_io::v20190401::make_optional; 59 | using ::cryptolens_io::v20190401::nullopt; 60 | 61 | } // namespace v20180502 62 | 63 | } // namespace cryptolens_io 64 | -------------------------------------------------------------------------------- /Cranium/console.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2020-2021 Kareem Olim (Kemo) 3 | * All Rights Reserved. Licensed under the Neo License 4 | * https://neonite.dev/LICENSE.html 5 | */ 6 | 7 | #pragma once 8 | #include "detours.h" 9 | 10 | namespace Console 11 | { 12 | //This is a hacky way to handle custom commands 13 | auto ExecuteConsoleCommand(const wchar_t* command) 14 | { 15 | ObjectFinder EngineFinder = ObjectFinder::EntryPoint(uintptr_t(GEngine)); 16 | ObjectFinder GameViewPortClientFinder = EngineFinder.Find(XOR(L"GameViewport")); 17 | ObjectFinder WorldFinder = GameViewPortClientFinder.Find(XOR(L"World")); 18 | ObjectFinder LocalPlayer = EngineFinder.Find(XOR(L"GameInstance")).Find(XOR(L"LocalPlayers")); 19 | ObjectFinder PlayerControllerFinder = LocalPlayer.Find(XOR(L"PlayerController")); 20 | 21 | auto KismetSysLib = UE4::FindObject(XOR(L"KismetSystemLibrary /Script/Engine.Default__KismetSystemLibrary")); 22 | auto fn = UE4::FindObject(XOR(L"Function /Script/Engine.KismetSystemLibrary.ExecuteConsoleCommand")); 23 | 24 | UKismetSystemLibrary_ExecuteConsoleCommand_Params params; 25 | params.WorldContextObject = WorldFinder.GetObj(); 26 | params.Command = command; 27 | params.SpecificPlayer = PlayerControllerFinder.GetObj(); 28 | 29 | ProcessEventDetour(KismetSysLib, fn, ¶ms); 30 | printf(XOR("\n[NeoRoyale] Executed a console command!\n")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Chronite/Backend/server/DefaultEngine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DefaultEngine 4 | { 5 | inline std::string ini = 6 | R"( 7 | [ConsoleVariables] 8 | FortMatchmakingV2.EnableContentBeacon=0 9 | FortMatchmakingV2.ContentBeaconFailureCancelsMatchmaking=0 10 | 11 | [Core.Log] 12 | LogHttp=error 13 | LogXmpp=error 14 | LogBeacon=verbose 15 | LogQos=error 16 | LogOnline=verbose 17 | LogOnlineCloud=verbose 18 | LogOnlineGame=verbose 19 | LogSourceControl=verbose 20 | LogUAC=verbose 21 | LogBattlEye=verbose 22 | LogEasyAntiCheatServer=verbose 23 | LogEasyAntiCheatClient=verbose 24 | LogFortAnalytics=verbose 25 | LogEpicCMS=verbose 26 | LogNetPlayerMovement=verbose 27 | LogDerivedDataCache=verbose 28 | LogOnlineDataAssetDirectory=verbose 29 | LogContentBeacon=verbose 30 | LogBPSInstallerConfig=verbose 31 | 32 | [PatchCheck] 33 | ModuleName=FortnitePatchCheck 34 | bCheckPlatformOSSForUpdate=false 35 | bCheckOSSForUpdate=false 36 | 37 | [XMPP] 38 | bEnableWebsockets=false 39 | 40 | [/Script/Qos.QosRegionManager] 41 | !RegionDefinitions=ClearArray 42 | +RegionDefinitions=(DisplayName=NSLOCTEXT("MMRegion", "NPP", "NPP"), RegionId="NPP", bEnabled=true, bVisible=true, bAutoAssignable=true) 43 | )"; 44 | 45 | inline std::string name = "DefaultEngine.ini"; 46 | inline std::string sha1 = "C8C23C183E44C2AADD3D7DE90CAF451DDD2D6E82"; 47 | inline std::string sha256 = "223C13EDE8ECF4C4EF8702B8FCC5A247C27A98F399DA03054D3F8F119C0F0D4A"; 48 | } 49 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/RawJson.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | 9 | namespace Internals { 10 | // A special type of data that can be used to insert pregenerated JSON portions. 11 | template 12 | class RawJsonString { 13 | public: 14 | explicit RawJsonString(T str) : _str(str) {} 15 | operator T() const { 16 | return _str; 17 | } 18 | 19 | private: 20 | T _str; 21 | }; 22 | 23 | template 24 | struct StringTraits, void> { 25 | static bool is_null(RawJsonString source) { 26 | return StringTraits::is_null(static_cast(source)); 27 | } 28 | 29 | typedef RawJsonString duplicate_t; 30 | 31 | template 32 | static duplicate_t duplicate(RawJsonString source, Buffer* buffer) { 33 | return duplicate_t(StringTraits::duplicate(source, buffer)); 34 | } 35 | 36 | static const bool has_append = false; 37 | static const bool has_equals = false; 38 | static const bool should_duplicate = StringTraits::should_duplicate; 39 | }; 40 | } // namespace Internals 41 | 42 | template 43 | inline Internals::RawJsonString RawJson(T str) { 44 | return Internals::RawJsonString(str); 45 | } 46 | } // namespace ArduinoJson 47 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/ListIterator.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "ListConstIterator.hpp" 8 | #include "ListNode.hpp" 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | template 14 | class List; 15 | 16 | // A read-write forward iterator for List 17 | template 18 | class ListIterator { 19 | friend class List; 20 | 21 | public: 22 | explicit ListIterator(ListNode *node = NULL) : _node(node) {} 23 | 24 | T &operator*() const { 25 | return _node->content; 26 | } 27 | T *operator->() { 28 | return &_node->content; 29 | } 30 | 31 | bool operator==(const ListIterator &other) const { 32 | return _node == other._node; 33 | } 34 | 35 | bool operator!=(const ListIterator &other) const { 36 | return _node != other._node; 37 | } 38 | 39 | ListIterator &operator++() { 40 | if (_node) _node = _node->next; 41 | return *this; 42 | } 43 | 44 | ListIterator &operator+=(size_t distance) { 45 | while (_node && distance) { 46 | _node = _node->next; 47 | --distance; 48 | } 49 | return *this; 50 | } 51 | 52 | operator ListConstIterator() const { 53 | return ListConstIterator(_node); 54 | } 55 | 56 | private: 57 | ListNode *_node; 58 | }; 59 | } // namespace Internals 60 | } // namespace ArduinoJson 61 | -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/NotExpiredValidator_kernel32.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../imports/windows/Windows.h" 4 | 5 | #include "../api.hpp" 6 | #include "../basic_Error.hpp" 7 | 8 | namespace cryptolens_io { 9 | 10 | namespace v20190401 { 11 | 12 | template 13 | class NotExpiredValidator_kernel32_ { 14 | public: 15 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 16 | explicit 17 | #endif 18 | NotExpiredValidator_kernel32_(basic_Error & e) {} 19 | 20 | void validate(basic_Error & e, Env & env) { 21 | std::uint64_t expires = env.get_license_key_information().get_expires(); 22 | 23 | if (expires < get_current_()) { 24 | using namespace errors; 25 | e.set(api::main(), Subsystem::Main, Main::KEY_EXPIRED); 26 | } 27 | } 28 | 29 | private: 30 | std::uint64_t get_current_() { 31 | FILETIME ft; 32 | GetSystemTimeAsFileTime(&ft); 33 | 34 | constexpr std::uint64_t EPOCH = 0x019DB1DED53E8000; 35 | constexpr std::uint64_t TICKS_PER_SECOND = 10000000; 36 | 37 | std::uint64_t tlow = ft.dwLowDateTime; 38 | std::uint64_t thigh = ft.dwHighDateTime; 39 | std::uint64_t t = thigh << 32 | tlow; 40 | return (t - EPOCH) / TICKS_PER_SECOND; 41 | } 42 | }; 43 | 44 | } // namespace v20190401 45 | 46 | namespace latest { 47 | 48 | template 49 | using NotExpiredValidator_kernel32_ = ::cryptolens_io::v20190401::NotExpiredValidator_kernel32_; 50 | 51 | } // namespace latest 52 | 53 | } // namespace cryptolens_io 54 | -------------------------------------------------------------------------------- /Chronite/Backend/server/DefaultRuntimeOptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DefaultRuntimeOptions 4 | { 5 | #ifdef PROD 6 | inline std::string ini = 7 | R"([/Script/FortniteGame.FortRuntimeOptions] 8 | bMOTDSameNewsForCreative=true 9 | bForceBRMode=true 10 | bEnableSavedLoadouts=false 11 | bIsOutOfSeasonMode=true 12 | !DisabledTabsForOutOfSeason=ClearArray 13 | +DisabledTabsForOutOfSeason=(TabName="Lobby",TabState=EFortRuntimeOptionTabState::Hidden) 14 | +DisabledTabsForOutOfSeason=(TabName="AthenaCompete",TabState=EFortRuntimeOptionTabState::Hidden) 15 | +DisabledTabsForOutOfSeason=(TabName="AthenaCareer",TabState=EFortRuntimeOptionTabState::Hidden) 16 | +DisabledTabsForOutOfSeason=(TabName="AthenaStore",TabState=EFortRuntimeOptionTabState::Hidden) 17 | +DisabledTabsForOutOfSeason=(TabName="CareerScreen",TabState=EFortRuntimeOptionTabState::Hidden) 18 | +DisabledTabsForOutOfSeason=(TabName="AthenaDirectAcquisition",TabState=EFortRuntimeOptionTabState::Hidden) 19 | +DisabledTabsForOutOfSeason=(TabName="BattlePass",TabState=EFortRuntimeOptionTabState::Hidden) 20 | +DisabledTabsForOutOfSeason=(TabName="AthenaCustomize",TabState=EFortRuntimeOptionTabState::Hidden) 21 | )"; 22 | #else 23 | inline std::string ini = 24 | R"([/Script/FortniteGame.FortRuntimeOptions] 25 | bMOTDSameNewsForCreative=true 26 | bForceBRMode=true 27 | bEnableSavedLoadouts=false 28 | bAllowAllReplays=true 29 | )"; 30 | #endif 31 | 32 | 33 | inline std::string name = "DefaultRuntimeOptions.ini"; 34 | inline std::string sha1 = "holder"; 35 | inline std::string sha256 = "holder"; 36 | } 37 | -------------------------------------------------------------------------------- /Chronite/Backend/server.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2020-2021 Kareem Olim (Kemo) 3 | * All Rights Reserved. Licensed under the Neo License 4 | * https://neonite.dev/LICENSE.html 5 | */ 6 | #pragma once 7 | 8 | //#define LOGGING 9 | 10 | #include "../includes/framework.h" 11 | #include "server/athena.h" 12 | #include "server/collections.h" 13 | #include "server/common_core.h" 14 | #include "server/common_public.h" 15 | #include "server/creative.h" 16 | #include "server/calendar.h" 17 | #include "server/fortnite-game.h" 18 | 19 | using namespace httplib; 20 | 21 | inline HANDLE hServer = INVALID_HANDLE_VALUE; 22 | inline Server app; 23 | 24 | #include "server/statics.h" 25 | #include "server/api.h" 26 | #include "server/dynamics.h" 27 | #include "server/profile.h" 28 | 29 | namespace server 30 | { 31 | inline void init() 32 | { 33 | initStatics(); 34 | initDynamics(); 35 | initApi(); 36 | initProfile(); 37 | 38 | app.set_error_handler([](const auto& req, auto& res) 39 | { 40 | auto fmt = "{}"; 41 | char buf[BUFSIZ]; 42 | snprintf(buf, sizeof(buf), fmt, res.status); 43 | //auto test = req.path; 44 | //console.AddLog(test.c_str()); 45 | res.set_content(buf, "application/json"); 46 | }); 47 | 48 | #ifdef LOGGING 49 | app.set_logger([](const Request& req, const Response& res) 50 | { 51 | std::string log = "Request: " + req.method + "\nPath: " + req.path + "\nBody: " + req.body + "\nResponse: " + res.body; 52 | console.AddLog(log.c_str()); 53 | }); 54 | #endif 55 | 56 | app.listen(XOR("127.0.0.1"), 5746); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Cranium/cryptolens/DataObject.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | // An immutable class representing an Cryptolens Data Object 10 | class DataObject { 11 | private: 12 | int id_; 13 | std::string name_; 14 | std::string string_value_; 15 | int int_value_; 16 | public: 17 | DataObject 18 | ( int id 19 | , std::string name 20 | , std::string string_value 21 | , int int_value 22 | ) 23 | : id_(id) 24 | , name_(std::move(name)) 25 | , string_value_(std::move(string_value)) 26 | , int_value_(int_value) 27 | { 28 | // TODO: Check requirements on max length of name and string_value 29 | // (Not really neccessary when we are just parsing requests from 30 | // the server, though) 31 | } 32 | 33 | // Returns the Id of the data object 34 | int get_id() const; 35 | 36 | // Returns the name of the data object 37 | std::string const& get_name() const; 38 | 39 | // Returns the string value of the data object 40 | std::string const& get_string_value() const; 41 | 42 | // Returns the integer value of the data object 43 | int get_int_value() const; 44 | }; 45 | 46 | } // namespace v20190401 47 | 48 | namespace v20180502 { 49 | 50 | using DataObject = ::cryptolens_io::v20190401::DataObject; 51 | 52 | } // namespace v20180502 53 | 54 | namespace latest { 55 | 56 | using DataObject = ::cryptolens_io::v20190401::DataObject; 57 | 58 | } // namespace latest 59 | 60 | } // namespace cryptolens_io 61 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/StringTraits/ArduinoStream.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_ARDUINO_STREAM 8 | 9 | #include 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | struct ArduinoStreamTraits { 15 | class Reader { 16 | Stream& _stream; 17 | char _current, _next; 18 | 19 | public: 20 | Reader(Stream& stream) : _stream(stream), _current(0), _next(0) {} 21 | 22 | void move() { 23 | _current = _next; 24 | _next = 0; 25 | } 26 | 27 | char current() { 28 | if (!_current) _current = read(); 29 | return _current; 30 | } 31 | 32 | char next() { 33 | // assumes that current() has been called 34 | if (!_next) _next = read(); 35 | return _next; 36 | } 37 | 38 | private: 39 | char read() { 40 | // don't use _stream.read() as it ignores the timeout 41 | char c = 0; 42 | _stream.readBytes(&c, 1); 43 | return c; 44 | } 45 | }; 46 | 47 | static const bool has_append = false; 48 | static const bool has_equals = false; 49 | }; 50 | 51 | template 52 | struct StringTraits< 53 | TStream, 54 | // match any type that is derived from Stream: 55 | typename EnableIf< 56 | IsBaseOf::type>::value>::type> 57 | : ArduinoStreamTraits {}; 58 | } // namespace Internals 59 | } // namespace ArduinoJson 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/StringTraits/StdStream.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_STD_STREAM 8 | 9 | #include 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | struct StdStreamTraits { 15 | class Reader { 16 | std::istream& _stream; 17 | char _current, _next; 18 | 19 | public: 20 | Reader(std::istream& stream) : _stream(stream), _current(0), _next(0) {} 21 | 22 | void move() { 23 | _current = _next; 24 | _next = 0; 25 | } 26 | 27 | char current() { 28 | if (!_current) _current = read(); 29 | return _current; 30 | } 31 | 32 | char next() { 33 | // assumes that current() has been called 34 | if (!_next) _next = read(); 35 | return _next; 36 | } 37 | 38 | private: 39 | Reader& operator=(const Reader&); // Visual Studio C4512 40 | 41 | char read() { 42 | return _stream.eof() ? '\0' : static_cast(_stream.get()); 43 | } 44 | }; 45 | 46 | static const bool has_append = false; 47 | static const bool has_equals = false; 48 | }; 49 | 50 | template 51 | struct StringTraits< 52 | TStream, 53 | // match any type that is derived from std::istream: 54 | typename EnableIf::type>::value>::type> 56 | : StdStreamTraits {}; 57 | } // namespace Internals 58 | } // namespace ArduinoJson 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Chronite/includes/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define _CRT_SECURE_NO_WARNINGS 3 | 4 | #ifdef _DEBUG 5 | #error "Manual mapping dll on debug mode will cause the game to crash," 6 | #error "please switch to release mode or comment out this error on framework.h" 7 | #endif 8 | 9 | //#define PROD 10 | 11 | #ifdef _WIN32 12 | #define _WIN32_WINNT 0x0A00 13 | #endif 14 | 15 | #define DIRECTINPUT_VERSION 0x0800 16 | 17 | #define CPPHTTPLIB_OPENSSL_SUPPORT 18 | 19 | #define WIN32_LEAN_AND_MEAN 20 | 21 | #pragma comment(lib, "d3d9.lib") 22 | 23 | #include "../includes/imgui/imgui.h" 24 | #include "../includes/imgui/imgui_impl_dx9.h" 25 | #include "../includes/imgui/imgui_impl_win32.h" 26 | #include "../includes/imgui/imgui_internal.h" 27 | #include "../includes/imgui/imconfig.h" 28 | #include "../includes/json/json.hpp" 29 | #include "../includes/httplib.h" 30 | #include "../includes/injection/Injection.h" 31 | #include "../includes/termcolor/termcolor.hpp" 32 | #include "../includes/DiscordSDK/discord_rpc.h" 33 | #include "../includes/DiscordSDK/discord_register.h" 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include "../xorstr.hpp" 53 | 54 | #define XOR(STR) xorstr(STR).crypt_get() -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rpc_connection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "connection.h" 4 | #include "serialization.h" 5 | 6 | // I took this from the buffer size libuv uses for named pipes; I suspect ours would usually be much 7 | // smaller. 8 | constexpr size_t MaxRpcFrameSize = 64 * 1024; 9 | 10 | struct RpcConnection 11 | { 12 | enum class ErrorCode : int 13 | { 14 | Success = 0, 15 | PipeClosed = 1, 16 | ReadCorrupt = 2, 17 | }; 18 | 19 | enum class Opcode : uint32_t 20 | { 21 | Handshake = 0, 22 | Frame = 1, 23 | Close = 2, 24 | Ping = 3, 25 | Pong = 4, 26 | }; 27 | 28 | struct MessageFrameHeader 29 | { 30 | Opcode opcode; 31 | uint32_t length; 32 | }; 33 | 34 | struct MessageFrame : public MessageFrameHeader 35 | { 36 | char message[MaxRpcFrameSize - sizeof(MessageFrameHeader)]; 37 | }; 38 | 39 | enum class State : uint32_t 40 | { 41 | Disconnected, 42 | SentHandshake, 43 | AwaitingResponse, 44 | Connected, 45 | }; 46 | 47 | BaseConnection* connection{nullptr}; 48 | State state{State::Disconnected}; 49 | void (*onConnect)(JsonDocument& message){nullptr}; 50 | void (*onDisconnect)(int errorCode, const char* message){nullptr}; 51 | char appId[64]{}; 52 | int lastErrorCode{0}; 53 | char lastErrorMessage[256]{}; 54 | MessageFrame sendFrame; 55 | 56 | static RpcConnection* Create(const char* applicationId); 57 | static void Destroy(RpcConnection*&); 58 | 59 | bool IsOpen() const { return state == State::Connected; } 60 | 61 | void Open(); 62 | void Close(); 63 | bool Write(const void* data, size_t length); 64 | bool Read(JsonDocument& message); 65 | }; 66 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98 - compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal 27 | { 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT 34 | { 35 | T tmp = a; 36 | a = b; 37 | b = tmp; 38 | } 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /Cranium/cryptolens/ResponseParser_ArduinoJson5.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "imports/std/optional" 4 | 5 | #include 6 | 7 | #include "basic_Error.hpp" 8 | #include "LicenseKeyInformation.hpp" 9 | #include "RawLicenseKey.hpp" 10 | 11 | namespace cryptolens_io { 12 | 13 | namespace v20190401 { 14 | 15 | class ResponseParser_ArduinoJson5 { 16 | /* 17 | * Note the API of this class is not considered stable. Please contact us if you would like to create 18 | * a custom ResponseParser. 19 | */ 20 | public: 21 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 22 | explicit 23 | #endif 24 | ResponseParser_ArduinoJson5(basic_Error & e) {} 25 | 26 | optional make_license_key_information(basic_Error & e, RawLicenseKey const& raw_license_key) const; 27 | optional make_license_key_information(basic_Error & e, optional const& raw_license_key) const; 28 | optional make_license_key_information_unsafe(basic_Error & e, std::string const& license_key) const; 29 | 30 | optional> parse_activate_response(basic_Error & e, std::string const& server_response) const; 31 | std::string parse_create_trial_key_response(basic_Error & e, std::string const& server_response) const; 32 | std::string parse_last_message_response(basic_Error & e, std::string const& server_response) const; 33 | }; 34 | 35 | } // namespace latest 36 | 37 | namespace latest { 38 | 39 | using ResponseParser_ArduinoJson5 = ::cryptolens_io::v20190401::ResponseParser_ArduinoJson5; 40 | 41 | } // namespace latest 42 | 43 | } // namespace cryptolens_io 44 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/compatibility.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | // 5 | // clang-format off 6 | 7 | #ifdef __GNUC__ 8 | 9 | #define ARDUINOJSON_PRAGMA(x) _Pragma(#x) 10 | 11 | #define ARDUINOJSON_COMPILE_ERROR(msg) ARDUINOJSON_PRAGMA(GCC error msg) 12 | 13 | #define ARDUINOJSON_STRINGIFY(S) #S 14 | 15 | #define ARDUINOJSON_DEPRECATION_ERROR(X, Y) \ 16 | ARDUINOJSON_COMPILE_ERROR(ARDUINOJSON_STRINGIFY(X is a Y from ArduinoJson 6 but version 5 is installed. Visit arduinojson.org to get more information.)) 17 | 18 | #define StaticJsonDocument ARDUINOJSON_DEPRECATION_ERROR(StaticJsonDocument, class) 19 | #define DynamicJsonDocument ARDUINOJSON_DEPRECATION_ERROR(DynamicJsonDocument, class) 20 | #define JsonDocument ARDUINOJSON_DEPRECATION_ERROR(JsonDocument, class) 21 | #define DeserializationError ARDUINOJSON_DEPRECATION_ERROR(DeserializationError, class) 22 | #define deserializeJson ARDUINOJSON_DEPRECATION_ERROR(deserializeJson, function) 23 | #define deserializeMsgPack ARDUINOJSON_DEPRECATION_ERROR(deserializeMsgPack, function) 24 | #define serializeJson ARDUINOJSON_DEPRECATION_ERROR(serializeJson, function) 25 | #define serializeMsgPack ARDUINOJSON_DEPRECATION_ERROR(serializeMsgPack, function) 26 | #define serializeJsonPretty ARDUINOJSON_DEPRECATION_ERROR(serializeJsonPretty, function) 27 | #define measureMsgPack ARDUINOJSON_DEPRECATION_ERROR(measureMsgPack, function) 28 | #define measureJson ARDUINOJSON_DEPRECATION_ERROR(measureJson, function) 29 | #define measureJsonPretty ARDUINOJSON_DEPRECATION_ERROR(measureJsonPretty, function) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Cranium/cryptolens/Customer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace cryptolens_io { 4 | 5 | namespace v20190401 { 6 | 7 | // This immutable class represents a customer 8 | class Customer { 9 | private: 10 | int id_; 11 | std::string name_; 12 | std::string email_; 13 | std::string company_name_; 14 | std::uint64_t created_; 15 | public: 16 | Customer 17 | ( int id 18 | , std::string name 19 | , std::string email 20 | , std::string company_name 21 | , std::uint64_t created 22 | ) 23 | : id_(id) 24 | , name_(std::move(name)) 25 | , email_(std::move(email)) 26 | , company_name_(std::move(company_name)) 27 | , created_(created) 28 | { 29 | // TODO: Check length requirements (does not matter when we are just reading things from the web api) 30 | } 31 | 32 | // Returns the customer id 33 | int get_id() const { return id_; } 34 | 35 | // Returns the customer name 36 | std::string const& get_name() const { return name_; } 37 | 38 | // Returns the customer's email 39 | std::string const& get_email() const { return email_; } 40 | 41 | // Returns the customer's company name 42 | std::string const& get_company_name() const { return company_name_; } 43 | 44 | // Returns when the customer's account was created 45 | std::uint64_t get_created() const { return created_; } 46 | }; 47 | 48 | } // namespace v20190401 49 | 50 | namespace v20180502 { 51 | 52 | using Customer = ::cryptolens_io::v20190401::Customer; 53 | 54 | } // namespace v20180502 55 | 56 | namespace latest { 57 | 58 | using Customer = ::cryptolens_io::v20190401::Customer; 59 | 60 | } // namespace latest 61 | 62 | } // namespace cryptolens_io 63 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Deserialization/Comments.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | template 10 | void skipSpacesAndComments(TInput& input) { 11 | for (;;) { 12 | switch (input.current()) { 13 | // spaces 14 | case ' ': 15 | case '\t': 16 | case '\r': 17 | case '\n': 18 | input.move(); 19 | continue; 20 | 21 | // comments 22 | case '/': 23 | switch (input.next()) { 24 | // C-style block comment 25 | case '*': 26 | input.move(); // skip '/' 27 | // no need to skip '*' 28 | for (;;) { 29 | input.move(); 30 | if (input.current() == '\0') return; 31 | if (input.current() == '*' && input.next() == '/') { 32 | input.move(); // skip '*' 33 | input.move(); // skip '/' 34 | break; 35 | } 36 | } 37 | break; 38 | 39 | // C++-style line comment 40 | case '/': 41 | // not need to skip "//" 42 | for (;;) { 43 | input.move(); 44 | if (input.current() == '\0') return; 45 | if (input.current() == '\n') break; 46 | } 47 | break; 48 | 49 | // not a comment, just a '/' 50 | default: 51 | return; 52 | } 53 | break; 54 | 55 | default: 56 | return; 57 | } 58 | } 59 | } 60 | } // namespace Internals 61 | } // namespace ArduinoJson 62 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/ValueSaver.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../JsonBuffer.hpp" 8 | #include "../JsonVariant.hpp" 9 | #include "../StringTraits/StringTraits.hpp" 10 | #include "../TypeTraits/EnableIf.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | template 16 | struct ValueSaver { 17 | template 18 | static bool save(JsonBuffer*, Destination& destination, Source source) { 19 | destination = source; 20 | return true; 21 | } 22 | }; 23 | 24 | template 25 | struct ValueSaver< 26 | Source, typename EnableIf::should_duplicate>::type> { 27 | template 28 | static bool save(JsonBuffer* buffer, Destination& dest, Source source) { 29 | if (!StringTraits::is_null(source)) { 30 | typename StringTraits::duplicate_t dup = 31 | StringTraits::duplicate(source, buffer); 32 | if (!dup) return false; 33 | dest = dup; 34 | } else { 35 | dest = reinterpret_cast(0); 36 | } 37 | return true; 38 | } 39 | }; 40 | 41 | // const char*, const signed char*, const unsigned char* 42 | template 43 | struct ValueSaver< 44 | Char*, typename EnableIf::should_duplicate>::type> { 45 | template 46 | static bool save(JsonBuffer*, Destination& dest, Char* source) { 47 | dest = reinterpret_cast(source); 48 | return true; 49 | } 50 | }; 51 | } // namespace Internals 52 | } // namespace ArduinoJson 53 | -------------------------------------------------------------------------------- /Cranium/gui/kiero.h: -------------------------------------------------------------------------------- 1 | #ifndef __KIERO_H__ 2 | #define __KIERO_H__ 3 | 4 | #include 5 | 6 | #define KIERO_VERSION "1.2.6" 7 | 8 | #define KIERO_INCLUDE_D3D9 0 // 1 if you need D3D9 hook 9 | #define KIERO_INCLUDE_D3D10 0 // 1 if you need D3D10 hook 10 | #define KIERO_INCLUDE_D3D11 1 // 1 if you need D3D11 hook 11 | #define KIERO_INCLUDE_D3D12 0 // 1 if you need D3D12 hook 12 | #define KIERO_INCLUDE_OPENGL 0 // 1 if you need OpenGL hook 13 | #define KIERO_INCLUDE_VULKAN 0 // 1 if you need Vulkan hook 14 | #define KIERO_USE_MINHOOK 1 // 1 if you will use kiero::bind function 15 | 16 | #define KIERO_ARCH_X64 0 17 | #define KIERO_ARCH_X86 0 18 | 19 | #if defined(_M_X64) 20 | # undef KIERO_ARCH_X64 21 | # define KIERO_ARCH_X64 1 22 | #else 23 | # undef KIERO_ARCH_X86 24 | # define KIERO_ARCH_X86 1 25 | #endif 26 | 27 | #if KIERO_ARCH_X64 28 | typedef uint64_t uint150_t; 29 | #else 30 | typedef uint32_t uint150_t; 31 | #endif 32 | 33 | namespace kiero 34 | { 35 | struct Status 36 | { 37 | enum Enum 38 | { 39 | UnknownError = -1, 40 | NotSupportedError = -2, 41 | ModuleNotFoundError = -3, 42 | 43 | AlreadyInitializedError = -4, 44 | NotInitializedError = -5, 45 | 46 | Success = 0, 47 | }; 48 | }; 49 | 50 | struct RenderType 51 | { 52 | enum Enum 53 | { 54 | None, 55 | 56 | D3D9, 57 | D3D10, 58 | D3D11, 59 | D3D12, 60 | 61 | OpenGL, 62 | Vulkan, 63 | 64 | Auto 65 | }; 66 | }; 67 | 68 | Status::Enum init(RenderType::Enum renderType); 69 | void shutdown(); 70 | 71 | Status::Enum bind(uint16_t index, void** original, void* function); 72 | void unbind(uint16_t index); 73 | 74 | RenderType::Enum getRenderType(); 75 | uint150_t* getMethodsTable(); 76 | } 77 | 78 | #endif // __KIERO_H__ -------------------------------------------------------------------------------- /Cranium/cryptolens/validators/OnValidMachineValidator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../basic_Error.hpp" 4 | 5 | namespace cryptolens_io { 6 | 7 | namespace v20190401 { 8 | 9 | template 10 | class OnValidMachineValidator_ { 11 | public: 12 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 13 | explicit 14 | #endif 15 | OnValidMachineValidator_(basic_Error & e) {} 16 | 17 | void 18 | validate(basic_Error & e, Env & env) { 19 | if (e) { return; } 20 | 21 | auto const& license_key_information = env.get_license_key_information(); 22 | auto const& expected_machine_code = env.get_machine_code(); 23 | bool floating = env.get_floating(); 24 | 25 | auto const& machines = license_key_information.get_activated_machines(); 26 | auto const& maxnoofmachines = license_key_information.get_maxnoofmachines(); 27 | bool valid = (maxnoofmachines && *maxnoofmachines == 0) 28 | || !machines; 29 | if (machines && !valid) { 30 | std::string full_expected_machine_code; 31 | if (floating) { full_expected_machine_code += "floating:"; } 32 | full_expected_machine_code += expected_machine_code; 33 | 34 | for (auto const& m : *machines) { 35 | if (m.get_mid() == full_expected_machine_code) { 36 | valid = true; 37 | break; 38 | } 39 | } 40 | } 41 | 42 | if (!valid) { 43 | e.set(api::main(), errors::Subsystem::Main, errors::Main::UNKNOWN_SERVER_REPLY); 44 | } 45 | } 46 | }; 47 | 48 | } // namespace v20190401 49 | 50 | namespace latest { 51 | 52 | template 53 | using OnValidMachineValidator_ = ::cryptolens_io::v20190401::OnValidMachineValidator_; 54 | 55 | } // namespace latest 56 | 57 | } // namespace cryptolens_io 58 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonVariantCasts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "Data/JsonVariantAs.hpp" 8 | #include "Polyfills/attributes.hpp" 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | template 14 | class JsonVariantCasts { 15 | public: 16 | #if ARDUINOJSON_ENABLE_DEPRECATED 17 | DEPRECATED("use as() instead") 18 | FORCE_INLINE JsonArray &asArray() const { 19 | return impl()->template as(); 20 | } 21 | 22 | DEPRECATED("use as() instead") 23 | FORCE_INLINE JsonObject &asObject() const { 24 | return impl()->template as(); 25 | } 26 | 27 | DEPRECATED("use as() instead") 28 | FORCE_INLINE const char *asString() const { 29 | return impl()->template as(); 30 | } 31 | #endif 32 | 33 | // Gets the variant as an array. 34 | // Returns a reference to the JsonArray or JsonArray::invalid() if the 35 | // variant 36 | // is not an array. 37 | FORCE_INLINE operator JsonArray &() const { 38 | return impl()->template as(); 39 | } 40 | 41 | // Gets the variant as an object. 42 | // Returns a reference to the JsonObject or JsonObject::invalid() if the 43 | // variant is not an object. 44 | FORCE_INLINE operator JsonObject &() const { 45 | return impl()->template as(); 46 | } 47 | 48 | template 49 | FORCE_INLINE operator T() const { 50 | return impl()->template as(); 51 | } 52 | 53 | private: 54 | const TImpl *impl() const { 55 | return static_cast(this); 56 | } 57 | }; 58 | } // namespace Internals 59 | } // namespace ArduinoJson 60 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonVariantOr.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "Data/JsonVariantAs.hpp" 8 | #include "Polyfills/attributes.hpp" 9 | #include "TypeTraits/EnableIf.hpp" 10 | #include "TypeTraits/IsIntegral.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | template 16 | class JsonVariantOr { 17 | public: 18 | // Returns the default value if the JsonVariant is undefined of incompatible 19 | template 20 | typename EnableIf::value, T>::type operator|( 21 | const T &defaultValue) const { 22 | if (impl()->template is()) 23 | return impl()->template as(); 24 | else 25 | return defaultValue; 26 | } 27 | 28 | // Returns the default value if the JsonVariant is undefined of incompatible 29 | // Special case for string: null is treated as undefined 30 | const char *operator|(const char *defaultValue) const { 31 | const char *value = impl()->template as(); 32 | return value ? value : defaultValue; 33 | } 34 | 35 | // Returns the default value if the JsonVariant is undefined of incompatible 36 | // Special case for integers: we also accept double 37 | template 38 | typename EnableIf::value, Integer>::type operator|( 39 | const Integer &defaultValue) const { 40 | if (impl()->template is()) 41 | return impl()->template as(); 42 | else 43 | return defaultValue; 44 | } 45 | 46 | private: 47 | const TImpl *impl() const { 48 | return static_cast(this); 49 | } 50 | }; 51 | } // namespace Internals 52 | } // namespace ArduinoJson 53 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/StringTraits/FlashString.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_PROGMEM 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | template <> 12 | struct StringTraits { 13 | class Reader { 14 | const char* _ptr; 15 | 16 | public: 17 | Reader(const __FlashStringHelper* ptr) 18 | : _ptr(reinterpret_cast(ptr)) {} 19 | 20 | void move() { 21 | _ptr++; 22 | } 23 | 24 | char current() const { 25 | return pgm_read_byte_near(_ptr); 26 | } 27 | 28 | char next() const { 29 | return pgm_read_byte_near(_ptr + 1); 30 | } 31 | }; 32 | 33 | static bool equals(const __FlashStringHelper* str, const char* expected) { 34 | const char* actual = reinterpret_cast(str); 35 | if (!actual || !expected) return actual == expected; 36 | return strcmp_P(expected, actual) == 0; 37 | } 38 | 39 | static bool is_null(const __FlashStringHelper* str) { 40 | return !str; 41 | } 42 | 43 | typedef const char* duplicate_t; 44 | 45 | template 46 | static duplicate_t duplicate(const __FlashStringHelper* str, Buffer* buffer) { 47 | if (!str) return NULL; 48 | size_t size = strlen_P((const char*)str) + 1; 49 | void* dup = buffer->alloc(size); 50 | if (dup != NULL) memcpy_P(dup, (const char*)str, size); 51 | return static_cast(dup); 52 | } 53 | 54 | static const bool has_append = false; 55 | static const bool has_equals = true; 56 | static const bool should_duplicate = true; 57 | }; 58 | } // namespace Internals 59 | } // namespace ArduinoJson 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Cranium/cryptolens/RequestHandler_v20190401_to_v20180502.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "api.hpp" 4 | #include "basic_Error.hpp" 5 | #include "Error.hpp" 6 | 7 | namespace cryptolens_io { 8 | 9 | namespace internal { 10 | 11 | template 12 | class RequestHandler_v20190401_to_v20180502 13 | { 14 | public: 15 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 16 | explicit 17 | #endif 18 | RequestHandler_v20190401_to_v20180502(); 19 | 20 | template 21 | std::string 22 | make_request(::cryptolens_io::v20180502::basic_Error & e, char const* method, Map const& map); 23 | 24 | private: 25 | ::cryptolens_io::v20190401::Error e_; 26 | RequestHandler inner_; 27 | }; 28 | 29 | template 30 | RequestHandler_v20190401_to_v20180502::RequestHandler_v20190401_to_v20180502() 31 | : e_(), inner_(e_) 32 | {} 33 | 34 | template 35 | template 36 | std::string 37 | RequestHandler_v20190401_to_v20180502::make_request(::cryptolens_io::v20180502::basic_Error & e, char const* method, Map const& map) 38 | { 39 | namespace api = ::cryptolens_io::v20180502::api; 40 | namespace errors = ::cryptolens_io::v20180502::errors; 41 | 42 | if (e) { return ""; } 43 | if (e_) { 44 | e.set(api::main(), errors::Subsystem::RequestHandler); // TODO: Add more detailed error code 45 | return ""; 46 | } 47 | 48 | std::string endpoint("/api/key/"); 49 | endpoint += method; 50 | 51 | auto request = inner_.post_request(e, "app.cryptolens.io", endpoint.c_str()); 52 | 53 | for (auto x : map) { request.add_argument(e, x.first.c_str(), x.second.c_str()); } 54 | 55 | return request.make(e); 56 | } 57 | 58 | } // namespace internal 59 | 60 | } // namespace cryptolens_io 61 | -------------------------------------------------------------------------------- /Cranium/kismet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2020-2021 Kareem Olim (Kemo) 3 | * All Rights Reserved. Licensed under the Neo License 4 | * https://neonite.dev/LICENSE.html 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace KismetFunctions 10 | { 11 | 12 | inline auto ImportPngAsTexture2D(const wchar_t* FileFullPath) 13 | { 14 | if (!KismetRenderingLibrary || Util::IsBadReadPtr(KismetRenderingLibrary)) 15 | { 16 | KismetRenderingLibrary = UE4::FindObject(XOR(L"KismetRenderingLibrary /Script/Engine.Default__KismetRenderingLibrary")); 17 | } 18 | 19 | auto fn = UE4::FindObject(XOR(L"Function /Script/Engine.KismetRenderingLibrary.ImportFileAsTexture2D")); 20 | 21 | ObjectFinder EngineFinder = ObjectFinder::EntryPoint(uintptr_t(GEngine)); 22 | ObjectFinder GameViewPortClientFinder = EngineFinder.Find(XOR(L"GameViewport")); 23 | ObjectFinder WorldFinder = GameViewPortClientFinder.Find(XOR(L"World")); 24 | 25 | UKismetRenderingLibrary_ImportFileAsTexture2D_Params params; 26 | params.WorldContextObject = WorldFinder.GetObj(); 27 | params.Filename = FileFullPath; 28 | 29 | ProcessEvent(KismetRenderingLibrary, fn, ¶ms); 30 | 31 | return params.ReturnValue; 32 | } 33 | 34 | inline auto GetFName(const wchar_t* String) 35 | { 36 | if (!KismetStringLibrary || Util::IsBadReadPtr(KismetStringLibrary)) 37 | { 38 | KismetStringLibrary = UE4::FindObject(XOR(L"KismetStringLibrary /Script/Engine.Default__KismetStringLibrary")); 39 | } 40 | 41 | auto fn = UE4::FindObject(XOR(L"Function /Script/Engine.KismetStringLibrary.Conv_StringToName")); 42 | 43 | UKismetStringLibrary_Conv_StringToName_Params params; 44 | params.inString = String; 45 | 46 | ProcessEvent(KismetStringLibrary, fn, ¶ms); 47 | 48 | return params.ReturnValue; 49 | } 50 | } -------------------------------------------------------------------------------- /Chronite/includes/imgui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding for Windows (standard windows API for 32 and 64 bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core imgui) 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | // [X] Platform: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 10 | 11 | #pragma once 12 | 13 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 14 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 15 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 16 | 17 | // DPI-related helpers (which run and compile without requiring 8.1 or 10, neither Windows version, neither associated SDK) 18 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 19 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); 20 | // HWND hwnd 21 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); 22 | // HMONITOR monitor 23 | 24 | // Handler for Win32 messages, update mouse/keyboard data. 25 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 26 | // Intentionally commented out to avoid dragging dependencies on types. You can COPY this line into your .cpp code instead. 27 | /* 28 | IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 29 | */ 30 | -------------------------------------------------------------------------------- /Chronite/Chronite.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // Italiano (Italia) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA) 19 | LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | // 49 | // Icon 50 | // 51 | 52 | // Icon with lowest ID value placed first to ensure application icon 53 | // remains consistent on all systems. 54 | IDI_ICON1 ICON "./NeoniteLogo.ico" 55 | 56 | #endif // Italiano (Italia) resources 57 | ///////////////////////////////////////////////////////////////////////////// 58 | 59 | #ifndef APSTUDIO_INVOKED 60 | ///////////////////////////////////////////////////////////////////////////// 61 | // 62 | // Generated from the TEXTINCLUDE 3 resource. 63 | // 64 | 65 | ///////////////////////////////////////////////////////////////////////////// 66 | #endif // not APSTUDIO_INVOKED -------------------------------------------------------------------------------- /Cranium/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2020-2021 Kareem Olim (Kemo) 3 | * All Rights Reserved. Licensed under the Neo License 4 | * https://neonite.dev/LICENSE.html 5 | */ 6 | 7 | #include "pch.h" 8 | #include "curlhooks.h" 9 | #include "hooks.h" 10 | #include "gui/gui.h" 11 | 12 | bool WINAPI ImguiThread() 13 | { 14 | while (true) 15 | { 16 | if (kiero::init(kiero::RenderType::D3D11) == kiero::Status::Success) 17 | { 18 | kiero::bind(8, reinterpret_cast(&oPresent), hkPresent); 19 | break; 20 | } 21 | }; 22 | return true; 23 | } 24 | 25 | void WINAPI dllMain() 26 | { 27 | #ifdef CONSOLE 28 | //#ifndef PROD 29 | FILE* fDummy; 30 | AllocConsole(); 31 | freopen_s(&fDummy, "CONIN$", "r", stdin); 32 | freopen_s(&fDummy, "CONOUT$", "w", stderr); 33 | freopen_s(&fDummy, "CONOUT$", "w", stdout); 34 | //freopen_s(&fDummy, "ProcessEvent.log", "w", stdout); 35 | //#endif 36 | printf(XOR("[=]Scuffed build for latest, Made by kemo (@xkem0x on twitter)")); 37 | #endif 38 | 39 | #ifdef SSL_BYPASS 40 | Hooks::Init(); 41 | #endif 42 | 43 | 44 | #ifdef HOOKS 45 | while (true) 46 | { 47 | if (isReady) 48 | { 49 | //Deprecated 50 | if (Hooks::Misc(gVersion)) //&& Console::Unlock()) //&& ForceSettings()) 51 | { 52 | ImguiThread(); 53 | break; 54 | } 55 | } 56 | else if (GetAsyncKeyState(VK_F3)) 57 | { 58 | if (Hooks::Misc(99.99f)) 59 | { 60 | //ImguiThread(); 61 | break; 62 | } 63 | } 64 | Sleep(1000 / 30); //30 fps 65 | } 66 | #endif 67 | } 68 | 69 | 70 | 71 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) 72 | { 73 | switch (dwReason) 74 | { 75 | case DLL_PROCESS_ATTACH: 76 | dllMain(); 77 | break; 78 | case DLL_PROCESS_DETACH: 79 | case DLL_THREAD_ATTACH: 80 | case DLL_THREAD_DETACH: 81 | default: 82 | break; 83 | } 84 | return TRUE; 85 | } 86 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/IndentedPrint.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | // Decorator on top of Print to allow indented output. 11 | // This class is used by JsonPrintable::prettyPrintTo() but can also be used 12 | // for your own purpose, like logging. 13 | template 14 | class IndentedPrint { 15 | public: 16 | explicit IndentedPrint(Print &p) : sink(&p) { 17 | level = 0; 18 | tabSize = 2; 19 | isNewLine = true; 20 | } 21 | 22 | size_t print(char c) { 23 | size_t n = 0; 24 | if (isNewLine) n += writeTabs(); 25 | n += sink->print(c); 26 | isNewLine = c == '\n'; 27 | return n; 28 | } 29 | 30 | size_t print(const char *s) { 31 | // TODO: optimize 32 | size_t n = 0; 33 | while (*s) n += print(*s++); 34 | return n; 35 | } 36 | 37 | // Adds one level of indentation 38 | void indent() { 39 | if (level < MAX_LEVEL) level++; 40 | } 41 | 42 | // Removes one level of indentation 43 | void unindent() { 44 | if (level > 0) level--; 45 | } 46 | 47 | // Set the number of space printed for each level of indentation 48 | void setTabSize(uint8_t n) { 49 | if (n < MAX_TAB_SIZE) tabSize = n & MAX_TAB_SIZE; 50 | } 51 | 52 | private: 53 | Print *sink; 54 | uint8_t level : 4; 55 | uint8_t tabSize : 3; 56 | bool isNewLine : 1; 57 | 58 | size_t writeTabs() { 59 | size_t n = 0; 60 | for (int i = 0; i < level * tabSize; i++) n += sink->print(' '); 61 | return n; 62 | } 63 | 64 | static const int MAX_LEVEL = 15; // because it's only 4 bits 65 | static const int MAX_TAB_SIZE = 7; // because it's only 3 bits 66 | }; 67 | } // namespace Internals 68 | } // namespace ArduinoJson 69 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/StringTraits/CharPointer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | namespace ArduinoJson { 8 | namespace Internals { 9 | 10 | template 11 | struct CharPointerTraits { 12 | class Reader { 13 | const TChar* _ptr; 14 | 15 | public: 16 | Reader(const TChar* ptr) 17 | : _ptr(ptr ? ptr : reinterpret_cast("")) {} 18 | 19 | void move() { 20 | ++_ptr; 21 | } 22 | 23 | char current() const { 24 | return char(_ptr[0]); 25 | } 26 | 27 | char next() const { 28 | return char(_ptr[1]); 29 | } 30 | }; 31 | 32 | static bool equals(const TChar* str, const char* expected) { 33 | const char* actual = reinterpret_cast(str); 34 | if (!actual || !expected) return actual == expected; 35 | return strcmp(actual, expected) == 0; 36 | } 37 | 38 | static bool is_null(const TChar* str) { 39 | return !str; 40 | } 41 | 42 | typedef const char* duplicate_t; 43 | 44 | template 45 | static duplicate_t duplicate(const TChar* str, Buffer* buffer) { 46 | if (!str) return NULL; 47 | size_t size = strlen(reinterpret_cast(str)) + 1; 48 | void* dup = buffer->alloc(size); 49 | if (dup != NULL) memcpy(dup, str, size); 50 | return static_cast(dup); 51 | } 52 | 53 | static const bool has_append = false; 54 | static const bool has_equals = true; 55 | static const bool should_duplicate = !IsConst::value; 56 | }; 57 | 58 | // char*, unsigned char*, signed char* 59 | // const char*, const unsigned char*, const signed char* 60 | template 61 | struct StringTraits::value>::type> 62 | : CharPointerTraits {}; 63 | } // namespace Internals 64 | } // namespace ArduinoJson 65 | -------------------------------------------------------------------------------- /Neonite++.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30709.132 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chronite", "Chronite\Chronite.vcxproj", "{DFF93ADF-5360-45BA-B864-970B7D9C8FD6}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cranium", "Cranium\Cranium.vcxproj", "{DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Prod|x64 = Prod|x64 13 | Prod|x86 = Prod|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Prod|x64.ActiveCfg = Release|x64 19 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Prod|x64.Build.0 = Release|x64 20 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Prod|x86.ActiveCfg = Prod|Win32 21 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Prod|x86.Build.0 = Prod|Win32 22 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Release|x64.ActiveCfg = Release|x64 23 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Release|x64.Build.0 = Release|x64 24 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Release|x86.ActiveCfg = Release|Win32 25 | {DFF93ADF-5360-45BA-B864-970B7D9C8FD6}.Release|x86.Build.0 = Release|Win32 26 | {DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}.Prod|x64.ActiveCfg = Prod|x64 27 | {DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}.Prod|x64.Build.0 = Prod|x64 28 | {DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}.Prod|x86.ActiveCfg = Prod|x64 29 | {DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}.Release|x64.ActiveCfg = Release|x64 30 | {DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}.Release|x64.Build.0 = Release|x64 31 | {DAAF5B8E-D234-4154-B5EB-DF0D7A02DFC3}.Release|x86.ActiveCfg = Release|x64 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | GlobalSection(ExtensibilityGlobals) = postSolution 37 | SolutionGuid = {F24CB1A3-E0B6-4953-96B4-2BAB2675628B} 38 | EndGlobalSection 39 | EndGlobal 40 | -------------------------------------------------------------------------------- /Cranium/cryptolens/Configuration_Windows.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResponseParser_ArduinoJson5.hpp" 4 | #include "RequestHandler_WinHTTP.hpp" 5 | #include "SignatureVerifier_CryptoAPI.hpp" 6 | 7 | #include "validators/AndValidator.hpp" 8 | #include "validators/CorrectKeyValidator.hpp" 9 | #include "validators/CorrectProductValidator.hpp" 10 | #include "validators/NotExpiredValidator_kernel32.hpp" 11 | #include "validators/OnValidMachineValidator.hpp" 12 | 13 | namespace cryptolens_io { 14 | 15 | namespace v20190401 { 16 | 17 | template 18 | struct Configuration_Windows { 19 | using ResponseParser = ResponseParser_ArduinoJson5; 20 | using RequestHandler = RequestHandler_WinHTTP; 21 | using SignatureVerifier = SignatureVerifier_CryptoAPI; 22 | using MachineCodeComputer = MachineCodeComputer_; 23 | 24 | template 25 | using ActivateValidator = AndValidator_ 26 | , AndValidator_ 27 | , AndValidator_ 28 | , NotExpiredValidator_kernel32_ 29 | >>>; 30 | }; 31 | 32 | template 33 | struct Configuration_Windows_IgnoreExpires { 34 | using ResponseParser = ResponseParser_ArduinoJson5; 35 | using RequestHandler = RequestHandler_WinHTTP; 36 | using SignatureVerifier = SignatureVerifier_CryptoAPI; 37 | using MachineCodeComputer = MachineCodeComputer_; 38 | 39 | template 40 | using ActivateValidator = AndValidator_ 41 | , AndValidator_ 42 | , OnValidMachineValidator_ 43 | >>; 44 | }; 45 | 46 | } // namespace v20190401 47 | 48 | namespace latest { 49 | 50 | template 51 | using Configuration_Windows = ::cryptolens_io::v20190401::Configuration_Windows; 52 | 53 | template 54 | using Configuration_Windows_IgnoreExpires = ::cryptolens_io::v20190401::Configuration_Windows_IgnoreExpires; 55 | 56 | } // namespace latest 57 | 58 | } // namespace cryptolens_io 59 | -------------------------------------------------------------------------------- /Cranium/cryptolens/Configuration_Unix.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResponseParser_ArduinoJson5.hpp" 4 | #include "RequestHandler_curl.hpp" 5 | #include "SignatureVerifier_OpenSSL.hpp" 6 | 7 | #include "validators/AndValidator.hpp" 8 | #include "validators/CorrectKeyValidator.hpp" 9 | #include "validators/CorrectProductValidator.hpp" 10 | #include "validators/NotExpiredValidator_ctime.hpp" 11 | #include "validators/OnValidMachineValidator.hpp" 12 | 13 | namespace cryptolens_io { 14 | 15 | namespace v20190401 { 16 | 17 | template 18 | struct Configuration_Unix { 19 | using ResponseParser = ResponseParser_ArduinoJson5; 20 | using RequestHandler = RequestHandler_curl; 21 | using SignatureVerifier = SignatureVerifier_OpenSSL; 22 | using MachineCodeComputer = MachineCodeComputer_; 23 | 24 | template 25 | using ActivateValidator = AndValidator_ 26 | , AndValidator_ 27 | , AndValidator_ 28 | , NotExpiredValidator_ctime_ 29 | >>>; 30 | }; 31 | 32 | template 33 | struct Configuration_Unix_IgnoreExpires { 34 | using ResponseParser = ResponseParser_ArduinoJson5; 35 | using RequestHandler = RequestHandler_curl; 36 | using SignatureVerifier = SignatureVerifier_OpenSSL; 37 | using MachineCodeComputer = MachineCodeComputer_; 38 | 39 | template 40 | using ActivateValidator = AndValidator_ 41 | , AndValidator_ 42 | , OnValidMachineValidator_ 43 | >>; 44 | }; 45 | 46 | } // namespace v20190401 47 | 48 | namespace latest { 49 | 50 | template 51 | using Configuration_Unix = ::cryptolens_io::v20190401::Configuration_Unix; 52 | 53 | template 54 | using Configuration_Unix_IgnoreExpires = ::cryptolens_io::v20190401::Configuration_Unix_IgnoreExpires; 55 | 56 | } // namespace latest 57 | 58 | } // namespace cryptolens_io 59 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/curl/isunreserved.cpp: -------------------------------------------------------------------------------- 1 | namespace cryptolens_io { 2 | 3 | namespace v20190401 { 4 | 5 | namespace internal { 6 | 7 | /* FROM CURL 8 | 9 | Copyright (c) 1996 - 2018, Daniel Stenberg, , and many 10 | contributors, see the THANKS file. 11 | 12 | All rights reserved. 13 | 14 | Permission to use, copy, modify, and distribute this software for any purpose 15 | with or without fee is hereby granted, provided that the above copyright 16 | notice and this permission notice appear in all copies. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN 21 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 22 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 23 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 24 | OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | Except as contained in this notice, the name of a copyright holder shall not 27 | be used in advertising or otherwise to promote the sale, use or other dealings 28 | in this Software without prior written authorization of the copyright holder. 29 | 30 | */ 31 | bool Curl_isunreserved(unsigned char in) 32 | { 33 | switch (in) { 34 | case '0': case '1': case '2': case '3': case '4': 35 | case '5': case '6': case '7': case '8': case '9': 36 | case 'a': case 'b': case 'c': case 'd': case 'e': 37 | case 'f': case 'g': case 'h': case 'i': case 'j': 38 | case 'k': case 'l': case 'm': case 'n': case 'o': 39 | case 'p': case 'q': case 'r': case 's': case 't': 40 | case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': 41 | case 'A': case 'B': case 'C': case 'D': case 'E': 42 | case 'F': case 'G': case 'H': case 'I': case 'J': 43 | case 'K': case 'L': case 'M': case 'N': case 'O': 44 | case 'P': case 'Q': case 'R': case 'S': case 'T': 45 | case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': 46 | case '-': case '.': case '_': case '~': 47 | return 1; 48 | default: 49 | break; 50 | } 51 | return 0; 52 | } 53 | 54 | } // namespace internal 55 | 56 | } // namespace v20190401 57 | 58 | } // namespace cryptolens_io 59 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/StringTraits/StdString.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #if ARDUINOJSON_ENABLE_STD_STRING || ARDUINOJSON_ENABLE_ARDUINO_STRING 8 | 9 | #if ARDUINOJSON_ENABLE_ARDUINO_STRING 10 | #include 11 | #endif 12 | 13 | #if ARDUINOJSON_ENABLE_STD_STRING 14 | #include 15 | #endif 16 | 17 | namespace ArduinoJson { 18 | namespace Internals { 19 | 20 | template 21 | struct StdStringTraits { 22 | typedef const char* duplicate_t; 23 | 24 | template 25 | static duplicate_t duplicate(const TString& str, Buffer* buffer) { 26 | if (!str.c_str()) return NULL; // <- Arduino string can return NULL 27 | size_t size = str.length() + 1; 28 | void* dup = buffer->alloc(size); 29 | if (dup != NULL) memcpy(dup, str.c_str(), size); 30 | return static_cast(dup); 31 | } 32 | 33 | static bool is_null(const TString& str) { 34 | // Arduino's String::c_str() can return NULL 35 | return !str.c_str(); 36 | } 37 | 38 | struct Reader : CharPointerTraits::Reader { 39 | Reader(const TString& str) : CharPointerTraits::Reader(str.c_str()) {} 40 | }; 41 | 42 | static bool equals(const TString& str, const char* expected) { 43 | // Arduino's String::c_str() can return NULL 44 | const char* actual = str.c_str(); 45 | if (!actual || !expected) return actual == expected; 46 | return 0 == strcmp(actual, expected); 47 | } 48 | 49 | static void append(TString& str, char c) { 50 | str += c; 51 | } 52 | 53 | static void append(TString& str, const char* s) { 54 | str += s; 55 | } 56 | 57 | static const bool has_append = true; 58 | static const bool has_equals = true; 59 | static const bool should_duplicate = true; 60 | }; 61 | 62 | #if ARDUINOJSON_ENABLE_ARDUINO_STRING 63 | template <> 64 | struct StringTraits : StdStringTraits {}; 65 | template <> 66 | struct StringTraits : StdStringTraits { 67 | }; 68 | #endif 69 | 70 | #if ARDUINOJSON_ENABLE_STD_STRING 71 | template <> 72 | struct StringTraits : StdStringTraits {}; 73 | #endif 74 | } // namespace Internals 75 | } // namespace ArduinoJson 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Cranium/cryptolens/RawLicenseKey.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "imports/std/optional" 6 | 7 | #include "basic_Error.hpp" 8 | #include "base64.hpp" 9 | 10 | namespace cryptolens_io { 11 | 12 | namespace v20190401 { 13 | 14 | /** 15 | * This class represents a raw reply from the Cryptolens Web API with 16 | * a license key. 17 | * 18 | * This object cannot be queried directly, instead a LicenseKey 19 | * object must be created, e.g: 20 | * 21 | * LicenseKey key = LicenseKey::make(raw_license_key) 22 | * 23 | */ 24 | class RawLicenseKey { 25 | RawLicenseKey 26 | ( std::string base64_license 27 | , std::string signature 28 | , std::string decoded_license 29 | ) 30 | : base64_license_(std::move(base64_license)) 31 | , signature_(std::move(signature)) 32 | , license_(std::move(decoded_license)) 33 | { } 34 | 35 | std::string base64_license_; 36 | std::string signature_; 37 | std::string license_; 38 | public: 39 | std::string const& get_base64_license() const; 40 | 41 | std::string const& get_signature() const; 42 | 43 | std::string const& get_license() const; 44 | 45 | template 46 | static 47 | optional 48 | make 49 | ( basic_Error & e 50 | , SignatureVerifier const& verifier 51 | , std::string base64_license 52 | , std::string signature 53 | ) 54 | { 55 | if (e) { return nullopt; } 56 | 57 | optional decoded = ::cryptolens_io::v20190401::internal::b64_decode(base64_license); 58 | 59 | if (!decoded) { 60 | e.set(api::main(), errors::Subsystem::Base64); 61 | return nullopt; 62 | } 63 | 64 | if (verifier.verify_message(e, *decoded, signature)) { 65 | return make_optional( 66 | RawLicenseKey 67 | ( std::move(base64_license) 68 | , std::move(signature) 69 | , std::move(*decoded) 70 | ) 71 | ); 72 | } else { 73 | return nullopt; 74 | } 75 | } 76 | }; 77 | 78 | } // namespace v20190401 79 | 80 | namespace v20180502 { 81 | 82 | using RawLicenseKey = ::cryptolens_io::v20190401::RawLicenseKey; 83 | 84 | } // namespace v20180502 85 | 86 | namespace latest { 87 | 88 | using RawLicenseKey = ::cryptolens_io::v20190401::RawLicenseKey; 89 | 90 | } // namespace latest 91 | 92 | } // namespace cryptolens_io 93 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Polyfills/parseFloat.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../TypeTraits/FloatTraits.hpp" 8 | #include "./ctype.hpp" 9 | #include "./math.hpp" 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | template 15 | inline T parseFloat(const char* s) { 16 | typedef FloatTraits traits; 17 | typedef typename traits::mantissa_type mantissa_t; 18 | typedef typename traits::exponent_type exponent_t; 19 | 20 | if (!s) return 0; // NULL 21 | 22 | bool negative_result = false; 23 | switch (*s) { 24 | case '-': 25 | negative_result = true; 26 | s++; 27 | break; 28 | case '+': 29 | s++; 30 | break; 31 | } 32 | 33 | if (*s == 't') return 1; // true 34 | if (*s == 'n' || *s == 'N') return traits::nan(); 35 | if (*s == 'i' || *s == 'I') 36 | return negative_result ? -traits::inf() : traits::inf(); 37 | 38 | mantissa_t mantissa = 0; 39 | exponent_t exponent_offset = 0; 40 | 41 | while (isdigit(*s)) { 42 | if (mantissa < traits::mantissa_max / 10) 43 | mantissa = mantissa * 10 + (*s - '0'); 44 | else 45 | exponent_offset++; 46 | s++; 47 | } 48 | 49 | if (*s == '.') { 50 | s++; 51 | while (isdigit(*s)) { 52 | if (mantissa < traits::mantissa_max / 10) { 53 | mantissa = mantissa * 10 + (*s - '0'); 54 | exponent_offset--; 55 | } 56 | s++; 57 | } 58 | } 59 | 60 | int exponent = 0; 61 | if (*s == 'e' || *s == 'E') { 62 | s++; 63 | bool negative_exponent = false; 64 | if (*s == '-') { 65 | negative_exponent = true; 66 | s++; 67 | } else if (*s == '+') { 68 | s++; 69 | } 70 | 71 | while (isdigit(*s)) { 72 | exponent = exponent * 10 + (*s - '0'); 73 | if (exponent + exponent_offset > traits::exponent_max) { 74 | if (negative_exponent) 75 | return negative_result ? -0.0f : 0.0f; 76 | else 77 | return negative_result ? -traits::inf() : traits::inf(); 78 | } 79 | s++; 80 | } 81 | if (negative_exponent) exponent = -exponent; 82 | } 83 | exponent += exponent_offset; 84 | 85 | T result = traits::make_float(static_cast(mantissa), exponent); 86 | 87 | return negative_result ? -result : result; 88 | } 89 | } // namespace Internals 90 | } // namespace ArduinoJson 91 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../stream.h" 19 | #include 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | namespace internal 23 | { 24 | //! Custom strlen() which works on different character types. 25 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 26 | \param s Null-terminated input string. 27 | \return Number of characters in the string. 28 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 29 | */ 30 | template 31 | SizeType StrLen(const Ch* s) 32 | { 33 | RAPIDJSON_ASSERT(s != nullptr); 34 | const Ch* p = s; 35 | while (*p) ++p; 36 | return SizeType(p - s); 37 | } 38 | 39 | template <> 40 | inline SizeType StrLen(const char* s) 41 | { 42 | return SizeType(std::strlen(s)); 43 | } 44 | 45 | template <> 46 | inline SizeType StrLen(const wchar_t* s) 47 | { 48 | return SizeType(std::wcslen(s)); 49 | } 50 | 51 | //! Returns number of code points in a encoded string. 52 | template 53 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) 54 | { 55 | RAPIDJSON_ASSERT(s != nullptr); 56 | RAPIDJSON_ASSERT(outCount != nullptr); 57 | GenericStringStream is(s); 58 | const typename Encoding::Ch* end = s + length; 59 | SizeType count = 0; 60 | while (is.src_ < end) 61 | { 62 | unsigned codepoint; 63 | if (!Encoding::Decode(is, &codepoint)) return false; 64 | count++; 65 | } 66 | *outCount = count; 67 | return true; 68 | } 69 | } // namespace internal 70 | RAPIDJSON_NAMESPACE_END 71 | 72 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 73 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/cursorstreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CURSORSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_CURSORSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | 20 | #if defined(__GNUC__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(effc++) 23 | #endif 24 | 25 | #if defined(_MSC_VER) && _MSC_VER <= 1800 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(4702) // unreachable code 28 | RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated 29 | #endif 30 | 31 | RAPIDJSON_NAMESPACE_BEGIN 32 | //! Cursor stream wrapper for counting line and column number if error exists. 33 | /*! 34 | \tparam InputStream Any stream that implements Stream Concept 35 | */ 36 | template > 37 | class CursorStreamWrapper : public GenericStreamWrapper 38 | { 39 | public: 40 | typedef typename Encoding::Ch Ch; 41 | 42 | CursorStreamWrapper(InputStream& is) : 43 | GenericStreamWrapper(is), line_(1), col_(0) 44 | { 45 | } 46 | 47 | // counting line and column number 48 | Ch Take() 49 | { 50 | Ch ch = this->is_.Take(); 51 | if (ch == '\n') 52 | { 53 | line_++; 54 | col_ = 0; 55 | } 56 | else 57 | { 58 | col_++; 59 | } 60 | return ch; 61 | } 62 | 63 | //! Get the error line number, if error exists. 64 | size_t GetLine() const { return line_; } 65 | //! Get the error column number, if error exists. 66 | size_t GetColumn() const { return col_; } 67 | 68 | private: 69 | size_t line_; //!< Current Line 70 | size_t col_; //!< Current Column 71 | }; 72 | 73 | #if defined(_MSC_VER) && _MSC_VER <= 1800 74 | RAPIDJSON_DIAG_POP 75 | #endif 76 | 77 | #if defined(__GNUC__) 78 | RAPIDJSON_DIAG_POP 79 | #endif 80 | 81 | RAPIDJSON_NAMESPACE_END 82 | 83 | #endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_ 84 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/FloatParts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../Configuration.hpp" 8 | #include "../Polyfills/math.hpp" 9 | #include "../TypeTraits/FloatTraits.hpp" 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | template 15 | struct FloatParts { 16 | uint32_t integral; 17 | uint32_t decimal; 18 | int16_t exponent; 19 | int8_t decimalPlaces; 20 | 21 | FloatParts(TFloat value) { 22 | uint32_t maxDecimalPart = sizeof(TFloat) >= 8 ? 1000000000 : 1000000; 23 | decimalPlaces = sizeof(TFloat) >= 8 ? 9 : 6; 24 | 25 | exponent = normalize(value); 26 | 27 | integral = uint32_t(value); 28 | // reduce number of decimal places by the number of integral places 29 | for (uint32_t tmp = integral; tmp >= 10; tmp /= 10) { 30 | maxDecimalPart /= 10; 31 | decimalPlaces--; 32 | } 33 | 34 | TFloat remainder = (value - TFloat(integral)) * TFloat(maxDecimalPart); 35 | 36 | decimal = uint32_t(remainder); 37 | remainder = remainder - TFloat(decimal); 38 | 39 | // rounding: 40 | // increment by 1 if remainder >= 0.5 41 | decimal += uint32_t(remainder * 2); 42 | if (decimal >= maxDecimalPart) { 43 | decimal = 0; 44 | integral++; 45 | if (exponent && integral >= 10) { 46 | exponent++; 47 | integral = 1; 48 | } 49 | } 50 | 51 | // remove trailing zeros 52 | while (decimal % 10 == 0 && decimalPlaces > 0) { 53 | decimal /= 10; 54 | decimalPlaces--; 55 | } 56 | } 57 | 58 | static int16_t normalize(TFloat& value) { 59 | typedef FloatTraits traits; 60 | int16_t powersOf10 = 0; 61 | 62 | int8_t index = sizeof(TFloat) == 8 ? 8 : 5; 63 | int bit = 1 << index; 64 | 65 | if (value >= ARDUINOJSON_POSITIVE_EXPONENTIATION_THRESHOLD) { 66 | for (; index >= 0; index--) { 67 | if (value >= traits::positiveBinaryPowerOfTen(index)) { 68 | value *= traits::negativeBinaryPowerOfTen(index); 69 | powersOf10 = int16_t(powersOf10 + bit); 70 | } 71 | bit >>= 1; 72 | } 73 | } 74 | 75 | if (value > 0 && value <= ARDUINOJSON_NEGATIVE_EXPONENTIATION_THRESHOLD) { 76 | for (; index >= 0; index--) { 77 | if (value < traits::negativeBinaryPowerOfTenPlusOne(index)) { 78 | value *= traits::positiveBinaryPowerOfTen(index); 79 | powersOf10 = int16_t(powersOf10 - bit); 80 | } 81 | bit >>= 1; 82 | } 83 | } 84 | 85 | return powersOf10; 86 | } 87 | }; 88 | } // namespace Internals 89 | } // namespace ArduinoJson 90 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonBuffer.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include // for size_t 8 | #include // for uint8_t 9 | #include 10 | 11 | #include "Data/NonCopyable.hpp" 12 | #include "JsonVariant.hpp" 13 | #include "TypeTraits/EnableIf.hpp" 14 | #include "TypeTraits/IsArray.hpp" 15 | 16 | namespace ArduinoJson { 17 | class JsonArray; 18 | class JsonObject; 19 | 20 | // Entry point for using the library. 21 | // 22 | // Handle the memory management (done in derived classes) and calls the parser. 23 | // This abstract class is implemented by StaticJsonBuffer which implements a 24 | // fixed memory allocation. 25 | class JsonBuffer : Internals::NonCopyable { 26 | public: 27 | // Allocates an empty JsonArray. 28 | // 29 | // Returns a reference to the new JsonArray or JsonArray::invalid() if the 30 | // allocation fails. 31 | JsonArray &createArray(); 32 | 33 | // Allocates an empty JsonObject. 34 | // 35 | // Returns a reference to the new JsonObject or JsonObject::invalid() if the 36 | // allocation fails. 37 | JsonObject &createObject(); 38 | 39 | // Duplicates a string 40 | // 41 | // const char* strdup(TValue); 42 | // TValue = const std::string&, const String&, 43 | template 44 | DEPRECATED("char* are duplicated, you don't need strdup() anymore") 45 | typename Internals::EnableIf::value, 46 | const char *>::type strdup(const TString &src) { 47 | return Internals::StringTraits::duplicate(src, this); 48 | } 49 | // 50 | // const char* strdup(TValue); 51 | // TValue = char*, const char*, const FlashStringHelper* 52 | template 53 | DEPRECATED("char* are duplicated, you don't need strdup() anymore") 54 | const char *strdup(TString *src) { 55 | return Internals::StringTraits::duplicate(src, this); 56 | } 57 | 58 | // Allocates n bytes in the JsonBuffer. 59 | // Return a pointer to the allocated memory or NULL if allocation fails. 60 | virtual void *alloc(size_t size) = 0; 61 | 62 | protected: 63 | // CAUTION: NO VIRTUAL DESTRUCTOR! 64 | // If we add a virtual constructor the Arduino compiler will add malloc() 65 | // and free() to the binary, adding 706 useless bytes. 66 | ~JsonBuffer() {} 67 | 68 | // Preserve aligment if necessary 69 | static FORCE_INLINE size_t round_size_up(size_t bytes) { 70 | #if ARDUINOJSON_ENABLE_ALIGNMENT 71 | const size_t x = sizeof(void *) - 1; 72 | return (bytes + x) & ~x; 73 | #else 74 | return bytes; 75 | #endif 76 | } 77 | }; 78 | } // namespace ArduinoJson 79 | -------------------------------------------------------------------------------- /Cranium/Resource.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 1,0,0,0 55 | PRODUCTVERSION 1,0,0,0 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x2L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "040904b0" 69 | BEGIN 70 | VALUE "CompanyName", "Neonite" 71 | VALUE "FileDescription", "Cranium" 72 | VALUE "FileVersion", "1.0.0.0" 73 | VALUE "InternalName", "Cranium.dll" 74 | VALUE "LegalCopyright", "Cranium (c) by kemo#1337 (@xkem0x)" 75 | VALUE "OriginalFilename", "Cranium.dll" 76 | VALUE "ProductName", "Cranium" 77 | VALUE "ProductVersion", "1.0.0.0" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x409, 1200 83 | END 84 | END 85 | 86 | #endif // English (United States) resources 87 | ///////////////////////////////////////////////////////////////////////////// 88 | 89 | 90 | 91 | #ifndef APSTUDIO_INVOKED 92 | ///////////////////////////////////////////////////////////////////////////// 93 | // 94 | // Generated from the TEXTINCLUDE 3 resource. 95 | // 96 | 97 | 98 | ///////////////////////////////////////////////////////////////////////////// 99 | #endif // not APSTUDIO_INVOKED 100 | 101 | -------------------------------------------------------------------------------- /Cranium/curlhooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "curl.h" 3 | #include "url.h" 4 | 5 | #define URL_PROTOCOL XOR("http") 6 | #define URL_HOST XOR("127.0.0.1") 7 | #define URL_PORT XOR("5746") 8 | 9 | inline bool isReady; 10 | inline std::string gUrl; 11 | inline float gVersion; 12 | 13 | static bool ProdMode; 14 | static bool bIsProdMode; 15 | static bool bIsVersionFound; 16 | 17 | inline CURLcode (*CurlSetOpt)(struct Curl_easy*, CURLoption, va_list) = nullptr; 18 | inline CURLcode (*CurlEasySetOpt)(struct Curl_easy*, CURLoption, ...) = nullptr; 19 | 20 | inline CURLcode CurlSetOpt_(struct Curl_easy* data, CURLoption option, ...) 21 | { 22 | va_list arg; 23 | va_start(arg, option); 24 | 25 | const auto result = CurlSetOpt(data, option, arg); 26 | 27 | va_end(arg); 28 | return result; 29 | } 30 | 31 | inline CURLcode CurlEasySetOptDetour(struct Curl_easy* data, CURLoption tag, ...) 32 | { 33 | va_list arg; 34 | va_start(arg, tag); 35 | 36 | CURLcode result = {}; 37 | 38 | if (!data) return CURLE_BAD_FUNCTION_ARGUMENT; 39 | 40 | //Ssl bypass 41 | if (tag == CURLOPT_SSL_VERIFYPEER) 42 | { 43 | result = CurlSetOpt_(data, tag, 0); 44 | } 45 | 46 | //Disable Proxy 47 | if (tag == CURLOPT_PROXY) 48 | { 49 | result = CurlSetOpt_(data, tag, ""); 50 | } 51 | 52 | //URL redirection 53 | else if (tag == CURLOPT_URL) 54 | { 55 | std::string url = va_arg(arg, char*); 56 | gUrl = url; 57 | 58 | if (url.find("ClientQuest") != std::string::npos) isReady = !isReady; 59 | 60 | #ifdef URL_HOST 61 | 62 | if (!ProdMode) 63 | { 64 | Uri uri = Uri::Parse(url); 65 | 66 | if (uri.Host.ends_with(XOR("ol.epicgames.com")) || uri.Host.ends_with(XOR(".akamaized.net")) || uri.Host.ends_with(XOR("on.epicgames.com"))) 67 | { 68 | //printf("LogURL: %s\n", url.c_str()); 69 | url = Uri::CreateUri(URL_PROTOCOL, URL_HOST, URL_PORT, uri.Path, uri.QueryString); 70 | } 71 | } 72 | 73 | #endif 74 | result = CurlSetOpt_(data, tag, url.c_str()); 75 | } 76 | 77 | //Version determination 78 | else if (tag == CURLOPT_HTTPHEADER && !bIsVersionFound) 79 | { 80 | auto list = va_arg(arg, curl_slist*);; 81 | 82 | while (list->next != nullptr && list->data) 83 | { 84 | std::string listData = list->data; 85 | if (listData.starts_with(XOR("User-Agent:"))) 86 | { 87 | const auto version = listData.erase(0, listData.find_first_of("0123456789")); //find first number 88 | gVersion = std::stof(version); 89 | bIsVersionFound = !bIsVersionFound; 90 | } 91 | list = list->next; 92 | } 93 | } 94 | 95 | else 96 | { 97 | result = CurlSetOpt(data, tag, arg); 98 | } 99 | 100 | va_end(arg); 101 | return result; 102 | } 103 | -------------------------------------------------------------------------------- /Cranium/url.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | struct Uri 8 | { 9 | private: 10 | typedef std::string_view::const_iterator iterator_t; 11 | 12 | public: 13 | std::string_view Protocol, Host, Port, Path, QueryString; 14 | 15 | static Uri Parse(const std::string_view& uri) 16 | { 17 | Uri result; 18 | 19 | if (uri.length() == 0) return result; 20 | 21 | iterator_t uriEnd = uri.end(); 22 | 23 | iterator_t queryStart = std::find(uri.begin(), uriEnd, '?'); 24 | 25 | iterator_t protocolStart = uri.begin(); 26 | iterator_t protocolEnd = std::find(protocolStart, uriEnd, ':'); 27 | 28 | if (protocolEnd != uriEnd) 29 | { 30 | std::string_view prot = &*(protocolEnd); 31 | if ((prot.length() > 3) && (prot.substr(0, 3) == "://")) 32 | { 33 | result.Protocol = make_string_view(uri, protocolStart, protocolEnd); 34 | protocolEnd += 3; 35 | } 36 | else protocolEnd = uri.begin(); 37 | } 38 | else protocolEnd = uri.begin(); 39 | 40 | iterator_t hostStart = protocolEnd; 41 | iterator_t pathStart = std::find(hostStart, uriEnd, '/'); 42 | 43 | iterator_t hostEnd = std::find(protocolEnd, (pathStart != uriEnd) ? pathStart : queryStart, ':'); 44 | 45 | result.Host = make_string_view(uri, hostStart, hostEnd); 46 | 47 | if ((hostEnd != uriEnd) && ((&*(hostEnd))[0] == ':')) 48 | { 49 | ++hostEnd; 50 | iterator_t portEnd = (pathStart != uriEnd) ? pathStart : queryStart; 51 | result.Port = make_string_view(uri, hostEnd, portEnd); 52 | } 53 | 54 | if (pathStart != uriEnd) result.Path = make_string_view(uri, pathStart, queryStart); 55 | 56 | if (queryStart != uriEnd) result.QueryString = make_string_view(uri, queryStart, uri.end()); 57 | 58 | return result; 59 | } 60 | 61 | static std::string CreateUri(std::string_view Protocol, std::string_view Host, std::string_view Port, std::string_view Path, std::string_view QueryString) 62 | { 63 | std::ostringstream str; 64 | if (!Protocol.empty()) 65 | { 66 | str.write(Protocol.data(), Protocol.size()); 67 | str.write("://", 3); 68 | } 69 | str.write(Host.data(), Host.size()); 70 | if (!Port.empty()) 71 | { 72 | str.write(":", 1); 73 | str.write(Port.data(), Port.size()); 74 | } 75 | if (!Path.empty()) 76 | { 77 | str.write(Path.data(), Path.size()); 78 | } 79 | if (!QueryString.empty()) 80 | { 81 | str.write(QueryString.data(), QueryString.size()); 82 | } 83 | return str.str(); 84 | } 85 | 86 | private: 87 | static constexpr std::string_view make_string_view(const std::string_view& base, iterator_t first, iterator_t last) 88 | { 89 | return base.substr(std::distance(base.begin(), first), std::distance(first, last)); 90 | } 91 | }; 92 | -------------------------------------------------------------------------------- /Cranium/cryptolens/SignatureVerifier_OpenSSL.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "imports/openssl/rsa.h" 6 | 7 | #include "basic_Error.hpp" 8 | #include "Error.hpp" 9 | #include "SignatureVerifier_v20190401_to_v20180502.hpp" 10 | 11 | namespace cryptolens_io { 12 | 13 | namespace v20190401 { 14 | 15 | /** 16 | * A signature verifier used by the library for checking the cryptographic 17 | * signatures return by the Cryptolens Web API and thus makes sure 18 | * the responses from the web API has not been tampered with. This signature 19 | * verifier can be used with the OpenSSL or LibreSSL libraries. 20 | * 21 | * In order for this signature verifier to work the modulus and exponent 22 | * must be set using the set_modulus_base64() and set_exponent_base64() 23 | * methods. 24 | */ 25 | class SignatureVerifier_OpenSSL 26 | { 27 | public: 28 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 29 | explicit 30 | #endif 31 | SignatureVerifier_OpenSSL(basic_Error & e); 32 | #ifndef CRYPTOLENS_ENABLE_DANGEROUS_COPY_MOVE_CONSTRUCTOR 33 | SignatureVerifier_OpenSSL(SignatureVerifier_OpenSSL const&) = delete; 34 | SignatureVerifier_OpenSSL(SignatureVerifier_OpenSSL &&) = delete; 35 | void operator=(SignatureVerifier_OpenSSL const&) = delete; 36 | void operator=(SignatureVerifier_OpenSSL &&) = delete; 37 | #endif 38 | ~SignatureVerifier_OpenSSL(); 39 | 40 | void set_modulus_base64(basic_Error & e, std::string const& modulus_base64); 41 | void set_exponent_base64(basic_Error & e, std::string const& exponent_base64); 42 | 43 | bool verify_message(basic_Error & e, std::string const& message, std::string const& signature_base64) const; 44 | 45 | private: 46 | RSA * rsa; 47 | 48 | void set_modulus_base64_(basic_Error & e, std::string const& modulus_base64); 49 | void set_exponent_base64_(basic_Error & e, std::string const& exponent_base64); 50 | }; 51 | 52 | } // namespace v20190401 53 | 54 | namespace latest { 55 | 56 | using SignatureVerifier_OpenSSL = ::cryptolens_io::v20190401::SignatureVerifier_OpenSSL; 57 | 58 | } // namespace latest 59 | 60 | namespace v20180502 { 61 | 62 | /** 63 | * A signature verifier used by the library for checking the cryptographic 64 | * signatures return by the Cryptolens Web API and thus makes sure 65 | * the responses from the web API has not been tampered with. This signature 66 | * verifier can be used with the OpenSSL or LibreSSL libraries. 67 | * 68 | * In order for this signature verifier to work the modulus and exponent 69 | * must be set using the set_modulus_base64() and set_exponent_base64() 70 | * methods. 71 | */ 72 | using SignatureVerifier_OpenSSL = ::cryptolens_io::internal::SignatureVerifier_v20190401_to_v20180502<::cryptolens_io::v20190401::SignatureVerifier_OpenSSL>; 73 | 74 | } // namespace v20180502 75 | 76 | } // namespace cryptolens_io 77 | -------------------------------------------------------------------------------- /Cranium/cryptolens/SignatureVerifier_CryptoAPI.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "imports/windows/Windows.h" 6 | #include "imports/windows/wincrypt.h" 7 | 8 | #include "basic_Error.hpp" 9 | #include "Error.hpp" 10 | #include "SignatureVerifier_v20190401_to_v20180502.hpp" 11 | 12 | namespace cryptolens_io { 13 | 14 | namespace v20190401 { 15 | 16 | /** 17 | * A signature verifier used by the library for checking the cryptographic 18 | * signatures return by the Cryptolens Web API and thus makes sure 19 | * the responses from the web API has not been tampered with. This signature 20 | * verifier depends on the Microsoft CryptoAPI. 21 | * 22 | * In order for this signature verifier to work the modulus and exponent 23 | * must be set using the set_modulus_base64() and set_exponent_base64() 24 | * methods. 25 | */ 26 | class SignatureVerifier_CryptoAPI 27 | { 28 | public: 29 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 30 | explicit 31 | #endif 32 | SignatureVerifier_CryptoAPI(basic_Error & e); 33 | #ifndef CRYPTOLENS_ENABLE_DANGEROUS_COPY_MOVE_CONSTRUCTOR 34 | SignatureVerifier_CryptoAPI(SignatureVerifier_CryptoAPI const&) = delete; 35 | SignatureVerifier_CryptoAPI(SignatureVerifier_CryptoAPI &&) = delete; 36 | void operator=(SignatureVerifier_CryptoAPI const&) = delete; 37 | void operator=(SignatureVerifier_CryptoAPI &&) = delete; 38 | #endif 39 | ~SignatureVerifier_CryptoAPI(); 40 | 41 | void set_modulus_base64(basic_Error & e, std::string const& modulus_base64); 42 | void set_exponent_base64(basic_Error & e, std::string const& exponent_base64) {} 43 | bool verify_message(basic_Error & e, std::string const& message, std::string const& signature_base64) const; 44 | private: 45 | HCRYPTPROV hProv_; 46 | HCRYPTKEY hPubKey_; 47 | 48 | void init(basic_Error & e); 49 | void set_modulus_base64_(basic_Error & e, std::string const& modulus_base64); 50 | }; 51 | 52 | } // namespace v20190401 53 | 54 | namespace latest { 55 | 56 | using SignatureVerifier_CryptoAPI = ::cryptolens_io::v20190401::SignatureVerifier_CryptoAPI; 57 | 58 | } // namespace latest 59 | 60 | namespace v20180502 { 61 | 62 | /** 63 | * A signature verifier used by the library for checking the cryptographic 64 | * signatures return by the Cryptolens Web API and thus makes sure 65 | * the responses from the web API has not been tampered with. This signature 66 | * verifier depends on the Microsoft CryptoAPI. 67 | * 68 | * In order for this signature verifier to work the modulus and exponent 69 | * must be set using the set_modulus_base64() and set_exponent_base64() 70 | * methods. 71 | */ 72 | using SignatureVerifier_CryptoAPI = ::cryptolens_io::internal::SignatureVerifier_v20190401_to_v20180502<::cryptolens_io::v20190401::SignatureVerifier_CryptoAPI>; 73 | 74 | } // namespace v20180502 75 | 76 | } // namespace cryptolens_io 77 | -------------------------------------------------------------------------------- /Cranium/cryptolens/MachineCodeComputer_COM.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "basic_Error.hpp" 6 | #include "MachineCodeComputer_caching.hpp" 7 | 8 | namespace cryptolens_io { 9 | 10 | namespace v20190401 { 11 | 12 | namespace errors { 13 | 14 | namespace MachineCodeComputer_COM_Recompute {} 15 | 16 | } // namespace errors 17 | 18 | /** 19 | * Computes a unique machine code for the device using the COM library 20 | * available on Windows. 21 | * 22 | * This class recomputes the machine code each time get_machine_code() 23 | * is called. 24 | * 25 | * Requires the project to link against Iphlpapi.lib 26 | */ 27 | class MachineCodeComputer_COM_Recompute 28 | { 29 | public: 30 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 31 | explicit 32 | #endif 33 | MachineCodeComputer_COM_Recompute(basic_Error & e) {} 34 | 35 | std::string 36 | get_machine_code(basic_Error & e); 37 | 38 | private: 39 | std::string machine_code_; 40 | }; 41 | 42 | /** 43 | * Computes a unique machine code for the device using the COM library 44 | * available on Windows. 45 | * 46 | * This class computes the machine code when created, and the same machine 47 | * code is returned on subsequent calls to get_machine_code(). This 48 | * can be convenient when used with floating licensing since 49 | * we do not want the machine code to change while the program is running. 50 | * 51 | * Requires the project to link against Iphlpapi.lib 52 | */ 53 | using MachineCodeComputer_COM = MachineCodeComputer_caching; 54 | 55 | } // namespace v20190401 56 | 57 | namespace latest { 58 | 59 | namespace errors { 60 | 61 | namespace MachineCodeComputer_COM_Recompute = ::cryptolens_io::v20190401::errors::MachineCodeComputer_COM_Recompute; 62 | 63 | } // namespace errors 64 | 65 | /** 66 | * Computes a unique machine code for the device using the COM library 67 | * available on Windows. 68 | * 69 | * This class recomputes the machine code each time get_machine_code() 70 | * is called. 71 | * 72 | * Requires the project to link against Iphlpapi.lib 73 | */ 74 | using MachineCodeComputer_COM_Recompute = ::cryptolens_io::v20190401::MachineCodeComputer_COM_Recompute; 75 | 76 | /** 77 | * Computes a unique machine code for the device using the COM library 78 | * available on Windows. 79 | * 80 | * This class computes the machine code when created, and the same machine 81 | * code is returned on subsequent calls to get_machine_code(). This 82 | * can be convenient when used with floating licensing since 83 | * we do not want the machine code to change while the program is running. 84 | * 85 | * Requires the project to link against Iphlpapi.lib 86 | */ 87 | using MachineCodeComputer_COM = ::cryptolens_io::v20190401::MachineCodeComputer_COM; 88 | 89 | } // namespace latest 90 | 91 | } // namespace cryptolens_io 92 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/memorybuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYBUFFER_H_ 16 | #define RAPIDJSON_MEMORYBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | //! Represents an in-memory output byte stream. 23 | /*! 24 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. 25 | 26 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. 27 | 28 | Differences between MemoryBuffer and StringBuffer: 29 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. 30 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. 31 | 32 | \tparam Allocator type for allocating memory buffer. 33 | \note implements Stream concept 34 | */ 35 | template 36 | struct GenericMemoryBuffer 37 | { 38 | typedef char Ch; // byte 39 | 40 | GenericMemoryBuffer(Allocator* allocator = nullptr, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) 41 | { 42 | } 43 | 44 | void Put(Ch c) { *stack_.template Push() = c; } 45 | 46 | void Flush() 47 | { 48 | } 49 | 50 | void Clear() { stack_.Clear(); } 51 | void ShrinkToFit() { stack_.ShrinkToFit(); } 52 | Ch* Push(size_t count) { return stack_.template Push(count); } 53 | void Pop(size_t count) { stack_.template Pop(count); } 54 | 55 | const Ch* GetBuffer() const 56 | { 57 | return stack_.template Bottom(); 58 | } 59 | 60 | size_t GetSize() const { return stack_.GetSize(); } 61 | 62 | static const size_t kDefaultCapacity = 256; 63 | mutable internal::Stack stack_; 64 | }; 65 | 66 | typedef GenericMemoryBuffer<> MemoryBuffer; 67 | 68 | //! Implement specialized version of PutN() with memset() for better performance. 69 | template <> 70 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) 71 | { 72 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); 73 | } 74 | 75 | RAPIDJSON_NAMESPACE_END 76 | 77 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 78 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Data/List.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../JsonBuffer.hpp" 8 | #include "ListConstIterator.hpp" 9 | #include "ListIterator.hpp" 10 | 11 | namespace ArduinoJson { 12 | namespace Internals { 13 | 14 | // A singly linked list of T. 15 | // The linked list is composed of ListNode. 16 | // It is derived by JsonArray and JsonObject 17 | template 18 | class List { 19 | public: 20 | typedef T value_type; 21 | typedef ListNode node_type; 22 | typedef ListIterator iterator; 23 | typedef ListConstIterator const_iterator; 24 | 25 | // Creates an empty List attached to a JsonBuffer. 26 | // The JsonBuffer allows to allocate new nodes. 27 | // When buffer is NULL, the List is not able to grow and success() returns 28 | // false. This is used to identify bad memory allocations and parsing 29 | // failures. 30 | explicit List(JsonBuffer *buffer) : _buffer(buffer), _firstNode(NULL) {} 31 | 32 | // Returns true if the object is valid 33 | // Would return false in the following situation: 34 | // - the memory allocation failed (StaticJsonBuffer was too small) 35 | // - the JSON parsing failed 36 | bool success() const { 37 | return _buffer != NULL; 38 | } 39 | 40 | // Returns the numbers of elements in the list. 41 | // For a JsonObject, it would return the number of key-value pairs 42 | size_t size() const { 43 | size_t nodeCount = 0; 44 | for (node_type *node = _firstNode; node; node = node->next) nodeCount++; 45 | return nodeCount; 46 | } 47 | 48 | iterator add() { 49 | node_type *newNode = new (_buffer) node_type(); 50 | 51 | if (_firstNode) { 52 | node_type *lastNode = _firstNode; 53 | while (lastNode->next) lastNode = lastNode->next; 54 | lastNode->next = newNode; 55 | } else { 56 | _firstNode = newNode; 57 | } 58 | 59 | return iterator(newNode); 60 | } 61 | 62 | iterator begin() { 63 | return iterator(_firstNode); 64 | } 65 | iterator end() { 66 | return iterator(NULL); 67 | } 68 | 69 | const_iterator begin() const { 70 | return const_iterator(_firstNode); 71 | } 72 | const_iterator end() const { 73 | return const_iterator(NULL); 74 | } 75 | 76 | void remove(iterator it) { 77 | node_type *nodeToRemove = it._node; 78 | if (!nodeToRemove) return; 79 | if (nodeToRemove == _firstNode) { 80 | _firstNode = nodeToRemove->next; 81 | } else { 82 | for (node_type *node = _firstNode; node; node = node->next) 83 | if (node->next == nodeToRemove) node->next = nodeToRemove->next; 84 | } 85 | } 86 | 87 | protected: 88 | JsonBuffer *_buffer; 89 | 90 | private: 91 | node_type *_firstNode; 92 | }; 93 | } // namespace Internals 94 | } // namespace ArduinoJson 95 | -------------------------------------------------------------------------------- /Chronite/Frontend/settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "util.h" 3 | #include "GUI/gui.h" 4 | 5 | namespace settings 6 | { 7 | inline bool config(bool sol) 8 | { 9 | std::string configPath = util::GetEXEPath() + "\\neonite.config"; 10 | const char* configFile = configPath.c_str(); 11 | json config = { 12 | {"name", name}, 13 | {"path", path}, 14 | }; 15 | 16 | if (sol) 17 | { 18 | std::ofstream o(configFile); 19 | o << config; 20 | o.close(); 21 | console.AddLog("[+] Config file was saved."); 22 | } 23 | else if (!sol) 24 | { 25 | try 26 | { 27 | std::ifstream i(configFile); 28 | i >> config; 29 | i.close(); 30 | console.AddLog("[+] Config file was loaded."); 31 | } 32 | catch (...) 33 | { 34 | console.AddLog("[x] Invalid config file was loaded."); 35 | return false; 36 | } 37 | try 38 | { 39 | std::string sname = config["name"]; 40 | std::string spath = config["path"]; 41 | 42 | if (sname.size() > 32) 43 | { 44 | console.AddLog("[x] Name in config file is too long, falling back."); 45 | return false; 46 | } 47 | strncpy(name, sname.c_str(), 33); 48 | 49 | strncpy(path, spath.c_str(), spath.size() + 1); 50 | } 51 | catch (...) 52 | { 53 | console.AddLog("[x] Invalid config file was loaded."); 54 | } 55 | } 56 | 57 | return true; 58 | } 59 | 60 | //TODO: find path function. 61 | inline bool readLocker() 62 | { 63 | char programData[MAX_PATH]; 64 | char datPath[] = "\\Epic\\UnrealEngineLauncher\\LauncherInstalled.dat"; 65 | json launcherInstalled; 66 | std::string fnPath; 67 | 68 | SHGetFolderPath(nullptr, CSIDL_COMMON_APPDATA, 69 | nullptr, 0, programData); 70 | 71 | //TODO: change this 72 | auto launcherInstalledPath = new char[ 73 | std::strlen(programData) + std::strlen(datPath) + 1]; 74 | 75 | std::strcpy(launcherInstalledPath, programData); 76 | std::strcat(launcherInstalledPath, datPath); 77 | 78 | std::ifstream f(launcherInstalledPath); 79 | f >> launcherInstalled; 80 | 81 | json installationList = launcherInstalled["InstallationList"]; 82 | 83 | 84 | for (auto i = 0; i < installationList.size(); i++) 85 | { 86 | if (installationList[i]["AppName"] == "Fortnite") 87 | { 88 | fnPath = installationList[i]["InstallLocation"]; 89 | } 90 | } 91 | 92 | std::string itemsPath = util::GetEXEPath() + "\\ids.config"; 93 | auto itemsFile = itemsPath.c_str(); 94 | try 95 | { 96 | std::ifstream i(itemsFile); 97 | 98 | std::string line; 99 | while (std::getline(i, line)) 100 | { 101 | if (line.starts_with("Athena")) IDs.push_back(line.c_str()); 102 | } 103 | i.close(); 104 | } 105 | catch (...) 106 | { 107 | return false; 108 | } 109 | 110 | return true; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/ostreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_OSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_OSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(padded) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. 28 | /*! 29 | The classes can be wrapped including but not limited to: 30 | 31 | - \c std::ostringstream 32 | - \c std::stringstream 33 | - \c std::wpstringstream 34 | - \c std::wstringstream 35 | - \c std::ifstream 36 | - \c std::fstream 37 | - \c std::wofstream 38 | - \c std::wfstream 39 | 40 | \tparam StreamType Class derived from \c std::basic_ostream. 41 | */ 42 | 43 | template 44 | class BasicOStreamWrapper 45 | { 46 | public: 47 | typedef typename StreamType::char_type Ch; 48 | 49 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) 50 | { 51 | } 52 | 53 | void Put(Ch c) 54 | { 55 | stream_.put(c); 56 | } 57 | 58 | void Flush() 59 | { 60 | stream_.flush(); 61 | } 62 | 63 | // Not implemented 64 | char Peek() const 65 | { 66 | RAPIDJSON_ASSERT(false); 67 | return 0; 68 | } 69 | 70 | char Take() 71 | { 72 | RAPIDJSON_ASSERT(false); 73 | return 0; 74 | } 75 | 76 | size_t Tell() const 77 | { 78 | RAPIDJSON_ASSERT(false); 79 | return 0; 80 | } 81 | 82 | char* PutBegin() 83 | { 84 | RAPIDJSON_ASSERT(false); 85 | return nullptr; 86 | } 87 | 88 | size_t PutEnd(char*) 89 | { 90 | RAPIDJSON_ASSERT(false); 91 | return 0; 92 | } 93 | 94 | private: 95 | BasicOStreamWrapper(const BasicOStreamWrapper&); 96 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); 97 | 98 | StreamType& stream_; 99 | }; 100 | 101 | typedef BasicOStreamWrapper OStreamWrapper; 102 | typedef BasicOStreamWrapper WOStreamWrapper; 103 | 104 | #ifdef __clang__ 105 | RAPIDJSON_DIAG_POP 106 | #endif 107 | 108 | RAPIDJSON_NAMESPACE_END 109 | 110 | #endif // RAPIDJSON_OSTREAMWRAPPER_H_ 111 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/memorystream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYSTREAM_H_ 16 | #define RAPIDJSON_MEMORYSTREAM_H_ 17 | 18 | #include "stream.h" 19 | 20 | #ifdef __clang__ 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(unreachable - code) 23 | RAPIDJSON_DIAG_OFF(missing - noreturn) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | //! Represents an in-memory input byte stream. 28 | /*! 29 | This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. 30 | 31 | It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. 32 | 33 | Differences between MemoryStream and StringStream: 34 | 1. StringStream has encoding but MemoryStream is a byte stream. 35 | 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. 36 | 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). 37 | \note implements Stream concept 38 | */ 39 | struct MemoryStream 40 | { 41 | typedef char Ch; // byte 42 | 43 | MemoryStream(const Ch* src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) 44 | { 45 | } 46 | 47 | Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } 48 | Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } 49 | size_t Tell() const { return static_cast(src_ - begin_); } 50 | 51 | Ch* PutBegin() 52 | { 53 | RAPIDJSON_ASSERT(false); 54 | return nullptr; 55 | } 56 | 57 | void Put(Ch) 58 | { 59 | RAPIDJSON_ASSERT(false); 60 | } 61 | 62 | void Flush() 63 | { 64 | RAPIDJSON_ASSERT(false); 65 | } 66 | 67 | size_t PutEnd(Ch*) 68 | { 69 | RAPIDJSON_ASSERT(false); 70 | return 0; 71 | } 72 | 73 | // For encoding detection only. 74 | const Ch* Peek4() const 75 | { 76 | return Tell() + 4 <= size_ ? src_ : nullptr; 77 | } 78 | 79 | const Ch* src_; //!< Current read position. 80 | const Ch* begin_; //!< Original head of the string. 81 | const Ch* end_; //!< End of stream. 82 | size_t size_; //!< Size of the stream. 83 | }; 84 | 85 | RAPIDJSON_NAMESPACE_END 86 | 87 | #ifdef __clang__ 88 | RAPIDJSON_DIAG_POP 89 | #endif 90 | 91 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 92 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/discord_rpc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // clang-format off 5 | 6 | #if defined(DISCORD_DYNAMIC_LIB) 7 | # if defined(_WIN32) 8 | # if defined(DISCORD_BUILDING_SDK) 9 | # define DISCORD_EXPORT __declspec(dllexport) 10 | # else 11 | # define DISCORD_EXPORT __declspec(dllimport) 12 | # endif 13 | # else 14 | # define DISCORD_EXPORT __attribute__((visibility("default"))) 15 | # endif 16 | #else 17 | # define DISCORD_EXPORT 18 | #endif 19 | 20 | // clang-format on 21 | 22 | #ifdef __cplusplus 23 | extern "C" 24 | { 25 | #endif 26 | 27 | typedef struct DiscordRichPresence 28 | { 29 | const char* state; /* max 128 bytes */ 30 | const char* details; /* max 128 bytes */ 31 | int64_t startTimestamp; 32 | int64_t endTimestamp; 33 | const char* largeImageKey; /* max 32 bytes */ 34 | const char* largeImageText; /* max 128 bytes */ 35 | const char* smallImageKey; /* max 32 bytes */ 36 | const char* smallImageText; /* max 128 bytes */ 37 | const char* partyId; /* max 128 bytes */ 38 | int partySize; 39 | int partyMax; 40 | int partyPrivacy; 41 | const char* matchSecret; /* max 128 bytes */ 42 | const char* joinSecret; /* max 128 bytes */ 43 | const char* spectateSecret; /* max 128 bytes */ 44 | int8_t instance; 45 | } DiscordRichPresence; 46 | 47 | typedef struct DiscordUser 48 | { 49 | const char* userId; 50 | const char* username; 51 | const char* discriminator; 52 | const char* avatar; 53 | } DiscordUser; 54 | 55 | typedef struct DiscordEventHandlers 56 | { 57 | void (*ready)(const DiscordUser* request); 58 | void (*disconnected)(int errorCode, const char* message); 59 | void (*errored)(int errorCode, const char* message); 60 | void (*joinGame)(const char* joinSecret); 61 | void (*spectateGame)(const char* spectateSecret); 62 | void (*joinRequest)(const DiscordUser* request); 63 | } DiscordEventHandlers; 64 | 65 | #define DISCORD_REPLY_NO 0 66 | #define DISCORD_REPLY_YES 1 67 | #define DISCORD_REPLY_IGNORE 2 68 | #define DISCORD_PARTY_PRIVATE 0 69 | #define DISCORD_PARTY_PUBLIC 1 70 | 71 | DISCORD_EXPORT void Discord_Initialize(const char* applicationId, 72 | DiscordEventHandlers* handlers, 73 | int autoRegister, 74 | const char* optionalSteamId); 75 | DISCORD_EXPORT void Discord_Shutdown(void); 76 | 77 | /* checks for incoming messages, dispatches callbacks */ 78 | DISCORD_EXPORT void Discord_RunCallbacks(void); 79 | 80 | /* If you disable the lib starting its own io thread, you'll need to call this from your own */ 81 | #ifdef DISCORD_DISABLE_IO_THREAD 82 | DISCORD_EXPORT void Discord_UpdateConnection(void); 83 | #endif 84 | 85 | DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence); 86 | DISCORD_EXPORT void Discord_ClearPresence(void); 87 | 88 | DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ 89 | int reply); 90 | 91 | DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* handlers); 92 | 93 | #ifdef __cplusplus 94 | } /* extern "C" */ 95 | #endif 96 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/JsonSerializerImpl.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "../JsonArray.hpp" 8 | #include "../JsonArraySubscript.hpp" 9 | #include "../JsonObject.hpp" 10 | #include "../JsonObjectSubscript.hpp" 11 | #include "../JsonVariant.hpp" 12 | #include "JsonSerializer.hpp" 13 | 14 | template 15 | inline void ArduinoJson::Internals::JsonSerializer::serialize( 16 | const JsonArray& array, Writer& writer) { 17 | writer.beginArray(); 18 | 19 | JsonArray::const_iterator it = array.begin(); 20 | while (it != array.end()) { 21 | serialize(*it, writer); 22 | 23 | ++it; 24 | if (it == array.end()) break; 25 | 26 | writer.writeComma(); 27 | } 28 | 29 | writer.endArray(); 30 | } 31 | 32 | template 33 | inline void ArduinoJson::Internals::JsonSerializer::serialize( 34 | const JsonArraySubscript& arraySubscript, Writer& writer) { 35 | serialize(arraySubscript.as(), writer); 36 | } 37 | 38 | template 39 | inline void ArduinoJson::Internals::JsonSerializer::serialize( 40 | const JsonObject& object, Writer& writer) { 41 | writer.beginObject(); 42 | 43 | JsonObject::const_iterator it = object.begin(); 44 | while (it != object.end()) { 45 | writer.writeString(it->key); 46 | writer.writeColon(); 47 | serialize(it->value, writer); 48 | 49 | ++it; 50 | if (it == object.end()) break; 51 | 52 | writer.writeComma(); 53 | } 54 | 55 | writer.endObject(); 56 | } 57 | 58 | template 59 | template 60 | inline void ArduinoJson::Internals::JsonSerializer::serialize( 61 | const JsonObjectSubscript& objectSubscript, Writer& writer) { 62 | serialize(objectSubscript.template as(), writer); 63 | } 64 | 65 | template 66 | inline void ArduinoJson::Internals::JsonSerializer::serialize( 67 | const JsonVariant& variant, Writer& writer) { 68 | switch (variant._type) { 69 | case JSON_FLOAT: 70 | writer.writeFloat(variant._content.asFloat); 71 | return; 72 | 73 | case JSON_ARRAY: 74 | serialize(*variant._content.asArray, writer); 75 | return; 76 | 77 | case JSON_OBJECT: 78 | serialize(*variant._content.asObject, writer); 79 | return; 80 | 81 | case JSON_STRING: 82 | writer.writeString(variant._content.asString); 83 | return; 84 | 85 | case JSON_UNPARSED: 86 | writer.writeRaw(variant._content.asString); 87 | return; 88 | 89 | case JSON_NEGATIVE_INTEGER: 90 | writer.writeRaw('-'); // Falls through. 91 | 92 | case JSON_POSITIVE_INTEGER: 93 | writer.writeInteger(variant._content.asInteger); 94 | return; 95 | 96 | case JSON_BOOLEAN: 97 | writer.writeBoolean(variant._content.asInteger != 0); 98 | return; 99 | 100 | default: // JSON_UNDEFINED 101 | return; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/Serialization/Prettyfier.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "IndentedPrint.hpp" 8 | 9 | namespace ArduinoJson { 10 | namespace Internals { 11 | 12 | // Converts a compact JSON string into an indented one. 13 | template 14 | class Prettyfier { 15 | public: 16 | explicit Prettyfier(IndentedPrint& p) : _sink(p) { 17 | _previousChar = 0; 18 | _inString = false; 19 | } 20 | 21 | size_t print(char c) { 22 | size_t n = _inString ? handleStringChar(c) : handleMarkupChar(c); 23 | _previousChar = c; 24 | return n; 25 | } 26 | 27 | size_t print(const char* s) { 28 | // TODO: optimize 29 | size_t n = 0; 30 | while (*s) n += print(*s++); 31 | return n; 32 | } 33 | 34 | private: 35 | Prettyfier& operator=(const Prettyfier&); // cannot be assigned 36 | 37 | bool inEmptyBlock() { 38 | return _previousChar == '{' || _previousChar == '['; 39 | } 40 | 41 | size_t handleStringChar(char c) { 42 | bool isQuote = c == '"' && _previousChar != '\\'; 43 | 44 | if (isQuote) _inString = false; 45 | 46 | return _sink.print(c); 47 | } 48 | 49 | size_t handleMarkupChar(char c) { 50 | switch (c) { 51 | case '{': 52 | case '[': 53 | return writeBlockOpen(c); 54 | 55 | case '}': 56 | case ']': 57 | return writeBlockClose(c); 58 | 59 | case ':': 60 | return writeColon(); 61 | 62 | case ',': 63 | return writeComma(); 64 | 65 | case '"': 66 | return writeQuoteOpen(); 67 | 68 | default: 69 | return writeNormalChar(c); 70 | } 71 | } 72 | 73 | size_t writeBlockClose(char c) { 74 | size_t n = 0; 75 | n += unindentIfNeeded(); 76 | n += _sink.print(c); 77 | return n; 78 | } 79 | 80 | size_t writeBlockOpen(char c) { 81 | size_t n = 0; 82 | n += indentIfNeeded(); 83 | n += _sink.print(c); 84 | return n; 85 | } 86 | 87 | size_t writeColon() { 88 | size_t n = 0; 89 | n += _sink.print(": "); 90 | return n; 91 | } 92 | 93 | size_t writeComma() { 94 | size_t n = 0; 95 | n += _sink.print(",\r\n"); 96 | return n; 97 | } 98 | 99 | size_t writeQuoteOpen() { 100 | _inString = true; 101 | size_t n = 0; 102 | n += indentIfNeeded(); 103 | n += _sink.print('"'); 104 | return n; 105 | } 106 | 107 | size_t writeNormalChar(char c) { 108 | size_t n = 0; 109 | n += indentIfNeeded(); 110 | n += _sink.print(c); 111 | return n; 112 | } 113 | 114 | size_t indentIfNeeded() { 115 | if (!inEmptyBlock()) return 0; 116 | 117 | _sink.indent(); 118 | return _sink.print("\r\n"); 119 | } 120 | 121 | size_t unindentIfNeeded() { 122 | if (inEmptyBlock()) return 0; 123 | 124 | _sink.unindent(); 125 | return _sink.print("\r\n"); 126 | } 127 | 128 | char _previousChar; 129 | IndentedPrint& _sink; 130 | bool _inString; 131 | }; 132 | } // namespace Internals 133 | } // namespace ArduinoJson 134 | -------------------------------------------------------------------------------- /Cranium/veh.cpp: -------------------------------------------------------------------------------- 1 | #include "framework.h" 2 | #include "veh.h" 3 | 4 | namespace VEH 5 | { 6 | bool IsSamePage(void* A, void* B) 7 | { 8 | MEMORY_BASIC_INFORMATION InfoA; 9 | if (!VirtualQuery(A, &InfoA, sizeof(InfoA))) 10 | { 11 | return true; 12 | } 13 | 14 | MEMORY_BASIC_INFORMATION InfoB; 15 | if (!VirtualQuery(B, &InfoB, sizeof(InfoB))) 16 | { 17 | return true; 18 | } 19 | 20 | return InfoA.BaseAddress == InfoB.BaseAddress; 21 | } 22 | 23 | struct HOOK_INFO 24 | { 25 | void* Original; 26 | void* Detour; 27 | 28 | HOOK_INFO(void* Original, void* Detour) : 29 | Original(Original), 30 | Detour(Detour) 31 | { 32 | } 33 | }; 34 | 35 | std::vector Hooks; 36 | std::vector HookProtections; 37 | HANDLE ExceptionHandler; 38 | 39 | LONG WINAPI Handler(EXCEPTION_POINTERS* Exception) 40 | { 41 | thread_local void* OriginalHook = nullptr; 42 | 43 | if (Exception->ExceptionRecord->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION) 44 | { 45 | auto Itr = std::find_if(Hooks.begin(), Hooks.end(), 46 | [Rip = Exception->ContextRecord->Rip](const HOOK_INFO& Hook) 47 | { 48 | return Hook.Original == (void*)Rip; 49 | }); 50 | if (Itr != Hooks.end()) 51 | { 52 | OriginalHook = Itr->Original; 53 | Exception->ContextRecord->Rip = (uintptr_t)Itr->Detour; 54 | } 55 | 56 | Exception->ContextRecord->EFlags |= 0x100; // SINGLE_STEP_FLAG 57 | 58 | return EXCEPTION_CONTINUE_EXECUTION; 59 | } 60 | else if (Exception->ExceptionRecord->ExceptionCode == STATUS_SINGLE_STEP) 61 | { 62 | for (auto& Hook : Hooks) 63 | { 64 | DWORD dwOldProtect; 65 | VirtualProtect(Hook.Original, 1, PAGE_EXECUTE_READ | PAGE_GUARD, 66 | &dwOldProtect); 67 | } 68 | 69 | return EXCEPTION_CONTINUE_EXECUTION; 70 | } 71 | 72 | return EXCEPTION_CONTINUE_SEARCH; 73 | } 74 | 75 | bool Init() 76 | { 77 | if (ExceptionHandler == nullptr) 78 | { 79 | ExceptionHandler = AddVectoredExceptionHandler(true, (PVECTORED_EXCEPTION_HANDLER)Handler); 80 | } 81 | return ExceptionHandler != nullptr; 82 | } 83 | 84 | bool AddHook(void* Target, void* Detour) 85 | { 86 | if (ExceptionHandler == nullptr) 87 | { 88 | return false; 89 | } 90 | if (IsSamePage(Target, Detour)) 91 | { 92 | return false; 93 | } 94 | if (!VirtualProtect(Target, 1, PAGE_EXECUTE_READ | PAGE_GUARD, &HookProtections.emplace_back())) 95 | { 96 | HookProtections.pop_back(); 97 | return false; 98 | } 99 | 100 | Hooks.emplace_back(Target, Detour); 101 | return true; 102 | } 103 | 104 | bool RemoveHook(void* Original) 105 | { 106 | auto Itr = std::find_if(Hooks.begin(), Hooks.end(), [Original](const HOOK_INFO& Hook) 107 | { 108 | return Hook.Original == Original; 109 | }); 110 | 111 | if (Itr == Hooks.end()) 112 | { 113 | return false; 114 | } 115 | 116 | const auto ProtItr = HookProtections.begin() + std::distance(Hooks.begin(), Itr); 117 | Hooks.erase(Itr); 118 | 119 | DWORD dwOldProtect; 120 | bool Ret = VirtualProtect(Original, 1, *ProtItr, &dwOldProtect); 121 | HookProtections.erase(ProtItr); 122 | 123 | return false; 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Chronite/includes/DiscordSDK/rapidjson/internal/ieee754.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_IEEE754_ 16 | #define RAPIDJSON_IEEE754_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal 22 | { 23 | class Double 24 | { 25 | public: 26 | Double() 27 | { 28 | } 29 | 30 | Double(double d) : d_(d) 31 | { 32 | } 33 | 34 | Double(uint64_t u) : u_(u) 35 | { 36 | } 37 | 38 | double Value() const { return d_; } 39 | uint64_t Uint64Value() const { return u_; } 40 | 41 | double NextPositiveDouble() const 42 | { 43 | RAPIDJSON_ASSERT(!Sign()); 44 | return Double(u_ + 1).Value(); 45 | } 46 | 47 | bool Sign() const { return (u_ & kSignMask) != 0; } 48 | uint64_t Significand() const { return u_ & kSignificandMask; } 49 | int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } 50 | 51 | bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } 52 | bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } 53 | bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } 54 | bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } 55 | bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } 56 | 57 | uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } 58 | int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } 59 | uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } 60 | 61 | static int EffectiveSignificandSize(int order) 62 | { 63 | if (order >= -1021) return 53; 64 | if (order <= -1074) return 0; 65 | return order + 1074; 66 | } 67 | 68 | private: 69 | static const int kSignificandSize = 52; 70 | static const int kExponentBias = 0x3FF; 71 | static const int kDenormalExponent = 1 - kExponentBias; 72 | static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); 73 | static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); 74 | static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); 75 | static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); 76 | 77 | union 78 | { 79 | double d_; 80 | uint64_t u_; 81 | }; 82 | }; 83 | } // namespace internal 84 | RAPIDJSON_NAMESPACE_END 85 | 86 | #endif // RAPIDJSON_IEEE754_ 87 | -------------------------------------------------------------------------------- /Cranium/curlver.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_CURLVER_H 2 | #define __CURL_CURLVER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* This header file contains nothing but libcurl version info, generated by 26 | a script at release-time. This was made its own header file in 7.11.2 */ 27 | 28 | /* This is the global package copyright */ 29 | #define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, ." 30 | 31 | /* This is the version number of the libcurl package from which this header 32 | file origins: */ 33 | #define LIBCURL_VERSION "7.55.1" 34 | 35 | /* The numeric version number is also available "in parts" by using these 36 | defines: */ 37 | #define LIBCURL_VERSION_MAJOR 7 38 | #define LIBCURL_VERSION_MINOR 55 39 | #define LIBCURL_VERSION_PATCH 1 40 | 41 | /* This is the numeric version of the libcurl version number, meant for easier 42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will 43 | always follow this syntax: 44 | 45 | 0xXXYYZZ 46 | 47 | Where XX, YY and ZZ are the main version, release and patch numbers in 48 | hexadecimal (using 8 bits each). All three numbers are always represented 49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7 50 | appears as "0x090b07". 51 | 52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number, 53 | and it is always a greater number in a more recent release. It makes 54 | comparisons with greater than and less than work. 55 | 56 | Note: This define is the full hex number and _does not_ use the 57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it 58 | and needs it to contain the full number. 59 | */ 60 | #define LIBCURL_VERSION_NUM 0x073701 61 | 62 | /* 63 | * This is the date and time when the full source package was created. The 64 | * timestamp is not stored in git, as the timestamp is properly set in the 65 | * tarballs by the maketgz script. 66 | * 67 | * The format of the date follows this template: 68 | * 69 | * "2007-11-23" 70 | */ 71 | #define LIBCURL_TIMESTAMP "2017-08-14" 72 | 73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) 74 | #define CURL_AT_LEAST_VERSION(x,y,z) \ 75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) 76 | 77 | #endif /* __CURL_CURLVER_H */ 78 | -------------------------------------------------------------------------------- /Cranium/cryptolens/imports/ArduinoJson5/ArduinoJson/JsonVariantSubscripts.hpp: -------------------------------------------------------------------------------- 1 | // ArduinoJson - arduinojson.org 2 | // Copyright Benoit Blanchon 2014-2019 3 | // MIT License 4 | 5 | #pragma once 6 | 7 | #include "Data/JsonVariantAs.hpp" 8 | #include "Polyfills/attributes.hpp" 9 | #include "StringTraits/StringTraits.hpp" 10 | #include "TypeTraits/EnableIf.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // Forward declarations. 16 | class JsonArraySubscript; 17 | template 18 | class JsonObjectSubscript; 19 | 20 | template 21 | class JsonVariantSubscripts { 22 | public: 23 | // Mimics an array or an object. 24 | // Returns the size of the array or object if the variant has that type. 25 | // Returns 0 if the variant is neither an array nor an object 26 | size_t size() const { 27 | return impl()->template as().size() + 28 | impl()->template as().size(); 29 | } 30 | 31 | // Mimics an array. 32 | // Returns the element at specified index if the variant is an array. 33 | // Returns JsonVariant::invalid() if the variant is not an array. 34 | FORCE_INLINE const JsonArraySubscript operator[](size_t index) const; 35 | FORCE_INLINE JsonArraySubscript operator[](size_t index); 36 | 37 | // Mimics an object. 38 | // Returns the value associated with the specified key if the variant is 39 | // an object. 40 | // Return JsonVariant::invalid() if the variant is not an object. 41 | // 42 | // const JsonObjectSubscript operator[](TKey) const; 43 | // TKey = const std::string&, const String& 44 | template 45 | FORCE_INLINE 46 | typename EnableIf::has_equals, 47 | const JsonObjectSubscript >::type 48 | operator[](const TString &key) const { 49 | return impl()->template as()[key]; 50 | } 51 | // 52 | // const JsonObjectSubscript operator[](TKey) const; 53 | // TKey = const std::string&, const String& 54 | template 55 | FORCE_INLINE typename EnableIf::has_equals, 56 | JsonObjectSubscript >::type 57 | operator[](const TString &key) { 58 | return impl()->template as()[key]; 59 | } 60 | // 61 | // JsonObjectSubscript operator[](TKey); 62 | // TKey = const char*, const char[N], const FlashStringHelper* 63 | template 64 | FORCE_INLINE typename EnableIf::has_equals, 65 | JsonObjectSubscript >::type 66 | operator[](const TString *key) { 67 | return impl()->template as()[key]; 68 | } 69 | // 70 | // JsonObjectSubscript operator[](TKey); 71 | // TKey = const char*, const char[N], const FlashStringHelper* 72 | template 73 | FORCE_INLINE 74 | typename EnableIf::has_equals, 75 | const JsonObjectSubscript >::type 76 | operator[](const TString *key) const { 77 | return impl()->template as()[key]; 78 | } 79 | 80 | private: 81 | const TImpl *impl() const { 82 | return static_cast(this); 83 | } 84 | }; 85 | } // namespace Internals 86 | } // namespace ArduinoJson 87 | -------------------------------------------------------------------------------- /Cranium/cryptolens/RequestHandler_WinHTTP.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "imports/windows/Windows.h" 6 | #include "imports/windows/winhttp.h" 7 | 8 | #include "api.hpp" 9 | #include "basic_Error.hpp" 10 | #include "RequestHandler_v20190401_to_v20180502.hpp" 11 | 12 | namespace cryptolens_io { 13 | 14 | namespace v20190401 { 15 | 16 | namespace errors { 17 | 18 | namespace RequestHandler_WinHTTP { 19 | 20 | int constexpr WINHTTP_OPEN_FAILED = 1; 21 | int constexpr WINHTTP_CONNECT_FAILED = 2; 22 | int constexpr WINHTTP_OPEN_REQUEST_FAILED = 3; 23 | int constexpr WINHTTP_SEND_REQUEST_FAILED = 4; 24 | int constexpr WINHTTP_RECIEVE_RESPONSE_FAILED = 5; 25 | int constexpr WINHTTP_QUERY_DATA_AVAILABLE_FAILED = 6; 26 | int constexpr WINHTTP_READ_DATA_FAILED = 7; 27 | int constexpr WINHTTP_POSTFIELDS_TOO_LARGE = 8; 28 | int constexpr MULTIBYTETOWIDE_ENDPOINT = 9; 29 | int constexpr MULTIBYTETOWIDE_HOST = 10; 30 | 31 | } // namespace RequestHandler_WinHTTP 32 | 33 | } // namespace errors 34 | 35 | class RequestHandler_WinHTTP_PostBuilder { 36 | public: 37 | RequestHandler_WinHTTP_PostBuilder(char const* host, char const* endpoint); 38 | 39 | RequestHandler_WinHTTP_PostBuilder & 40 | add_argument(basic_Error & e, char const* key, char const* value); 41 | 42 | std::string 43 | make(basic_Error & e); 44 | 45 | private: 46 | char separator_; 47 | std::string postfields_; 48 | char const* host_; 49 | char const* endpoint_; 50 | }; 51 | 52 | /** 53 | * A request handler that is responsible for making the HTTPS requests 54 | * to the Cryptolens Web API. This request handler is build 55 | * around the Curl library, which is responsible for making the 56 | * actual HTTPS request. 57 | * 58 | * No particular initialization is needed in order to use this 59 | * RequestHandler. 60 | */ 61 | class RequestHandler_WinHTTP 62 | { 63 | public: 64 | #ifndef CRYPTOLENS_20190701_ALLOW_IMPLICIT_CONSTRUCTORS 65 | explicit 66 | #endif 67 | RequestHandler_WinHTTP(basic_Error & e); 68 | #ifndef CRYPTOLENS_ENABLE_DANGEROUS_COPY_MOVE_CONSTRUCTOR 69 | RequestHandler_WinHTTP(RequestHandler_WinHTTP const&) = delete; 70 | RequestHandler_WinHTTP(RequestHandler_WinHTTP &&) = delete; 71 | void operator=(RequestHandler_WinHTTP const&) = delete; 72 | void operator=(RequestHandler_WinHTTP &&) = delete; 73 | #endif 74 | ~RequestHandler_WinHTTP(); 75 | 76 | using PostBuilder = RequestHandler_WinHTTP_PostBuilder; 77 | 78 | PostBuilder 79 | post_request(basic_Error& e, char const* host, char const* endpoint); 80 | }; 81 | 82 | } // namespace v20190401 83 | 84 | namespace latest { 85 | 86 | namespace errors { 87 | 88 | namespace RequestHandler_WinHTTP = ::cryptolens_io::v20190401::errors::RequestHandler_WinHTTP; 89 | 90 | } // namespace errors 91 | 92 | using RequestHandler_WinHTTP = ::cryptolens_io::v20190401::RequestHandler_WinHTTP; 93 | 94 | } // namespace latest 95 | 96 | namespace v20180502 { 97 | 98 | namespace errors { 99 | 100 | namespace RequestHandler_WinHTTP = ::cryptolens_io::v20190401::errors::RequestHandler_WinHTTP; 101 | 102 | } // namespace errors 103 | 104 | using RequestHandler_WinHTTP = ::cryptolens_io::internal::RequestHandler_v20190401_to_v20180502<::cryptolens_io::v20190401::RequestHandler_WinHTTP>; 105 | 106 | } // namespace v20180502 107 | 108 | } // namespace cryptolens_io 109 | -------------------------------------------------------------------------------- /Cranium/cryptolens/LicenseKey.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "imports/std/optional" 7 | 8 | #include "basic_Error.hpp" 9 | #include "ActivationData.hpp" 10 | #include "Customer.hpp" 11 | #include "DataObject.hpp" 12 | #include "LicenseKeyInformation.hpp" 13 | #include "RawLicenseKey.hpp" 14 | 15 | namespace cryptolens_io { 16 | 17 | namespace v20190401 { 18 | 19 | class LicenseKeyChecker; 20 | 21 | /** 22 | * This immutable class represents a license key. 23 | * 24 | * The class is constructed using the static factory make(). 25 | * 26 | * The check() method can be used to create a LicenseKeyChecker, 27 | * which can be used to check properties of a license key in a 28 | * convenient fashion. I.e. 29 | * 30 | * if (key.check().has_feature(1).has_not_feature(2)) { 31 | * DO_SOMETHING(); 32 | * } 33 | */ 34 | class LicenseKey { 35 | private: 36 | LicenseKeyInformation info_; 37 | RawLicenseKey raw_; 38 | public: 39 | LicenseKey(LicenseKeyInformation && license_key_information, RawLicenseKey && raw_license_key); 40 | 41 | // TODO: Add factory taking r-value references? 42 | // This would mostly be used internally in the library since in most cases 43 | // the handle class will be responsible for constructing the object. 44 | //static optional make(basic_Error & e, RawLicenseKey const& raw_license_key); 45 | //static optional make(basic_Error & e, optional const& raw_license_key); 46 | //static optional make_unsafe(basic_Error & e, std::string const& license_key); 47 | 48 | std::string to_string() const; 49 | 50 | LicenseKeyInformation & get_license_key_information() { return info_; } 51 | LicenseKeyInformation const& get_license_key_information() const { return info_; } 52 | 53 | LicenseKeyChecker check() const; 54 | 55 | int get_product_id() const; 56 | std::uint64_t get_created() const; 57 | std::uint64_t get_expires() const; 58 | int get_period() const; 59 | bool get_block() const; 60 | bool get_trial_activation() const; 61 | std::uint64_t get_sign_date() const; 62 | bool get_f1() const; 63 | bool get_f2() const; 64 | bool get_f3() const; 65 | bool get_f4() const; 66 | bool get_f5() const; 67 | bool get_f6() const; 68 | bool get_f7() const; 69 | bool get_f8() const; 70 | 71 | optional const& get_id() const; 72 | optional const& get_key() const; 73 | optional const& get_notes() const; 74 | optional const& get_global_id() const; 75 | optional const& get_customer() const; 76 | optional> const& get_activated_machines() const; 77 | optional const& get_maxnoofmachines() const; 78 | optional const& get_allowed_machines() const; 79 | optional> const& get_data_objects() const; 80 | }; 81 | 82 | } // namespace v20190401 83 | 84 | namespace v20180502 { 85 | 86 | using LicenseKey = ::cryptolens_io::v20190401::LicenseKey; 87 | 88 | } // namespace v20180502 89 | 90 | namespace latest { 91 | 92 | using LicenseKey = ::cryptolens_io::v20190401::LicenseKey; 93 | 94 | } // namespace latest 95 | 96 | } // namespace cryptolens_io 97 | --------------------------------------------------------------------------------