diff options
| author | Debulois <quentin@debulois.fr> | 2022-10-19 12:43:49 +0200 |
|---|---|---|
| committer | Debulois <quentin@debulois.fr> | 2022-10-19 12:43:49 +0200 |
| commit | d482ed88724b9dc84ee5f2b70252d4aab6b837d9 (patch) | |
| tree | 957f35752d0669835cf299884cc72eac09fbcf80 /WinKeyRecover/KeyChecker/GetProductDescription.cs | |
| parent | d0ed44e15795a4090d95d137532ecd59ae0aaaa5 (diff) | |
Initial commitVPS
Diffstat (limited to 'WinKeyRecover/KeyChecker/GetProductDescription.cs')
| -rw-r--r-- | WinKeyRecover/KeyChecker/GetProductDescription.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/WinKeyRecover/KeyChecker/GetProductDescription.cs b/WinKeyRecover/KeyChecker/GetProductDescription.cs new file mode 100644 index 0000000..3a42418 --- /dev/null +++ b/WinKeyRecover/KeyChecker/GetProductDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; + +namespace WinKeyRecover +{ + internal class GetProductDescription + { + public string Get(string aid, string fileXml) + { + XmlDocument xmlDocument = new XmlDocument(); + xmlDocument.Load(fileXml); + Stream inStream = new MemoryStream(Convert.FromBase64String(xmlDocument.GetElementsByTagName("tm:infoBin")[0].InnerText)); + xmlDocument.Load(inStream); + XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager(xmlDocument.NameTable); + xmlNamespaceManager.AddNamespace("pkc", "http://www.microsoft.com/DRM/PKEY/Configuration/2.0"); + XmlNode xmlNode = xmlDocument.SelectSingleNode("/pkc:ProductKeyConfiguration/pkc:Configurations/pkc:Configuration[pkc:ActConfigId='" + aid + "']", xmlNamespaceManager); + if (xmlNode == null) + { + xmlNode = xmlDocument.SelectSingleNode("/pkc:ProductKeyConfiguration/pkc:Configurations/pkc:Configuration[pkc:ActConfigId='" + aid.ToUpper() + "']", xmlNamespaceManager); + } + return xmlNode.ChildNodes.Item(3).InnerText; + } + } +} |
