From dd0558c09bf970ec45fd6430c3063a882c07be87 Mon Sep 17 00:00:00 2001 From: Alexander German Date: Fri, 6 Apr 2018 18:02:33 +0500 Subject: [PATCH] Theoreticaly working tf party and gc reclasses. --- src/sdk/tfparty.cc | 92 ++++++++++++++++++++++++++++++++++++++++++++++ src/sdk/tfparty.hh | 25 +++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 src/sdk/tfparty.cc create mode 100644 src/sdk/tfparty.hh diff --git a/src/sdk/tfparty.cc b/src/sdk/tfparty.cc new file mode 100644 index 0000000..f83e480 --- /dev/null +++ b/src/sdk/tfparty.cc @@ -0,0 +1,92 @@ +#include + +#include + +namespace tf { +namespace party { +static uptr thisptr{NULL}; + +void get_tf_party() { +#if doghook_platform_windows() + thisptr = *signature::find_pattern("client", "A1 ? ? ? ? C3", 1); +#elif doghook_platform_linux() + thisptr = *signature::find_pattern("client", "55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ? 85 C0", 2); +#else + //todo mac +#endif +} + +bool in_queue() { + return *(u8 *)(thisptr + 69); +} + +void request_queue(int type) { + typedef char( +#if doghook_platform_windows() + __thiscall +#endif + * func)(uptr, int); +#if doghook_platform_windows() + static func kek = signature::find_pattern("client", "55 8B EC 83 EC 38 56 8B 75 08 57", 0); +#elif doghook_platform_linux() + static func kek = signature::find_pattern("client", "55 89 E5 57 56 53 81 EC ? ? ? ? 8B 75 ? 89 F0", 0); +#else + static func kek{NULL}; +#endif + kek(thisptr, type); +} + +void request_leave_queue(int type) { + //55 8B EC 83 EC 18 53 56 8B 75 08 8B D9 56 + typedef bool( +#if doghook_platform_windows() + __thiscall +#endif + * func)(uptr, int); +#if doghook_platform_windows() + static func kek = signature::find_pattern("client", "55 8B EC 83 EC 18 53 56 8B 75 08 8B D9 56", 0); +#elif doghook_platform_linux() + static func kek = signature::find_pattern("client", "55 89 E5 57 56 53 83 EC ? 8B 45 ? 89 44 24 ? 8B 45 ? 89 04 24 E8 ? ? ? ? 84 C0 89 C6 75 ?", 0); +#else + static func kek{NULL}; +#endif + + kek(thisptr, type); +} + +} // namespace party +namespace gc { +static uptr thisptr{NULL}; // B8 ? ? ? ? C3 + +void get_gc() { + uptr tmp{NULL}; +#if doghook_platform_windows() + tmp = signature::find_pattern("client", "B8 ? ? ? ? C3", 1); +#elif doghook_platform_linux() + tmp = signature::find_pattern("client", "55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ?", 2); +#else + //todo mac; +#endif + thisptr = tmp + *(uptr *)tmp; +} + +bool is_connect_to_match_server() { + return (u32)(*(unsigned long *)(thisptr + 1332) - 1) <= 1; +} + +void abandon() { + typedef int (*func)(uptr); +#if doghook_platform_windows() + static func kek = signature::find_pattern("client", "55 8B EC 83 EC 14 56 57 8B 3D ? ? ? ?", 0); +#elif doghook_platform_linux() + static func kek = signature::find_pattern("client", "55 89 E5 57 56 8D 75 ? 53 81 EC ? ? ? ? C7 04 24 ? ? ? ?", 0); +#else + // todomac + static func kek{NULL}; +#endif + kek(thisptr); +} + +} // namespace gc + +} // namespace tf diff --git a/src/sdk/tfparty.hh b/src/sdk/tfparty.hh new file mode 100644 index 0000000..5e2f454 --- /dev/null +++ b/src/sdk/tfparty.hh @@ -0,0 +1,25 @@ +#pragma once + +namespace tf { +namespace party { + +void get_tf_party(); + +bool in_queue(); + +void request_queue(int type); + +void request_leave_queue(int type); + +} // namespace party +namespace gc { + +void get_gc(); + +bool is_connect_to_match_server(); + +void abandon(); + +} // namespace gc + +} // namespace tf