mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-31 16:31:02 +00:00
Merge remote-tracking branch 'origin/main' into unhandled-exceptions
This commit is contained in:
@@ -8,7 +8,6 @@ option(MOMO_ENABLE_CLANG_TIDY "Enable clang-tidy checks" OFF)
|
|||||||
option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON)
|
option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON)
|
||||||
option(MOMO_EMSCRIPTEN_MEMORY64 "Enable memory 64 support for emscripten builds" OFF)
|
option(MOMO_EMSCRIPTEN_MEMORY64 "Enable memory 64 support for emscripten builds" OFF)
|
||||||
option(MOMO_EMSCRIPTEN_SUPPORT_NODEJS "Enable Node.js filesystem for emscripten compilation" OFF)
|
option(MOMO_EMSCRIPTEN_SUPPORT_NODEJS "Enable Node.js filesystem for emscripten compilation" OFF)
|
||||||
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the sogen as a shared library (without the samples and tests)" OFF)
|
|
||||||
|
|
||||||
set(MOMO_REFLECTION_LEVEL "0" CACHE STRING "Reflection level for the build")
|
set(MOMO_REFLECTION_LEVEL "0" CACHE STRING "Reflection level for the build")
|
||||||
message(STATUS "Reflection level is set to: ${MOMO_REFLECTION_LEVEL}")
|
message(STATUS "Reflection level is set to: ${MOMO_REFLECTION_LEVEL}")
|
||||||
@@ -37,6 +36,18 @@ enable_testing()
|
|||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
|
if(PROJECT_IS_TOP_LEVEL)
|
||||||
|
set(MOMO_IS_SUBPROJECT OFF)
|
||||||
|
else()
|
||||||
|
set(MOMO_IS_SUBPROJECT ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the sogen as a shared library (without the samples and tests)" ${MOMO_IS_SUBPROJECT})
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
|||||||
2
deps/unicorn
vendored
2
deps/unicorn
vendored
Submodule deps/unicorn updated: 79f4f7a51e...6d9cc93779
@@ -473,19 +473,6 @@ namespace
|
|||||||
|
|
||||||
const auto concise_logging = !options.verbose_logging;
|
const auto concise_logging = !options.verbose_logging;
|
||||||
|
|
||||||
win_emu->emu().hook_instruction(x86_hookable_instructions::sgdt, [&](const uint64_t) {
|
|
||||||
const auto rip = win_emu->emu().read_instruction_pointer();
|
|
||||||
const auto mod = get_module_if_interesting(win_emu->mod_manager, options.modules, rip);
|
|
||||||
|
|
||||||
if (mod.has_value())
|
|
||||||
{
|
|
||||||
win_emu->log.print(color::blue, "Executing SGDT instruction at 0x%" PRIx64 " (%s)\n", rip,
|
|
||||||
(*mod) ? (*mod)->name.c_str() : "<N/A>");
|
|
||||||
}
|
|
||||||
|
|
||||||
return instruction_hook_continuation::run_instruction;
|
|
||||||
});
|
|
||||||
|
|
||||||
win_emu->emu().hook_instruction(x86_hookable_instructions::cpuid, [&] {
|
win_emu->emu().hook_instruction(x86_hookable_instructions::cpuid, [&] {
|
||||||
const auto rip = win_emu->emu().read_instruction_pointer();
|
const auto rip = win_emu->emu().read_instruction_pointer();
|
||||||
const auto mod = get_module_if_interesting(win_emu->mod_manager, options.modules, rip);
|
const auto mod = get_module_if_interesting(win_emu->mod_manager, options.modules, rip);
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ namespace unicorn
|
|||||||
return UC_X86_INS_RDTSC;
|
return UC_X86_INS_RDTSC;
|
||||||
case x86_hookable_instructions::rdtscp:
|
case x86_hookable_instructions::rdtscp:
|
||||||
return UC_X86_INS_RDTSCP;
|
return UC_X86_INS_RDTSCP;
|
||||||
case x86_hookable_instructions::sgdt:
|
|
||||||
return UC_X86_INS_SGDT;
|
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("Bad instruction for mapping");
|
throw std::runtime_error("Bad instruction for mapping");
|
||||||
}
|
}
|
||||||
@@ -401,18 +399,6 @@ namespace unicorn
|
|||||||
|
|
||||||
container->add(std::move(wrapper), std::move(hook));
|
container->add(std::move(wrapper), std::move(hook));
|
||||||
}
|
}
|
||||||
else if (inst_type == x86_hookable_instructions::sgdt)
|
|
||||||
{
|
|
||||||
function_wrapper<int, uc_engine*, uint64_t> wrapper([c = std::move(callback)](uc_engine*, const uint64_t data) {
|
|
||||||
return (c(data) == instruction_hook_continuation::skip_instruction) ? 1 : 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
const auto uc_instruction = map_hookable_instruction(inst_type);
|
|
||||||
uce(uc_hook_add(*this, hook.make_reference(), UC_HOOK_INSN, wrapper.get_function(), wrapper.get_user_data(), 0,
|
|
||||||
std::numeric_limits<pointer_type>::max(), uc_instruction));
|
|
||||||
|
|
||||||
container->add(std::move(wrapper), std::move(hook));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
function_wrapper<int, uc_engine*> wrapper([c = std::move(callback)](uc_engine*) {
|
function_wrapper<int, uc_engine*> wrapper([c = std::move(callback)](uc_engine*) {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ enum class x86_hookable_instructions
|
|||||||
cpuid,
|
cpuid,
|
||||||
rdtsc,
|
rdtsc,
|
||||||
rdtscp,
|
rdtscp,
|
||||||
sgdt,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// --[x86_64]-------------------------------------------------------------------------
|
// --[x86_64]-------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user