diff options
| author | auth12 <[email protected]> | 2021-07-04 01:15:09 +0100 |
|---|---|---|
| committer | auth12 <[email protected]> | 2021-07-04 01:15:09 +0100 |
| commit | 661b73df47caae2cc62a9a2f7b85eb925ff1f80b (patch) | |
| tree | 79ab09cc3b9877b52fe32186ba3c0c354d0120bd /sysmap/src/main.cpp | |
| download | archived-sysmap-661b73df47caae2cc62a9a2f7b85eb925ff1f80b.tar.xz archived-sysmap-661b73df47caae2cc62a9a2f7b85eb925ff1f80b.zip | |
initial commit
Diffstat (limited to 'sysmap/src/main.cpp')
| -rw-r--r-- | sysmap/src/main.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/sysmap/src/main.cpp b/sysmap/src/main.cpp new file mode 100644 index 0000000..871be35 --- /dev/null +++ b/sysmap/src/main.cpp @@ -0,0 +1,59 @@ +#include "include.h" +#include "io.h" +#include "mapper/util.h" +#include "mapper/pe.h" + +#include "context.h" + +#include "mapper/syscalls.h" +#include "mapper/apiset.h" + +#include "mapper/process.h" + +mapper_context_t g_ctx; +syscalls_t g_syscalls; +apiset_t g_apiset; + + +int main(int argc, char* argv[]) { + std::vector<std::string> args; + + for (int i = 1; i < argc; ++i) { + args.emplace_back(argv[i]); + } + + if (args.size() < 2) { + io::log<critical>("Invalid arguments specified."); + return 0; + } + + spdlog::set_pattern("[%^%l%$] %v"); + + for (auto& arg : args) { + if (arg == "--debug") { + spdlog::set_level(spdlog::level::debug); + } + } + + g_ctx.local_modules = std::move(util::get_modules()); + + auto ntdll = g_ctx.local_modules[1]; + + g_ctx.win_path = ntdll.full_path.substr(0, ntdll.full_path.size() - ntdll.name.size()); + + g_syscalls.init(); + + 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.close(proc.handle); + } + + std::cin.get(); + return 0; +}
\ No newline at end of file |