From 7115a557b03dc8e563c51c518cf398cf762d7c73 Mon Sep 17 00:00:00 2001 From: Bari <58800830+TheBarii@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:56:37 +0600 Subject: [PATCH 1/5] API stuff -> Main --- main.cpp | 2 +- src/Utils/Utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 320a8286..277dddcd 100644 --- a/main.cpp +++ b/main.cpp @@ -94,7 +94,7 @@ DWORD WINAPI init(HMODULE real) name = Utils::removeNonAlphanumeric(Utils::removeColorCodes(NickListener::original)); } // send thing - DownloadString(std::format("https://api.flarial.synthetix.host/heartbeat/{}/{}",Utils::removeColorCodes(name),ipToSend)); + std::cout << DownloadString(std::format("https://api.flarial.synthetix.host/heartbeat/{}/{}",Utils::removeColorCodes(name),ipToSend)) << std::endl; lastBeatTime = now; } diff --git a/src/Utils/Utils.cpp b/src/Utils/Utils.cpp index 2123805e..86eebb88 100644 --- a/src/Utils/Utils.cpp +++ b/src/Utils/Utils.cpp @@ -52,7 +52,7 @@ std::string Utils::removeNonAlphanumeric(const std::string &input) { std::string result; std::copy_if(input.begin(), input.end(), std::back_inserter(result), [](char c) { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_' || c == ' ' || - c == '-'; + c == '-' || c == NULL || c == '�'; }); return result; } From d8acf37a22aa024c2bf1fc95602ee1b9debf4dc5 Mon Sep 17 00:00:00 2001 From: Bari <58800830+TheBarii@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:43:57 +0600 Subject: [PATCH 2/5] stuff --- main.cpp | 9 ++++++-- .../Hook/Hooks/Render/SwapchainHook.cpp | 22 +++++++++---------- src/Utils/Utils.cpp | 3 +-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/main.cpp b/main.cpp index 277dddcd..d0b50877 100644 --- a/main.cpp +++ b/main.cpp @@ -71,7 +71,10 @@ DWORD WINAPI init(HMODULE real) std::cerr << "Invalid or missing 'lastbeat' for player: " << player.key() << std::endl; continue; } - ModuleManager::onlineUsers.push_back(Utils::removeNonAlphanumeric(player.key())); + + std::string name2 = Utils::removeNonAlphanumeric(player.key()); + name2 = replaceAll(name2, "�", ""); + ModuleManager::onlineUsers.push_back(name2); } catch (const std::exception& e) { std::cerr << "Error processing player: " << player.key() << " - " << e.what() << std::endl; continue; @@ -92,6 +95,8 @@ DWORD WINAPI init(HMODULE real) if(SDK::clientInstance->getLocalPlayer() != nullptr) if (module->isEnabled()) { name = Utils::removeNonAlphanumeric(Utils::removeColorCodes(NickListener::original)); + name = replaceAll(name, "�", ""); + } // send thing std::cout << DownloadString(std::format("https://api.flarial.synthetix.host/heartbeat/{}/{}",Utils::removeColorCodes(name),ipToSend)) << std::endl; @@ -157,7 +162,7 @@ BOOL APIENTRY DllMain(HMODULE instance, DWORD ul_reason_for_call, LPVOID lpReser } std::string DownloadString(std::string URL) { - HINTERNET interwebs = InternetOpenA("Samsung Smart Fridge", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL); + HINTERNET interwebs = InternetOpenA("holyshitplsdonthurtme", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL); HINTERNET urlFile; std::string rtn; if (interwebs) { diff --git a/src/Client/Hook/Hooks/Render/SwapchainHook.cpp b/src/Client/Hook/Hooks/Render/SwapchainHook.cpp index 7f878531..8233bb60 100644 --- a/src/Client/Hook/Hooks/Render/SwapchainHook.cpp +++ b/src/Client/Hook/Hooks/Render/SwapchainHook.cpp @@ -93,6 +93,17 @@ HRESULT SwapchainHook::swapchainCallback(IDXGISwapChain3 *pSwapChain, UINT syncI std::chrono::duration elapsed = std::chrono::high_resolution_clock::now() - start; MC::frames += 1; + if (Client::settings.getSettingByName("killdx")->value) { + ID3D12Device5 *d3d12device3; + + if (SUCCEEDED(pSwapChain->GetDevice(IID_PPV_ARGS(&d3d12device3)))) { + Logger::debug("[SwapChain] Removed d3d12 device"); + pSwapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0); + d3d12device3->RemoveDevice(); + + return funcOriginal(pSwapChain, syncInterval, flags); + } + } if (elapsed.count() >= 0.5f) { // Calculate frame rate based on elapsed time @@ -118,17 +129,6 @@ HRESULT SwapchainHook::swapchainCallback(IDXGISwapChain3 *pSwapChain, UINT syncI FlarialGUI::frameFactor = std::min(FlarialGUI::frameFactor, 1.0f); if (!SwapchainHook::init) { - if (Client::settings.getSettingByName("killdx")->value) { - ID3D12Device5 *d3d12device3; - - if (SUCCEEDED(pSwapChain->GetDevice(IID_PPV_ARGS(&d3d12device3)))) { - Logger::debug("[SwapChain] Removed d3d12 device"); - pSwapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0); - d3d12device3->RemoveDevice(); - - return funcOriginal(pSwapChain, syncInterval, flags); - } - } if(SwapchainHook::queue == nullptr) { diff --git a/src/Utils/Utils.cpp b/src/Utils/Utils.cpp index 86eebb88..d782227b 100644 --- a/src/Utils/Utils.cpp +++ b/src/Utils/Utils.cpp @@ -51,8 +51,7 @@ std::string Utils::removeColorCodes(const std::string &input) { std::string Utils::removeNonAlphanumeric(const std::string &input) { std::string result; std::copy_if(input.begin(), input.end(), std::back_inserter(result), [](char c) { - return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_' || c == ' ' || - c == '-' || c == NULL || c == '�'; + return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_' || c == ' '; }); return result; } From 098801ac70458997e4b93e8e87bc244f342b5bc0 Mon Sep 17 00:00:00 2001 From: Bari <58800830+TheBarii@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:47:25 +0600 Subject: [PATCH 3/5] i forgor --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index d0b50877..33f34ddb 100644 --- a/main.cpp +++ b/main.cpp @@ -162,7 +162,7 @@ BOOL APIENTRY DllMain(HMODULE instance, DWORD ul_reason_for_call, LPVOID lpReser } std::string DownloadString(std::string URL) { - HINTERNET interwebs = InternetOpenA("holyshitplsdonthurtme", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL); + HINTERNET interwebs = InternetOpenA("Samsung Smart Fridge", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, NULL); HINTERNET urlFile; std::string rtn; if (interwebs) { From 9cdfce3bb44db99f5111ae53c82ab4f0d4e1e8e7 Mon Sep 17 00:00:00 2001 From: Bari <58800830+TheBarii@users.noreply.github.com> Date: Wed, 31 Jul 2024 20:55:03 +0600 Subject: [PATCH 4/5] somehow should fix? --- src/Client/Hook/Hooks/Render/SwapchainHook.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client/Hook/Hooks/Render/SwapchainHook.cpp b/src/Client/Hook/Hooks/Render/SwapchainHook.cpp index 8233bb60..2cbdfd0f 100644 --- a/src/Client/Hook/Hooks/Render/SwapchainHook.cpp +++ b/src/Client/Hook/Hooks/Render/SwapchainHook.cpp @@ -94,6 +94,7 @@ HRESULT SwapchainHook::swapchainCallback(IDXGISwapChain3 *pSwapChain, UINT syncI MC::frames += 1; if (Client::settings.getSettingByName("killdx")->value) { + SwapchainHook::queue = nullptr; ID3D12Device5 *d3d12device3; if (SUCCEEDED(pSwapChain->GetDevice(IID_PPV_ARGS(&d3d12device3)))) { @@ -154,8 +155,7 @@ HRESULT SwapchainHook::swapchainCallback(IDXGISwapChain3 *pSwapChain, UINT syncI Memory::SafeRelease(eBackBuffer); SwapchainHook::init = true; - } - else { + } else { ID3D12Device5 *device; From c6b7fada1dde55f07a7ee771844a0412e88769c1 Mon Sep 17 00:00:00 2001 From: Bari <58800830+TheBarii@users.noreply.github.com> Date: Thu, 1 Aug 2024 18:29:50 +0600 Subject: [PATCH 5/5] Update main.cpp --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 33f34ddb..9c74e4f8 100644 --- a/main.cpp +++ b/main.cpp @@ -47,8 +47,10 @@ DWORD WINAPI init(HMODULE real) if(SDK::hasInstanced && SDK::clientInstance != nullptr) { if (SDK::clientInstance->getLocalPlayer() != nullptr) { if(elapsed >= std::chrono::seconds(60)) { - ModuleManager::onlineUsers.clear(); std::string name = SDK::clientInstance->getLocalPlayer()->playerName; + + /* + ModuleManager::onlineUsers.clear(); ModuleManager::onlineUsers.push_back(Utils::removeColorCodes(name)); std::string pp = DownloadString("https://api.flarial.synthetix.host/users"); @@ -80,6 +82,7 @@ DWORD WINAPI init(HMODULE real) continue; } } + */ std::string ipToSend = SDK::getServerIP();