108{
109 string Ip;
110 string Port;
111
114 {
115 ShowMessages("you're connected to a debugger, please use '.disconnect' "
116 "command\n");
117 return;
118 }
119
122 {
123 ShowMessages("you're connected to a an instance of HyperDbg, please use "
124 "'.debug close' command\n");
125 return;
126 }
127
128 if (CommandTokens.size() == 1)
129 {
130
131
132
133
134 ShowMessages("incorrect use of the '%s'\n\n",
137 return;
138 }
140 {
141
142
143
144 ShowMessages("local debugging (vmi-mode)\n");
145
147
148 return;
149 }
150 else if (CommandTokens.size() == 3 || CommandTokens.size() == 2)
151 {
153
154 if (CommandTokens.size() == 3)
155 {
157 }
158
159
160
161
162
163
165 {
166 ShowMessages("incorrect ip address\n");
167 return;
168 }
169
170 if (CommandTokens.size() == 3)
171 {
172 if (!
IsNumber(Port) || stoi(Port) > 65535 || stoi(Port) < 0)
173 {
174 ShowMessages("incorrect port\n");
175 return;
176 }
177
178
179
180
182 }
183 else
184 {
185
186
187
189 }
190 }
191 else
192 {
193 ShowMessages("incorrect use of the '%s'\n\n",
196 return;
197 }
198}
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest).
Definition globals.h:253
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
BOOLEAN ValidateIP(const string &ip)
Function to validate an IP address.
Definition common.cpp:590
BOOLEAN CompareLowerCaseStrings(CommandToken TargetToken, const CHAR *StringToCompare)
Compare lower case strings.
Definition common.cpp:503
VOID ConnectLocalDebugger()
Connect to local debugger.
Definition connect.cpp:50
VOID CommandConnectHelp()
help of the .connect command
Definition connect.cpp:31
BOOLEAN ConnectRemoteDebugger(const CHAR *Ip, const CHAR *Port)
Connect to remote debugger.
Definition connect.cpp:61
BOOLEAN g_IsConnectedToRemoteDebuggee
Shows whether the current debugger is the host and connected to a remote debuggee (guest).
Definition globals.h:96
BOOLEAN g_IsConnectedToHyperDbgLocally
Shows whether the user is allowed to use 'load' command to load modules locally in VMI (virtual machi...
Definition globals.h:89
BOOLEAN g_IsSerialConnectedToRemoteDebugger
Shows if the debugger was connected to remote debugger (A remote host).
Definition rev.cpp:18
BOOLEAN g_IsConnectedToRemoteDebugger
Shows whether the current system is a guest (debuggee) and a remote debugger is connected to this sys...
Definition globals.h:103