Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
49 lines (41 loc) · 1.23 KB

File metadata and controls

49 lines (41 loc) · 1.23 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Collections.Generic;
using System.IO;
using System.Xml;
namespace ScribdMpubToEpubConverter
{
public static class DecryptionKeyListParser
{
public static void Parse(string file_path, ref Dictionary<string, string> DecryptionKeys)
{
using var reader = XmlReader.Create(File.OpenRead(file_path));
while (reader.Read())
{
if (reader.NodeType != XmlNodeType.Element)
continue;
if (reader.Name != "string")
continue;
// Make sure to filter out the IS_MIGRATED option
var name = reader.GetAttribute("name");
if (!name.StartsWith("KEY_"))
{
Helper.Information("Skipping XML entry, as it is not a key: " + name);
continue;
}
// Try to read the value
if (!reader.Read())
continue;
if (reader.NodeType != XmlNodeType.Text)
continue;
// Sanity check, as the key length should be 32 bytes.
var value = reader.Value.Trim();
if (value.Length != 32)
{
Helper.Warning("Skipping decryption key with incorrect value length: " + name);
continue;
}
DecryptionKeys.Add(name.Remove(0, "KEY_".Length), value);
}
Helper.Debug("Decryption key entries: " + DecryptionKeys.Count);
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.