Commit f132d361 authored by IDontCode's avatar IDontCode 🔧
Browse files

renamed

parent b89b0295
......@@ -85,10 +85,10 @@ namespace vm
};
}
class tracer_t
class hook_t
{
public:
explicit tracer_t(
explicit hook_t(
u64 module_base,
u64 image_base,
decrypt_handler_t decrypt_handler,
......@@ -112,7 +112,7 @@ namespace vm
const encrypt_handler_t encrypt_handler;
};
inline vm::tracer_t* g_vmctx = nullptr;
inline vm::hook_t* g_vmctx = nullptr;
}
extern "C" void vtrap_wrapper(vm::registers * regs, u8 handler_idx);
\ No newline at end of file
#pragma once
#include "vmtracer.hpp"
namespace vmp2
{
enum class exec_type_t
{
forward,
backward
};
enum class version_t
{
invalid,
v1 = 0x101
};
struct file_header
{
u32 magic; // VMP2!
u64 epoch_time;
u64 module_base;
exec_type_t advancement;
version_t version;
u32 entry_count;
u32 entry_offset;
};
struct entry_t
{
u8 handler_idx;
u64 decrypt_key;
u64 vip;
union
{
struct
{
u64 r15;
u64 r14;
u64 r13;
u64 r12;
u64 r11;
u64 r10;
u64 r9;
u64 r8;
u64 rbp;
u64 rdi;
u64 rsi;
u64 rdx;
u64 rcx;
u64 rbx;
u64 rax;
u64 rflags;
};
u64 raw[16];
} regs;
union
{
u64 qword[0x28];
u8 raw[0x140];
} vregs;
union
{
u64 qword[0x20];
u8 raw[0x100];
} vsp;
};
}
\ No newline at end of file
#include "vmtracer.hpp"
#include "vmhook.hpp"
namespace vm
{
......@@ -36,7 +36,7 @@ namespace vm
}
}
tracer_t::tracer_t(
hook_t::hook_t(
u64 module_base,
u64 image_base,
decrypt_handler_t decrypt_handler,
......@@ -67,29 +67,29 @@ namespace vm
&__vtrap) - module_base) + image_base);
}
u64 tracer_t::encrypt(u64 val) const
u64 hook_t::encrypt(u64 val) const
{
return encrypt_handler(val);
}
u64 tracer_t::decrypt(u64 val) const
u64 hook_t::decrypt(u64 val) const
{
return decrypt_handler(val);
}
void tracer_t::set_trap(u64 val) const
void hook_t::set_trap(u64 val) const
{
for (auto idx = 0u; idx < 256; ++idx)
handler_table->set_entry(idx, val);
}
void tracer_t::start() const
void hook_t::start() const
{
for (auto idx = 0u; idx < 256; ++idx)
handler_table->set_entry(idx, vtrap_encrypted);
}
void tracer_t::stop() const
void hook_t::stop() const
{
for (auto idx = 0u; idx < 256; ++idx)
{
......
......@@ -24,7 +24,7 @@
<ProjectGuid>{D257C9F6-C705-49D5-84ED-64C9C513C419}</ProjectGuid>
<RootNamespace>vmtracer</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>vmtracer</ProjectName>
<ProjectName>vmhook</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
......@@ -143,7 +143,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="vmtracer.cpp" />
<ClCompile Include="vmhook.cpp" />
</ItemGroup>
<ItemGroup>
<MASM Include="vtrap.asm">
......@@ -151,8 +151,7 @@
</MASM>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vmp2.hpp" />
<ClInclude Include="..\include\vmtracer.hpp" />
<ClInclude Include="..\include\vmhook.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -10,22 +10,19 @@
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="vmtracer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="vtrap.asm">
<Filter>Source Files</Filter>
</MASM>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vmp2.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vmtracer.hpp">
<ClInclude Include="..\include\vmhook.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="vmhook.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment