From 318b529135500ca799fd80a48fbd86d7b0284f32 Mon Sep 17 00:00:00 2001 From: MisterY52 <11368116+MisterY52@users.noreply.github.com> Date: Tue, 27 Oct 2020 11:45:52 +0100 Subject: [PATCH] FOV update --- apex_dma/Game.cpp | 18 ++++++++++++++++++ apex_dma/Game.h | 4 ++++ apex_dma/apex_dma.cpp | 6 ++++-- apex_dma/offsets.h | 10 ++++++---- apex_guest/Client/Client/main.cpp | 7 +++++-- apex_guest/Client/Client/overlay.cpp | 10 ++++++++-- 6 files changed, 45 insertions(+), 10 deletions(-) diff --git a/apex_dma/Game.cpp b/apex_dma/Game.cpp index 422eef4..2120c47 100644 --- a/apex_dma/Game.cpp +++ b/apex_dma/Game.cpp @@ -99,6 +99,11 @@ bool Entity::isGlowing() return *(int*)(buffer + OFFSET_GLOW_ENABLE) == 7; } +bool Entity::isZooming() +{ + return *(int*)(buffer + OFFSET_ZOOMING) == 1; +} + void Entity::enableGlow(WinProcess& mem) { mem.Write(ptr + OFFSET_GLOW_T1, 16256); @@ -205,6 +210,13 @@ QAngle CalculateBestBoneAim(WinProcess& mem, Entity& from, uintptr_t t, float ma curweap.update(mem, from.ptr); float BulletSpeed = curweap.get_projectile_speed(); float BulletGrav = curweap.get_projectile_gravity(); + float zoom_fov = curweap.get_zoom_fov(); + + if (zoom_fov != 0.0f && zoom_fov != 1.0f) + { + max_fov *= zoom_fov/90.0f; + } + /* //simple aim prediction if (BulletSpeed > 1.f) @@ -306,6 +318,7 @@ void WeaponXEntity::update(WinProcess& mem, uint64_t LocalPlayer) projectile_speed = mem.Read(wep_entity + OFFSET_BULLET_SPEED); projectile_scale = mem.Read(wep_entity + OFFSET_BULLET_SCALE); + zoom_fov = mem.Read(wep_entity + OFFSET_ZOOM_FOV); } float WeaponXEntity::get_projectile_speed() @@ -317,3 +330,8 @@ float WeaponXEntity::get_projectile_gravity() { return 750.0f * projectile_scale; } + +float WeaponXEntity::get_zoom_fov() +{ + return zoom_fov; +} \ No newline at end of file diff --git a/apex_dma/Game.h b/apex_dma/Game.h index e24bea2..25ab179 100644 --- a/apex_dma/Game.h +++ b/apex_dma/Game.h @@ -30,6 +30,7 @@ public: int getHealth(); int getShield(); bool isGlowing(); + bool isZooming(); Vector getAbsVelocity(); QAngle GetSwayAngles(); QAngle GetViewAngles(); @@ -64,11 +65,14 @@ public: void update(WinProcess& mem, uint64_t LocalPlayer); float get_projectile_speed(); float get_projectile_gravity(); + float get_zoom_fov(); private: float projectile_scale; float projectile_speed; + float zoom_fov; }; + Entity getEntity(WinProcess& mem, uintptr_t ptr); Item getItem(WinProcess& mem, uintptr_t ptr); bool WorldToScreen(Vector from, float* m_vMatrix, int targetWidth, int targetHeight, Vector& to); diff --git a/apex_dma/apex_dma.cpp b/apex_dma/apex_dma.cpp index 57f700b..0ba94b6 100644 --- a/apex_dma/apex_dma.cpp +++ b/apex_dma/apex_dma.cpp @@ -25,7 +25,7 @@ int team_player = 0; int tmp_spec = 0, spectators = 0; int tmp_all_spec = 0, allied_spectators = 0; int playerId = 0; -int s_FOV = 15; +int max_fov = 15; int toRead = 100; int aim = false; bool esp = false; @@ -526,7 +526,7 @@ static void AimbotLoop(WinProcess& mem) uint64_t LocalPlayer = mem.Read(g_Base + OFFSET_LOCAL_ENT); if (LocalPlayer == 0) continue; Entity LPlayer = getEntity(mem, LocalPlayer); - QAngle Angles = CalculateBestBoneAim(mem, LPlayer, aimentity, s_FOV); + QAngle Angles = CalculateBestBoneAim(mem, LPlayer, aimentity, max_fov); if (Angles.x == 0 && Angles.y == 0) { lock=false; @@ -560,6 +560,7 @@ static void set_vars(WinProcess& mem, uint64_t add_addr) uint64_t player_glow_addr = mem.Read(add_addr + sizeof(uint64_t)*12); uint64_t aim_no_recoil_addr = mem.Read(add_addr + sizeof(uint64_t)*13); uint64_t smooth_addr = mem.Read(add_addr + sizeof(uint64_t)*14); + uint64_t max_fov_addr = mem.Read(add_addr + sizeof(uint64_t)*15); if(mem.Read(spec_addr)!=1) { @@ -589,6 +590,7 @@ static void set_vars(WinProcess& mem, uint64_t add_addr) player_glow = mem.Read(player_glow_addr); aim_no_recoil = mem.Read(aim_no_recoil_addr); smooth = mem.Read(smooth_addr); + max_fov = mem.Read(max_fov_addr); if(esp && next) { diff --git a/apex_dma/offsets.h b/apex_dma/offsets.h index 399da1b..0d12ff4 100644 --- a/apex_dma/offsets.h +++ b/apex_dma/offsets.h @@ -8,8 +8,9 @@ #define OFFSET_SHIELD 0x170 #define OFFSET_ABS_VELOCITY 0x140 //m_vecAbsVelocity #define OFFSET_VISIBLE_TIME 0x1A6C +#define OFFSET_ZOOMING 0x1b81 //m_bZooming -#define OFFSET_LIFE_STATE 0x770 //>0 = dead +#define OFFSET_LIFE_STATE 0x770 //>0 = dead #define OFFSET_BLEED_OUT_STATE 0x2610 //>0 = knocked #define OFFSET_ORIGIN 0x14c //m_vecAbsOrigin @@ -21,12 +22,13 @@ #define OFFSET_OBSERVER_MODE 0x32bc #define OFFSET_OBSERVING_TARGET 0x32c0 -#define OFFSET_MATRIX 0x1b3bd0 -#define OFFSET_RENDER 0x40d5e18 +#define OFFSET_MATRIX 0x1b3bd0 +#define OFFSET_RENDER 0x40d5e18 -#define OFFSET_WEAPON 0x1a0c //m_latestPrimaryWeapons +#define OFFSET_WEAPON 0x1a0c //m_latestPrimaryWeapons #define OFFSET_BULLET_SPEED 0x1e0c #define OFFSET_BULLET_SCALE 0x1e14 +#define OFFSET_ZOOM_FOV 0x1668 + 0xb4 //m_playerData + m_curZoomFOV #define OFFSET_ITEM_GLOW 0x2A8 //m_highlightFunctionBits diff --git a/apex_guest/Client/Client/main.cpp b/apex_guest/Client/Client/main.cpp index a84d1b5..5509bdc 100644 --- a/apex_guest/Client/Client/main.cpp +++ b/apex_guest/Client/Client/main.cpp @@ -16,6 +16,7 @@ typedef struct player int shield = 0; }player; +int aim_key = VK_RBUTTON; bool use_nvidia = true; bool active = true; bool ready = false; @@ -32,11 +33,12 @@ bool aiming = false; //read uint64_t g_Base = 0; //write float max_dist = 200.0f * 40.0f; //read float smooth = 12.0f; +float max_fov = 15.0f; bool valid = false; //write bool next = false; //read write -uint64_t add[15]; +uint64_t add[16]; bool k_f5 = 0; bool k_f6 = 0; @@ -128,6 +130,7 @@ int main(int argc, char** argv) add[12] = (uintptr_t)&player_glow; add[13] = (uintptr_t)&aim_no_recoil; add[14] = (uintptr_t)&smooth; + add[15] = (uintptr_t)&max_fov; printf("add offset: 0x%I64x\n", (uint64_t)&add[0] - (uint64_t)GetModuleHandle(NULL)); Overlay ov1 = Overlay(); ov1.Start(); @@ -235,7 +238,7 @@ int main(int argc, char** argv) std::this_thread::sleep_for(std::chrono::milliseconds(130)); } - if (IsKeyDown(VK_RBUTTON)) + if (IsKeyDown(aim_key)) aiming = true; else aiming = false; diff --git a/apex_guest/Client/Client/overlay.cpp b/apex_guest/Client/Client/overlay.cpp index 28992a7..bdae068 100644 --- a/apex_guest/Client/Client/overlay.cpp +++ b/apex_guest/Client/Client/overlay.cpp @@ -12,6 +12,7 @@ extern int spectators; extern int allied_spectators; extern float max_dist; extern float smooth; +extern float max_fov; int width; int height; bool k_leftclick = false; @@ -116,7 +117,7 @@ void Overlay::RenderMenu() all_spec_disable = false; } ImGui::SetNextWindowPos(ImVec2(0, 0)); - ImGui::SetNextWindowSize(ImVec2(490, 250)); + ImGui::SetNextWindowSize(ImVec2(490, 200)); ImGui::Begin("##title", (bool*)true, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar); if (ImGui::BeginTabBar("Tab")) { @@ -167,7 +168,10 @@ void Overlay::RenderMenu() ImGui::Checkbox("Glow items", &item_glow); ImGui::Checkbox("Glow players", &player_glow); - + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Config")) + { ImGui::Text("Max distance:"); ImGui::SliderFloat("##1", &max_dist, 100.0f * 40, 800.0f * 40, "%.2f"); ImGui::SameLine(); @@ -176,6 +180,8 @@ void Overlay::RenderMenu() ImGui::Text("Smooth aim value:"); ImGui::SliderFloat("##2", &smooth, 12.0f, 150.0f, "%.2f"); + ImGui::Text("Max FOV:"); + ImGui::SliderFloat("##3", &max_fov, 5.0f, 250.0f, "%.2f"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Visuals"))