57{
58 UINT32 TargetProcessId = 0;
60 UINT64 AddressOfActiveProcessHead = 0;
61 UINT32 OffsetOfImageFileName = 0;
62 UINT32 OffsetOfUniqueProcessId = 0;
63 UINT32 OffsetOfActiveProcessLinks = 0;
67
68 if (SplitCommand.size() >= 4)
69 {
72 return;
73 }
74
75 if (SplitCommand.size() == 1)
76 {
77
78
79
81 {
82
83
84
86 }
87 else
88 {
89
90
91
93 NULL,
94 NULL,
96 NULL);
97 }
98 }
99 else if (SplitCommand.size() == 2)
100 {
101 if (!SplitCommand.at(1).compare("list"))
102 {
103
104
105
106
107
108
113 {
114
115
116
117
118
119
120
121
122
123
124
129
131 {
132
133
134
136 &ProcessListNeededItems,
137 NULL,
138 NULL);
139 }
140 else
141 {
142
143
144
146 NULL,
147 NULL,
149 &ProcessListNeededItems);
150 }
151 }
152 else
153 {
154 ShowMessages(
"err, the need offset to iterate over processes not found, "
155 "make sure to load ntoskrnl.exe's PDB file. use '.help .sym' for "
156 "more information\n");
157 return;
158 }
159 }
160 else
161 {
163 "err, unknown parameter at '%s'\n\n",
164 SplitCommand.at(1).c_str());
166 return;
167 }
168 }
169 else if (SplitCommand.size() == 3)
170 {
171
172
173
175 {
176 ShowMessages(
"err, you're not connected to any debuggee in Debugger Mode, "
177 "you can use the '.attach', or the '.detach' commands if you're "
178 "operating in VMI Mode\n");
179 return;
180 }
181
182 if (!SplitCommand.at(1).compare("pid"))
183 {
185 {
187 "please specify a correct hex value for the process id that you "
188 "want to operate on it\n\n");
190 return;
191 }
192 }
193 else if (!SplitCommand.at(1).compare("process"))
194 {
196 {
198 "please specify a correct hex value for the process (nt!_EPROCESS) that you "
199 "want to operate on it\n\n");
201 return;
202 }
203 }
204 else
205 {
207 "err, unknown parameter at '%s'\n\n",
208 SplitCommand.at(2).c_str());
210 return;
211 }
212
213
214
215
216 if (!SplitCommand.at(0).compare(".process2"))
217 {
218 IsSetByClkIntr =
FALSE;
219 }
220 else
221 {
222 IsSetByClkIntr =
TRUE;
223 }
224
225
226
227
229 TargetProcessId,
230 TargetProcess,
231 IsSetByClkIntr,
232 NULL);
233 }
234 else
235 {
238 return;
239 }
240}
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
char CHAR
Definition BasicTypes.h:31
@ DEBUGGEE_DETAILS_AND_SWITCH_PROCESS_GET_PROCESS_DETAILS
Definition RequestStructures.h:912
@ DEBUGGEE_DETAILS_AND_SWITCH_PROCESS_GET_PROCESS_LIST
Definition RequestStructures.h:913
@ DEBUGGEE_DETAILS_AND_SWITCH_PROCESS_PERFORM_SWITCH
Definition RequestStructures.h:914
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 KdSendSwitchProcessPacketToDebuggee(DEBUGGEE_DETAILS_AND_SWITCH_PROCESS_TYPE ActionType, UINT32 NewPid, UINT64 NewProcess, BOOLEAN SetChangeByClockInterrupt, PDEBUGGEE_PROCESS_LIST_NEEDED_DETAILS SymDetailsForProcessList)
Sends a change process or show process details packet to the debuggee.
Definition kd.cpp:805
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN ObjectShowProcessesOrThreadList(BOOLEAN IsProcess, PDEBUGGEE_PROCESS_LIST_NEEDED_DETAILS SymDetailsForProcessList, UINT64 Eprocess, PDEBUGGEE_THREAD_LIST_NEEDED_DETAILS SymDetailsForThreadList)
Get details about processes or threads.
Definition objects.cpp:138
BOOLEAN ObjectShowProcessesOrThreadDetails(BOOLEAN IsProcess)
Get details about processes or threads.
Definition objects.cpp:26
VOID CommandProcessHelp()
help of the .process command
Definition process.cpp:25
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
BOOLEAN ScriptEngineGetFieldOffsetWrapper(CHAR *TypeName, CHAR *FieldName, UINT32 *FieldOffset)
ScriptEngineGetFieldOffset wrapper.
Definition script-engine-wrapper.cpp:131
The structure of needed information to get the details of the process from nt!_EPROCESS and location ...
Definition RequestStructures.h:684
ULONG UniquePidOffset
Definition RequestStructures.h:687
ULONG ImageFileNameOffset
Definition RequestStructures.h:686
ULONG ActiveProcessLinksOffset
Definition RequestStructures.h:688
UINT64 PsActiveProcessHead
Definition RequestStructures.h:685
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