mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 11:13:57 +00:00
Fix compilation
This commit is contained in:
@@ -103,6 +103,9 @@ namespace icicle
|
||||
|
||||
~icicle_x86_64_emulator() override
|
||||
{
|
||||
reset_object_with_delayed_destruction(this->hooks_);
|
||||
reset_object_with_delayed_destruction(this->storage_);
|
||||
|
||||
if (this->emu_)
|
||||
{
|
||||
icicle_destroy_emulator(this->emu_);
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace unicorn
|
||||
|
||||
~unicorn_x86_64_emulator() override
|
||||
{
|
||||
this->hooks_.clear();
|
||||
reset_object_with_delayed_destruction(this->hooks_);
|
||||
uc_close(this->uc_);
|
||||
}
|
||||
|
||||
|
||||
@@ -298,11 +298,11 @@ typedef struct _IMAGE_IMPORT_BY_NAME
|
||||
|
||||
typedef struct _IMAGE_IMPORT_DESCRIPTOR
|
||||
{
|
||||
union
|
||||
{
|
||||
DWORD Characteristics; // 0 for terminating null import descriptor
|
||||
DWORD OriginalFirstThunk; // RVA to original unbound IAT (PIMAGE_THUNK_DATA)
|
||||
} DUMMYUNIONNAME;
|
||||
// union
|
||||
//{
|
||||
// DWORD Characteristics; // 0 for terminating null import descriptor
|
||||
DWORD OriginalFirstThunk; // RVA to original unbound IAT (PIMAGE_THUNK_DATA)
|
||||
//} DUMMYUNIONNAME;
|
||||
DWORD TimeDateStamp; // 0 if not bound,
|
||||
// -1 if bound, and real date\time stamp
|
||||
// in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT (new BIND)
|
||||
|
||||
@@ -12,4 +12,12 @@ namespace utils
|
||||
object& operator=(object&&) = default;
|
||||
object& operator=(const object&) = default;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
void reset_object_with_delayed_destruction(T& obj)
|
||||
{
|
||||
T new_obj{};
|
||||
const auto old = std::move(obj);
|
||||
obj = std::move(new_obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace
|
||||
auto& imports = binary.imports[module_name];
|
||||
|
||||
auto original_thunk_data = buffer.as<IMAGE_THUNK_DATA64>(descriptor.FirstThunk);
|
||||
|
||||
if (descriptor.OriginalFirstThunk)
|
||||
{
|
||||
original_thunk_data = buffer.as<IMAGE_THUNK_DATA64>(descriptor.OriginalFirstThunk);
|
||||
@@ -79,7 +78,8 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
sym.name = buffer.as_string(original_thunk.u1.AddressOfData + offsetof(IMAGE_IMPORT_BY_NAME, Name));
|
||||
sym.name = buffer.as_string(
|
||||
static_cast<size_t>(original_thunk.u1.AddressOfData + offsetof(IMAGE_IMPORT_BY_NAME, Name)));
|
||||
}
|
||||
|
||||
imports.push_back(std::move(sym));
|
||||
|
||||
Reference in New Issue
Block a user