45{
48
49
50
51
52#if ActivateUserModeDebugger == FALSE
53
55 {
56 ShowMessages(
"the user-mode debugger in VMI Mode is still in the beta version and not stable. "
57 "we decided to exclude it from this release and release it in future versions. "
58 "if you want to test the user-mode debugger in VMI Mode, you should build "
59 "HyperDbg with special instructions. But attaching/switching to other processes\n"
60 "are fully supported in the Debugger Mode.\n"
61 "(it's not recommended to use it in VMI Mode yet!)\n");
62 return;
63 }
64
65#endif
66
67
68
69
70 if (SplitCommand.size() >= 4)
71 {
74 return;
75 }
76
77
78
79
81 {
82 ShowMessages(
"err, '.attach', and '.detach' commands are only usable "
83 "in VMI Mode, you can use the '.process', or the '.thread' "
84 "in Debugger Mode\n");
85 return;
86 }
87
88 for (auto item : SplitCommand)
89 {
90
91
92
93 if (NextIsPid)
94 {
96
98 {
99 ShowMessages(
"please specify a correct hex value for process id\n\n");
101 return;
102 }
103 }
104 else if (!item.compare("pid"))
105 {
106
107
108
110 }
111 }
112
113
114
115
116 if (TargetPid == 0)
117 {
118 ShowMessages(
"please specify a hex value for process id\n\n");
120 return;
121 }
122
123
124
125
127}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned int UINT32
Definition BasicTypes.h:48
BOOLEAN g_IsSerialConnectedToRemoteDebugger
Shows if the debugger was connected to remote debugger (A remote host)
Definition globals.h:238
VOID CommandAttachHelp()
help of the .attach command
Definition attach.cpp:26
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
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
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN UdAttachToProcess(UINT32 TargetPid, const WCHAR *TargetFileAddress, const WCHAR *CommandLine, BOOLEAN RunCallbackAtTheFirstInstruction)
Attach to target process.
Definition ud.cpp:349