Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MzHeader and PeHeader classes in PELIB were replaced by ImageLoader class #812

Merged
merged 34 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a5fbd06
ImageLoader: Import Directory 1
Jun 16, 2020
546dbdb
ImageLoader: Import & IAT
Jun 16, 2020
d20fe2a
Image Loader: IAT
Jun 17, 2020
b728684
ImageLoader: Debug Directory
Jun 19, 2020
e361360
ImageLoader: TLS Directory
Jun 19, 2020
64a6d9e
ImageLoader: Resources
Jun 19, 2020
f68df78
ImageLoader : Relocations + COM directory
Jun 22, 2020
6405bd9
ImageLoader: Regression Tests 1
Jun 24, 2020
e7701d3
ImageLoader: Last regression test remaining to solve
Jun 26, 2020
175fa6c
ImageLoader: Finalizing
Jun 29, 2020
a7640da
ImageLoader: Regression tests passed
Jun 29, 2020
6fcafec
ImageLoader: Tests OK
Jun 30, 2020
cbc761e
ImageLoader: Complete
Jul 1, 2020
f5c6c35
Linux build: Removed _cdecl
Jul 1, 2020
b1989bd
Linux Build: reference solved
Jul 1, 2020
1bd2fa6
Linux Build
Jul 2, 2020
2c8bdc3
Commiting all changes to cloud
Jul 2, 2020
c1e403a
Solved the mystery of image header mapping under Windows XP
Jul 4, 2020
b930258
Unpackers: UPX (progress)
Jul 9, 2020
c799cdd
Unpackers: Progress
Jul 10, 2020
eefe6c6
Unpacker: UPX complete
Jul 13, 2020
ee063ba
Unpacker: MPRESS complete
Jul 14, 2020
020ff9b
Make linux-doxygen build happy
Jul 14, 2020
608c2d0
Fixing Mac build
Jul 14, 2020
e33bc6e
Fixing doxygen build
Jul 14, 2020
0f8bbbb
Fixing Mac build
Jul 14, 2020
b697100
Cleaning up
Jul 14, 2020
5f79546
Cleaning up
Jul 15, 2020
bc459cf
Fixing doxugen build regression
Jul 15, 2020
d12edc6
cosmetic
Jul 15, 2020
321d444
Fixing build
Jul 15, 2020
25fefe2
Final version ImageLoader also testes on Windows Vista and Windows 8/8.1
Jul 15, 2020
fcfcea1
Post-apocalypse fix after OpenSSL has been removed
Jul 16, 2020
1aca22f
Changes requested in review
Jul 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions include/retdec/fileformat/file_format/pe/pe_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#define RETDEC_FILEFORMAT_FILE_FORMAT_PE_PE_FORMAT_H

#include "retdec/fileformat/file_format/file_format.h"
#include "retdec/fileformat/file_format/pe/pe_format_parser/pe_format_parser.h"
#include "retdec/fileformat/file_format/pe/pe_format_parser.h"
#include "retdec/fileformat/types/dotnet_headers/blob_stream.h"
#include "retdec/fileformat/types/dotnet_headers/guid_stream.h"
#include "retdec/fileformat/types/dotnet_headers/metadata_stream.h"
#include "retdec/fileformat/types/dotnet_headers/string_stream.h"
#include "retdec/fileformat/types/dotnet_headers/user_string_stream.h"
#include "retdec/fileformat/types/dotnet_types/dotnet_class.h"
#include "retdec/fileformat/types/visual_basic/visual_basic_info.h"
#include "retdec/pelib/PeLib.h"
#include "retdec/pelib/PeFile.h"

// Forward declare OpenSSL structures used in this header.
typedef struct pkcs7_st PKCS7;
Expand All @@ -32,7 +32,6 @@ class PeFormat : public FileFormat
{
private:
PeFormatParser *formatParser; ///< parser of PE file
PeLib::MzHeader mzHeader; ///< MZ header
std::unique_ptr<CLRHeader> clrHeader; ///< .NET CLR header
std::unique_ptr<MetadataHeader> metadataHeader; ///< .NET metadata header
std::unique_ptr<MetadataStream> metadataStream; ///< .NET metadata stream
Expand Down Expand Up @@ -123,9 +122,7 @@ class PeFormat : public FileFormat
void scanForOptHeaderAnomalies();
/// @}
protected:
PeLib::PeFile *file; ///< PeLib representation of PE file
PeLib::PeHeaderT<32> *peHeader32; ///< header of 32-bit PE file
PeLib::PeHeaderT<64> *peHeader64; ///< header of 64-bit PE file
PeLib::PeFileT *file; ///< PeLib representation of PE file
public:
PeFormat(const std::string & pathToFile, const std::string & dllListFile, LoadFlags loadFlags = LoadFlags::NONE);
PeFormat(std::istream &inputStream, LoadFlags loadFlags = LoadFlags::NONE);
Expand Down Expand Up @@ -162,10 +159,11 @@ class PeFormat : public FileFormat

/// @name Detection methods
/// @{
const PeLib::MzHeader & getMzHeader() const;
const PeLib::ImageLoader & getImageLoader() const;
std::size_t getMzHeaderSize() const;
std::size_t getOptionalHeaderSize() const;
std::size_t getPeHeaderOffset() const;
std::size_t getImageBitability() const;
std::size_t getCoffSymbolTableOffset() const;
std::size_t getNumberOfCoffSymbols() const;
std::size_t getSizeOfStringTable() const;
Expand All @@ -191,8 +189,6 @@ class PeFormat : public FileFormat
bool dllListFailedToLoad() const;
bool initDllList(const std::string & dllListFile);

PeLib::PeFile32* isPe32() const;
PeLib::PeFile64* isPe64() const;
bool isDotNet() const;
bool isPackedDotNet() const;
bool isVisualBasic(unsigned long long &version) const;
Expand Down
Loading