30#define PE_SHOW_LOCK false
157 if (!buf_size)
return NULL;
176 if (!secView)
return false;
292 size_t initialSize = entrypoints.size();
297 return entrypoints.size() - initialSize;
326 if (newSize > currentSize) {
330 if (newSize < hEnd) {
338 bool isRepro =
false;
340 if (dbgDir && dbgDir->
isRepro()) {
359 return offset + secHdrSize;
const offset_t INVALID_ADDR
bool fillContent(BYTE filling)
virtual ExeElementWrapper * getWrapper(size_t wrapperId)
BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
virtual offset_t getRawSize() const
virtual size_t getAllEntryPoints(QMap< offset_t, QString > &entrypoints, Executable::addr_type aType=Executable::RVA)
Executable::exe_arch getHdrArch() const
virtual bufsize_t getAlignment(Executable::addr_type aType) const
bufsize_t hdrsSize() const
offset_t peOptHdrOffset() const
virtual offset_t getImageBase(bool recalculate=false)
offset_t peFileHdrOffset() const
offset_t peSignatureOffset() const
bufsize_t peNtHeadersSize() const
offset_t secHdrsOffset() const
Executable::exe_bits getHdrBitMode() const
virtual Executable * build(AbstractByteBuffer *buf)
virtual bool signatureMatches(AbstractByteBuffer *buf)
DataDirEntryWrapper * dataDirEntries[pe::DIR_ENTRIES_COUNT]
DebugDirWrapper * getDebugDir()
virtual bufsize_t getMappedSize(Executable::addr_type aType)
BufferView * _createSectionView(SectionHdrWrapper *sec)
size_t getExportsMap(QMap< offset_t, QString > &entrypoints, Executable::addr_type aType=Executable::RVA)
offset_t secHdrsEndOffset()
RelocDirWrapper * getRelocsDir()
bufsize_t getSectionAlignment() const
offset_t peFileHdrOffset() const
SectionHdrWrapper * _getSecHdr(size_t index) const
bufsize_t peNtHeadersSize() const
ImportDirWrapper * getImportsDir()
bool hasDirectory(pe::dir_entry dirNum)
offset_t peDataDirOffset()
virtual offset_t getEntryPoint(Executable::addr_type addrType=Executable::RVA)
offset_t secHdrsOffset() const
void _init(AbstractByteBuffer *v_buf)
SecurityDirWrapper * getSecurityDir()
offset_t getLastMapped(Executable::addr_type aType)
size_t _getSecIndex(SectionHdrWrapper *sec) const
bool setEntryPoint(offset_t entry, Executable::addr_type aType)
pe::RICH_DANS_HEADER * getRichHeaderBgn(pe::RICH_SIGNATURE *sign)
virtual size_t getAllEntryPoints(QMap< offset_t, QString > &entrypoints, Executable::addr_type aType=Executable::RVA)
virtual offset_t getImageBase(bool recalculate=false)
SectionHdrWrapper * extendLastSection(bufsize_t addedSize)
size_t getSectionsCount(bool useMapped=true)
SectionHdrWrapper * getLastSection()
bool dumpSection(SectionHdrWrapper *sec, QString fileName)
ClrDirWrapper * getClsDir()
offset_t _getLastMapped(Executable::addr_type aType)
virtual offset_t rvaToRaw(offset_t rva)
BufferView * createSectionView(size_t secNum)
BoundImpDirWrapper * getBoundImportsDir()
ResourcesAlbum * getResourcesAlbum() const
offset_t peOptHdrOffset() const
bool setHdrSectionsNum(size_t newNum)
DelayImpDirWrapper * getDelayedImportsDir()
bool setVirtualSize(bufsize_t newSize)
DataDirEntryWrapper * getDataDirEntry(pe::dir_entry eType)
SectionHdrWrapper * _getSecHdrAtOffset(offset_t offset, Executable::addr_type aType, bool recalculate=false, bool verbose=false)
bool clearContent(SectionHdrWrapper *sec)
bool moveDataDirEntry(pe::dir_entry id, offset_t newOffset, Executable::addr_type addType=Executable::RAW)
SectionHdrWrapper * _getLastSection()
virtual void clearWrappers()
size_t getSecIndex(SectionHdrWrapper *sec)
offset_t _secHdrsEndOffset()
SectionHdrWrapper * getSecHdr(size_t index)
IMAGE_DATA_DIRECTORY * getDataDirectory()
virtual offset_t rawToRva(offset_t raw)
ResourceDirWrapper * getResourcesDir()
LdConfigDirWrapper * getLoadConfigDir()
size_t hdrSectionsNum() const
virtual exe_arch getArch()
SectionHdrWrapper * getEntrySection()
void setImageSize(size_t newSize)
PEFile(AbstractByteBuffer *v_buf)
offset_t peNtHdrOffset() const
bufsize_t getFileAlignment() const
virtual bufsize_t getAlignment(Executable::addr_type aType) const
virtual exe_bits getBitMode()
BYTE * getSecContent(SectionHdrWrapper *sec)
pe::RICH_SIGNATURE * getRichHeaderSign()
bool canResize(bufsize_t newSize)
ExceptionDirWrapper * getExceptionsDir()
ExportDirWrapper * getExportsDir()
static long computeChecksum(BYTE *buffer, size_t bufferSize, offset_t checksumOffset)
DosHdrWrapper * dosHdrWrapper
ResourcesContainer * getResourcesOfType(pe::resource_type typeId)
TlsDirWrapper * getTlsDir()
SectionHdrWrapper * getSecHdrAtOffset(offset_t offset, Executable::addr_type aType, bool recalculate=false, bool verbose=false)
size_t _getSectionsCount(bool useMapped=true) const
SectionHdrWrapper * addNewSection(QString name, bufsize_t size, bufsize_t v_size=0)
ResourcesContainer * getResourcesOfType(pe::resource_type typeId)
SectionHdrWrapper * _getSecHdr(size_t index)
SectionHdrWrapper * getSecHdrAtOffset(offset_t offset, Executable::addr_type addrType, bool roundup, bool verbose=false)
size_t getSecIndex(SectionHdrWrapper *sec) const
static size_t SECT_INVALID_INDEX
bufsize_t getContentSize(Executable::addr_type aType, bool recalculate)
offset_t getContentOffset(Executable::addr_type aType, bool useMapped=true)