From 4c8b52fc94c04c4b3d338c2501971ae348f5b3e5 Mon Sep 17 00:00:00 2001 From: navewindre Date: Tue, 16 Jul 2024 07:19:43 +0200 Subject: =?UTF-8?q?=E3=82=84=E3=83=BC=E3=83=BC=E3=83=BC=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cs2/hack.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/cs2/hack.cpp') diff --git a/src/cs2/hack.cpp b/src/cs2/hack.cpp index ef4008d..c98337a 100644 --- a/src/cs2/hack.cpp +++ b/src/cs2/hack.cpp @@ -1,9 +1,10 @@ #include "hack.h" +#include "entity.h" +#include "entity.h" #include "iface.h" SETTING_HOLDER gcfg; -#include "cs2.h" PROCESS64* hack_init() { CS2* p = new CS2(); @@ -12,9 +13,32 @@ PROCESS64* hack_init() { return nullptr; } + schema_dump_to_file( p ); + iface_dump_to_file( p ); + return p; } bool hack_run( PROCESS64* p ) { + perf_run_metric( perf_loop_start ); + CS2* cs = (CS2*)p; + + for( I32 i = 0; i < 64; ++i ) { + CS2_PLAYERCONTROLLER pc = cs2_ent_from_idx( cs, i ); + if( !pc ) + continue; + + CS2_PAWN pawn = pc.get_pawn(); + if( !pawn ) + continue; + + STR<128> name = pc.m_sSanitizedPlayerName(); + I32 health = pawn.m_iHealth(); + + clog( "player %d [%llx]: %s, health %d\n", i, pc.ptr, name.data, health ); + } + + + perf_run_metric( perf_loop_end ); return true; } \ No newline at end of file -- cgit v1.2.3