120{
121 UINT32 TargetThreadId = 0;
125
126 if (SplitCommand.size() >= 5)
127 {
130 return;
131 }
132
133 if (SplitCommand.size() == 1)
134 {
135
136
137
139 {
141 }
142 else
143 {
144
145
146
148 NULL,
149 NULL,
151 NULL);
152 }
153 }
154 else if (SplitCommand.size() == 2)
155 {
156 if (!SplitCommand.at(1).compare("list"))
157 {
158
159
160
161
163 {
164 ShowMessages(
"err, the need offset to iterate over threads not found, "
165 "make sure to load ntoskrnl.exe's PDB file. use '.help .sym' for "
166 "more information\n");
167 return;
168 }
169 }
170 else
171 {
173 "err, unknown parameter at '%s'\n\n",
174 SplitCommand.at(1).c_str());
176 return;
177 }
178 }
179 else if (SplitCommand.size() == 3)
180 {
181
182
183
185 {
186 ShowMessages(
"err, you're not connected to any debuggee in Debugger Mode, "
187 "you can use the '.attach', or the '.detach' commands if you're "
188 "operating in VMI Mode\n");
189 return;
190 }
191
192 if (!SplitCommand.at(1).compare("tid"))
193 {
195 {
197 "please specify a correct hex value for the thread id that you "
198 "want to operate on it\n\n");
200 return;
201 }
202 }
203 else if (!SplitCommand.at(1).compare("thread"))
204 {
206 {
208 "please specify a correct hex value for the thread (nt!_ETHREAD) that you "
209 "want to operate on it\n\n");
211 return;
212 }
213 }
214 else if (!SplitCommand.at(1).compare("list") && !SplitCommand.at(2).compare("process"))
215 {
217 "please specify a hex value for the process\n\n");
219 return;
220 }
221 else
222 {
224 "err, unknown parameter at '%s'\n\n",
225 SplitCommand.at(2).c_str());
227 return;
228 }
229
230 if (!SplitCommand.at(0).compare(".thread2"))
231 {
232
233
234
235 CheckByClkIntr =
FALSE;
236 }
237 else
238 {
239
240
241
242 CheckByClkIntr =
TRUE;
243 }
244
245
246
247
249 TargetThreadId,
250 TargetThread,
251 CheckByClkIntr,
252 NULL);
253 }
254 else if (SplitCommand.size() == 4)
255 {
256 if (!SplitCommand.at(1).compare("list"))
257 {
258 if (!SplitCommand.at(2).compare("process"))
259 {
261 {
263 "please specify a correct hex value for the process (nt!_EPROCESS) that you "
264 "want to see its threads\n\n");
266 return;
267 }
268
269
270
271
273 {
274 ShowMessages(
"err, the need offset to iterate over threads not found, "
275 "make sure to load ntoskrnl.exe's PDB file. use '.help .sym' for "
276 "more information\n");
277 return;
278 }
279 }
280 else
281 {
283 "err, unknown parameter at '%s'\n\n",
284 SplitCommand.at(2).c_str());
286 return;
287 }
288 }
289 else
290 {
292 "err, unknown parameter at '%s'\n\n",
293 SplitCommand.at(1).c_str());
295 return;
296 }
297 }
298 else
299 {
302 return;
303 }
304}
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
@ DEBUGGEE_DETAILS_AND_SWITCH_THREAD_PERFORM_SWITCH
Definition RequestStructures.h:952
@ DEBUGGEE_DETAILS_AND_SWITCH_THREAD_GET_THREAD_DETAILS
Definition RequestStructures.h:953
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 KdSendSwitchThreadPacketToDebuggee(DEBUGGEE_DETAILS_AND_SWITCH_THREAD_TYPE ActionType, UINT32 NewTid, UINT64 NewThread, BOOLEAN CheckByClockInterrupt, PDEBUGGEE_THREAD_LIST_NEEDED_DETAILS SymDetailsForThreadList)
Sends a change thread or show threads detail packet to the debuggee.
Definition kd.cpp:858
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN ObjectShowProcessesOrThreadDetails(BOOLEAN IsProcess)
Get details about processes or threads.
Definition objects.cpp:26
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
VOID CommandThreadHelp()
help of the .thread command
Definition thread.cpp:25
BOOLEAN CommandThreadListThreads(UINT64 Eprocess)
Definition thread.cpp:50
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231