diff --git a/dependencies/xtils b/dependencies/xtils index 99a1fc7..fdcafdb 160000 --- a/dependencies/xtils +++ b/dependencies/xtils @@ -1 +1 @@ -Subproject commit 99a1fc74e16af3261e7cfff4e03d470a7a05feb0 +Subproject commit fdcafdbbcb3f34c33b9cffb2be569b9aa5f42a57 diff --git a/src/main.cpp b/src/main.cpp index 5fca15d..8ad0548 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,18 +43,22 @@ int __cdecl main( int argc, const char *argv[] ) if ( parser.exists( "bin" ) && parser.exists( "vmentry" ) ) { + if ( !std::filesystem::exists( parser.get< std::string >( "bin" ) ) ) + { + std::printf( "> path to protected file is invalid... check your cli args...\n" ); + return -1; + } const auto module_base = reinterpret_cast< std::uintptr_t >( LoadLibraryExA( parser.get< std::string >( "bin" ).c_str(), NULL, DONT_RESOLVE_DLL_REFERENCES ) ); const auto vm_entry_rva = std::strtoull( parser.get< std::string >( "vmentry" ).c_str(), nullptr, 16 ); - const auto image_base = umtils->image_base( parser.get< std::string >( "bin" ).c_str() ); - const auto image_size = NT_HEADER( module_base )->OptionalHeader.SizeOfImage; std::printf( "> module base = 0x%p, image base = 0x%p, image size = 0x%p\n", module_base, image_base, image_size ); + vm::ctx_t vmctx( module_base, image_base, image_size, vm_entry_rva ); if ( !vmctx.init() )