Fix compilation

This commit is contained in:
momo5502
2025-08-09 17:38:20 +02:00
parent eb07148bfd
commit 292fc6ce67
5 changed files with 19 additions and 8 deletions

View File

@@ -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_);

View File

@@ -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_);
}

View File

@@ -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)

View File

@@ -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);
}
}

View File

@@ -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));