diff options
| author | JustSomePwner <crotchyalt@gmail.com> | 2018-08-30 14:01:54 +0200 |
|---|---|---|
| committer | JustSomePwner <crotchyalt@gmail.com> | 2018-08-30 14:01:54 +0200 |
| commit | 7ccb819f867493f8ec202ea3b39c94c198c64584 (patch) | |
| tree | 94622e61af0ff359e3d6689cf274d74f60b2492a /internal_rewrite/traceray.cpp | |
| parent | 564d979b79e8a5aaa5014eba0ecd36c61575934f (diff) | |
first
Diffstat (limited to 'internal_rewrite/traceray.cpp')
| -rw-r--r-- | internal_rewrite/traceray.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/internal_rewrite/traceray.cpp b/internal_rewrite/traceray.cpp new file mode 100644 index 0000000..8ca6d79 --- /dev/null +++ b/internal_rewrite/traceray.cpp @@ -0,0 +1,33 @@ +#include "hooks.hpp"
+
+#include <intrin.h>
+#include "mem.hpp"
+
+void __fastcall hooks::trace_ray( void* ecx_, void* edx_, const Ray_t& ray, unsigned int fMask, ITraceFilter* pTraceFilter, CBaseTrace* pTrace ) {
+ static auto trace_ray_o = g_csgo.m_trace->get_old_function< decltype( &trace_ray ) >( 5 );
+
+/* if( std::this_thread::get_id( ) == g_csgo.m_d3d_thread ) {
+ void* address = _ReturnAddress( );
+ //MEMORY_BASIC_INFORMATION info;
+ //VirtualQuery( address, &info, sizeof( MEMORY_BASIC_INFORMATION ) );
+
+ char mod[ MAX_PATH ];
+ //GetModuleFileNameA( ( HMODULE )info.AllocationBase, mod, MAX_PATH );
+
+ //printf( "TRACERAY CALLED FROM D3D\n" );
+ stack_t stack( get_baseptr( ) );
+
+ int i{ };
+ for( ; stack.get( ) > 0x100; stack = stack.next( ), i++ ) {
+ MEMORY_BASIC_INFORMATION info;
+ VirtualQuery( ( void* )( stack.return_address( ) ), &info, sizeof( MEMORY_BASIC_INFORMATION ) );
+
+ GetModuleFileNameA( ( HMODULE )info.AllocationBase, mod, MAX_PATH );
+
+ if( strstr( mod, "moneybot" ) )
+ printf( "stack frame: %d retaddr: %08x %s\n", i, stack.return_address( ), mod );
+ }
+ }*/
+
+ return trace_ray_o( ecx_, edx_, ray, fMask, pTraceFilter, pTrace );
+}
\ No newline at end of file |
