From 9e7a567acb123ba6c1e6f1abbc70a8f2bcce005d Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 7 Apr 2023 13:55:43 +0200 Subject: [PATCH] Fix xuid offset --- src/client/component/bots.cpp | 2 -- src/client/component/dedicated_patches.cpp | 2 +- src/client/game/structs.hpp | 16 ++++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/client/component/bots.cpp b/src/client/component/bots.cpp index 0d06afd0..2f334f62 100644 --- a/src/client/component/bots.cpp +++ b/src/client/component/bots.cpp @@ -115,8 +115,6 @@ namespace bots struct component final : generic_component { - static_assert(offsetof(game::client_s, bIsTestClient) == 0xBB360); - void post_unpack() override { utils::hook::jump(game::select(0x141653B70, 0x1402732E0), get_bot_name); diff --git a/src/client/component/dedicated_patches.cpp b/src/client/component/dedicated_patches.cpp index 48ed8326..6e7f249e 100644 --- a/src/client/component/dedicated_patches.cpp +++ b/src/client/component/dedicated_patches.cpp @@ -76,7 +76,7 @@ namespace dedicated_patches return 0; } - return static_cast(clients[client_num].guid); + return clients[client_num].xuid; } } diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index 9e35f729..1e852b6c 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1547,21 +1547,21 @@ namespace game int client_state; char __pad0[0x28]; netadr_t address; - char __pad1[0xBB318]; - int guid; - char __pad2[0x8]; - bool bIsTestClient; - char __pad3[0x25818]; + char __pad1[0x5588]; uint64_t xuid; - char __pad4[0x4588]; + char __pad2[0xB5D84]; + int guid; + char __pad3[0x8]; + bool bIsTestClient; + char __pad4[0x29DAC]; }; - static_assert(sizeof(client_s) == 0xE5110); + static_assert(sizeof(client_s) <= 0xE5110); static_assert(offsetof(game::client_s, address) == 0x2C); + static_assert(offsetof(game::client_s, xuid) == 0x55C8); static_assert(offsetof(game::client_s, guid) == 0xBB354); static_assert(offsetof(game::client_s, bIsTestClient) == 0xBB360); - static_assert(offsetof(game::client_s, xuid) == 0xE0B80); struct client_s_cl : client_s {