From 3e28fedf4d60d40f0fc3b37ba2b017c079c4d2ef Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 20 May 2021 17:23:24 -0700 Subject: [PATCH] changed name to vmemu --- .gitmodules | 3 ++ dependencies/cli-parser | 1 + uc-tracer.sln | 35 ------------------- uc-tracer/main.cpp | 16 --------- vmemu.sln | 22 ++++++++++++ vmemu/main.cpp | 31 ++++++++++++++++ .../uc-tracer.vcxproj => vmemu/vmemu.vcxproj | 5 ++- .../vmemu.vcxproj.filters | 3 ++ 8 files changed, 64 insertions(+), 52 deletions(-) create mode 160000 dependencies/cli-parser delete mode 100644 uc-tracer.sln delete mode 100644 uc-tracer/main.cpp create mode 100644 vmemu.sln create mode 100644 vmemu/main.cpp rename uc-tracer/uc-tracer.vcxproj => vmemu/vmemu.vcxproj (92%) rename uc-tracer/uc-tracer.vcxproj.filters => vmemu/vmemu.vcxproj.filters (95%) diff --git a/.gitmodules b/.gitmodules index e1d1847..cf7c4bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "dependencies/unicorn"] path = dependencies/unicorn url = https://github.com/unicorn-engine/unicorn.git +[submodule "dependencies/cli-parser"] + path = dependencies/cli-parser + url = https://githacks.org/_xeroxz/cli-parser.git diff --git a/dependencies/cli-parser b/dependencies/cli-parser new file mode 160000 index 0000000..1aedaf8 --- /dev/null +++ b/dependencies/cli-parser @@ -0,0 +1 @@ +Subproject commit 1aedaf8bb7f383f54b7cd498767611535526da85 diff --git a/uc-tracer.sln b/uc-tracer.sln deleted file mode 100644 index c800de9..0000000 --- a/uc-tracer.sln +++ /dev/null @@ -1,35 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30907.101 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uc-tracer", "uc-tracer\uc-tracer.vcxproj", "{B94A9F63-113F-4F80-A962-2E949A0D4826}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Debug|Win32.ActiveCfg = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Debug|Win32.Build.0 = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Debug|x64.ActiveCfg = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Debug|x64.Build.0 = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Debug|x86.ActiveCfg = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Debug|x86.Build.0 = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Release|Win32.ActiveCfg = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Release|x64.ActiveCfg = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Release|x64.Build.0 = Release|x64 - {B94A9F63-113F-4F80-A962-2E949A0D4826}.Release|x86.ActiveCfg = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E29AF102-41DF-4103-9BBF-D88331E8BF11} - EndGlobalSection -EndGlobal diff --git a/uc-tracer/main.cpp b/uc-tracer/main.cpp deleted file mode 100644 index 3ad123c..0000000 --- a/uc-tracer/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -int __cdecl main(int argc, const char* argv[]) -{ - uc_err err; - uc_engine* uc; - - err = uc_open(UC_ARCH_X86, UC_MODE_64, &uc); - - if (err) - { - std::printf("[!] uc open failed with: %u\n", err); - return -1; - } -} diff --git a/vmemu.sln b/vmemu.sln new file mode 100644 index 0000000..7cbfe9f --- /dev/null +++ b/vmemu.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmemu", "vmemu\vmemu.vcxproj", "{B94A9F63-113F-4F80-A962-2E949A0D4826}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B94A9F63-113F-4F80-A962-2E949A0D4826}.Release|x64.ActiveCfg = Release|x64 + {B94A9F63-113F-4F80-A962-2E949A0D4826}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E29AF102-41DF-4103-9BBF-D88331E8BF11} + EndGlobalSection +EndGlobal diff --git a/vmemu/main.cpp b/vmemu/main.cpp new file mode 100644 index 0000000..9130335 --- /dev/null +++ b/vmemu/main.cpp @@ -0,0 +1,31 @@ +#include +#include +#include + +int __cdecl main(int argc, const char* argv[]) +{ + argparse::argument_parser_t parser("uc-tracer", + "VMProtect 2 Virtual Instruction Tracer Using Unicorn"); + + parser.add_argument() + .name("--vmentry").required(true) + .description("relative virtual address to a vm entry..."); + + parser.add_argument() + .name("--vmpbin").required(true) + .description("path to unpacked virtualized binary..."); + + parser.add_argument() + .name("--imagebase").required("true") + .description("image base from optional PE header..."); + + auto result = parser.parse(argc, argv); + + if (result) + { + std::printf("[!] error parsing commandline arguments... reason = %s\n", + result.what().c_str()); + + return -1; + } +} diff --git a/uc-tracer/uc-tracer.vcxproj b/vmemu/vmemu.vcxproj similarity index 92% rename from uc-tracer/uc-tracer.vcxproj rename to vmemu/vmemu.vcxproj index 3d94017..763bd65 100644 --- a/uc-tracer/uc-tracer.vcxproj +++ b/vmemu/vmemu.vcxproj @@ -12,6 +12,7 @@ {b94a9f63-113f-4f80-a962-2e949a0d4826} uctracer 10.0 + vmemu @@ -32,7 +33,7 @@ false - $(Project)..\dependencies\unicorn\include;$(IncludePath) + $(Project)..\dependencies\cli-parser;$(Project)..\dependencies\unicorn\include;$(IncludePath) @@ -42,6 +43,7 @@ true NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true + stdcpp17 Console @@ -55,6 +57,7 @@ + diff --git a/uc-tracer/uc-tracer.vcxproj.filters b/vmemu/vmemu.vcxproj.filters similarity index 95% rename from uc-tracer/uc-tracer.vcxproj.filters rename to vmemu/vmemu.vcxproj.filters index 396eb07..3214239 100644 --- a/uc-tracer/uc-tracer.vcxproj.filters +++ b/vmemu/vmemu.vcxproj.filters @@ -55,5 +55,8 @@ Header Files\unicorn\unicorn + + Header Files + \ No newline at end of file