xoreos  0.0.5
pefile.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef AURORA_PEFILE_H
26 #define AURORA_PEFILE_H
27 
28 #include <vector>
29 
30 #include "src/common/types.h"
31 #include "src/common/scopedptr.h"
32 #include "src/common/ustring.h"
33 
34 #include "src/aurora/types.h"
35 #include "src/aurora/archive.h"
36 
37 namespace Common {
38  class SeekableReadStream;
39  class PEResources;
40 }
41 
42 namespace Aurora {
43 
45 class PEFile : public Archive {
46 public:
48  PEFile(Common::SeekableReadStream *exe, const std::vector<Common::UString> &remap);
49  ~PEFile();
50 
52  const ResourceList &getResources() const;
53 
55  Common::SeekableReadStream *getResource(uint32 index, bool tryNoCopy = false) const;
56 
57 private:
60 
63 
64  void load(const std::vector<Common::UString> &remap);
65 };
66 
67 } // End of namespace Aurora
68 
69 #endif // AURORA_PEFILE_H
void load(const std::vector< Common::UString > &remap)
Definition: pefile.cpp:104
Definition: 2dafile.h:39
Handling various archive files.
PEFile(Common::SeekableReadStream *exe, const std::vector< Common::UString > &remap)
Take over this stream and read a PE file out of it.
Definition: pefile.cpp:35
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource&#39;s contents.
Definition: pefile.cpp:50
A simple scoped smart pointer template.
std::list< Resource > ResourceList
Definition: archive.h:57
Low-level type definitions to handle fixed width types portably.
const ResourceList & getResources() const
Return the list of resources.
Definition: pefile.cpp:46
Unicode string handling.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
uint32_t uint32
Definition: types.h:204
Common::ScopedPtr< Common::PEResources > _peFile
The actual exe.
Definition: pefile.h:59
An abstract file archive.
Definition: archive.h:45
ResourceList _resources
External list of resource names and types.
Definition: pefile.h:62
Interface for a seekable & readable data stream.
Definition: readstream.h:265
A class encapsulating PE exe&#39;s for resource archive access.
Definition: pefile.h:45