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

t command More...

#include "pch.h"

Functions

VOID CommandTHelp ()
 help of the t command
VOID CommandT (vector< CommandToken > CommandTokens, string Command)
 handler of t command

Variables

BOOLEAN g_IsSerialConnectedToRemoteDebuggee
 Shows if the debugger was connected to remote debuggee over (A remote guest).
BOOLEAN g_IsInstrumentingInstructions
 Shows whether the user is running 't', 'p', or 'i' command.
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
 State of active debugging thread.

Detailed Description

t command

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

Function Documentation

◆ CommandT()

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

handler of t command

Parameters
CommandTokens
Command
Returns
VOID
54{
55 UINT32 StepCount;
56
57 //
58 // Validate the commands
59 //
60 if (CommandTokens.size() != 1 && CommandTokens.size() != 2)
61 {
62 ShowMessages("incorrect use of the '%s'\n\n",
63 GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
65 return;
66 }
67
68 //
69 // Check if the command has a counter parameter
70 //
71 if (CommandTokens.size() == 2)
72 {
73 if (!ConvertTokenToUInt32(CommandTokens.at(1), &StepCount))
74 {
75 ShowMessages("please specify a correct hex value for [count]\n\n");
77 return;
78 }
79 }
80 else
81 {
82 StepCount = 1;
83 }
84
85 //
86 // Check if the remote serial debuggee or user debugger are paused or not
87 //
89 {
90 //
91 // Check if the thread is paused or not
92 //
94 {
95 ShowMessages("the target process is running, use the "
96 "'pause' command to pause the process\n");
97 return;
98 }
99
100 //
101 // Indicate that we're instrumenting
102 //
104
105 for (SIZE_T i = 0; i < StepCount; i++)
106 {
107 //
108 // For logging purpose
109 //
110 // ShowMessages("percentage : %f %% (%x)\n", 100.0 * (i /
111 // (float)StepCount), i);
112 //
113
114 //
115 // Instrument (regular) the instruction
116 //
118
119 if (CompareLowerCaseStrings(CommandTokens.at(0), "tr"))
120 {
121 //
122 // Show registers
123 //
125
126 if (i != StepCount - 1)
127 {
128 ShowMessages("\n");
129 }
130 }
131
132 //
133 // Check if user pressed CTRL+C
134 //
136 {
137 break;
138 }
139 }
140
141 //
142 // We're not instrumenting instructions anymore
143 //
145 }
146 else
147 {
148 ShowMessages("err, stepping (t) is not valid in the current context, you "
149 "should connect to a debuggee\n");
150 }
151}
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest).
Definition globals.h:253
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
State of active debugging thread.
Definition globals.h:372
#define TRUE
Definition BasicTypes.h:114
#define FALSE
Definition BasicTypes.h:113
unsigned int UINT32
Definition BasicTypes.h:54
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
BOOLEAN CompareLowerCaseStrings(CommandToken TargetToken, const CHAR *StringToCompare)
Compare lower case strings.
Definition common.cpp:503
BOOLEAN ConvertTokenToUInt32(CommandToken TargetToken, PUINT32 Result)
check and convert command token to a 32 bit unsigned integer
Definition common.cpp:546
BOOLEAN g_IsInstrumentingInstructions
Shows whether the user is running 't', 'p', or 'i' command.
Definition globals.h:571
BOOLEAN HyperDbgRegisterShowAll()
handler of r show all registers
Definition r.cpp:354
BOOLEAN SteppingRegularStepIn()
Perform Regular Step-in.
Definition steppings.cpp:80
VOID CommandTHelp()
help of the t command
Definition t.cpp:27

◆ CommandTHelp()

VOID CommandTHelp ( )

help of the t command

Returns
VOID
28{
29 ShowMessages(
30 "t : executes a single instruction (step-in) and optionally displays the "
31 "resulting values of all registers and flags.\n\n");
32
33 ShowMessages("syntax : \tt\n");
34 ShowMessages("syntax : \tt [Count (hex)]\n");
35 ShowMessages("syntax : \ttr\n");
36 ShowMessages("syntax : \ttr [Count (hex)]\n");
37
38 ShowMessages("\n");
39 ShowMessages("\t\te.g : t\n");
40 ShowMessages("\t\te.g : tr\n");
41 ShowMessages("\t\te.g : tr 1f\n");
42}

Variable Documentation

◆ g_ActiveProcessDebuggingState

ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
extern

State of active debugging thread.

372{0};

◆ g_IsInstrumentingInstructions

BOOLEAN g_IsInstrumentingInstructions
extern

Shows whether the user is running 't', 'p', or 'i' command.

◆ g_IsSerialConnectedToRemoteDebuggee

BOOLEAN g_IsSerialConnectedToRemoteDebuggee
extern

Shows if the debugger was connected to remote debuggee over (A remote guest).