HyperDbg Debugger
|
HyperDbg general functions for reading and converting and etc. More...
#include "pch.h"
Functions | |
string | SeparateTo64BitValue (UINT64 Value) |
add ` between 64 bit values and convert them to string | |
VOID | PrintBits (const UINT32 Size, const void *Ptr) |
print bits and bytes for d* commands | |
BOOL | Replace (std::string &str, const std::string &from, const std::string &to) |
general replace all function | |
VOID | ReplaceAll (string &str, const string &from, const string &to) |
general replace all function | |
const vector< string > | Split (const string &s, const char &c) |
general split command | |
BOOLEAN | IsNumber (const string &str) |
check if given string is a numeric string or not | |
BOOLEAN | IsHexNotation (const string &s) |
check whether the string is hex or not | |
BOOLEAN | IsDecimalNotation (const string &s) |
check whether the string is decimal or not | |
vector< char > | HexToBytes (const string &hex) |
converts hex to bytes | |
BOOLEAN | ConvertStringToUInt64 (string TextToConvert, PUINT64 Result) |
check and convert string to a 64 bit unsigned integer and also check for special notations like 0x, 0n, etc. | |
BOOLEAN | ConvertStringToUInt32 (string TextToConvert, PUINT32 Result) |
check and convert string to a 32 bit unsigned it and also check for special notations like 0x etc. | |
BOOLEAN | HasEnding (string const &fullString, string const &ending) |
checks whether the string ends with a special string or not | |
BOOLEAN | ValidateIP (const string &ip) |
Function to validate an IP address. | |
BOOLEAN | VmxSupportDetection () |
Detect whether the VMX is supported or not. | |
BOOL | SetPrivilege (HANDLE Token, LPCTSTR Privilege, BOOL EnablePrivilege) |
SetPrivilege enables/disables process token privilege. | |
void | Trim (std::string &s) |
trim from both ends and start of a string (in place) | |
std::string | RemoveSpaces (std::string str) |
Remove all the spaces in a string. | |
BOOLEAN | IsFileExistA (const char *FileName) |
check if a file exist or not (ASCII) | |
BOOLEAN | IsFileExistW (const wchar_t *FileName) |
check if a file exist or not (wide-char) | |
BOOLEAN | IsEmptyString (char *Text) |
Is empty character. | |
VOID | GetConfigFilePath (PWCHAR ConfigPath) |
Get config path. | |
std::vector< std::string > | ListDirectory (const std::string &Directory, const std::string &Extension) |
Create a list of special files in a directory. | |
VOID | StringToWString (std::wstring &ws, const std::string &s) |
convert std::string to std::wstring | |
VOID | SplitPathAndArgs (std::vector< std::string > &Qargs, const std::string &Command) |
Split path and arguments and handle strings between quotes. | |
size_t | FindCaseInsensitive (std::string Input, std::string ToSearch, size_t Pos) |
Find case insensitive sub string in a given substring. | |
size_t | FindCaseInsensitiveW (std::wstring Input, std::wstring ToSearch, size_t Pos) |
Find case insensitive sub string in a given substring (unicode) | |
char * | ConvertStringVectorToCharPointerArray (const std::string &s) |
Convert vector<string> to char*. | |
VOID | CommonCpuidInstruction (UINT32 Func, UINT32 SubFunc, int *CpuInfo) |
Get cpuid results. | |
UINT32 | Getx86VirtualAddressWidth () |
Get virtual address width for x86 processors. | |
BOOLEAN | CheckCpuSupportRtm () |
Check whether the processor supports RTM or not. | |
BOOLEAN | CheckAddressCanonicality (UINT64 VAddr, PBOOLEAN IsKernelAddress) |
Checks if the address is canonical based on x86 processor's virtual address width or not. | |
BOOLEAN | CheckAddressValidityUsingTsx (UINT64 Address) |
This function checks whether the address is valid or not using Intel TSX. | |
BOOLEAN | CheckAccessValidityAndSafety (UINT64 TargetAddress, UINT32 Size) |
Check the safety to access the memory. | |
UINT32 | Log2Ceil (UINT32 n) |
Function to compute log2Ceil. | |
Variables | |
BOOLEAN | g_RtmSupport |
check for RTM support | |
UINT32 | g_VirtualAddressWidth |
Virtual address width for x86 processors. | |
HyperDbg general functions for reading and converting and etc.
Check the safety to access the memory.
TargetAddress | |
Size |
Checks if the address is canonical based on x86 processor's virtual address width or not.
VAddr | virtual address to check |
IsKernelAddress | Filled to show whether the address is a kernel address or user-address |
IsKernelAddress wouldn't check for page attributes, it just checks the address convention in Windows
This function checks whether the address is valid or not using Intel TSX.
Address | Address to check |
UINT32 | ProcId |
BOOLEAN CheckCpuSupportRtm | ( | ) |
Check whether the processor supports RTM or not.
Get cpuid results.
UINT32 | Func |
UINT32 | SubFunc |
int | * CpuInfo |
check and convert string to a 32 bit unsigned it and also check for special notations like 0x etc.
TextToConvert | the target string |
Result | result will be save to the pointer |
check and convert string to a 64 bit unsigned integer and also check for special notations like 0x, 0n, etc.
TextToConvert | the target string |
Result | result will be save to the pointer |
char * ConvertStringVectorToCharPointerArray | ( | const std::string & | s | ) |
Convert vector<string> to char*.
use it like : std::transform(vs.begin(), vs.end(), std::back_inserter(vc), ConvertStringVectorToCharPointerArray); from: https://stackoverflow.com/questions/7048888/stdvectorstdstring-to-char-array
Input | |
ToSearch | |
Pos |
size_t FindCaseInsensitive | ( | std::string | Input, |
std::string | ToSearch, | ||
size_t | Pos ) |
Find case insensitive sub string in a given substring.
Input | |
ToSearch | |
Pos |
size_t FindCaseInsensitiveW | ( | std::wstring | Input, |
std::wstring | ToSearch, | ||
size_t | Pos ) |
Find case insensitive sub string in a given substring (unicode)
Input | |
ToSearch | |
Pos |
VOID GetConfigFilePath | ( | PWCHAR | ConfigPath | ) |
Get config path.
ConfigPath |
UINT32 Getx86VirtualAddressWidth | ( | ) |
Get virtual address width for x86 processors.
BOOLEAN HasEnding | ( | string const & | fullString, |
string const & | ending ) |
checks whether the string ends with a special string or not
fullString | |
ending |
vector< char > HexToBytes | ( | const string & | hex | ) |
converts hex to bytes
hex |
BOOLEAN IsDecimalNotation | ( | const string & | s | ) |
check whether the string is decimal or not
s |
BOOLEAN IsEmptyString | ( | char * | Text | ) |
Is empty character.
Text |
BOOLEAN IsFileExistA | ( | const char * | FileName | ) |
check if a file exist or not (ASCII)
FileName | path of file |
BOOLEAN IsFileExistW | ( | const wchar_t * | FileName | ) |
check if a file exist or not (wide-char)
FileName | path of file |
BOOLEAN IsHexNotation | ( | const string & | s | ) |
check whether the string is hex or not
s |
BOOLEAN IsNumber | ( | const string & | str | ) |
check if given string is a numeric string or not
str |
std::vector< std::string > ListDirectory | ( | const std::string & | Directory, |
const std::string & | Extension ) |
Create a list of special files in a directory.
Directory | |
Extension |
Function to compute log2Ceil.
n |
print bits and bytes for d* commands
Size | |
Ptr |
std::string RemoveSpaces | ( | std::string | str | ) |
Remove all the spaces in a string.
str |
BOOL Replace | ( | std::string & | str, |
const std::string & | from, | ||
const std::string & | to ) |
VOID ReplaceAll | ( | string & | str, |
const string & | from, | ||
const string & | to ) |
general replace all function
str | |
from | |
to |
string SeparateTo64BitValue | ( | UINT64 | Value | ) |
add ` between 64 bit values and convert them to string
Value |
SetPrivilege enables/disables process token privilege.
Token | |
Privilege | |
EnablePrivilege |
const vector< string > Split | ( | const string & | s, |
const char & | c ) |
general split command
s | target string |
c | splitter (delimiter) |
VOID SplitPathAndArgs | ( | std::vector< std::string > & | Qargs, |
const std::string & | Command ) |
Split path and arguments and handle strings between quotes.
Qargs | |
Command |
VOID StringToWString | ( | std::wstring & | ws, |
const std::string & | s ) |
convert std::string to std::wstring
ws | |
s |
void Trim | ( | std::string & | s | ) |
trim from both ends and start of a string (in place)
s |
BOOLEAN ValidateIP | ( | const string & | ip | ) |
Function to validate an IP address.
ip |
BOOLEAN VmxSupportDetection | ( | ) |
Detect whether the VMX is supported or not.
|
extern |
check for RTM support
|
extern |
Virtual address width for x86 processors.