HyperDbg Debugger
Loading...
Searching...
No Matches
print.cpp File Reference

print command More...

#include "pch.h"

Functions

VOID CommandPrintHelp ()
 help of the print command
VOID CommandPrint (vector< CommandToken > CommandTokens, string Command)
 handler of print command

Detailed Description

print command

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
M.H. Gholamrezaei (mh@hy.nosp@m.perd.nosp@m.bg.or.nosp@m.g)
Version
0.1
Date
2020-10-08

Function Documentation

◆ CommandPrint()

VOID CommandPrint ( vector< CommandToken > CommandTokens,
string Command )

handler of print command

Parameters
CommandTokens
Command
Returns
VOID
43{
44 if (CommandTokens.size() == 1)
45 {
46 ShowMessages("incorrect use of the '%s'\n\n",
47 GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
49 return;
50 }
51
52 //
53 // Trim the command
54 //
55 Trim(Command);
56
57 //
58 // Remove print from it
59 //
60 Command.erase(0, GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).size());
61
62 //
63 // Trim it again
64 //
65 Trim(Command);
66
67 //
68 // Prepend and append 'print(' and ')'
69 //
70 Command.insert(0, "print(");
71 Command.append(");");
72
73 //
74 // Execute the expression
75 //
77}
#define TRUE
Definition BasicTypes.h:114
#define FALSE
Definition BasicTypes.h:113
char CHAR
Definition BasicTypes.h:33
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
VOID Trim(std::string &s)
trim from both ends and start of a string (in place)
Definition common.cpp:715
VOID CommandPrintHelp()
help of the print command
Definition print.cpp:23
BOOLEAN ScriptEngineExecuteSingleExpression(CHAR *Expr, BOOLEAN ShowErrorMessageIfAny, BOOLEAN IsFormat)
Execute single expression for the kernel debugger and the user-mode debugger.
Definition script-engine.cpp:100

◆ CommandPrintHelp()

VOID CommandPrintHelp ( )

help of the print command

Returns
VOID
24{
25 ShowMessages("print : evaluates expressions.\n\n");
26
27 ShowMessages("syntax : \tprint [Expression (string)]\n");
28
29 ShowMessages("\n");
30 ShowMessages("\t\te.g : print dq(poi(@rcx))\n");
31}