retdec
Public Member Functions | Private Attributes | List of all members
retdec::fileinfo::DotnetInfo Class Reference

#include <dotnet_info.h>

Collaboration diagram for retdec::fileinfo::DotnetInfo:
Collaboration graph
[legend]

Public Member Functions

 DotnetInfo ()
 
Getters
const std::string & getRuntimeVersion () const
 
std::size_t getNumberOfImportedClasses () const
 
std::string getImportedClassName (std::size_t position) const
 
std::string getImportedClassNestedName (std::size_t position) const
 
std::string getImportedClassNameWithParentClassIndex (std::size_t position) const
 
std::string getImportedClassLibName (std::size_t position) const
 
std::string getImportedClassNameSpace (std::size_t position) const
 
bool getImportedClassIndex (std::size_t position, std::size_t &result) const
 
const std::string & getTypeRefhashCrc32 () const
 
const std::string & getTypeRefhashMd5 () const
 
const std::string & getTypeRefhashSha256 () const
 
std::string getMetadataHeaderAddressStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getMetadataStreamOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getMetadataStreamSizeStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getStringStreamOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getStringStreamSizeStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getBlobStreamOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getBlobStreamSizeStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getGuidStreamOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getGuidStreamSizeStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getUserStringStreamOffsetStr (std::ios_base &(*format)(std::ios_base &)) const
 
std::string getUserStringStreamSizeStr (std::ios_base &(*format)(std::ios_base &)) const
 
const std::string & getModuleVersionId () const
 
const std::string & getTypeLibId () const
 
const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass > > & getDefinedClassList () const
 
const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass > > & getImportedClassList () const
 
Setters
void setUsed (bool set)
 
void setRuntimeVersion (std::uint64_t majorVersion, std::uint64_t minorVersion)
 
void setMetadataHeaderAddress (std::uint64_t address)
 
void setMetadataStreamInfo (std::uint64_t offset, std::uint64_t size)
 
void setStringStreamInfo (std::uint64_t offset, std::uint64_t size)
 
void setBlobStreamInfo (std::uint64_t offset, std::uint64_t size)
 
void setGuidStreamInfo (std::uint64_t offset, std::uint64_t size)
 
void setUserStringStreamInfo (std::uint64_t offset, std::uint64_t size)
 
void setModuleVersionId (const std::string &id)
 
void setTypeLibId (const std::string &id)
 
void setDefinedClassList (const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass >> &dotnetClassList)
 
void setImportedClassList (const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass >> &dotnetClassList)
 
void setTypeRefhashCrc32 (const std::string &crc32)
 
void setTypeRefhashMd5 (const std::string &md5)
 
void setTypeRefhashSha256 (const std::string &sha256)
 
Detection
bool isUsed () const
 
bool hasMetadataStream () const
 
bool hasStringStream () const
 
bool hasBlobStream () const
 
bool hasGuidStream () const
 
bool hasUserStringStream () const
 
bool hasTypeLibId () const
 
bool hasImportedClassListRecords () const
 

Private Attributes

bool used
 
std::string runtimeVersion
 
std::uint64_t metadataHeaderAddress
 
StreamInfo metadataStream
 
StreamInfo stringStream
 
StreamInfo blobStream
 
StreamInfo guidStream
 
StreamInfo userStringStream
 
std::string moduleVersionId
 
std::string typeLibId
 
std::vector< std::shared_ptr< retdec::fileformat::DotnetClass > > definedClassList
 
std::vector< std::shared_ptr< retdec::fileformat::DotnetClass > > importedClassList
 
std::string typeRefHashCrc32
 
std::string typeRefHashMd5
 
std::string typeRefHashSha256
 

Detailed Description

Class for information about .NET

Constructor & Destructor Documentation

◆ DotnetInfo()

retdec::fileinfo::DotnetInfo::DotnetInfo ( )

Constructor.

Member Function Documentation

◆ getBlobStreamOffsetStr()

std::string retdec::fileinfo::DotnetInfo::getBlobStreamOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the blob stream offset in string representation with specified format.

Parameters
formatFormat.
Returns
Blob stream offset string.

◆ getBlobStreamSizeStr()

std::string retdec::fileinfo::DotnetInfo::getBlobStreamSizeStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the blob stream size in string representation with specified format.

Parameters
formatFormat.
Returns
Blob stream size string.

◆ getDefinedClassList()

const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass > > & retdec::fileinfo::DotnetInfo::getDefinedClassList ( ) const

Returns defined class list.

Returns
Defined classes.

◆ getGuidStreamOffsetStr()

std::string retdec::fileinfo::DotnetInfo::getGuidStreamOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the GUID stream offset in string representation with specified format.

Parameters
formatFormat.
Returns
GUID stream offset string.

◆ getGuidStreamSizeStr()

std::string retdec::fileinfo::DotnetInfo::getGuidStreamSizeStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the GUID stream size in string representation with specified format.

Parameters
formatFormat.
Returns
GUID stream size string.

◆ getImportedClassIndex()

bool retdec::fileinfo::DotnetInfo::getImportedClassIndex ( std::size_t  position,
std::size_t &  result 
) const

Get imported class typeref index

Parameters
positionIndex of selected imported class from typeref table (indexed from 0)
resultVariable to store the result to
Returns
true if result is valid, otherwise false.

◆ getImportedClassLibName()

std::string retdec::fileinfo::DotnetInfo::getImportedClassLibName ( std::size_t  position) const

Get imported class library name

Parameters
positionIndex of selected imported class from typeref table (indexed from 0)
Returns
Imported class library name

◆ getImportedClassList()

const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass > > & retdec::fileinfo::DotnetInfo::getImportedClassList ( ) const

Returns imported class list.

Returns
Imported classes.

◆ getImportedClassName()

std::string retdec::fileinfo::DotnetInfo::getImportedClassName ( std::size_t  position) const

Get imported class name

Parameters
positionIndex of selected imported class from typeref table (indexed from 0)
Returns
Imported class name

◆ getImportedClassNameSpace()

std::string retdec::fileinfo::DotnetInfo::getImportedClassNameSpace ( std::size_t  position) const

Get imported class namespace

Parameters
positionIndex of selected imported class from typeref table (indexed from 0)
Returns
Imported class namespace

◆ getImportedClassNameWithParentClassIndex()

std::string retdec::fileinfo::DotnetInfo::getImportedClassNameWithParentClassIndex ( std::size_t  position) const

Get imported class name with parent class presentation index

Parameters
positionIndex of selected imported class from typeref table (indexed from 0)
Returns
Imported class name with parent class presentation index

◆ getImportedClassNestedName()

std::string retdec::fileinfo::DotnetInfo::getImportedClassNestedName ( std::size_t  position) const

Get imported class nested name

Parameters
positionIndex of selected imported class from typeref table (indexed from 0)
Returns
Imported class nested name

◆ getMetadataHeaderAddressStr()

std::string retdec::fileinfo::DotnetInfo::getMetadataHeaderAddressStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the metadata header address in string representation with specified format.

Parameters
formatFormat.
Returns
Metadata header address string.

◆ getMetadataStreamOffsetStr()

std::string retdec::fileinfo::DotnetInfo::getMetadataStreamOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the metadata stream offset in string representation with specified format.

Parameters
formatFormat.
Returns
Metadata stream offset string.

◆ getMetadataStreamSizeStr()

std::string retdec::fileinfo::DotnetInfo::getMetadataStreamSizeStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the metadata stream size in string representation with specified format.

Parameters
formatFormat.
Returns
Metadata stream size string.

◆ getModuleVersionId()

const std::string & retdec::fileinfo::DotnetInfo::getModuleVersionId ( ) const

Returns the module version ID.

Returns
Module version ID.

◆ getNumberOfImportedClasses()

std::size_t retdec::fileinfo::DotnetInfo::getNumberOfImportedClasses ( ) const

Get number of imported classes in typeref table

Returns
Number of imported classes in typeref table

◆ getRuntimeVersion()

const std::string & retdec::fileinfo::DotnetInfo::getRuntimeVersion ( ) const

Returns the runtime version.

Returns
Runtime version.

◆ getStringStreamOffsetStr()

std::string retdec::fileinfo::DotnetInfo::getStringStreamOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the string stream offset in string representation with specified format.

Parameters
formatFormat.
Returns
String stream offset string.

◆ getStringStreamSizeStr()

std::string retdec::fileinfo::DotnetInfo::getStringStreamSizeStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the string stream size in string representation with specified format.

Parameters
formatFormat.
Returns
String stream size string.

◆ getTypeLibId()

const std::string & retdec::fileinfo::DotnetInfo::getTypeLibId ( ) const

Returns type lib ID.

Returns
Type lib ID.

◆ getTypeRefhashCrc32()

const std::string & retdec::fileinfo::DotnetInfo::getTypeRefhashCrc32 ( ) const

Get typeRefhash as CRC32

Returns
TypeRefhash as CRC32

◆ getTypeRefhashMd5()

const std::string & retdec::fileinfo::DotnetInfo::getTypeRefhashMd5 ( ) const

Get typeRefhash as MD5

Returns
TypeRefhash as MD5

◆ getTypeRefhashSha256()

const std::string & retdec::fileinfo::DotnetInfo::getTypeRefhashSha256 ( ) const

Get typeRefhash as SHA256

Returns
TypeRefhash as SHA256

◆ getUserStringStreamOffsetStr()

std::string retdec::fileinfo::DotnetInfo::getUserStringStreamOffsetStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the user string stream offset in string representation with specified format.

Parameters
formatFormat.
Returns
User string stream offset string.

◆ getUserStringStreamSizeStr()

std::string retdec::fileinfo::DotnetInfo::getUserStringStreamSizeStr ( std::ios_base &(*)(std::ios_base &)  format) const

Returns the user string stream size in string representation with specified format.

Parameters
formatFormat.
Returns
User string stream size string.

◆ hasBlobStream()

bool retdec::fileinfo::DotnetInfo::hasBlobStream ( ) const

Checks whether .NET information contains blob stream.

Returns
true if contains, otherwise false.

◆ hasGuidStream()

bool retdec::fileinfo::DotnetInfo::hasGuidStream ( ) const

Checks whether .NET information contains GUID stream.

Returns
true if contains, otherwise false.

◆ hasImportedClassListRecords()

bool retdec::fileinfo::DotnetInfo::hasImportedClassListRecords ( ) const

Find out if there are any imported class records

Returns
true if there are some imported class records, false otherwise

◆ hasMetadataStream()

bool retdec::fileinfo::DotnetInfo::hasMetadataStream ( ) const

Checks whether .NET information contains metadata stream.

Returns
true if contains, otherwise false.

◆ hasStringStream()

bool retdec::fileinfo::DotnetInfo::hasStringStream ( ) const

Checks whether .NET information contains string stream.

Returns
true if contains, otherwise false.

◆ hasTypeLibId()

bool retdec::fileinfo::DotnetInfo::hasTypeLibId ( ) const

Checks whether .NET information contains type lib ID.

Returns
true if contains, otherwise false.

◆ hasUserStringStream()

bool retdec::fileinfo::DotnetInfo::hasUserStringStream ( ) const

Checks whether .NET information contains user string stream.

Returns
true if contains, otherwise false.

◆ isUsed()

bool retdec::fileinfo::DotnetInfo::isUsed ( ) const

Checks whether .NET information are used.

Returns
true if used, otherwise false.

◆ setBlobStreamInfo()

void retdec::fileinfo::DotnetInfo::setBlobStreamInfo ( std::uint64_t  offset,
std::uint64_t  size 
)

Sets the blob stream information.

Parameters
offsetBlob stream offset.
sizeBlob stream size.

◆ setDefinedClassList()

void retdec::fileinfo::DotnetInfo::setDefinedClassList ( const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass >> &  dotnetClassList)

Sets defined class list.

Parameters
dotnetClassListDefined classes.

◆ setGuidStreamInfo()

void retdec::fileinfo::DotnetInfo::setGuidStreamInfo ( std::uint64_t  offset,
std::uint64_t  size 
)

Sets the GUID stream information.

Parameters
offsetGUID stream offset.
sizeGUID stream size.

◆ setImportedClassList()

void retdec::fileinfo::DotnetInfo::setImportedClassList ( const std::vector< std::shared_ptr< retdec::fileformat::DotnetClass >> &  dotnetClassList)

Sets imported class list.

Parameters
dotnetClassListImported classes.

◆ setMetadataHeaderAddress()

void retdec::fileinfo::DotnetInfo::setMetadataHeaderAddress ( std::uint64_t  address)

Sets the metadata header address.

Parameters
addressMetadata header address.

◆ setMetadataStreamInfo()

void retdec::fileinfo::DotnetInfo::setMetadataStreamInfo ( std::uint64_t  offset,
std::uint64_t  size 
)

Sets the metadata stream information.

Parameters
offsetMetadata stream offset.
sizeMetadata stream size.

◆ setModuleVersionId()

void retdec::fileinfo::DotnetInfo::setModuleVersionId ( const std::string &  id)

Sets the module version ID.

Parameters
idModule version ID.

◆ setRuntimeVersion()

void retdec::fileinfo::DotnetInfo::setRuntimeVersion ( std::uint64_t  majorVersion,
std::uint64_t  minorVersion 
)

Sets the runtime version.

Parameters
majorVersionMajor runtime version.
minorVersionMinor runtime version.

◆ setStringStreamInfo()

void retdec::fileinfo::DotnetInfo::setStringStreamInfo ( std::uint64_t  offset,
std::uint64_t  size 
)

Sets the string stream information.

Parameters
offsetString stream offset.
sizeString stream size.

◆ setTypeLibId()

void retdec::fileinfo::DotnetInfo::setTypeLibId ( const std::string &  id)

Sets the type lib ID.

Parameters
idType lib ID.

◆ setTypeRefhashCrc32()

void retdec::fileinfo::DotnetInfo::setTypeRefhashCrc32 ( const std::string &  crc32)

Sets typeref table hash as CRC32.

Parameters
crc32Hash as CRC32.

◆ setTypeRefhashMd5()

void retdec::fileinfo::DotnetInfo::setTypeRefhashMd5 ( const std::string &  md5)

Sets typeref table hash as MD5.

Parameters
md5Hash as MD5.

◆ setTypeRefhashSha256()

void retdec::fileinfo::DotnetInfo::setTypeRefhashSha256 ( const std::string &  sha256)

Sets typeref table hash as SHA256.

Parameters
sha256Hash as SHA256.

◆ setUsed()

void retdec::fileinfo::DotnetInfo::setUsed ( bool  set)

Sets whether .NET info is used.

Parameters
settrue if used, false otherwise.

◆ setUserStringStreamInfo()

void retdec::fileinfo::DotnetInfo::setUserStringStreamInfo ( std::uint64_t  offset,
std::uint64_t  size 
)

Sets the user string stream information.

Parameters
offsetUser string stream offset.
sizeUser string stream size.

Member Data Documentation

◆ blobStream

StreamInfo retdec::fileinfo::DotnetInfo::blobStream
private

◆ definedClassList

std::vector<std::shared_ptr<retdec::fileformat::DotnetClass> > retdec::fileinfo::DotnetInfo::definedClassList
private

◆ guidStream

StreamInfo retdec::fileinfo::DotnetInfo::guidStream
private

◆ importedClassList

std::vector<std::shared_ptr<retdec::fileformat::DotnetClass> > retdec::fileinfo::DotnetInfo::importedClassList
private

◆ metadataHeaderAddress

std::uint64_t retdec::fileinfo::DotnetInfo::metadataHeaderAddress
private

◆ metadataStream

StreamInfo retdec::fileinfo::DotnetInfo::metadataStream
private

◆ moduleVersionId

std::string retdec::fileinfo::DotnetInfo::moduleVersionId
private

◆ runtimeVersion

std::string retdec::fileinfo::DotnetInfo::runtimeVersion
private

◆ stringStream

StreamInfo retdec::fileinfo::DotnetInfo::stringStream
private

◆ typeLibId

std::string retdec::fileinfo::DotnetInfo::typeLibId
private

◆ typeRefHashCrc32

std::string retdec::fileinfo::DotnetInfo::typeRefHashCrc32
private

◆ typeRefHashMd5

std::string retdec::fileinfo::DotnetInfo::typeRefHashMd5
private

◆ typeRefHashSha256

std::string retdec::fileinfo::DotnetInfo::typeRefHashSha256
private

◆ used

bool retdec::fileinfo::DotnetInfo::used
private

◆ userStringStream

StreamInfo retdec::fileinfo::DotnetInfo::userStringStream
private

The documentation for this class was generated from the following files: