Exemplo n.º 1
0
 public static void HandleLoadRegistryKey(GetRegistryKeysResponse packet, Client client)
 {
     try
     {
         // Make sure that the client is in the correct state to handle the packet appropriately.
         if (client != null && client.Value.FrmRe != null && !client.Value.FrmRe.IsDisposed || !client.Value.FrmRe.Disposing)
         {
             if (!packet.IsError)
             {
                 client.Value.FrmRe.AddKeys(packet.RootKey, packet.Matches);
             }
             else
             {
                 client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg);
                 //If root keys failed to load then close the form
                 if (packet.RootKey == null)
                 {
                     //Invoke a closing of the form
                     client.Value.FrmRe.PerformClose();
                 }
             }
         }
     }
     catch { }
 }
Exemplo n.º 2
0
 private void Execute(ISender client, GetRegistryKeysResponse message)
 {
     if (!message.IsError)
     {
         OnKeysReceived(message.RootKey, message.Matches);
     }
     else
     {
         OnReport(message.ErrorMsg);
     }
 }
Exemplo n.º 3
0
 public static void HandleLoadRegistryKey(GetRegistryKeysResponse packet, Client client)
 {
     try
     {
         if (packet.Matches != null && packet.Matches.Length > 0)
         {
             if (client != null && client.Value.FrmRe != null && !client.Value.FrmRe.IsDisposed ||
                 !client.Value.FrmRe.Disposing)
             {
                 client.Value.FrmRe.AddKeysToTree(packet.RootKey, packet.Matches);
             }
         }
     }
     catch
     {
     }
 }
Exemplo n.º 4
0
        private void Execute(ISender client, DoLoadRegistryKey message)
        {
            GetRegistryKeysResponse responsePacket = new GetRegistryKeysResponse();

            try
            {
                RegistrySeeker seeker = new RegistrySeeker();
                seeker.BeginSeeking(message.RootKeyName);

                responsePacket.Matches = seeker.Matches;
                responsePacket.IsError = false;
            }
            catch (Exception e)
            {
                responsePacket.IsError  = true;
                responsePacket.ErrorMsg = e.Message;
            }
            responsePacket.RootKey = message.RootKeyName;
            client.Send(responsePacket);
        }
        public static void HandleGetRegistryKey(DoLoadRegistryKey packet, Networking.Client client)
        {
            GetRegistryKeysResponse responsePacket = new GetRegistryKeysResponse();

            try
            {
                RegistrySeeker seeker = new RegistrySeeker();
                seeker.BeginSeeking(packet.RootKeyName);

                responsePacket.Matches = seeker.Matches;
                responsePacket.IsError = false;
            }
            catch (Exception e)
            {
                responsePacket.IsError  = true;
                responsePacket.ErrorMsg = e.Message;
            }
            responsePacket.RootKey = packet.RootKeyName;
            client.Send(responsePacket);
        }