Skip to content

Commit

Permalink
Updated offsets, added features (GunData)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoigorr committed Jul 23, 2022
1 parent 3b541d9 commit 1a689dd
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Addresses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void Addresses::calcAddresses()
cGunData->reloadDuration = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->reloadDuration);
cGunData->numOfProjectiles = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->numOfProjectiles);
cGunData->spread = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->spread);
cGunData->knockback = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->spread);
cGunData->knockback = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->knokback);
cGunData->projectileSpeed = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->projectileSpeed);
cGunData->bounce = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->bounce);
cGunData->piercing = (uintptr_t*)mem::FindDMAAddy(localPlayer, offsets->piercing);
Expand Down
58 changes: 34 additions & 24 deletions MyMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
#include "MyMenu.h"

#include "Options.h"

#include "info.h"

#include "Addresses.h"

#include <type_traits>


void MyMenu::SetStyle()
{
Expand All @@ -17,7 +13,7 @@ void MyMenu::SetStyle()
// Colors
style.Colors[ImGuiCol_TitleBg] = ImVec4(0.000f, 0.000f, 0.000f, 0.000f);
style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.000f, 0.000f, 0.000f, 0.000f);
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.200f, 0.200f, 0.200f, 0.800f);
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.200f, 0.200f, 0.200f, 0.420f);

style.Colors[ImGuiCol_Border] = ImVec4(1.000f, 0.000f, 0.647f, 1.000f);
style.Colors[ImGuiCol_Separator] = ImVec4(1.000f, 0.000f, 0.647f, 1.000f);
Expand Down Expand Up @@ -70,6 +66,12 @@ void AddCheckBox(const char* title, bool* var)
ImGui::Checkbox(title, var);
}

bool AddButton(const char* title)
{
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 10, ImGui::GetCursorPos().y + 20));
return ImGui::Button(title, ImVec2(110.0f, 30.0f));
}

ImVec4 Red = ImVec4(1.0f, 0, 0, 1.0f);
ImVec4 Green = ImVec4(0, 1.0f, 0, 1.0f);
void AddStatus(bool b)
Expand All @@ -82,18 +84,18 @@ void AddStatus(bool b)
}

template <typename T>
void AddSlider(const char* label, T& value, T v_min, T v_max)
void AddSlider(const char* label, T* value, T v_min, T v_max)
{
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX(), ImGui::GetCursorPosY() + 10));

if constexpr (std::is_integral_v<T>)
{
ImGui::SliderInt(label, &value, v_min, v_max);
ImGui::SliderInt(label, value, v_min, v_max);
}

if constexpr (std::is_floating_point_v<T>)
{
ImGui::SliderFloat(label, &value, v_min, v_max);
ImGui::SliderFloat(label, value, v_min, v_max);
}
}

Expand All @@ -115,8 +117,8 @@ void MyMenu::Draw()

if (info::sHealth)
{
AddSlider<int>("HP", *(int*)cHealth->HP, 1, 10);
AddSlider<int>("maxHP", *(int*)cHealth->maxHP, 1, 10);
AddSlider<int>("HP", &*(int*)cHealth->HP, 1, 10);
AddSlider<int>("maxHP", &*(int*)cHealth->maxHP, 1, 10);
}

ImGui::EndTabItem();
Expand All @@ -129,19 +131,12 @@ void MyMenu::Draw()

if (info::sAmmo)
{
AddSlider<int>("Ammo", *(int*)cAmmo->Ammo, 0, 31);
AddSlider<int>("maxAmmo", *(int*)cGunData->maxAmmo, 0, 31);
AddSlider<float>("Damage", *(float*)cGunData->damage, 0, 200);
AddSlider<float>("ShootCoolDown", *(float*)cGunData->shootCooldown, 0, 10);
AddSlider<float>("ReloadDuration", *(float*)cGunData->reloadDuration, 0, 5);
AddSlider<int>("numOfProjectiles", *(int*)cGunData->numOfProjectiles, 1, 20);
AddSlider<int>("spread", *(int*)cGunData->spread, 0, 100);
AddSlider<float>("knockback", *(float*)cGunData->knockback, 0, 100);
AddSlider<float>("projectileSpeed", *(float*)cGunData->projectileSpeed, 1, 200);
AddSlider<int>("bounce", *(int*)cGunData->bounce, 0, 8);
AddSlider<int>("piercing", *(int*)cGunData->piercing, 0, 20);
AddSlider<float>("burnChance", *(float*)cGunData, 0, 10);
AddSlider<float>("inaccuracy", *(float*)cGunData->inaccuracy, 0, 5);
AddSlider<int>("maxAmmo", &*(int*)cGunData->maxAmmo, 0, 24);
AddSlider<float>("damage", &*(float*)cGunData->damage, 0.f, 100.f);
AddSlider<float>("shootCooldown", &*(float*)cGunData->shootCooldown, 0.100f, 3.f);
AddSlider<float>("reloadDuration", &*(float*)cGunData->reloadDuration, 0.100f, 3.f);
AddSlider<int>("numOfProjectiles", &*(int*)cGunData->numOfProjectiles, 1, 10);
AddSlider<float>("spread", &*(float*)cGunData->spread, 0.f, 90.f);
}

ImGui::EndTabItem();
Expand All @@ -154,7 +149,7 @@ void MyMenu::Draw()

if (info::sSpeedHack)
{
AddSlider<float>("movementSpeed", *(float*)cPlayerController->movementSpeed, 3, 10);
AddSlider<float>("movementSpeed", &*(float*)cPlayerController->movementSpeed, 3, 10);
}

ImGui::EndTabItem();
Expand All @@ -173,6 +168,21 @@ void MyMenu::Draw()
ImGui::EndTabItem();
}

if (ImGui::BeginTabItem("Menu Conf"))
{
if (AddButton("Disable All"))
{
options->SetAllFalse();
}

if (AddButton("Enable All"))
{
options->SetAllTrue();
}

ImGui::EndTabItem();
}

ImGui::EndTabBar();
}
}
Expand Down
26 changes: 13 additions & 13 deletions Offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ class Offsets
std::vector<unsigned int> multiplierReduction = { 0x178,0x50,0xD0,0x10,0x60,0x30,0x20 };
std::vector<unsigned int> multiplierBonus = { 0x178,0x50,0xD0,0x10,0x60,0x30,0x1C };
// flanne.GunData
std::vector<unsigned int> damage = { 0x218,0x180,0x10,0x60,0x48 };
std::vector<unsigned int> shootCooldown = { 0x218,0x180,0x10,0x60,0x4C };
std::vector<unsigned int> maxAmmo = { 0x218,0x180,0x10,0x60,0x50 };
std::vector<unsigned int> reloadDuration = { 0x218,0x180,0x10,0x60,0x54 };
std::vector<unsigned int> numOfProjectiles = { 0x218,0x180,0x10,0x60,0x58 };
std::vector<unsigned int> spread = { 0x218,0x180,0x10,0x60,0x5C };
std::vector<unsigned int> knokback = { 0x218,0x180,0x10,0x60,0x60 };
std::vector<unsigned int> projectileSpeed = { 0x218,0x180,0x10,0x60,0x64 };
std::vector<unsigned int> bounce = { 0x218,0x180,0x10,0x60,0x68 };
std::vector<unsigned int> piercing = { 0x218,0x180,0x10,0x60,0x6C };
std::vector<unsigned int> burnChance = { 0x218,0x180,0x10,0x60,0x70 };
std::vector<unsigned int> inaccuracy = { 0x218,0x180,0x10,0x60,0x74 };
std::vector<unsigned int> isSummonGun = { 0x218,0x180,0x10,0x60,0x78 };
std::vector<unsigned int> damage = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x48 };
std::vector<unsigned int> shootCooldown = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x4C };
std::vector<unsigned int> maxAmmo = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x50 };
std::vector<unsigned int> reloadDuration = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x54 };
std::vector<unsigned int> numOfProjectiles = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x58 };
std::vector<unsigned int> spread = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x5C };
std::vector<unsigned int> knokback = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x60 };
std::vector<unsigned int> projectileSpeed = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x64 };
std::vector<unsigned int> bounce = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x68 };
std::vector<unsigned int> piercing = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x6C };
std::vector<unsigned int> burnChance = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x70 };
std::vector<unsigned int> inaccuracy = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x74 };
std::vector<unsigned int> isSummonGun = { 0xD38,0xA70,0xD8,0x28,0xB8,0x30,0x78 };

};

Expand Down
3 changes: 0 additions & 3 deletions Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ class Options
class FeatureValues
{
public:
int vHP;
int vAmmo;
int vMovementSpeed = 3;
int vLevel;
};
};

Expand Down
1 change: 1 addition & 0 deletions framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <Psapi.h>
#include <vector>
#include <chrono>
#include <type_traits>

#include "MinHook/MinHook.h"
#pragma comment(lib, "MinHook/libMinHook.x64.lib")
Expand Down

0 comments on commit 1a689dd

Please sign in to comment.