binlex
binlex::Common Class Reference
Inheritance diagram for binlex::Common:
binlex::DecompilerBase binlex::File binlex::CILDecompiler binlex::Decompiler binlex::ELF binlex::PE binlex::Raw binlex::DOTNET

Static Public Member Functions

static BINLEX_EXPORT string GetTLSH (const uint8_t *data, size_t len)
 
static BINLEX_EXPORT string GetFileTLSH (const char *file_path)
 
static BINLEX_EXPORT string SHA256 (char *trait)
 
static BINLEX_EXPORT string GetFileSHA256 (char *file_path)
 
static BINLEX_EXPORT string GetSHA256 (const uint8_t *data, size_t len)
 
static BINLEX_EXPORT vector< char > TraitToChar (string trait)
 
static BINLEX_EXPORT string RemoveWildcards (string trait)
 
static BINLEX_EXPORT uint GetByteSize (string s)
 
static BINLEX_EXPORT string RemoveSpaces (string s)
 
static BINLEX_EXPORT string WildcardTrait (string trait, string bytes)
 
static BINLEX_EXPORT string TrimRight (const std::string &s)
 
static BINLEX_EXPORT string HexdumpBE (const void *data, size_t size)
 
static BINLEX_EXPORT string Wildcards (uint count)
 
static BINLEX_EXPORT string HexdumpMemDisp (uint64_t disp)
 
static BINLEX_EXPORT float Entropy (string trait)
 
static BINLEX_EXPORT void Hexdump (const char *desc, const void *addr, const int len)
 

Member Function Documentation

◆ GetByteSize()

static BINLEX_EXPORT uint binlex::Common::GetByteSize ( string  s)
static

This method gets the size in bytes of a trait string (includes wildcards).

Parameters
traitinput trait string.
Returns
Returns uint size of bytes

◆ GetFileSHA256()

static BINLEX_EXPORT string binlex::Common::GetFileSHA256 ( char *  file_path)
static

This method reads a file returns its sha256 hash.

Parameters
file_pathpath to the file to read
Returns
Returns the sha256 hash of the file
Exceptions
std::runtime_errorif file operation fails

◆ GetFileTLSH()

static BINLEX_EXPORT string binlex::Common::GetFileTLSH ( const char *  file_path)
static

This method reads a file returns its tlsh hash.

Parameters
file_pathpath to the file to read
Returns
Returns the tlsh hash of the file
Exceptions
std::runtime_errorif file operation fails

◆ GetSHA256()

static BINLEX_EXPORT string binlex::Common::GetSHA256 ( const uint8_t *  data,
size_t  len 
)
static

This method reads a file returns its sha256 hash.

Parameters
datainput string
lenlength of data
Returns
Returns the sha256 hash of the file
Exceptions
std::runtime_errorif file operation fails

◆ GetTLSH()

static BINLEX_EXPORT string binlex::Common::GetTLSH ( const uint8_t *  data,
size_t  len 
)
static

This class contains methods common to binlex. This method takes a (binary) input string and returns its tlsh hash.

Parameters
datainput string
lenlength of data
Returns
Returns the tlsh hash of the trait string

◆ Hexdump()

static BINLEX_EXPORT void binlex::Common::Hexdump ( const char *  desc,
const void *  addr,
const int  len 
)
static

This method prints hexdump to stdout.

Parameters
descA description of the data.
dataA pointer to the data
sizeThe size of the data to collect

◆ HexdumpBE()

static BINLEX_EXPORT string binlex::Common::HexdumpBE ( const void *  data,
size_t  size 
)
static

This method creates a byte string based on a pointer and its size.

Parameters
dataA pointer to the data
sizeThe size of the data to collect
Returns
Returns a byte string of the selected data

◆ RemoveSpaces()

static BINLEX_EXPORT string binlex::Common::RemoveSpaces ( string  s)
static

This method removes spaces from a string.

Parameters
sinput string
Returns
Returns string without spaces

◆ RemoveWildcards()

static BINLEX_EXPORT string binlex::Common::RemoveWildcards ( string  trait)
static

This method removes wildcards from a trait string.

Parameters
traitinput trait string.
Returns
Returns trait without wildcards

◆ SHA256()

static BINLEX_EXPORT string binlex::Common::SHA256 ( char *  trait)
static

This method takes an input string and returns its sha256 hash.

Parameters
traitinput string.
Returns
Returns the sha256 hash of the trait string

◆ TraitToChar()

static BINLEX_EXPORT vector<char> binlex::Common::TraitToChar ( string  trait)
static

This method takes an input trait string and returns a char vector of bytes (ignores wildcards).

Parameters
traitinput string.
Returns
Returns char vector of bytes

◆ TrimRight()

static BINLEX_EXPORT string binlex::Common::TrimRight ( const std::string &  s)
static

This method removes whitespace on the right.

Parameters
sinput string
Returns
Returns string with whitespace on right trimmed

◆ Wildcards()

static BINLEX_EXPORT string binlex::Common::Wildcards ( uint  count)
static

Generate Number of Wildcards

Parameters
countnumber of wildcard bytes to create
Returns
string

◆ WildcardTrait()

static BINLEX_EXPORT string binlex::Common::WildcardTrait ( string  trait,
string  bytes 
)
static

This method wildcards byte strings for traits.

Parameters
traitinput trait string
bytesbyte string to wildcard
Returns
Returns wildcarded trait string

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