Some fixes

This commit is contained in:
momo5502
2024-08-19 21:16:26 +02:00
parent c6c297cb97
commit 9150d48475
2 changed files with 7 additions and 6 deletions

View File

@@ -125,7 +125,7 @@ namespace
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 system_information = uc.reg(UC_X86_REG_RDX);
@@ -175,7 +175,7 @@ namespace
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 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);
break;
case 0x19:
handle_NtQueryProcessInformation(uc, context);
handle_NtQueryProcessInformation(uc);
break;
case 0x23:
handle_NtQueryVirtualMemory(uc, context);
@@ -407,7 +407,7 @@ void handle_syscall(const unicorn& uc, process_context& context)
handle_NtQueryPerformanceCounter(uc);
break;
case 0x36:
handle_NtQuerySystemInformation(uc, context);
handle_NtQuerySystemInformation(uc);
break;
case 0x48:
handle_NtCreateEvent(uc, context);

View File

@@ -50,9 +50,10 @@ public:
return value;
}
template <typename T = uint64_t>
void reg(const int regid, const T& value) const
template <typename T = uint64_t, typename S>
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));
}