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 (CommandTokens.size() >= 4)
71 {
72 ShowMessages("incorrect use of the '%s'\n\n",
75 return;
76 }
77
78 for (auto Section = CommandTokens.begin() + 1; Section != CommandTokens.end(); Section++)
79 {
80
81
82
83 if (NextIsPid)
84 {
86
88 {
89 ShowMessages("please specify a correct hex value for process id\n\n");
91 return;
92 }
93 }
95 {
96
97
98
100 }
101 else
102 {
103 ShowMessages("unknown parameter at '%s'\n\n",
106 return;
107 }
108 }
109
110
111
112
113 if (TargetPid == 0)
114 {
115 ShowMessages("please specify a hex value for process id\n\n");
117 return;
118 }
119
120
121
122
123 ShowMessages("Attaching to process 0x%llx (%lld)...\n\n", TargetPid, TargetPid);
125}
VOID CommandAttachHelp()
help of the .attach command
Definition attach.cpp:25
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_IsSerialConnectedToRemoteDebugger
Shows if the debugger was connected to remote debugger (A remote host).
Definition rev.cpp:18
BOOLEAN UdAttachToProcess(UINT32 TargetPid, const WCHAR *TargetFileAddress, const WCHAR *CommandLine, BOOLEAN RunCallbackAtTheFirstInstruction)
Attach to target process.
Definition ud.cpp:372