0% found this document useful (0 votes)
13 views15 pages

A

The document outlines the Luminosity API, which includes various functionalities for interacting with Roblox, such as client information retrieval, script execution, and Discord integration. It features methods for auto-injecting scripts, managing client connections, and handling file operations. Additionally, it provides error handling and setup procedures for required dependencies and configurations.

Uploaded by

gigatuoongmo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views15 pages

A

The document outlines the Luminosity API, which includes various functionalities for interacting with Roblox, such as client information retrieval, script execution, and Discord integration. It features methods for auto-injecting scripts, managing client connections, and handling file operations. Additionally, it provides error handling and setup procedures for required dependencies and configurations.

Uploaded by

gigatuoongmo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 15

#region Assembly Luminosity-API, Version=1.0.0.

0, Culture=neutral,
PublicKeyToken=null
// C:\Users\new\Desktop\New folder\LuminosityApis\bin\x64\Debug\CloudyApis.dll
// Decompiled with ICSharpCode.Decompiler 8.1.1.7464
#endregion

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using DiscordRPC;
using DiscordRPC.Message;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace LuminosityAPI
{
public static class LuminosityFunctions
{
public static class CoreAPI
{
public static class CoreSystem
{
public static class AutomaticallySetupFileSCore
{
public static class AutomaticallyClientInfo
{
public static class AutoIssueFalse
{
public static class FixException
{
public static class LuminosityFUNC
{
public static class External
{
public struct ClientInfo
{
public string version;
public string name;
public int id;
}

private static System.Windows.Forms.Timer


time12;
private static bool isua = false;
private static bool _autoInject;
public static bool isRegistred;
public static string i;
public static bool Isua { get => isua; set
=> isua = value; }

[DllImport("bin\\Cloudy.dll",
CallingConvention = CallingConvention.Cdecl)]
private static extern void Initialize();

[DllImport("bin\\Cloudy.dll",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern void
ExecuteAsync(byte[] scriptSource, string[] clientUsers, int numUsers);

[DllImport("bin\\Cloudy.dll",
CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr GetClients();

static External()
{
time12 = new
System.Windows.Forms.Timer();
Isua = false;
isRegistred = false;
i = "Axel"; // Changed name to Axel
AutoSetup();
}

public static void AutoInject(bool enable)


{
if (misc.isRobloxOpen() &&
misc.CheckRobloxVersion())
{
Initialize();
_autoInject = enable;
if (enable)
{
inject();
}
}
}

public static bool IsAutoInjectEnabled()


{
return _autoInject;
}

public static void inject()


{
if (misc.isRobloxOpen() &&
misc.CheckRobloxVersion() && isRegistred)
{
Initialize();
Thread.Sleep(2000);
string s = "\
tgame:GetService(\"StarterGui\"):SetCore(\"SendNotification\", {\r\n\t\tTitle = \""
+ i + "\",\r\n\t\tText = \"Injected Successfuly!\"\r\n\t})";
string[] array = (from c in
GetClientsList()
select
c.name).ToArray();

ExecuteAsync(Encoding.UTF8.GetBytes(s), array, array.Length);


}
}

public static void execute(string


scriptSource)
{
string[] array = (from c in
GetClientsList()
select
c.name).ToArray();

ExecuteAsync(Encoding.UTF8.GetBytes(scriptSource), array, array.Length);


}

public static List<ClientInfo>


GetClientsList()
{
List<ClientInfo> list = new
List<ClientInfo>();
IntPtr clients = GetClients();
while (true)
{
ClientInfo item =
Marshal.PtrToStructure<ClientInfo>(clients);
if (item.name != null)
{
list.Add(item);
clients +=
Marshal.SizeOf<ClientInfo>();
continue;
}
break;
}
return list;
}

public static void RegisterExecutor(string


injectionMessage)
{
i = injectionMessage;
isRegistred = true;
}

public static bool IsInjected()


{
try
{
return GetClientsList().Count > 0;
}
catch
{
return false;
}
}

private static void AutoSetup()


{
string[] array = new string[5]
{ "Cloudy.dll", "libcrypto-3-x64.dll", "libssl-3-x64.dll", "xxhash.dll", "zstd.dll"
};
string text =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin");
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}

foreach (string text2 in array)


{
string text3 = Path.Combine(text,
text2);
if (!File.Exists(text3))
{
try
{
string address =
"https://github.com/CloudyExecugor/frontend/releases/download/reareaaaa/" + text2;
using (WebClient webClient
= new WebClient())
{

webClient.DownloadFile(address, text3);
}
}
catch (Exception ex)
{
MessageBox.Show("Failed to
Download " + text2 + ": " + ex.Message, "LuminosityApi");
}
}
}
}
}

public static class Internal


{
static Internal()
{
AutoSetup();
Task.Run(delegate
{
CleanRobloxVersions();
});
CreateCLDYWorkspace();
Configs.executeP =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationDa
ta), "execute.txt");
Configs.SetupFileWatcher();
}

private static void CleanRobloxVersions()


{
string folderPath =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string path = Path.Combine(folderPath,
"Roblox", "Versions");
if (!Directory.Exists(path))
{
return;
}

string[] array = new string[5]


{ "msvcp140_1.dll", "msvcp140_2.dll", "msvcp140.dll", "vcruntime140.dll",
"vcruntime140_1.dll" };
try
{
string[] directories =
Directory.GetDirectories(path, "version-*");
foreach (string path2 in
directories)
{
foreach (string path3 in array)
{
string path4 =
Path.Combine(path2, path3);
if (File.Exists(path4))
{
try
{
File.Delete(path4);
}
catch { }
}
}
}
}
catch { }
}

public static void CreateCLDYWorkspace()


{
string localAppData =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string targetPath =
Path.Combine(localAppData, "CLDY", "Workspace");
if (!Directory.Exists(targetPath))
{

Directory.CreateDirectory(targetPath);
}
}

public static void inject()


{
try
{
Process process = new Process
{
StartInfo =
{
FileName = "Injector.exe",
UseShellExecute = false,
CreateNoWindow = true
}
};
process.Start();
}
catch (Exception ex)
{
MessageBox.Show("Error starting
injector: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

public static void execute(string script)


{
try
{
string directoryName =
Path.GetDirectoryName(Configs.executeP);
if (!
Directory.Exists(directoryName))
{

Directory.CreateDirectory(directoryName);
}
File.WriteAllText(Configs.executeP,
script);
}
catch (Exception) { }
}

private static void AutoSetup()


{
string[] array = new string[2]
{ "Injector.exe", "Module.dll" };
string[] array2 = new string[2]
{ "Injector.exe", "Module.dll" };
string baseDirectory =
AppDomain.CurrentDomain.BaseDirectory;
if (!Directory.Exists(baseDirectory))
{

Directory.CreateDirectory(baseDirectory);
}

for (int i = 0; i < array.Length; i++)


{
string text = array[i];
string path = array2[i];
string text2 =
Path.Combine(baseDirectory, path);
if (!File.Exists(text2))
{
try
{
string address =
"https://github.com/CloudyExecugor/frontend/releases/download/reareaaaa/" + text;
using (WebClient webClient
= new WebClient())
{

webClient.DownloadFile(address, text2);
}
}
catch (Exception ex)
{
MessageBox.Show("An error
occurred while downloading required files. ERR: " + ex.Message);
}
}
}
}

private class Configs


{
internal static string executeP;

internal static void SetupFileWatcher()


{
FileSystemWatcher watcher = new
FileSystemWatcher
{
Path =
Path.GetDirectoryName(executeP),
Filter =
Path.GetFileName(executeP),
EnableRaisingEvents = true
};
watcher.Changed += OnFileChanged;
}

private static void


OnFileChanged(object sender, FileSystemEventArgs e)
{
// Handle file change event here
}
}
}

public static class misc


{
public static string editorUri;
private static readonly HttpClient client;
private static DiscordRpcClient clients;
private static DiscordRpcClient clientas;

static misc()
{
editorUri =
"https://getcloudy.xyz/Editor";
client = new HttpClient();
AutoSetup();

client.DefaultRequestHeaders.Add("Authorization", "v1USERFREE");
}

public static void disableSecurity()


{
Configs.isSec = false;
}
public static void credits()
{
MessageBox.Show("This api was made by
@PolarBear. Thanks to @Bomaymup for contributing to the internal module!",
"LuminosityApi");
}

private static string


GetUserIdFromUsername(string username)
{
string address =
"https://users.roblox.com/v1/usernames/users";
string data = "{\"usernames\": [\"" +
username + "\"]}";
try
{
using (WebClient webClient = new
WebClient())
{

webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
string text =
webClient.UploadString(address, "POST", data);
JObject json =
JObject.Parse(text);
if (json["data"] != null &&
json["data"].HasValues)
{
return json["data"][0]
["id"]?.ToString();
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error getting user
ID for " + username + ": " + ex.Message, "LuminosityApi");
}
return null;
}

public static BitmapImage GetAvatar(string


username)
{
string userIdFromUsername =
GetUserIdFromUsername(username);
if
(string.IsNullOrEmpty(userIdFromUsername))
{
return null;
}

string address =
"https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=" +
userIdFromUsername + "&size=420x420&format=png";
try
{
using (WebClient webClient = new
WebClient())
{
string text =
webClient.DownloadString(address);
JObject json =
JObject.Parse(text);
if (json["data"] != null &&
json["data"].HasValues)
{
string uriString =
json["data"][0]["imageUrl"]?.ToString();
return new BitmapImage(new
Uri(uriString));
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error getting
avatar for " + username + ": " + ex.Message, "LuminosityApi");
}
return null;
}

public static string SetScriptJS(string


script)
{
return "setText(\"" +
HttpUtility.JavaScriptStringEncode(script) + "\")";
}

public static string GetTextJS()


{
return "getText()";
}

public static string AddTabJS(string name,


string content)
{
return "addTab(\"" +
HttpUtility.JavaScriptStringEncode(name) + "\", \"" +
HttpUtility.JavaScriptStringEncode(content) + "\")";
}

public static bool isRobloxOpen()


{
return
Process.GetProcessesByName("RobloxPlayerBeta").Any();
}

public static void SetDiscordRpc(string


title, string appid, string img, string state)
{
clients = new DiscordRpcClient(appid);
clients.OnReady += (sender, e) => { };
clients.Initialize();
clients.SetPresence(new RichPresence
{
Details = title,
State = state,
Timestamps = Timestamps.Now,
Assets = new Assets
{
LargeImageKey = img,
LargeImageText = title
}
});
}

[Obsolete]
public static async Task<string>
GetDiscordUsername(string appId)
{
TaskCompletionSource<string> tcs = new
TaskCompletionSource<string>();
clientas = new DiscordRpcClient(appId);
clientas.OnReady += (sender, e) =>
{
string result =
$"{e.User.Username}#{e.User.Discriminator}";
tcs.SetResult(result);
};
clientas.Initialize();
clientas.SetPresence(new RichPresence
{
Details = "Username Validation...",
State = "Please wait",
Timestamps = Timestamps.Now
});
return await tcs.Task;
}

public static bool CheckRobloxVersion()


{
Process[] processesByName =
Process.GetProcessesByName("RobloxPlayerBeta");
if (processesByName.Length == 0)
{
MessageBox.Show("Roblox is not
running.", "LuminosityApi");
return false;
}

string fileName =
processesByName[0].MainModule.FileName;
string name = new
DirectoryInfo(Path.GetDirectoryName(fileName)).Name;
if (name !=
Configs.SupportedRobloxVersion)
{
if (!Configs.isSec)
{
return true;
}
MessageBox.Show("LuminosityApi is
Outdated. Please Update The Newest Version!", "LuminosityApi");
return false;
}
return true;
}

public static string GetUsername()


{
string userName = Environment.UserName;
string path = "C:\\\\Users\\\\" +
userName + "\\\\AppData\\\\Local\\\\Roblox\\\\LocalStorage\\\\appStorage.json";
if (!File.Exists(path))
{
return null;
}

try
{
string text =
File.ReadAllText(path);
JObject json = JObject.Parse(text);
if (json.ContainsKey("Username"))
{
return
json["Username"]?.ToString();
}
}
catch (Exception ex)
{
MessageBox.Show("Error getting
username " + ex.Message, "LuminosityApi");
}
return null;
}

public static void killRoblox()


{
Process[] processesByName =
Process.GetProcessesByName("RobloxPlayerBeta");
foreach (Process process in
processesByName)
{
try
{
process.Kill();
process.WaitForExit();
}
catch (Exception ex)
{
Console.WriteLine("Failed to
kill process: " + ex.Message);
}
}
}

public static async Task<string>


AskAi(string input)
{
try
{
using (StringContent reqbody = new
StringContent("{\"input\":\"" + input + "\"}", Encoding.UTF8, "application/json"))
{
HttpResponseMessage response =
await client.PostAsync("http://37.114.56.124:5000/v1/cloudy/requests", reqbody);
if
(response.IsSuccessStatusCode)
{
string responseContent =
await response.Content.ReadAsStringAsync();
JObject json =
JObject.Parse(responseContent);
return
json["response"]?.ToString() ?? "AI is currently not available: 'AI WAS DISABLED BY
ADMINISTRATOR'";
}
return "Error: No valid
response";
}
}
catch (Exception ex)
{
return "Error: " + ex.Message;
}
}

public static string Cleanres(string res)


{
return Regex.Replace(res, "^```lua\\
s*(.*?)\\s*```$", "$1", RegexOptions.Singleline);
}

private static void AutoSetup()


{
string[] array = new string[2]
{ "Newtonsoft.Json.dll", "DiscordRPC.dll" };
string text =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory);
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}

foreach (string text2 in array)


{
string text3 = Path.Combine(text,
text2);
if (!File.Exists(text3))
{
try
{
string address =
"https://github.com/CloudyExecugor/frontend/releases/download/reareaaaa/" + text2;
using (WebClient webClient
= new WebClient())
{

webClient.DownloadFile(address, text3);
}
}
catch (Exception ex)
{
MessageBox.Show("Failed to
Download " + text2 + ": " + ex.Message, "LuminosityApi");
}
}
}
}

public static string cPlaceId()


{
try
{
string path =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationDa
ta), "Roblox", "logs");
List<string> source = (from f in
Directory.GetFiles(path, "*.log")
orderby new
FileInfo(f).LastWriteTime descending, new FileInfo(f).Length descending
select
f).ToList();
Regex regex = new
Regex("placeIds=(\\d+)", RegexOptions.IgnoreCase);
Regex regex2 = new Regex("placeid:
(\\d+)", RegexOptions.IgnoreCase);
foreach (string item in
source.Take(5))
{
using (FileStream stream = new
FileStream(item, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (StreamReader
streamReader = new StreamReader(stream))
{
string text = null;
string input;
while ((input =
streamReader.ReadLine()) != null)
{
Match match =
regex.Match(input);
if (match.Success)
{
text =
match.Groups[1].Value;
}

Match match2 =
regex2.Match(input);
if (match2.Success)
{
text =
match2.Groups[1].Value;
}
}

if (!
string.IsNullOrEmpty(text))
{
return text;
}
}
}
return null;
}
catch (Exception ex)
{
return "Error: " + ex.Message;
}
}

public static async Task<string>


cPlaceName(string placeId)
{
try
{
using (HttpClient httpClient = new
HttpClient())
{
string url =
"https://www.roblox.com/games/" + placeId;
HttpResponseMessage response =
await httpClient.GetAsync(url);
if (!
response.IsSuccessStatusCode)
{
return $"Failed to retrieve
data: {response.StatusCode}";
}

string content = await


response.Content.ReadAsStringAsync();
Match titleMatch =
Regex.Match(content, "<title>(.+?) - Roblox</title>", RegexOptions.IgnoreCase);
if (titleMatch.Success)
{
return
titleMatch.Groups[1].Value.Trim();
}
return "Place name not found in
page content.";
}
}
catch (Exception ex)
{
return "Error: " + ex.Message;
}
}

public static async Task<string>


cPlaceImage(string placeId)
{
try
{
using (HttpClient httpClient = new
HttpClient())
{
string url =
"https://thumbnails.roblox.com/v1/assets?assetIds=" + placeId +
"&format=Png&size=768x432";
HttpResponseMessage response =
await httpClient.GetAsync(url);
if (!
response.IsSuccessStatusCode)
{
return $"Failed to retrieve
image: {response.StatusCode}";
}

string content = await


response.Content.ReadAsStringAsync();
Match match =
Regex.Match(content, "\"imageUrl\":\\s*\"(https:[^\"]+)\"");
if (match.Success)
{
return
match.Groups[1].Value;
}
return "Image URL not found.";
}
}
catch (Exception ex)
{
return "Error: " + ex.Message;
}
}
}
}

internal class Configs


{
internal static bool isSec;
internal static string SupportedRobloxVersion =
null;
}
}
}
}
}
}
}
}
}

You might also like