xoreos
0.0.5
|
A class encapsulating PE exe's for resource archive access. More...
#include <pefile.h>
Public Member Functions | |
PEFile (Common::SeekableReadStream *exe, const std::vector< Common::UString > &remap) | |
Take over this stream and read a PE file out of it. More... | |
~PEFile () | |
const ResourceList & | getResources () const |
Return the list of resources. More... | |
Common::SeekableReadStream * | getResource (uint32 index, bool tryNoCopy=false) const |
Return a stream of the resource's contents. More... | |
Public Member Functions inherited from Aurora::Archive | |
Archive () | |
virtual | ~Archive () |
virtual uint32 | getResourceSize (uint32 index) const |
Return the size of a resource. More... | |
virtual Common::HashAlgo | getNameHashAlgo () const |
Return with which algorithm the name is hashed. More... | |
uint32 | findResource (uint64 hash) const |
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found. More... | |
uint32 | findResource (const Common::UString &name, FileType type) const |
Return the index of the resource matching the name and type, or 0xFFFFFFFF if not found. More... | |
Private Member Functions | |
void | load (const std::vector< Common::UString > &remap) |
Private Attributes | |
Common::ScopedPtr< Common::PEResources > | _peFile |
The actual exe. More... | |
ResourceList | _resources |
External list of resource names and types. More... | |
Additional Inherited Members | |
Public Types inherited from Aurora::Archive | |
typedef std::list< Resource > | ResourceList |
Aurora::PEFile::PEFile | ( | Common::SeekableReadStream * | exe, |
const std::vector< Common::UString > & | remap | ||
) |
Take over this stream and read a PE file out of it.
Definition at line 35 of file pefile.cpp.
References _peFile, load(), and Common::ScopedPtrBase< T, Deallocator >::reset().
Aurora::PEFile::~PEFile | ( | ) |
Definition at line 43 of file pefile.cpp.
|
virtual |
Return a stream of the resource's contents.
Implements Aurora::Archive.
Definition at line 50 of file pefile.cpp.
References _peFile, Common::MemoryWriteStreamDynamic::getData(), Common::kPECursor, Common::kPEGroupCursor, Common::PtrVector< T, Deallocator >::resize(), Common::MemoryWriteStreamDynamic::setDisposable(), Common::MemoryWriteStreamDynamic::size(), Common::WriteStream::writeByte(), Common::WriteStream::writeStream(), Common::WriteStream::writeUint16LE(), and Common::WriteStream::writeUint32LE().
|
virtual |
Return the list of resources.
Implements Aurora::Archive.
Definition at line 46 of file pefile.cpp.
References _resources.
|
private |
Definition at line 104 of file pefile.cpp.
References _peFile, _resources, Common::UString::format(), Aurora::Archive::Resource::index, Aurora::kFileTypeCUR, Common::kPEGroupCursor, Aurora::Archive::Resource::name, and Aurora::Archive::Resource::type.
Referenced by PEFile().
|
private |
The actual exe.
Definition at line 59 of file pefile.h.
Referenced by getResource(), load(), and PEFile().
|
private |
External list of resource names and types.
Definition at line 62 of file pefile.h.
Referenced by getResources(), and load().