54{
   55    string port;
   56 
   57    if (SplitCommand.size() >= 3)
   58    {
   59        
   60        
   61        
   64        return;
   65    }
   66 
   69    {
   70        ShowMessages(
"you're connected to a debugger, please use '.disconnect' " 
   71                     "command\n");
   72        return;
   73    }
   74 
   75    
   76    
   77    
   79    {
   80        ShowMessages(
"you're connected to a an instance of HyperDbg, please use " 
   81                     "'.debug close' command\n");
   82        return;
   83    }
   84 
   85    if (SplitCommand.size() == 1)
   86    {
   87        
   88        
   89        
   92 
   93        return;
   94    }
   95    else if (SplitCommand.size() == 2)
   96    {
   97        port = SplitCommand.at(1);
   98 
   99        
  100        
  101        
  102        
  103        
  104        if (!
IsNumber(port) || stoi(port) > 65535 || stoi(port) < 0)
 
  105        {
  107            return;
  108        }
  109 
  110        
  111        
  112        
  115    }
  116    else
  117    {
  120        return;
  121    }
  122}
#define DEFAULT_PORT
default port of HyperDbg for listening by debuggee (server, guest)
Definition Constants.h:323
BOOLEAN IsNumber(const string &str)
check if given string is a numeric string or not
Definition common.cpp:145
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN g_IsSerialConnectedToRemoteDebugger
Shows if the debugger was connected to remote debugger (A remote host)
Definition globals.h:238
BOOLEAN g_IsConnectedToRemoteDebuggee
Shows whether the current debugger is the host and connected to a remote debuggee (guest)
Definition globals.h:74
BOOLEAN g_IsConnectedToRemoteDebugger
Shows whether the current system is a guest (debuggee) and a remote debugger is connected to this sys...
Definition globals.h:81
VOID CommandListenHelp()
help of the listen command
Definition listen.cpp:29
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
BOOLEAN g_IsConnectedToHyperDbgLocally
Shows whether the user is allowed to use 'load' command to load modules locally in VMI (virtual machi...
Definition globals.h:67
VOID RemoteConnectionListen(PCSTR Port)
Listen of a port and wait for a client connection.
Definition remote-connection.cpp:40