binlex
binlex::Common Class Reference

Public Member Functions

string SHA256 (const char *trait)
 
vector< char > TraitToChar (string trait)
 
string RemoveWildcards (string trait)
 
uint GetByteSize (string s)
 
string RemoveSpaces (string s)
 
string WildcardTrait (string trait, string bytes)
 
string TrimRight (const std::string &s)
 
string HexdumpBE (const void *data, size_t size)
 
void Hexdump (const char *desc, const void *addr, const int len)
 

Member Function Documentation

◆ GetByteSize()

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

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

Parameters
traitinput trait string.
Returns
Returns uint size of bytes

◆ Hexdump()

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

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()

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

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()

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

This method removes spaces from a string.

Parameters
sinput string
Returns
Returns string without spaces

◆ RemoveWildcards()

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

This method removes wildcards from a trait string.

Parameters
traitinput trait string.
Returns
Returns trait without wildcards

◆ SHA256()

string binlex::Common::SHA256 ( const char *  trait)

This class contains methods common to binlex. This method takes an input string and returns its sha256 hash.

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

◆ TraitToChar()

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

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()

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

This method removes whitespace on the right.

Parameters
sinput string
Returns
Returns string with whitespace on right trimmed

◆ WildcardTrait()

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

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: