127 lines
3.7 KiB
C#
127 lines
3.7 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: RatonBack.BackendClient
|
|
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
|
|
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
|
|
|
|
using Raton.Properties;
|
|
using System;
|
|
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
#nullable disable
|
|
namespace RatonBack;
|
|
|
|
public static class BackendClient
|
|
{
|
|
private static readonly string BackendUrl = "http://127.0.0.1";
|
|
private static readonly string BackendKey = BackendClient.LoadBackendKey();
|
|
private static readonly HttpClient http = new HttpClient();
|
|
|
|
private static string LoadBackendKey()
|
|
{
|
|
string bk = Resources.bk;
|
|
return !string.IsNullOrWhiteSpace(bk) ? bk.Trim() : throw new Exception("Backend key missing");
|
|
}
|
|
|
|
public static string SessionToken { get; private set; }
|
|
|
|
public static DateTime SessionExpires { get; private set; }
|
|
|
|
static BackendClient()
|
|
{
|
|
BackendClient.http.DefaultRequestHeaders.Add("X-Raton-Key", BackendClient.BackendKey);
|
|
}
|
|
|
|
private static async Task<string> GetPublicIPv4() => "337";
|
|
|
|
public static bool IsLoggedIn()
|
|
{
|
|
return !string.IsNullOrEmpty(BackendClient.SessionToken) && DateTime.UtcNow < BackendClient.SessionExpires;
|
|
}
|
|
|
|
public static void Logout()
|
|
{
|
|
BackendClient.SessionToken = (string) null;
|
|
BackendClient.SessionExpires = DateTime.MinValue;
|
|
}
|
|
|
|
private static void AttachSession(HttpRequestMessage req)
|
|
{
|
|
req.Headers.Add("X-Session-Token", BackendClient.SessionToken);
|
|
}
|
|
|
|
public static Task<(bool, string)> Register(
|
|
string hwid,
|
|
string username,
|
|
string deviceId,
|
|
string password)
|
|
{
|
|
return (Task<(bool, string)>) null;
|
|
}
|
|
|
|
public static async Task<bool> Login(
|
|
string hwid,
|
|
string deviceId,
|
|
string password,
|
|
string username)
|
|
{
|
|
BackendClient.SessionToken = "cracked";
|
|
BackendClient.SessionExpires = DateTime.UtcNow.AddYears(10);
|
|
return true;
|
|
}
|
|
|
|
public static Task<(bool, string)> CheckDevice(string hwid, string deviceId)
|
|
{
|
|
return Task.FromResult<(bool, string)>((false, (string) null));
|
|
}
|
|
|
|
public static Task<bool> ValidateSessionFlags(string hwid, string deviceId)
|
|
{
|
|
return Task.FromResult<bool>(true);
|
|
}
|
|
|
|
public static async Task<int> GetTotalUsers() => 6741;
|
|
|
|
public static Task<bool> AddFriend(string myDeviceId, string friendDeviceId)
|
|
{
|
|
int num = (int) MessageBox.Show("dwey", "dwey", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
return Task.FromResult<bool>(true);
|
|
}
|
|
|
|
public static Task<bool> RemoveFriend(
|
|
string myDeviceId,
|
|
string myUsername,
|
|
string friendUsername)
|
|
{
|
|
int num = (int) MessageBox.Show("dwey", "dwey", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
return Task.FromResult<bool>(true);
|
|
}
|
|
|
|
public static Task<(int count, string[] friends, string link)> GetFriends(
|
|
string deviceId,
|
|
string username)
|
|
{
|
|
int num = (int) MessageBox.Show("dwey", "dwey", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
return Task.FromResult<(int, string[], string)>((1, new string[2]
|
|
{
|
|
"dwey",
|
|
"dwey"
|
|
}, (string) null));
|
|
}
|
|
|
|
public static Task<string> GetID(string deviceId) => Task.FromResult<string>("dwey");
|
|
|
|
public static Task<bool> SetFriendLink(string deviceId, string username, string link)
|
|
{
|
|
int num = (int) MessageBox.Show("tdwey", "dwey", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
return Task.FromResult<bool>(true);
|
|
}
|
|
|
|
public static Task<string> GetFriendLinkByUsername(string username)
|
|
{
|
|
return Task.FromResult<string>("");
|
|
}
|
|
}
|