55{
56 string Port;
57
58 if (CommandTokens.size() >= 3)
59 {
60
61
62
63 ShowMessages("incorrect use of the '%s'\n\n",
66 return;
67 }
68
71 {
72 ShowMessages("you're connected to a debugger, please use '.disconnect' "
73 "command\n");
74 return;
75 }
76
77
78
79
81 {
82 ShowMessages("you're connected to a an instance of HyperDbg, please use "
83 "'.debug close' command\n");
84 return;
85 }
86
87 if (CommandTokens.size() == 1)
88 {
89
90
91
94
95 return;
96 }
97 else if (CommandTokens.size() == 2)
98 {
100
101
102
103
104
105
106 if (!
IsNumber(Port) || stoi(Port) > 65535 || stoi(Port) < 0)
107 {
108 ShowMessages("incorrect port\n");
109 return;
110 }
111
112
113
114
115 ShowMessages("listening on %s ...\n", Port.c_str());
117 }
118 else
119 {
120 ShowMessages("incorrect use of the '%s'\n\n",
123 return;
124 }
125}
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 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
VOID CommandListenHelp()
help of the listen command
Definition listen.cpp:29
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
VOID RemoteConnectionListen(PCSTR Port)
Listen of a port and wait for a client connection.
Definition remote-connection.cpp:40