From 7a4b1f06f2493d6f4c9403af466fa6bcacd1483e Mon Sep 17 00:00:00 2001 From: xerox Date: Tue, 18 Aug 2020 16:41:48 -0700 Subject: [PATCH] made little FOV cheat --- badeye/inside/bedaisy.hpp | 6 +++--- badeye/inside/dllmain.cpp | 24 +++++++--------------- badeye/inside/inside.vcxproj | 1 + badeye/inside/inside.vcxproj.filters | 3 +++ badeye/inside/rust.hpp | 30 ++++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 badeye/inside/rust.hpp diff --git a/badeye/inside/bedaisy.hpp b/badeye/inside/bedaisy.hpp index 149ab15..aa9f5fd 100644 --- a/badeye/inside/bedaisy.hpp +++ b/badeye/inside/bedaisy.hpp @@ -42,7 +42,7 @@ namespace bedaisy GetModuleHandleA("lsasrv.dll")); // 0f 1f 44 00 ? 8b f0 48 8b 0d ? ? ? ? 49 3b cd (proper return) - return { ioctl_handle, reinterpret_cast(lsasrv + 0x36E3B) }; // windows 10 2004 RVA you will need to update for your winver! :) + return { ioctl_handle, reinterpret_cast(lsasrv + 0x3B2AD) }; // windows 10 2004 RVA you will need to update for your winver! :) } return { {}, {} }; } @@ -114,7 +114,7 @@ namespace bedaisy return {}; T buffer{}; - read(proc_handle, addr, static_cast(&buffer), sizeof(T)); + read(proc_handle, addr, (void*)&buffer, sizeof(T)); return buffer; } @@ -124,6 +124,6 @@ namespace bedaisy if (!proc_handle || !addr) return; - write(proc_handle, addr, static_cast(&data), sizeof(T)); + write(proc_handle, addr, (void*)&data, sizeof(T)); } } \ No newline at end of file diff --git a/badeye/inside/dllmain.cpp b/badeye/inside/dllmain.cpp index a98fa63..aed3617 100644 --- a/badeye/inside/dllmain.cpp +++ b/badeye/inside/dllmain.cpp @@ -1,28 +1,18 @@ -#include "bedaisy.hpp" -#include "utils.hpp" +#include "rust.hpp" -void read_demo() +void example() { OutputDebugStringA("[lsass] main thread created!"); - const auto rust_handle = + const auto proc_handle = OpenProcess( PROCESS_QUERY_INFORMATION, FALSE, utils::get_pid(L"RustClient.exe") ); - if (rust_handle) + if (proc_handle) { - const auto game_base = utils::get_proc_base(rust_handle); - if (bedaisy::read(rust_handle, game_base) == 0x5A4D) - OutputDebugStringA("[lsass] read rust MZ!"); - else - OutputDebugStringA("[lsass] didnt read rust MZ!"); - - const auto asm_base = utils::get_module_base(rust_handle, L"GameAssembly.dll"); - if (bedaisy::read(rust_handle, asm_base) == 0x5A4D) - OutputDebugStringA("[lsass] read game assembly MZ!"); - else - OutputDebugStringA("[lsass] didnt game assembly MZ!"); + rust::set_fov(proc_handle, 120.f); + OutputDebugStringA("[lsass] set fov!"); } } @@ -32,7 +22,7 @@ extern "C" NTSTATUS nt_close(void* handle) if (!init.exchange(true)) { OutputDebugStringA("[lsass] creating thread!"); - CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&read_demo, NULL, NULL, NULL); + CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&example, NULL, NULL, NULL); } return NULL; } \ No newline at end of file diff --git a/badeye/inside/inside.vcxproj b/badeye/inside/inside.vcxproj index 6b9a20c..2caaa24 100644 --- a/badeye/inside/inside.vcxproj +++ b/badeye/inside/inside.vcxproj @@ -165,6 +165,7 @@ + diff --git a/badeye/inside/inside.vcxproj.filters b/badeye/inside/inside.vcxproj.filters index bdb77d8..bcfddca 100644 --- a/badeye/inside/inside.vcxproj.filters +++ b/badeye/inside/inside.vcxproj.filters @@ -21,5 +21,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/badeye/inside/rust.hpp b/badeye/inside/rust.hpp new file mode 100644 index 0000000..47b6bb3 --- /dev/null +++ b/badeye/inside/rust.hpp @@ -0,0 +1,30 @@ +#pragma once +#include "utils.hpp" +#define GFX_MANAGER 0x28C6F30 +#define CAMERA_MANAGER 0xB8 +#define CAMERA_FOV 0x18 + +namespace rust +{ + void set_fov(HANDLE proc_handle, float fov_value) + { + const auto asm_base = utils::get_module_base(proc_handle, L"GameAssembly.dll"); + + if (!asm_base) + return; + + const auto gfx_manager = bedaisy::read( + proc_handle, asm_base + GFX_MANAGER); + + if (!gfx_manager) + return; + + const auto camera_manager = bedaisy::read( + proc_handle, gfx_manager + CAMERA_MANAGER); + + if (!camera_manager) + return; + + bedaisy::write(proc_handle, camera_manager + CAMERA_FOV, fov_value); + } +} \ No newline at end of file