internal static ValueKey Get(byte[] bytes, string path, string key, string val) { NamedKey hiveroot = Helper.GetRootKey(bytes, path); NamedKey nk = hiveroot; if (key != null) { foreach (string k in key.Split('\\')) { foreach (NamedKey n in nk.GetSubKeys(bytes)) { if (n.Name.ToUpper() == k.ToUpper()) { nk = n; } } } } ValueKey[] values = nk.GetValues(bytes); foreach (ValueKey v in values) { if (v.Name.ToUpper() == val.ToUpper()) { return(v); } } return(null); }
internal static NamedKey[] GetInstances(byte[] bytes, string path, string key) { NamedKey hiveroot = Helper.GetRootKey(bytes, path); NamedKey nk = hiveroot; if (key != null) { foreach (string k in key.Split('\\')) { foreach (NamedKey n in nk.GetSubKeys(bytes)) { if (n.Name.ToUpper() == k.ToUpper()) { nk = n; } } } } return(nk.GetSubKeys(bytes)); }