141 lines
4.2 KiB
C#
141 lines
4.2 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: HandleRegistry
|
|
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
|
|
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
|
|
|
|
using Raton.Forms.ClientForms.Monitor;
|
|
using Server.Connection;
|
|
using Stuff;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
|
|
#nullable disable
|
|
internal class HandleRegistry
|
|
{
|
|
public HandleRegistry(SillyClient client, Unpack msgUnpack)
|
|
{
|
|
if (!(Application.OpenForms["Registry | Client ID: " + msgUnpack.GetAsString("UID")] is ratonReg openForm))
|
|
return;
|
|
string asString1 = msgUnpack.GetAsString("Type");
|
|
string asString2 = msgUnpack.GetAsString("Path");
|
|
string asString3 = msgUnpack.GetAsString("Roots");
|
|
string asString4 = msgUnpack.GetAsString("SubKeys");
|
|
string asString5 = msgUnpack.GetAsString("Values");
|
|
switch (asString1)
|
|
{
|
|
case "Roots":
|
|
this.LoadRootsSafe(openForm, asString3);
|
|
break;
|
|
case "SubKeys":
|
|
List<string> stringList = new List<string>();
|
|
if (!string.IsNullOrEmpty(asString4))
|
|
stringList.AddRange((IEnumerable<string>) asString4.Split('|'));
|
|
if (openForm == null)
|
|
break;
|
|
this.LoadSubKeysSafe(openForm, asString2, asString4);
|
|
break;
|
|
case "Values":
|
|
this.LoadValuesSafe(openForm, asString2, asString5);
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void LoadRoots(ratonReg form, string rootsStr)
|
|
{
|
|
form.treeView1.Nodes.Clear();
|
|
string str = rootsStr;
|
|
char[] chArray = new char[1]{ '|' };
|
|
foreach (string text in str.Split(chArray))
|
|
form.treeView1.Nodes.Add(new TreeNode(text)
|
|
{
|
|
Nodes = {
|
|
"Loading..."
|
|
}
|
|
});
|
|
}
|
|
|
|
private void LoadSubKeys(ratonReg form, string path, string subKeysStr)
|
|
{
|
|
TreeNode nodeByPath = this.FindNodeByPath(form.treeView1, path);
|
|
if (nodeByPath == null)
|
|
return;
|
|
nodeByPath.Nodes.Clear();
|
|
if (string.IsNullOrEmpty(subKeysStr))
|
|
return;
|
|
string str = subKeysStr;
|
|
char[] chArray = new char[1]{ '|' };
|
|
foreach (string text in str.Split(chArray))
|
|
nodeByPath.Nodes.Add(new TreeNode(text)
|
|
{
|
|
Nodes = {
|
|
"Loading..."
|
|
}
|
|
});
|
|
}
|
|
|
|
private void LoadValues(ratonReg form, string path, string valuesStr)
|
|
{
|
|
form.dataGridView1.Rows.Clear();
|
|
if (string.IsNullOrEmpty(valuesStr))
|
|
return;
|
|
string str1 = valuesStr;
|
|
char[] chArray1 = new char[1]{ '|' };
|
|
foreach (string str2 in str1.Split(chArray1))
|
|
{
|
|
char[] chArray2 = new char[1]{ '^' };
|
|
string[] strArray = str2.Split(chArray2);
|
|
if (strArray.Length == 3)
|
|
form.dataGridView1.Rows.Add((object) strArray[0], (object) strArray[1], (object) strArray[2]);
|
|
}
|
|
}
|
|
|
|
private void LoadRootsSafe(ratonReg form, string rootsStr)
|
|
{
|
|
if (form.InvokeRequired)
|
|
form.Invoke((Delegate) (() => this.LoadRoots(form, rootsStr)));
|
|
else
|
|
this.LoadRoots(form, rootsStr);
|
|
}
|
|
|
|
private void LoadSubKeysSafe(ratonReg form, string path, string subKeysStr)
|
|
{
|
|
if (form.InvokeRequired)
|
|
form.Invoke((Delegate) (() => this.LoadSubKeys(form, path, subKeysStr)));
|
|
else
|
|
this.LoadSubKeys(form, path, subKeysStr);
|
|
}
|
|
|
|
private void LoadValuesSafe(ratonReg form, string path, string valuesStr)
|
|
{
|
|
if (form.InvokeRequired)
|
|
form.Invoke((Delegate) (() => this.LoadValues(form, path, valuesStr)));
|
|
else
|
|
this.LoadValues(form, path, valuesStr);
|
|
}
|
|
|
|
private TreeNode FindNodeByPath(TreeView tree, string path)
|
|
{
|
|
string[] strArray = path.Split('\\');
|
|
TreeNodeCollection nodes = tree.Nodes;
|
|
TreeNode nodeByPath = (TreeNode) null;
|
|
foreach (string str in strArray)
|
|
{
|
|
nodeByPath = (TreeNode) null;
|
|
foreach (TreeNode treeNode in nodes)
|
|
{
|
|
if (treeNode.Text == str)
|
|
{
|
|
nodeByPath = treeNode;
|
|
nodes = treeNode.Nodes;
|
|
break;
|
|
}
|
|
}
|
|
if (nodeByPath == null)
|
|
return (TreeNode) null;
|
|
}
|
|
return nodeByPath;
|
|
}
|
|
}
|