fix warnings

This commit is contained in:
robert-yates
2024-11-23 19:02:49 +01:00
parent 22d64437aa
commit 6b51b143bc
4 changed files with 10 additions and 8 deletions

View File

@@ -90,7 +90,7 @@ namespace
restore_emulator();
const auto memory = emu.emu().allocate_memory(page_align_up(std::max(data.size(), 1ULL)),
const auto memory = emu.emu().allocate_memory(page_align_up(std::max(data.size(), size_t(1))),
memory_permission::read_write);
emu.emu().write_memory(memory, data.data(), data.size());

View File

@@ -123,7 +123,7 @@ namespace fuzzer
const auto executions = context.executions.exchange(0);
const auto highest_scorer = context.generator.get_highest_scorer();
const auto avg_score = context.generator.get_average_score();
printf("Executions/s: %lld - Score: %llX - Avg: %.3f\n", executions, highest_scorer.score, avg_score);
printf("Executions/s: %zd - Score: %zX - Avg: %.3f\n", executions, highest_scorer.score, avg_score);
}
}
}

View File

@@ -315,15 +315,17 @@ namespace unicorn
mmio_write_callback write_cb) override
{
mmio_callbacks cb{
.read = [c = std::move(read_cb)](uc_engine*, const uint64_t addr, const uint32_t s)
.read = mmio_callbacks::read_wrapper(
[c = std::move(read_cb)](uc_engine*, const uint64_t addr, const uint32_t s)
{
return c(addr, s);
},
.write = [c = std::move(write_cb)](uc_engine*, const uint64_t addr, const uint32_t s,
}),
.write = mmio_callbacks::write_wrapper(
[c = std::move(write_cb)](uc_engine*, const uint64_t addr, const uint32_t s,
const uint64_t value)
{
c(addr, s, value);
}
})
};
uce(uc_mmio_map(*this, address, size, cb.read.get_c_function(), cb.read.get_user_data(),

View File

@@ -109,13 +109,13 @@ void syscall_dispatcher::dispatch(windows_emulator& win_emu)
}
catch (std::exception& e)
{
printf("Syscall threw an exception: %X (0x%llX) - %s\n", syscall_id, address, e.what());
printf("Syscall threw an exception: %X (0x%zX) - %s\n", syscall_id, address, e.what());
emu.reg<uint64_t>(x64_register::rax, STATUS_UNSUCCESSFUL);
emu.stop();
}
catch (...)
{
printf("Syscall threw an unknown exception: %X (0x%llX)\n", syscall_id, address);
printf("Syscall threw an unknown exception: %X (0x%zX)\n", syscall_id, address);
emu.reg<uint64_t>(x64_register::rax, STATUS_UNSUCCESSFUL);
emu.stop();
}