#include "components/zucchini/abs32_utils.h"
#include <algorithm>
#include <type_traits>
#include <utility>
#include "base/check_op.h"
#include "components/zucchini/io_utils.h"
namespace zucchini {
namespace {
template <typename T>
bool ReadAbs(ConstBufferView image, offset_t offset, uint64_t* value) { … }
template <typename T>
bool WriteAbs(offset_t offset, T value, MutableBufferView* image) { … }
}
AbsoluteAddress::AbsoluteAddress(Bitness bitness, uint64_t image_base)
: … { … }
AbsoluteAddress::AbsoluteAddress(AbsoluteAddress&&) = default;
AbsoluteAddress::~AbsoluteAddress() = default;
bool AbsoluteAddress::FromRva(rva_t rva) { … }
rva_t AbsoluteAddress::ToRva() const { … }
bool AbsoluteAddress::Read(offset_t offset, const ConstBufferView& image) { … }
bool AbsoluteAddress::Write(offset_t offset, MutableBufferView* image) { … }
Abs32RvaExtractorWin32::Abs32RvaExtractorWin32(
ConstBufferView image,
AbsoluteAddress&& addr,
const std::deque<offset_t>& abs32_locations,
offset_t lo,
offset_t hi)
: … { … }
Abs32RvaExtractorWin32::Abs32RvaExtractorWin32(Abs32RvaExtractorWin32&&) =
default;
Abs32RvaExtractorWin32::~Abs32RvaExtractorWin32() = default;
std::optional<Abs32RvaExtractorWin32::Unit> Abs32RvaExtractorWin32::GetNext() { … }
Abs32ReaderWin32::Abs32ReaderWin32(Abs32RvaExtractorWin32&& abs32_rva_extractor,
const AddressTranslator& translator)
: … { … }
Abs32ReaderWin32::~Abs32ReaderWin32() = default;
std::optional<Reference> Abs32ReaderWin32::GetNext() { … }
Abs32WriterWin32::Abs32WriterWin32(MutableBufferView image,
AbsoluteAddress&& addr,
const AddressTranslator& translator)
: … { … }
Abs32WriterWin32::~Abs32WriterWin32() = default;
void Abs32WriterWin32::PutNext(Reference ref) { … }
size_t RemoveUntranslatableAbs32(ConstBufferView image,
AbsoluteAddress&& addr,
const AddressTranslator& translator,
std::deque<offset_t>* locations) { … }
size_t RemoveOverlappingAbs32Locations(uint32_t width,
std::deque<offset_t>* locations) { … }
}