Welcome to hackvshack.net Forum!
Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, and More!
Register

C++ VIew model changer help

Im new to these stuff idk what pattern to hook etc im kinda dumb
I'd really appreciate it if someone could help me with this
for cs2 start with GetViewModelOffsets / CalcViewmodel in client.dll this signature is from latest game build (14194)
Code:
Expand Collapse Copy
40 55 53 56 41 56 41 57 48 8B EC 48 83 EC 20 4D 8B F8 4C 8B F2 48 8B F1 E8
it points directly to the function start you need to confirm its prototype and output parameters in latest cs2 dump before hooking. dont guess the arguments call the original first then apply your own position/rotation adjusments to the appropriate outputs (x,y,z) and also skip installing the hook if the scan fails or just find multiple matches. so its kinda just this enjoy coding!
 
for cs2 start with GetViewModelOffsets / CalcViewmodel in client.dll this signature is from latest game build (14194)
Code:
Expand Collapse Copy
40 55 53 56 41 56 41 57 48 8B EC 48 83 EC 20 4D 8B F8 4C 8B F2 48 8B F1 E8
it points directly to the function start you need to confirm its prototype and output parameters in latest cs2 dump before hooking. dont guess the arguments call the original first then apply your own position/rotation adjusments to the appropriate outputs (x,y,z) and also skip installing the hook if the scan fails or just find multiple matches. so its kinda just this enjoy coding!
tnx bro i will try it rn
 
  • Like
Reactions: TomiHVH
it does hook but it just dosent do anything untill i change my fov after i change my fov it just crashes the game


void* GetViewModelOffsets(float* flUnk, float* flOffsets, float* flFov) {
const auto original = calc.get_original<decltype(&GetViewModelOffsets)>();

void* pReturn = original(flUnk, flOffsets, flFov);

if (!vars::misc::viewModelChanger) return pReturn;

flOffsets[0] += vars::misc::viewmodeloffsets.x;
flOffsets[1] += vars::misc::viewmodeloffsets.y;
flOffsets[2] += vars::misc::viewmodeloffsets.z;

*flFov = vars::misc::viewmodeloffsetsfov;

return pReturn;
}

this is my current hook
 
it does hook but it just dosent do anything untill i change my fov after i change my fov it just crashes the game


void* GetViewModelOffsets(float* flUnk, float* flOffsets, float* flFov) {
const auto original = calc.get_original<decltype(&GetViewModelOffsets)>();

void* pReturn = original(flUnk, flOffsets, flFov);

if (!vars::misc::viewModelChanger) return pReturn;

flOffsets[0] += vars::misc::viewmodeloffsets.x;
flOffsets[1] += vars::misc::viewmodeloffsets.y;
flOffsets[2] += vars::misc::viewmodeloffsets.z;

*flFov = vars::misc::viewmodeloffsetsfov;

return pReturn;
}

this is my current hook
yea because the hook runs doesnt mean the arguments are right you didnt told me your third argument is a fov pointer so writing on it basically means instant crash in my cheat i use local pawns viewmodel fields
Code:
Expand Collapse Copy
void UpdateViewmodel(std::uintptr_t pawn)
{
    if (!pawn || !vars::misc::viewModelChanger)
        return;

    using namespace cs2_dumper::schemas::client_dll;

    *reinterpret_cast<float*>(pawn + C_CSPlayerPawn::m_flViewmodelOffsetX)
        = vars::misc::viewmodeloffsets.x;

    *reinterpret_cast<float*>(pawn + C_CSPlayerPawn::m_flViewmodelOffsetY)
        = vars::misc::viewmodeloffsets.y;

    *reinterpret_cast<float*>(pawn + C_CSPlayerPawn::m_flViewmodelOffsetZ)
        = vars::misc::viewmodeloffsets.z;

    *reinterpret_cast<float*>(pawn + C_CSPlayerPawn::m_flViewmodelFOV)
        = vars::misc::viewmodeloffsetsfov;
}
call this from your existing per frame update with fresh valid local pawn
 

Who has read this thread (Total: 0) in last 1 hours View details