diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /gmod/iface_dllmain_impl.hpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever.
i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'gmod/iface_dllmain_impl.hpp')
| -rw-r--r-- | gmod/iface_dllmain_impl.hpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/gmod/iface_dllmain_impl.hpp b/gmod/iface_dllmain_impl.hpp deleted file mode 100644 index 761c215..0000000 --- a/gmod/iface_dllmain_impl.hpp +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once - -namespace factory -{ - namespace interfaces - { - class c_interface_manager - { - struct reg - { - char m_key; - uintptr_t m_ptr; - uintptr_t m_module; - char m_module_name[ 64 ]; - char m_name[ 64 ]; - }; - - size_t m_count; - reg* m_regs; - - void decrypt_str( char* buf, size_t size, char key ) { - for( size_t i{ }; i < size; ++i ) { - buf[ i ] ^= key; - } - } - - public: - void init( uintptr_t iface_addr ) { - m_count = *( size_t* )( iface_addr ); - m_regs = ( reg* )( iface_addr + 4 ); - } - - template < typename t = void* > - t find_interface( const std::string& module_, std::string name ) { - if( !::isdigit( name[ name.length( ) - 1 ] ) ) - name += '0'; - - char name_buf[ 64 ]; - char module_buf[ 64 ]; - - for( size_t i{ }; i < m_count; ++i ) { - auto& reg = m_regs[ i ]; - - memcpy( name_buf, reg.m_name, 64 ); - memcpy( module_buf, reg.m_module_name, 64 ); - - decrypt_str( name_buf, 64, reg.m_key ); - decrypt_str( module_buf, 64, reg.m_key ); - - if( !module_.compare( module_buf ) && strstr( name_buf, name.c_str( ) ) ) { - return ( t )( reg.m_ptr ); - } - } - - return t{ }; - } - - template < typename t = void* > - t find_interface( std::string name ) { - if( !::isdigit( name[ name.length( ) - 1 ] ) ) - name += '0'; - - char name_buf[ 64 ]; - char module_buf[ 64 ]; - - for( size_t i{ }; i < m_count; ++i ) { - auto& reg = m_regs[ i ]; - - memcpy( name_buf, reg.m_name, 64 ); - memcpy( module_buf, reg.m_module_name, 64 ); - - decrypt_str( name_buf, 64, reg.m_key ); - decrypt_str( module_buf, 64, reg.m_key ); - - if( strstr( name_buf, name.c_str( ) ) ) { - return ( t )( reg.m_ptr ); - } - } - - return t{ }; - } - }; - } -}
\ No newline at end of file |
