retdec
|
Functions | |
template<int bits> | |
bool | peSectionName (const PeLib::PeHeaderT< bits > &peHeader, std::string &name, unsigned long long sectionIndex) |
std::unique_ptr< FileFormat > | createFileFormat (const std::string &filePath, const std::string &dllListFile, bool isRaw=false, LoadFlags loadFlags=LoadFlags::NONE) |
std::unique_ptr< FileFormat > | createFileFormat (const std::string &filePath, bool isRaw=false, LoadFlags loadFlags=LoadFlags::NONE) |
std::unique_ptr< FileFormat > | createFileFormat (std::istream &inputStream, bool isRaw=false, LoadFlags loadFlags=LoadFlags::NONE) |
std::unique_ptr< FileFormat > | createFileFormat (const std::uint8_t *data, std::size_t size, bool isRaw=false, LoadFlags loadFlags=LoadFlags::NONE) |
template<> | |
std::uint8_t | BaseRecord::loadUInt< std::uint8_t > (const FileFormat *file, std::uint64_t &address) |
template<> | |
std::uint16_t | BaseRecord::loadUInt< std::uint16_t > (const FileFormat *file, std::uint64_t &address) |
template<> | |
std::uint32_t | BaseRecord::loadUInt< std::uint32_t > (const FileFormat *file, std::uint64_t &address) |
template<typename It > | |
CharacterIterator< It > | makeCharacterIterator (It first, It last, std::size_t charStep) |
template<typename It > | |
CharacterIterator< It > | makeCharacterIterator (It itr, It first, It last, std::size_t charStep) |
template<typename N > | |
bool | addUniqueValue (std::vector< N > ¤tValues, N newVal, std::size_t &newIndex) |
std::ios_base & | hexWithPrefix (std::ios_base &str) |
std::ios_base & | truncFloat (std::ios_base &str) |
void | separateStrings (std::string &str, std::vector< std::string > &words) |
std::string | getCrc32 (const unsigned char *data, std::uint64_t length) |
Count CRC32 of data. More... | |
std::string | getMd5 (const unsigned char *data, std::uint64_t length) |
Count MD5 of data. More... | |
std::string | getSha1 (const unsigned char *data, std::uint64_t length) |
Count SHA1 of data. More... | |
std::string | getSha256 (const unsigned char *data, std::uint64_t length) |
Count SHA256 of data. More... | |
bool | readHexString (std::istream &fileStream, std::string &hexa, std::size_t start=0, std::size_t desiredSize=0) |
bool | readPlainString (std::istream &fileStream, std::string &plain, std::size_t start=0, std::size_t desiredSize=0) |
Format | detectFileFormat (const std::string &filePath, bool isRaw=false) |
Format | detectFileFormat (std::istream &inputStream, bool isRaw=false) |
Format | detectFileFormat (const std::uint8_t *data, std::size_t size, bool isRaw=false) |
std::size_t | getRealSizeInRegion (std::size_t offset, std::size_t requestedSize, std::size_t regionSize) |
std::string | getFileFormatNameFromEnum (Format format) |
std::vector< std::string > | getSupportedFileFormats () |
std::vector< std::string > | getSupportedArchitectures () |
std::string | lcidToStr (std::size_t lcid) |
std::string | codePageToStr (std::size_t cpage) |
double | computeDataEntropy (const std::uint8_t *data, std::size_t dataLen) |
Variables | |
const std::uint64_t | MetadataHeaderSignature = 0x424A5342 |
constexpr std::size_t | VBHEADER_SIGNATURE = 0x21354256 |
constexpr std::size_t | VB_MAX_STRING_LEN = 100 |
const std::uint8_t | Asn1TagMask_Class = 0xC0 |
const std::uint8_t | Asn1TagMask_Primitive = 0x20 |
const std::uint8_t | Asn1TagMask_Type = 0x1F |
const std::uint8_t | Asn1Tag_Universal = 0x00 |
const std::uint8_t | Asn1Tag_Application = 0x40 |
const std::uint8_t | Asn1Tag_ContextSpecific = 0x80 |
const std::uint8_t | Asn1Tag_Private = 0xC0 |
const std::uint8_t | Asn1Tag_Constructed = 0x20 |
const std::uint8_t | Asn1Tag_BitString = 0x03 |
const std::uint8_t | Asn1Tag_OctetString = 0x04 |
const std::uint8_t | Asn1Tag_Null = 0x05 |
const std::uint8_t | Asn1Tag_Object = 0x06 |
const std::uint8_t | Asn1Tag_Sequence = 0x10 |
const std::string | DigestAlgorithmOID_Sha1 = "1.3.14.3.2.26" |
const std::string | DigestAlgorithmOID_Sha256 = "2.16.840.1.101.3.4.2.1" |
const std::string | DigestAlgorithmOID_Md5 = "1.2.840.113549.2.5" |
using retdec::fileformat::AuxVectorEntry = typedef std::pair<std::uint64_t, std::uint64_t> |
using retdec::fileformat::DotnetDataTypeArray = typedef DotnetDataType<ElementType::Array> |
using retdec::fileformat::DotnetDataTypeBoolean = typedef DotnetDataType<ElementType::Boolean> |
using retdec::fileformat::DotnetDataTypeByRef = typedef DotnetDataType<ElementType::ByRef> |
using retdec::fileformat::DotnetDataTypeChar = typedef DotnetDataType<ElementType::Char> |
using retdec::fileformat::DotnetDataTypeClass = typedef DotnetDataType<ElementType::Class> |
using retdec::fileformat::DotnetDataTypeCModOptional = typedef DotnetDataType<ElementType::CModOptional> |
using retdec::fileformat::DotnetDataTypeCModRequired = typedef DotnetDataType<ElementType::CModRequired> |
using retdec::fileformat::DotnetDataTypeEnd = typedef DotnetDataType<ElementType::End> |
using retdec::fileformat::DotnetDataTypeFloat32 = typedef DotnetDataType<ElementType::Float32> |
using retdec::fileformat::DotnetDataTypeFloat64 = typedef DotnetDataType<ElementType::Float64> |
using retdec::fileformat::DotnetDataTypeFnPtr = typedef DotnetDataType<ElementType::FnPtr> |
using retdec::fileformat::DotnetDataTypeGenericInst = typedef DotnetDataType<ElementType::GenericInst> |
using retdec::fileformat::DotnetDataTypeGenericMVar = typedef DotnetDataType<ElementType::GenericMVar> |
using retdec::fileformat::DotnetDataTypeGenericVar = typedef DotnetDataType<ElementType::GenericVar> |
using retdec::fileformat::DotnetDataTypeInt16 = typedef DotnetDataType<ElementType::Int16> |
using retdec::fileformat::DotnetDataTypeInt32 = typedef DotnetDataType<ElementType::Int32> |
using retdec::fileformat::DotnetDataTypeInt64 = typedef DotnetDataType<ElementType::Int64> |
using retdec::fileformat::DotnetDataTypeInt8 = typedef DotnetDataType<ElementType::Int8> |
using retdec::fileformat::DotnetDataTypeIntPtr = typedef DotnetDataType<ElementType::IntPtr> |
using retdec::fileformat::DotnetDataTypeObject = typedef DotnetDataType<ElementType::Object> |
using retdec::fileformat::DotnetDataTypePtr = typedef DotnetDataType<ElementType::Ptr> |
using retdec::fileformat::DotnetDataTypeString = typedef DotnetDataType<ElementType::String> |
using retdec::fileformat::DotnetDataTypeSzArray = typedef DotnetDataType<ElementType::SzArray> |
using retdec::fileformat::DotnetDataTypeTypedByRef = typedef DotnetDataType<ElementType::TypedByRef> |
using retdec::fileformat::DotnetDataTypeUInt16 = typedef DotnetDataType<ElementType::UInt16> |
using retdec::fileformat::DotnetDataTypeUInt32 = typedef DotnetDataType<ElementType::UInt32> |
using retdec::fileformat::DotnetDataTypeUInt64 = typedef DotnetDataType<ElementType::UInt64> |
using retdec::fileformat::DotnetDataTypeUInt8 = typedef DotnetDataType<ElementType::UInt8> |
using retdec::fileformat::DotnetDataTypeUIntPtr = typedef DotnetDataType<ElementType::UIntPtr> |
using retdec::fileformat::DotnetDataTypeVoid = typedef DotnetDataType<ElementType::Void> |
using retdec::fileformat::RegisterMap = typedef std::map<std::string, std::uint64_t> |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
enum retdec::fileformat::PeImportFlag : std::uint32_t |
|
strong |
Stream type
Enumerator | |
---|---|
Metadata | |
String | |
UserString | |
Blob | |
Guid |
|
strong |
|
strong |
bool retdec::fileformat::addUniqueValue | ( | std::vector< N > & | currentValues, |
N | newVal, | ||
std::size_t & | newIndex | ||
) |
Add newVal to currentValues, if newVal is not stored in currentValues before calling of this function
currentValues | Vector of current values |
newVal | New value |
newIndex | Into this parameter is stored index (indexed from 0) of currentValues at which is newVal |
true
if newVal was added to currentValues, false
otherwise std::uint16_t retdec::fileformat::BaseRecord::loadUInt< std::uint16_t > | ( | const FileFormat * | file, |
std::uint64_t & | address | ||
) |
std::uint32_t retdec::fileformat::BaseRecord::loadUInt< std::uint32_t > | ( | const FileFormat * | file, |
std::uint64_t & | address | ||
) |
std::uint8_t retdec::fileformat::BaseRecord::loadUInt< std::uint8_t > | ( | const FileFormat * | file, |
std::uint64_t & | address | ||
) |
std::string retdec::fileformat::codePageToStr | ( | std::size_t | cpage | ) |
Get string representation of IBM code page
cpage | Language code id |
double retdec::fileformat::computeDataEntropy | ( | const std::uint8_t * | data, |
std::size_t | dataLen | ||
) |
std::unique_ptr< FileFormat > retdec::fileformat::createFileFormat | ( | const std::string & | filePath, |
bool | isRaw = false , |
||
LoadFlags | loadFlags = LoadFlags::NONE |
||
) |
std::unique_ptr< FileFormat > retdec::fileformat::createFileFormat | ( | const std::string & | filePath, |
const std::string & | dllListFile, | ||
bool | isRaw, | ||
LoadFlags | loadFlags | ||
) |
Create instance of FileFormat class
filePath | Path to input file |
dllListFile | Path to text file containing list of OS DLLs |
isRaw | Is the input is a raw binary? |
loadFlags | Load flags |
nullptr
if any errorIf format of input file is not supported, function will return nullptr
.
std::unique_ptr< FileFormat > retdec::fileformat::createFileFormat | ( | const std::uint8_t * | data, |
std::size_t | size, | ||
bool | isRaw = false , |
||
LoadFlags | loadFlags = LoadFlags::NONE |
||
) |
std::unique_ptr< FileFormat > retdec::fileformat::createFileFormat | ( | std::istream & | inputStream, |
bool | isRaw = false , |
||
LoadFlags | loadFlags = LoadFlags::NONE |
||
) |
Format retdec::fileformat::detectFileFormat | ( | const std::string & | filePath, |
bool | isRaw | ||
) |
Detects file format of input file
filePath | Path to input file |
isRaw | Is the input is a raw binary? |
Format retdec::fileformat::detectFileFormat | ( | const std::uint8_t * | data, |
std::size_t | size, | ||
bool | isRaw = false |
||
) |
Format retdec::fileformat::detectFileFormat | ( | std::istream & | inputStream, |
bool | isRaw = false |
||
) |
std::string retdec::fileformat::getCrc32 | ( | const unsigned char * | data, |
std::uint64_t | length | ||
) |
Count CRC32 of data.
[in] | data | Input data. |
[in] | length | Length of input data. |
std::string retdec::fileformat::getFileFormatNameFromEnum | ( | Format | format | ) |
std::string retdec::fileformat::getMd5 | ( | const unsigned char * | data, |
std::uint64_t | length | ||
) |
Count MD5 of data.
[in] | data | Input data. |
[in] | length | Length of input data. |
std::size_t retdec::fileformat::getRealSizeInRegion | ( | std::size_t | offset, |
std::size_t | requestedSize, | ||
std::size_t | regionSize | ||
) |
Get real size of selected area in region
offset | Start offset of selected area in region |
requestedSize | Requested size of selected area (0 means maximal size from offset to end of region) |
regionSize | Total size of region |
std::string retdec::fileformat::getSha1 | ( | const unsigned char * | data, |
std::uint64_t | length | ||
) |
Count SHA1 of data.
[in] | data | Input data. |
[in] | length | Length of input data. |
std::string retdec::fileformat::getSha256 | ( | const unsigned char * | data, |
std::uint64_t | length | ||
) |
Count SHA256 of data.
[in] | data | Input data. |
[in] | length | Length of input data. |
std::vector< std::string > retdec::fileformat::getSupportedArchitectures | ( | ) |
Get list of all supported target architectures
std::vector< std::string > retdec::fileformat::getSupportedFileFormats | ( | ) |
Get list of all supported file formats
std::ios_base & retdec::fileformat::hexWithPrefix | ( | std::ios_base & | str | ) |
Formatter for conversions between string and number
std::string retdec::fileformat::lcidToStr | ( | std::size_t | lcid | ) |
Get string representation of language code id
lcid | Language code id |
CharacterIterator<It> retdec::fileformat::makeCharacterIterator | ( | It | first, |
It | last, | ||
std::size_t | charStep | ||
) |
Creates character iterator pointing to the beginning of the sequence.
first | Lower bound. |
last | Upper bound. |
charStep | Size of the single character. |
CharacterIterator<It> retdec::fileformat::makeCharacterIterator | ( | It | itr, |
It | first, | ||
It | last, | ||
std::size_t | charStep | ||
) |
Creates character iterator pointing to the specific element of the sequence.
itr | Iterator of element which to point at. |
first | Lower bound. |
last | Upper bound. |
charStep | Size of the single character. |
bool retdec::fileformat::peSectionName | ( | const PeLib::PeHeaderT< bits > & | peHeader, |
std::string & | name, | ||
unsigned long long | sectionIndex | ||
) |
Get name of selected section
peHeader | PE reader |
name | Parameter for store the result |
sectionIndex | Index of selected section (indexed from 0) |
true
if section index is valid, false
otherwise bool retdec::fileformat::readHexString | ( | std::istream & | fileStream, |
std::string & | hexa, | ||
std::size_t | start, | ||
std::size_t | desiredSize | ||
) |
Read bytes from file stream and convert them to hexadecimal string representation
fileStream | Representation of input file |
hexa | Read bytes in hexadecimal string representation |
start | Start offset of read |
desiredSize | Number of bytes for read. If this parameter is set to zero, function will read all bytes from start until end of file. |
true
if operation went OK, otherwise false
If function returns false
, hexa is set to empty string
bool retdec::fileformat::readPlainString | ( | std::istream & | fileStream, |
std::string & | plain, | ||
std::size_t | start, | ||
std::size_t | desiredSize | ||
) |
Read bytes from file stream as plain text
fileStream | Representation of input file |
plain | Into this parameter the resulting string is stored |
start | Start offset of read |
desiredSize | Number of bytes for read. If this parameter is set to zero, function will read all bytes from start until end of file. |
true
if operation went OK, otherwise false
If function returns false
, plain is set to empty string
void retdec::fileformat::separateStrings | ( | std::string & | str, |
std::vector< std::string > & | words | ||
) |
Divide str into individual strings separated by a null character ('\0')
str | Input string |
words | Into this parameter the separated strings are saved |
At start of this function, everything from vector words is deleted.
Into words is stored each word (chunk of text), which contain at least one character with different value than '\0' (words containing only null character are eliminated). Null character at end of each stored word is erased.
std::ios_base & retdec::fileformat::truncFloat | ( | std::ios_base & | str | ) |
Formatter for truncated real numbers
const std::uint8_t retdec::fileformat::Asn1Tag_Application = 0x40 |
const std::uint8_t retdec::fileformat::Asn1Tag_BitString = 0x03 |
const std::uint8_t retdec::fileformat::Asn1Tag_Constructed = 0x20 |
const std::uint8_t retdec::fileformat::Asn1Tag_ContextSpecific = 0x80 |
const std::uint8_t retdec::fileformat::Asn1Tag_Null = 0x05 |
const std::uint8_t retdec::fileformat::Asn1Tag_Object = 0x06 |
const std::uint8_t retdec::fileformat::Asn1Tag_OctetString = 0x04 |
const std::uint8_t retdec::fileformat::Asn1Tag_Private = 0xC0 |
const std::uint8_t retdec::fileformat::Asn1Tag_Sequence = 0x10 |
const std::uint8_t retdec::fileformat::Asn1Tag_Universal = 0x00 |
const std::uint8_t retdec::fileformat::Asn1TagMask_Class = 0xC0 |
const std::uint8_t retdec::fileformat::Asn1TagMask_Primitive = 0x20 |
const std::uint8_t retdec::fileformat::Asn1TagMask_Type = 0x1F |
const std::string retdec::fileformat::DigestAlgorithmOID_Md5 = "1.2.840.113549.2.5" |
const std::string retdec::fileformat::DigestAlgorithmOID_Sha1 = "1.3.14.3.2.26" |
const std::string retdec::fileformat::DigestAlgorithmOID_Sha256 = "2.16.840.1.101.3.4.2.1" |
const std::uint64_t retdec::fileformat::MetadataHeaderSignature = 0x424A5342 |
|
constexpr |
|
constexpr |