You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "lloutils.hpp"
|
|
|
|
|
|
|
|
namespace llo
|
|
|
|
{
|
|
|
|
class lloiff_t
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit lloiff_t( std::string &file_name ) : file_name( file_name )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
class section_offset_t
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
llo::utils::hash_t< std::string > section_name;
|
|
|
|
std::uint32_t offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
class symbol_t
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
llo::utils::hash_t< std::string > symbol_name;
|
|
|
|
section_offset_t location;
|
|
|
|
};
|
|
|
|
|
|
|
|
class section_t
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
llo::utils::hash_t< std::string > section_name;
|
|
|
|
std::vector< symbol_t > symbols;
|
|
|
|
std::vector< std::uint8_t > section_raw;
|
|
|
|
};
|
|
|
|
|
|
|
|
static std::shared_ptr< lloiff_t > begin( std::string &file_name )
|
|
|
|
{
|
|
|
|
return std::make_shared< lloiff_t >( file_name );
|
|
|
|
}
|
|
|
|
|
|
|
|
llo::utils::hash_t< std::string > get_name() const
|
|
|
|
{
|
|
|
|
return file_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
llo::utils::hash_t< std::string > file_name;
|
|
|
|
std::vector< section_t > sections;
|
|
|
|
};
|
|
|
|
} // namespace llo
|