Reimplement snapshot support

This commit is contained in:
momo5502
2025-05-25 17:56:50 +02:00
parent 2c7f63b794
commit 30363cc760
2 changed files with 5 additions and 9 deletions

View File

@@ -75,7 +75,7 @@ namespace
emu.restore_snapshot();
}
fuzzer::execution_result execute(std::span<const uint8_t> data,
fuzzer::execution_result execute(const std::span<const uint8_t> data,
const std::function<fuzzer::coverage_functor>& coverage_handler) override
{
// printf("Input size: %zd\n", data.size());

View File

@@ -696,11 +696,9 @@ void windows_emulator::deserialize(utils::buffer_deserializer& buffer)
this->dispatcher.deserialize(buffer);
}
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
void windows_emulator::save_snapshot()
{
throw std::runtime_error("Not supported");
/*utils::buffer_serializer serializer{};
utils::buffer_serializer serializer{};
this->emu().serialize_state(serializer, true);
this->memory.serialize_memory_state(serializer, true);
this->mod_manager.serialize(serializer);
@@ -709,14 +707,12 @@ void windows_emulator::save_snapshot()
this->process_snapshot_ = serializer.move_buffer();
// TODO: Make process copyable
// this->process_snapshot_ = this->process;*/
// this->process_snapshot_ = this->process;
}
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
void windows_emulator::restore_snapshot()
{
throw std::runtime_error("Not supported");
/*if (this->process_snapshot_.empty())
if (this->process_snapshot_.empty())
{
assert(false);
return;
@@ -727,5 +723,5 @@ void windows_emulator::restore_snapshot()
this->memory.deserialize_memory_state(deserializer, true);
this->mod_manager.deserialize(deserializer);
this->process.deserialize(deserializer);
// this->process = *this->process_snapshot_;*/
// this->process = *this->process_snapshot_;
}