56{
59 vector<string> SplitCommandCaseSensitive {
Split(Command,
' ')};
60 UINT32 IndexInCommandCaseSensitive = 0;
64
65 string FirstCommand = SplitCommand.front();
66
67 if (SplitCommand.size() >= 6)
68 {
69 ShowMessages(
"incorrect use of the '%s'\n\n", FirstCommand.c_str());
71 return;
72 }
73
75 {
76 ShowMessages(
"err, tracing callstack is not possible when you're not "
77 "connected to a debuggee\n");
78 return;
79 }
80
81
82
83
85 {
86 Length = 0x100;
87 }
88 else
89 {
90 Length = 0x200;
91 }
92
93 for (auto Section : SplitCommand)
94 {
95 IndexInCommandCaseSensitive++;
96
97 if (IsFirstCommand)
98 {
99 IsFirstCommand =
FALSE;
100 continue;
101 }
102 if (IsNextBase ==
TRUE)
103 {
105 &BaseAddress))
106 {
107
108
109
111 SplitCommandCaseSensitive.at(IndexInCommandCaseSensitive - 1).c_str());
112 return;
113 }
114
116 continue;
117 }
118
119 if (IsNextLength ==
TRUE)
120 {
122 {
123 ShowMessages(
"err, you should enter a valid length\n\n");
124 return;
125 }
126 IsNextLength =
FALSE;
127 continue;
128 }
129
130 if (!Section.compare("l"))
131 {
133 continue;
134 }
135
136 if (!Section.compare("base"))
137 {
139 continue;
140 }
141
142
143
144
145 ShowMessages(
"err, incorrect use of the '%s' command\n\n",
146 FirstCommand.c_str());
148
149 return;
150 }
151
152 if (IsNextLength || IsNextBase)
153 {
154 ShowMessages(
"incorrect use of the '%s' command\n\n", FirstCommand.c_str());
156 return;
157 }
158
159
160
161
162
163 if (!FirstCommand.compare("k"))
164 {
166 Length,
169 }
170 else if (!FirstCommand.compare("kq"))
171 {
173 Length,
176 }
177 else if (!FirstCommand.compare("kd"))
178 {
180 Length,
183 }
184}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
@ DEBUGGER_CALLSTACK_DISPLAY_METHOD_WITHOUT_PARAMS
Definition RequestStructures.h:779
@ DEBUGGER_CALLSTACK_DISPLAY_METHOD_WITH_PARAMS
Definition RequestStructures.h:780
const vector< string > Split(const string &s, const char &c)
general split command
Definition common.cpp:117
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.
Definition common.cpp:347
BOOLEAN g_IsRunningInstruction32Bit
whether the Current executing instructions is 32-bit or 64 bit
Definition globals.h:210
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
VOID CommandKHelp()
help of the k command
Definition k.cpp:26
BOOLEAN KdSendCallStackPacketToDebuggee(UINT64 BaseAddress, UINT32 Size, DEBUGGER_CALLSTACK_DISPLAY_METHOD DisplayMethod, BOOLEAN Is32Bit)
Send a callstack request to the debuggee.
Definition kd.cpp:348
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
NULL()
Definition test-case-generator.py:530
BOOLEAN SymbolConvertNameOrExprToAddress(const string &TextToConvert, PUINT64 Result)
check and convert string to a 64 bit unsigned integer and also check for symbol object names and eval...
Definition symbol.cpp:360