mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-30 08:11:01 +00:00
Some fixes
This commit is contained in:
@@ -125,7 +125,7 @@ namespace
|
|||||||
uc.reg<uint64_t>(UC_X86_REG_RAX, STATUS_SUCCESS);
|
uc.reg<uint64_t>(UC_X86_REG_RAX, STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_NtQuerySystemInformation(const unicorn& uc, const process_context& context)
|
void handle_NtQuerySystemInformation(const unicorn& uc)
|
||||||
{
|
{
|
||||||
const auto info_class = uc.reg<uint32_t>(UC_X86_REG_R10D);
|
const auto info_class = uc.reg<uint32_t>(UC_X86_REG_R10D);
|
||||||
const auto system_information = uc.reg(UC_X86_REG_RDX);
|
const auto system_information = uc.reg(UC_X86_REG_RDX);
|
||||||
@@ -175,7 +175,7 @@ namespace
|
|||||||
uc.reg<uint64_t>(UC_X86_REG_RAX, STATUS_SUCCESS);
|
uc.reg<uint64_t>(UC_X86_REG_RAX, STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_NtQueryProcessInformation(const unicorn& uc, const process_context& context)
|
void handle_NtQueryProcessInformation(const unicorn& uc)
|
||||||
{
|
{
|
||||||
const auto process_handle = uc.reg<uint64_t>(UC_X86_REG_R10);
|
const auto process_handle = uc.reg<uint64_t>(UC_X86_REG_R10);
|
||||||
const auto info_class = uc.reg<uint32_t>(UC_X86_REG_EDX);
|
const auto info_class = uc.reg<uint32_t>(UC_X86_REG_EDX);
|
||||||
@@ -398,7 +398,7 @@ void handle_syscall(const unicorn& uc, process_context& context)
|
|||||||
handle_NtFreeVirtualMemory(uc);
|
handle_NtFreeVirtualMemory(uc);
|
||||||
break;
|
break;
|
||||||
case 0x19:
|
case 0x19:
|
||||||
handle_NtQueryProcessInformation(uc, context);
|
handle_NtQueryProcessInformation(uc);
|
||||||
break;
|
break;
|
||||||
case 0x23:
|
case 0x23:
|
||||||
handle_NtQueryVirtualMemory(uc, context);
|
handle_NtQueryVirtualMemory(uc, context);
|
||||||
@@ -407,7 +407,7 @@ void handle_syscall(const unicorn& uc, process_context& context)
|
|||||||
handle_NtQueryPerformanceCounter(uc);
|
handle_NtQueryPerformanceCounter(uc);
|
||||||
break;
|
break;
|
||||||
case 0x36:
|
case 0x36:
|
||||||
handle_NtQuerySystemInformation(uc, context);
|
handle_NtQuerySystemInformation(uc);
|
||||||
break;
|
break;
|
||||||
case 0x48:
|
case 0x48:
|
||||||
handle_NtCreateEvent(uc, context);
|
handle_NtCreateEvent(uc, context);
|
||||||
|
|||||||
@@ -50,9 +50,10 @@ public:
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T = uint64_t>
|
template <typename T = uint64_t, typename S>
|
||||||
void reg(const int regid, const T& value) const
|
void reg(const int regid, const S& maybe_value) const
|
||||||
{
|
{
|
||||||
|
T value = static_cast<T>(maybe_value);
|
||||||
e(uc_reg_write(this->uc_, regid, &value));
|
e(uc_reg_write(this->uc_, regid, &value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user