#include <ElfReader.h>
Onikiri::EmulatorUtility::ElfReaderのコラボレーション図
Public 型 | |
typedef u64 | Elf_Addr |
typedef ELF64_HEADER | Elf_Ehdr |
typedef u64 | Elf_Off |
typedef ELF64_PROGRAM | Elf_Phdr |
typedef ELF64_SECTION | Elf_Shdr |
typedef u32 | Elf_Word |
typedef std::streamsize | streamsize |
Public メソッド | |
void | Close () |
ElfReader () | |
int | FindSection (const char *name) const |
int | GetClass () const |
int | GetDataEncoding () const |
Elf_Addr | GetEntryPoint () const |
streamsize | GetImageSize () const |
u16 | GetMachine () const |
const Elf_Phdr & | GetProgramHeader (int index) const |
int | GetProgramHeaderCount () const |
Elf_Off | GetProgramHeaderOffset () const |
const Elf_Shdr & | GetSectionHeader (int index) const |
int | GetSectionHeaderCount () const |
Elf_Off | GetSectionHeaderOffset () const |
const char * | GetSectionName (int index) const |
int | GetVersion () const |
bool | IsBigEndian () const |
void | Open (const char *name) |
void | ReadImage (char *buf, size_t buf_size) const |
void | ReadRange (size_t offset, char *buf, size_t buf_size) const |
void | ReadSectionBody (int index, char *buf, size_t buf_size) const |
~ElfReader () |
ElfReader.h の 45 行で定義されています。
ElfReader.h の 51 行で定義されています。
ElfReader.h の 48 行で定義されています。
ElfReader.h の 53 行で定義されています。
ElfReader.h の 50 行で定義されています。
ElfReader.h の 49 行で定義されています。
ElfReader.h の 52 行で定義されています。
typedef std::streamsize Onikiri::EmulatorUtility::ElfReader::streamsize |
ElfReader.h の 55 行で定義されています。
ElfReader::ElfReader | ( | ) | [explicit] |
ElfReader::~ElfReader | ( | ) |
void ElfReader::Close | ( | ) |
int ElfReader::FindSection | ( | const char * | name | ) | const |
ElfReader.cpp の 213 行で定義されています。
参照先 GetSectionHeaderCount()・GetSectionName().
00214 { 00215 for (int i = 0; i < GetSectionHeaderCount(); i++) { 00216 if (strcmp(GetSectionName(i), name) == 0) 00217 return i; 00218 } 00219 00220 return -1; 00221 }
関数の呼び出しグラフ:
int ElfReader::GetClass | ( | ) | const |
int ElfReader::GetDataEncoding | ( | ) | const |
ElfReader::Elf_Addr ElfReader::GetEntryPoint | ( | ) | const |
ElfReader.cpp の 268 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::CalculateEntryPoint()・Onikiri::PPC64Linux::PPC64LinuxLoader::CalculateEntryPoint()・Onikiri::PPC64Linux::PPC64LinuxLoader::CalculateOthers().
00269 { 00270 return m_elfHeader.e_entry; 00271 }
Here is the caller graph for this function:
streamsize ElfReader::GetImageSize | ( | ) | const |
u16 ElfReader::GetMachine | ( | ) | const |
ElfReader.cpp の 258 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary().
00259 { 00260 return m_elfHeader.e_machine; 00261 }
Here is the caller graph for this function:
const ElfReader::Elf_Phdr & ElfReader::GetProgramHeader | ( | int | index | ) | const |
ElfReader.cpp の 299 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary().
Here is the caller graph for this function:
int ElfReader::GetProgramHeaderCount | ( | ) | const |
ElfReader.cpp の 289 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary().
Here is the caller graph for this function:
ElfReader::Elf_Off ElfReader::GetProgramHeaderOffset | ( | ) | const |
ElfReader.cpp の 278 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary().
00279 { 00280 return m_elfHeader.e_phoff; 00281 }
Here is the caller graph for this function:
const ElfReader::Elf_Shdr & ElfReader::GetSectionHeader | ( | int | index | ) | const |
ElfReader.cpp の 294 行で定義されています。
参照元 GetSectionName()・ReadSectionBody().
Here is the caller graph for this function:
int ElfReader::GetSectionHeaderCount | ( | ) | const |
ElfReader::Elf_Off ElfReader::GetSectionHeaderOffset | ( | ) | const |
const char * ElfReader::GetSectionName | ( | int | index | ) | const |
ElfReader.cpp の 206 行で定義されています。
参照先 GetSectionHeader()・Onikiri::EmulatorUtility::ELF64::ELF64_SECTION::sh_name.
参照元 FindSection().
00207 { 00208 const Elf_Shdr &sh = GetSectionHeader(index); 00209 00210 return m_sectionNameTable + sh.sh_name; 00211 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
int ElfReader::GetVersion | ( | ) | const |
ElfReader.cpp の 253 行で定義されています。
参照先 Onikiri::EmulatorUtility::ELF::EI_VERSION.
00254 { 00255 return m_elfHeader.e_ident[EI_VERSION]; 00256 }
bool ElfReader::IsBigEndian | ( | ) | const |
ElfReader.cpp の 263 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary().
Here is the caller graph for this function:
void ElfReader::Open | ( | const char * | name | ) |
ElfReader.cpp の 58 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary().
00059 { 00060 m_file.open(name, ios_base::in | ios_base::binary); 00061 if (m_file.fail()) { 00062 stringstream ss; 00063 ss << "'" << name << "' : cannot open file"; 00064 throw runtime_error(ss.str()); 00065 } 00066 00067 try { 00068 ReadELFHeader(); 00069 ReadSectionHeaders(); 00070 ReadProgramHeaders(); 00071 ReadSectionNameTable(); 00072 } 00073 catch (runtime_error& e) { 00074 m_file.close(); 00075 00076 stringstream ss; 00077 ss << "'" << name << "' : " << e.what(); 00078 throw runtime_error(ss.str()); 00079 } 00080 }
Here is the caller graph for this function:
void ElfReader::ReadImage | ( | char * | buf, | |
size_t | buf_size | |||
) | const |
ElfReader.cpp の 229 行で定義されています。
参照先 GetImageSize().
00230 { 00231 streamsize size = GetImageSize(); 00232 if ((streamsize)buf_size < size) 00233 throw runtime_error("read error"); 00234 00235 m_file.seekg(0, ios_base::beg); 00236 m_file.read(buf, static_cast<std::streamoff>(size)); 00237 00238 if (m_file.fail()) 00239 throw runtime_error("read error"); 00240 }
関数の呼び出しグラフ:
void ElfReader::ReadRange | ( | size_t | offset, | |
char * | buf, | |||
size_t | buf_size | |||
) | const |
ElfReader.cpp の 197 行で定義されています。
参照元 Onikiri::EmulatorUtility::Linux64Loader::LoadBinary()・ReadSectionBody().
00198 { 00199 m_file.seekg(static_cast<istream::off_type>(offset), ios_base::beg); 00200 m_file.read(buf, static_cast<std::streamsize>(buf_size)); 00201 00202 if (m_file.fail()) 00203 throw runtime_error("read error"); 00204 }
Here is the caller graph for this function:
void ElfReader::ReadSectionBody | ( | int | index, | |
char * | buf, | |||
size_t | buf_size | |||
) | const |
ElfReader.cpp の 188 行で定義されています。
参照先 GetSectionHeader()・ReadRange()・Onikiri::EmulatorUtility::ELF64::ELF64_SECTION::sh_offset・Onikiri::EmulatorUtility::ELF64::ELF64_SECTION::sh_size.
00189 { 00190 const Elf_Shdr &sh = GetSectionHeader(index); 00191 if (buf_size != sh.sh_size) 00192 throw runtime_error("not enough buffer"); 00193 00194 ReadRange((size_t)sh.sh_offset, buf, (size_t)sh.sh_size); 00195 }
関数の呼び出しグラフ: