mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-20 04:03:57 +00:00
Rename is_within method to contains
This commit is contained in:
@@ -308,8 +308,8 @@ namespace
|
||||
#endif
|
||||
|
||||
const auto previous_ip = c.win_emu->current_thread().previous_ip;
|
||||
const auto is_main_exe = win_emu.mod_manager.executable->is_within(address);
|
||||
const auto is_previous_main_exe = win_emu.mod_manager.executable->is_within(previous_ip);
|
||||
const auto is_main_exe = win_emu.mod_manager.executable->contains(address);
|
||||
const auto is_previous_main_exe = win_emu.mod_manager.executable->contains(previous_ip);
|
||||
|
||||
const auto binary = utils::make_lazy([&] {
|
||||
if (is_main_exe)
|
||||
@@ -448,7 +448,7 @@ namespace
|
||||
win_emu.log.print(color::blue, "Executing inline syscall: %.*s (0x%X) at 0x%" PRIx64 " (%s)\n", STR_VIEW_VA(syscall_name),
|
||||
syscall_id, address, mod ? mod->name.c_str() : "<N/A>");
|
||||
}
|
||||
else if (mod->is_within(previous_ip))
|
||||
else if (mod->contains(previous_ip))
|
||||
{
|
||||
const auto rsp = emu.read_stack_pointer();
|
||||
|
||||
@@ -514,7 +514,7 @@ namespace
|
||||
const auto& import_list = c.win_emu->mod_manager.executable->imports;
|
||||
|
||||
const auto rip = c.win_emu->emu().read_instruction_pointer();
|
||||
if (!c.win_emu->mod_manager.executable->is_within(rip))
|
||||
if (!c.win_emu->mod_manager.executable->contains(rip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -582,7 +582,7 @@ void register_analysis_callbacks(analysis_context& c)
|
||||
|
||||
std::optional<mapped_module*> get_module_if_interesting(module_manager& manager, const string_set& modules, const uint64_t address)
|
||||
{
|
||||
if (manager.executable->is_within(address))
|
||||
if (manager.executable->contains(address))
|
||||
{
|
||||
return manager.executable;
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace
|
||||
|
||||
const char* get_module_memory_region_name(const mapped_module& mod, const uint64_t address)
|
||||
{
|
||||
if (!mod.is_within(address))
|
||||
if (!mod.contains(address))
|
||||
{
|
||||
return "outside???";
|
||||
}
|
||||
@@ -540,7 +540,7 @@ namespace
|
||||
|
||||
auto read_handler = [&, section, concise_logging, read_count](const uint64_t address, const void*, size_t) {
|
||||
const auto rip = win_emu->emu().read_instruction_pointer();
|
||||
if (!win_emu->mod_manager.executable->is_within(rip))
|
||||
if (!win_emu->mod_manager.executable->contains(rip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -560,7 +560,7 @@ namespace
|
||||
|
||||
const auto write_handler = [&, section, concise_logging, write_count](const uint64_t address, const void*, size_t) {
|
||||
const auto rip = win_emu->emu().read_instruction_pointer();
|
||||
if (!win_emu->mod_manager.executable->is_within(rip))
|
||||
if (!win_emu->mod_manager.executable->contains(rip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void tenet_tracer::filter_and_write_buffer()
|
||||
char* end_ptr = nullptr;
|
||||
uint64_t address = std::strtoull(line.c_str() + rip_pos + 6, &end_ptr, 16);
|
||||
|
||||
bool is_line_inside = exe_module->is_within(address);
|
||||
bool is_line_inside = exe_module->contains(address);
|
||||
const auto _1 = utils::finally([&] {
|
||||
currently_outside = !is_line_inside; //
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ struct mapped_module
|
||||
|
||||
bool is_static{false};
|
||||
|
||||
bool is_within(const uint64_t address) const
|
||||
bool contains(const uint64_t address) const
|
||||
{
|
||||
return address >= this->image_base && address < (this->image_base + this->size_of_image);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class module_manager
|
||||
|
||||
std::advance(upper_bound, -1);
|
||||
|
||||
if (upper_bound->second.is_within(address))
|
||||
if (upper_bound->second.contains(address))
|
||||
{
|
||||
return upper_bound;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user