summaryrefslogtreecommitdiff
path: root/legacy/injector/util.h
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
committerboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
commit3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch)
tree26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /legacy/injector/util.h
parente4729e4393d90271a3814c7a79950a660c48325a (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 'legacy/injector/util.h')
-rw-r--r--legacy/injector/util.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/legacy/injector/util.h b/legacy/injector/util.h
new file mode 100644
index 0000000..61b18dc
--- /dev/null
+++ b/legacy/injector/util.h
@@ -0,0 +1,44 @@
+#pragma once
+#include <cstdint>
+
+namespace util
+{
+ __forceinline void memcpy( void* dst, void* src, size_t size ) {
+ uint8_t* data = ( uint8_t* )src;
+ uint8_t* dest = ( uint8_t* )dst;
+
+ for( size_t i{ }; i < size; ++i ) {
+ dest[ i ] = data[ i ];
+ }
+ }
+
+ __forceinline size_t strlen( const char* str ) {
+ size_t len;
+ for( len = 0; !!str[ len ]; ++len );
+
+ return len;
+ }
+
+ __forceinline bool strcmp( const char* str, const char* comp ) {
+ for( size_t i{ }; i < strlen( comp ); ++i ) {
+ if( str[ i ] != comp[ i ] ) return false;
+ }
+
+ return true;
+ }
+
+ __forceinline size_t wstrlen( const wchar_t* str ) {
+ size_t len;
+ for( len = 0; !!str[ len ]; ++len );
+
+ return len;
+ }
+
+ __forceinline bool wstrcmp( const wchar_t* str, const wchar_t* comp ) {
+ for( size_t i{ }; i < wstrlen( comp ); ++i ) {
+ if( str[ i ] != comp[ i ] ) return false;
+ }
+
+ return true;
+ }
+} \ No newline at end of file