HyperDbg Debugger
Loading...
Searching...
No Matches
routines.h File Reference

header for testing routines More...

Go to the source code of this file.

Functions

BOOLEAN TestCase (std::vector< std::string > &TestCase)
VOID AsmTest ()
VOID TestCreateLookupTable (HANDLE PipeHandle, PVOID KernelInformation, UINT32 KernelInformationSize)
std::string Uint64ToString (UINT64 Value)
 Convert a UINT64 value to a hex string.
BOOLEAN StringReplace (std::string &Str, const std::string &From, const std::string &To)
 Replace the first occurrence of a substring in a string.
std::string ConvertToString (CHAR *Str)
 Convert a C-string to a std::string.

Detailed Description

header for testing routines

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.1
Date
2020-09-16

Function Documentation

◆ AsmTest()

VOID AsmTest ( )
externinline

◆ ConvertToString()

std::string ConvertToString ( CHAR * Str)

Convert a C-string to a std::string.

Parameters
Strthe C-string to convert
Returns
std::string the resulting string object
54{
55 string Result(Str);
56
57 return Result;
58}

◆ StringReplace()

BOOLEAN StringReplace ( std::string & Str,
const std::string & From,
const std::string & To )

Replace the first occurrence of a substring in a string.

Parameters
Strthe string to modify
Fromthe substring to search for
Tothe replacement substring
Returns
BOOLEAN TRUE if the replacement was made, FALSE otherwise
38{
39 SIZE_T StartPos = Str.find(From);
40 if (StartPos == string::npos)
41 return FALSE;
42 Str.replace(StartPos, From.length(), To);
43 return TRUE;
44}
#define TRUE
Definition BasicTypes.h:114
#define FALSE
Definition BasicTypes.h:113

◆ TestCase()

BOOLEAN TestCase ( std::vector< std::string > & TestCase)

◆ TestCreateLookupTable()

VOID TestCreateLookupTable ( HANDLE PipeHandle,
PVOID KernelInformation,
UINT32 KernelInformationSize )

◆ Uint64ToString()

std::string Uint64ToString ( UINT64 Value)

Convert a UINT64 value to a hex string.

Parameters
Valuethe value to convert
Returns
std::string the hex string representation
22{
23 ostringstream Os;
24 Os << setw(16) << setfill('0') << hex << Value;
25 return Os.str();
26}
RequestedActionOfThePacket Value(0x1) 00000000