diff options
| author | auth12 <[email protected]> | 2021-07-06 23:21:34 +0100 |
|---|---|---|
| committer | auth12 <[email protected]> | 2021-07-06 23:21:34 +0100 |
| commit | 813e464a2f7a6ebfe073b1cade577f9f803ae700 (patch) | |
| tree | fbe765e26ba39db34979bec773d24bfe5256a85a /sysmap/src/main.cpp | |
| parent | replaced CreateRemoteThread (diff) | |
| download | archived-sysmap-813e464a2f7a6ebfe073b1cade577f9f803ae700.tar.xz archived-sysmap-813e464a2f7a6ebfe073b1cade577f9f803ae700.zip | |
Replaced create thread with thread hijacking
Diffstat (limited to 'sysmap/src/main.cpp')
| -rw-r--r-- | sysmap/src/main.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sysmap/src/main.cpp b/sysmap/src/main.cpp index 4c73340..d775e6c 100644 --- a/sysmap/src/main.cpp +++ b/sysmap/src/main.cpp @@ -24,17 +24,20 @@ int main(int argc, char* argv[]) { if (args.size() < 2) { io::log<critical>("Invalid arguments specified."); + std::cin.get(); + return 0; } - spdlog::set_pattern("[%^%l%$] %v"); - for (auto& arg : args) { if (arg == "--debug") { spdlog::set_level(spdlog::level::debug); } } + spdlog::set_pattern("[%^%l%$] %v"); + spdlog::set_level(spdlog::level::debug); + g_ctx.local_modules = std::move(util::get_modules()); auto ntdll = g_ctx.local_modules[1]; @@ -45,13 +48,21 @@ int main(int argc, char* argv[]) { io::log<info>("waiting for {}", args[0]); + auto buf = io::read_file(args[1]); + if (buf.empty()) { + io::log<critical>("failed to read file."); + std::cin.get(); + + return 0; + } + process::process_x64_t proc; if (NT_SUCCESS(proc.attach(args[0]))) { io::log<info>("attached!"); proc.modules = proc.get_modules(); - proc.map(io::read_file(args[1])); + proc.map(buf); proc.close(proc.handle); } |