mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-30 08:11:01 +00:00
Log message box arguments
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "memory_manager.hpp"
|
||||
#include "memory_utils.hpp"
|
||||
#include "address_utils.hpp"
|
||||
#include "x86_register.hpp"
|
||||
|
||||
#include <utils/time.hpp>
|
||||
|
||||
@@ -367,3 +368,20 @@ inline std::u16string read_unicode_string(emulator& emu, const uint64_t uc_strin
|
||||
{
|
||||
return read_unicode_string(emu, emulator_object<UNICODE_STRING<EmulatorTraits<Emu64>>>{emu, uc_string});
|
||||
}
|
||||
|
||||
inline uint64_t get_function_argument(x86_64_emulator& emu, const size_t index, bool is_syscall = false)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return emu.reg(is_syscall ? x86_register::r10 : x86_register::rcx);
|
||||
case 1:
|
||||
return emu.reg(x86_register::rdx);
|
||||
case 2:
|
||||
return emu.reg(x86_register::r8);
|
||||
case 3:
|
||||
return emu.reg(x86_register::r9);
|
||||
default:
|
||||
return emu.read_stack(index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,19 +15,7 @@ struct syscall_context
|
||||
|
||||
inline uint64_t get_syscall_argument(x86_64_emulator& emu, const size_t index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return emu.reg(x86_register::r10);
|
||||
case 1:
|
||||
return emu.reg(x86_register::rdx);
|
||||
case 2:
|
||||
return emu.reg(x86_register::r8);
|
||||
case 3:
|
||||
return emu.reg(x86_register::r9);
|
||||
default:
|
||||
return emu.read_stack(index + 1);
|
||||
}
|
||||
return get_function_argument(emu, index, true);
|
||||
}
|
||||
|
||||
inline bool is_uppercase(const char character)
|
||||
|
||||
Reference in New Issue
Block a user