2022-03-13 16:13:38 -04:00
|
|
|
#pragma once
|
2008-10-20 04:12:44 +00:00
|
|
|
|
|
|
|
#include "ELF.h"
|
2022-03-13 16:13:38 -04:00
|
|
|
#include "Stream.h"
|
2008-10-20 04:12:44 +00:00
|
|
|
|
|
|
|
class CElfFileContainer
|
|
|
|
{
|
|
|
|
public:
|
2018-04-30 21:01:23 +01:00
|
|
|
CElfFileContainer(Framework::CStream&);
|
|
|
|
virtual ~CElfFileContainer();
|
2008-10-20 04:12:44 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
uint8* GetFileContent() const;
|
2008-10-20 04:12:44 +00:00
|
|
|
|
|
|
|
private:
|
2018-04-30 21:01:23 +01:00
|
|
|
uint8* m_content;
|
2008-10-20 04:12:44 +00:00
|
|
|
};
|
|
|
|
|
2022-07-22 17:01:59 -04:00
|
|
|
template <typename ElfType>
|
|
|
|
class CElfFile : protected CElfFileContainer, public ElfType
|
2008-10-20 04:12:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-07-22 17:01:59 -04:00
|
|
|
CElfFile(Framework::CStream& stream)
|
|
|
|
: CElfFileContainer(stream)
|
|
|
|
, ElfType(GetFileContent())
|
|
|
|
{
|
|
|
|
}
|
2008-10-20 04:12:44 +00:00
|
|
|
|
2022-07-22 17:01:59 -04:00
|
|
|
virtual ~CElfFile() = default;
|
2008-10-20 04:12:44 +00:00
|
|
|
};
|
2022-07-22 17:01:59 -04:00
|
|
|
|
|
|
|
typedef CElfFile<CELF32> CElf32File;
|
|
|
|
typedef CElfFile<CELF64> CElf64File;
|