Skip to content

Commit

Permalink
feat: add season pass module & theme setting in client category
Browse files Browse the repository at this point in the history
  • Loading branch information
R-unic committed Apr 14, 2024
1 parent e028439 commit 1405ef5
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 42 deletions.
126 changes: 97 additions & 29 deletions GirlKisser/Cheat/Gui/imgui_hooker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
#include <vector>
#include <algorithm>
#include <filesystem>
#include <thread>
#include <map>
#include <MinHook.h>

#include "imgui_hooker.h"
#include "../Logger/Logger.h"
#include "../Hooks/Hooks.h"
#include <thread>

#pragma comment( lib, "d3d11.lib" )

Expand All @@ -24,11 +26,13 @@ void CleanupRenderTarget();
WPARAM MapLeftRightKeys(const MSG& msg);

std::stringstream full_title;
std::string combo_file = "default";
static char config_file[32] = "default";
static char offsets_rhd[32] = "";
static char return_rhd[32] = "";
static LPVOID last_rhd = nullptr;
static ImU32 color_title = ImGui::ColorConvertFloat4ToU32({0.875f, 0.12f, 0.9f, 1.00f});
static ImU32 color_bg = ImGui::ColorConvertFloat4ToU32({0.00f, 0.00f, 0.00f, 0.75f});
std::string combo_file = "default";
std::string current_font = "C:/Windows/Fonts/calibril.ttf";
static bool boundless_value_setting = false;

void InitModules(const std::vector<GKModule>& init_mods);
Expand All @@ -44,17 +48,44 @@ struct Theme
ImVec4 highlight;
};

std::string current_font = "C:/Windows/Fonts/calibril.ttf";
std::string current_theme = "GirlKisser";

std::vector<std::string> get_native_font_list(bool ttf_only)
{
std::vector<std::string> paths;
const std::string path = "C:/Windows/Fonts";
for (const auto& entry : std::filesystem::directory_iterator(path))
{
const std::filesystem::path& p = entry.path();
if (ttf_only && !p.extension().string().contains("ttf")) continue;
if (p.extension().string().contains("wing")) continue;
// std::string str_path = p.generic_string();
// str_path = str_path.replace(str_path.begin(), str_path.end(), "/", "\\");
paths.push_back(p.generic_string());
}
return paths;
}

auto fonts = get_native_font_list(true);
std::vector<std::string> themes = {"GirlKisser"};

// https://github.com/ocornut/imgui/issues/707
void init_style()
{
Logger::log_info("Initialized GUI style");
auto style = &ImGui::GetStyle();
auto colors = style->Colors;
auto theme = Theme {
ImVec4(0.00f, 0.00f, 0.00f, 0.00f),
ImVec4(0.49f, 0.145f, 0.439f, 1.00f),
ImVec4(0.875f, 0.12f, 0.9f, 1.00f),
ImVec4(0.82f, 0.35f, 0.75f, 1.00f),
};
Theme theme;
if (current_theme == "GirlKisser")
{
theme = {
ImVec4(0.00f, 0.00f, 0.00f, 0.00f),
ImVec4(0.49f, 0.145f, 0.439f, 1.00f),
ImVec4(0.875f, 0.12f, 0.9f, 1.00f),
ImVec4(0.82f, 0.35f, 0.75f, 1.00f)
};
}

colors[ImGuiCol_Text] = ImVec4(0.92f, 0.92f, 0.92f, 1.00f);
colors[ImGuiCol_TextDisabled] = ImVec4(0.44f, 0.44f, 0.44f, 1.00f);
Expand Down Expand Up @@ -160,6 +191,41 @@ void GetDesktopResolution(int& horizontal, int& vertical)
vertical = desktop.bottom;
}

inline int(__stdcall* rhd_original)(void* arg);
inline int __stdcall rhd(void* arg)
{
Logger::log_debug("Dev Hook Called!");
return std::stoi(return_rhd);
}

void try_runtime_hook()
{
if (!last_rhd == 0)
{
Logger::log_debug("Clearing Last Hook");
MH_DisableHook(last_rhd);
MH_RemoveHook(last_rhd);
}
uint64_t offset;
std::stringstream stringstream;
stringstream << std::hex << offsets_rhd;
stringstream >> offset;
std::stringstream s2;
if (offset == 0)
{
Logger::log_debug("Not Creating Null Hook!");
return;
}
s2 << "Creating Hook | Offset: " << offset << " | Return: " << return_rhd;
Logger::log_debug(s2.str());
last_rhd = (LPVOID*)offset;
if (MH_CreateHook((LPVOID*)(Hooks::GameAssembly + offset), &rhd, (LPVOID*)&rhd_original) == MH_OK)
{
Logger::log_debug("Hook Created");
MH_EnableHook((LPVOID*)(Hooks::GameAssembly + offset));
}
}

std::wstring get_executing_directory()
{
TCHAR buffer[MAX_PATH] = { 0 };
Expand Down Expand Up @@ -396,7 +462,7 @@ float GKImGuiHooker::scale_factor = 1;
std::string GKImGuiHooker::c_Title = "GirlKisser";
std::string GKImGuiHooker::c_Build = "v1.3-BETA";
std::string GKImGuiHooker::c_Message = "Tits <3";
std::vector<std::string> fonts = native_font_list(true);


void GKImGuiHooker::setup_imgui_hwnd(HWND handle, ID3D11Device * device, ID3D11DeviceContext * device_context)
{
Expand Down Expand Up @@ -537,28 +603,30 @@ void GKImGuiHooker::start(ID3D11RenderTargetView* g_mainRenderTargetView, ID3D11
if (selected) ImGui::SetItemDefaultFocus();
}

if (ImGui::BeginCombo("Theme", current_theme.c_str()))
ImGui::EndCombo();
}

if (ImGui::BeginCombo("Theme", current_theme.c_str()))
{
for (std::string::size_type i = 0; i < themes.size(); i++)
{
for (std::string::size_type i = 0; i < fonts.size(); i++)
const bool selected = current_theme == themes[i];

if (ImGui::Selectable(themes[i].c_str(), selected))
{
const bool selected = current_theme == themes[i];

if (ImGui::Selectable(themes[i].c_str(), selected))
{
current_theme = themes[i];
ImGuiIO& io = ImGui::GetIO(); (void)io;


// force invalidation and new frames
ImGui_ImplDX11_InvalidateDeviceObjects();
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
Logger::log_info("Changed client theme to " + current_theme);
return;
}
if (selected) ImGui::SetItemDefaultFocus();
if (selected) continue;
current_theme = themes[i];

// force invalidation, new frames, and style change
// init_style();
ImGui_ImplDX11_InvalidateDeviceObjects();
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
Logger::log_info("Changed client theme to " + current_theme);
return;
}
if (selected) ImGui::SetItemDefaultFocus();
}

ImGui::EndCombo();
Expand Down
25 changes: 20 additions & 5 deletions GirlKisser/Cheat/Hooks/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@
#include "../Module/Impl/ModuleESP.h"
#include "../Module/Impl/ModuleHeadshotMultiplier.h"
#include "../Module/Impl/ModulePriceModifier.h"
#include "../Module/Impl/ModuleSeasonPass.h"
#include "../Module/Impl/ModuleRewardsMultiplier.h"
#include "../Module/Impl/ModuleExtraDisplay.h"

class ModuleSpeed;
uintptr_t GameBase;
uintptr_t GameAssembly;
uintptr_t UnityPlayer;
uintptr_t Hooks::GameBase;
uintptr_t Hooks::GameAssembly;
uintptr_t Hooks::UnityPlayer;

ModuleRapidFire* rapid_fire_module;
ModuleSpeed* speed_module;
Expand All @@ -52,6 +53,7 @@ ModulePriceModifier* lottery_price_module;
ModuleBase* fast_levels_module;
ModuleRewardsMultiplier* rewards_multiplier_module;
ModuleESP* esp_module;
ModuleSeasonPass* season_pass_module;
std::list<ModuleBase*> player_move_c_modules = { };
std::list<ModuleBase*> player_fps_controller_sharp_modules = { };
std::list<ModuleBase*> weapon_sounds_modules = { };
Expand Down Expand Up @@ -318,12 +320,23 @@ inline bool __stdcall double_rewards(void* arg)
return double_rewards_original(arg);
}

inline bool(__stdcall* season_pass_premium_original)(void* arg);
inline bool __stdcall season_pass_premium(void* arg)
{
if (((ModuleBase*)season_pass_module)->is_enabled() && season_pass_module->spoof_premium())
{
return true;
}

return season_pass_premium_original(arg);
}

// Static
void hook_function(uintptr_t offset, LPVOID detour, void* original)
{
if (MH_CreateHook((LPVOID*)(GameAssembly + offset), detour, (LPVOID*)original) == MH_OK)
if (MH_CreateHook((LPVOID*)(Hooks::GameAssembly + offset), detour, (LPVOID*)original) == MH_OK)
{
MH_EnableHook((LPVOID*)(GameAssembly + offset));
MH_EnableHook((LPVOID*)(Hooks::GameAssembly + offset));
}
}

Expand Down Expand Up @@ -359,13 +372,15 @@ void Hooks::load()
hook_function(0x1AC4C70, &player_move_c_fixed, &player_move_c_fixed_original);
hook_function(0xC326E0, &reward_multiplier, &reward_multiplier_original);
hook_function(0xC33660, &double_rewards, &double_rewards_original);
hook_function(0x18881E0, &season_pass_premium, &season_pass_premium_original);

// Init Modules Here
rapid_fire_module = new ModuleRapidFire();
speed_module = new ModuleSpeed();
infinite_gem_claim_module = (ModuleBase*) new ModuleInfiniteGemClaim();
lottery_price_module = new ModulePriceModifier;
rewards_multiplier_module = new ModuleRewardsMultiplier();
season_pass_module = new ModuleSeasonPass();

esp_module = new ModuleESP();
player_move_c_modules.push_back((ModuleBase*) esp_module);
Expand Down
4 changes: 4 additions & 0 deletions GirlKisser/Cheat/Hooks/Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
class Hooks
{
public:
static uintptr_t GameBase;
static uintptr_t GameAssembly;
static uintptr_t UnityPlayer;

static uint64_t tick;
static std::list<void*> player_list;
static void* our_player;
Expand Down
13 changes: 10 additions & 3 deletions GirlKisser/Cheat/Logger/Logger.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <iostream>
#include <windows.h>

#include "Logger.h"

#include <chrono>
#include <fstream>
#include <sstream>
#include <thread>

#include "Logger.h"

HANDLE Logger::console;

// reds
Expand Down Expand Up @@ -48,6 +48,11 @@ void Logger::log_client_name()
std::cout << "[GirlKisser PG3D]";
}

void write_error_log()
{
std::ofstream("error.log") << std::cout.rdbuf();
}

void debug(const std::string& msg)
{
Logger::log_client_name();
Expand Down Expand Up @@ -85,6 +90,7 @@ void err(const std::string& msg)
std::cout << " [ERR] ";
SetConsoleTextAttribute(Logger::console, fg_white);
std::cout << msg << std::endl;
write_error_log();
thread_write_locked = false;
}

Expand All @@ -95,6 +101,7 @@ void fatal(const std::string& msg)
std::cout << " [FATAL] ";
SetConsoleTextAttribute(Logger::console, fg_white);
std::cout << msg << std::endl;
write_error_log();
thread_write_locked = false;
}

Expand Down
6 changes: 3 additions & 3 deletions GirlKisser/Cheat/Module/Impl/ModuleDebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ static GKSlider __slow_duration = GKSlider("Slow Duration", 9999, 0, 9999);
static GKSlider __slow_factor = GKSlider("Slow Factor", 0.001f, 0.001f, 10);

static GKCheckbox __stun = GKCheckbox{ "Stun", false };
static GKSlider __stun_duration = GKSlider("Slow Duration", 9999, 0, 9999);
static GKSlider __stun_factor = GKSlider("Slow Factor", 10, 0.001f, 10);
static GKSlider __stun_radius = GKSlider("Slow Radius", 9999, 0, 9999);
static GKSlider __stun_duration = GKSlider("Stun Duration", 9999, 0, 9999);
static GKSlider __stun_factor = GKSlider("Stun Factor", 10, 0.001f, 10);
static GKSlider __stun_radius = GKSlider("Stun Radius", 9999, 0, 9999);

static GKModule __debuffer = { "Debuffer", COMBAT, 0x0, false, {(GKSetting<>*) &__blind, (GKSetting<>*) &__blind_duration, (GKSetting<>*) &__charm, (GKSetting<>*) &__curse, (GKSetting<>*) &__curse_duration, (GKSetting<>*) &__curse_damage, (GKSetting<>*) &__lightning, (GKSetting<>*) &__poison, (GKSetting<>*) &__poison_amount, (GKSetting<>*) &__slow, (GKSetting<>*) &__slow_duration, (GKSetting<>*) &__slow_factor, (GKSetting<>*) &__stun, (GKSetting<>*) &__stun_duration, (GKSetting<>*) &__stun_factor, (GKSetting<>*) &__stun_radius} };

Expand Down
20 changes: 20 additions & 0 deletions GirlKisser/Cheat/Module/Impl/ModuleSeasonPass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once
#include "../ModuleBase.h"

static GKCheckbox __season_pass_premium = { "Spoof Premium", true, "Only lasts while enabled." };
static GKModule __season_pass = { "Season Pass", REWARDS, 0x0, true, { (GKSetting<>*) & __season_pass_premium}};

class ModuleSeasonPass : ModuleBase
{
public:
ModuleSeasonPass() : ModuleBase(&__season_pass) {}

void do_module(void* arg) override
{
}

bool spoof_premium()
{
return __season_pass_premium.enabled;
}
};
1 change: 1 addition & 0 deletions GirlKisser/GirlKisser.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
<ClInclude Include="Cheat\Logger\Logger.h" />
<ClInclude Include="Cheat\Module\Impl\ModuleAimBot.h" />
<ClInclude Include="Cheat\Module\Impl\ModuleAOEBullets.h" />
<ClInclude Include="Cheat\Module\Impl\ModuleSeasonPass.h" />
<ClInclude Include="Cheat\Module\Impl\ModuleShowEnabledModules.h" />
<ClInclude Include="Cheat\Module\Impl\ModuleBetterScope.h" />
<ClInclude Include="Cheat\Module\Impl\ModuleCriticals.h" />
Expand Down
6 changes: 6 additions & 0 deletions GirlKisser/GirlKisser.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,11 @@
<ClInclude Include="Cheat\Module\ModuleBase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Cheat\Module\Impl\ModuleExtraDisplay.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Cheat\Module\Impl\ModuleSeasonPass.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions GirlKisser/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ LRESULT __stdcall WndProc(const HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
return DefWindowProcW(GetActiveWindow(), msg, wParam, lParam);
}

void native_font_list(bool ttf_only)
void get_native_font_list(bool ttf_only)
{
const std::string path = "C:\\Windows\\Fonts";
for (const auto & entry : std::filesystem::directory_iterator(path))
Expand Down Expand Up @@ -237,7 +237,7 @@ int64_t WINAPI MainThread(LPVOID param)

Logger::log_info("Starting injection...");

native_font_list(true);
get_native_font_list(true);

bool init_hook = false;
while (!init_hook)
Expand Down

0 comments on commit 1405ef5

Please sign in to comment.