add Novetus.Core namespace. Basic web proxy Extension support.

This commit is contained in:
Bitl 2023-01-05 10:07:51 -07:00
parent b0b2bad019
commit f46b7d9a9c
59 changed files with 5598 additions and 5286 deletions

View File

@ -1,5 +1,6 @@
#region Usings
using NLog;
using Novetus.Core;
using System;
using System.Diagnostics;
using System.IO;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System.IO;
using System.Reflection;
#endregion

View File

@ -1,4 +1,5 @@
using NLog;
using Novetus.Core;
using System;
using System.Drawing;
using System.Drawing.Text;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.Diagnostics;

View File

@ -7,6 +7,8 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using Novetus.Core;
partial class CharacterCustomizationCompact
{
/// <summary>

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -6,6 +6,8 @@
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using Novetus.Core;
partial class CharacterCustomizationExtended
{
/// <summary>

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -3,7 +3,9 @@ using System.Collections.Specialized;
using System.Text.RegularExpressions;
#endregion
#region CommandLineArguments
namespace Novetus.Core
{
#region CommandLineArguments
public class CommandLineArguments
{
//https://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser
@ -118,3 +120,4 @@ using System.Text.RegularExpressions;
}
}
#endregion
}

View File

@ -3,10 +3,12 @@ using System;
using System.Security.Cryptography;
#endregion
#region CryptoRandom
public class CryptoRandom : RandomNumberGenerator
namespace Novetus.Core
{
#region CryptoRandom
public class CryptoRandom : RandomNumberGenerator
{
private static RandomNumberGenerator r;
public CryptoRandom()
@ -47,5 +49,6 @@ public class CryptoRandom : RandomNumberGenerator
{
return Next(0, maxValue);
}
}
#endregion
}
#endregion

View File

@ -6,10 +6,12 @@ using System.Threading;
using System.Windows.Forms;
#endregion
#region Downloader
class Downloader
namespace Novetus.Core
{
#region Downloader
class Downloader
{
public readonly string fileURL;
public readonly string fileName;
public readonly string fileFilter;
@ -246,5 +248,6 @@ class Downloader
// Return total bytes processed to caller.
return bytesProcessed;
}
}
#endregion
}
#endregion

View File

@ -2,10 +2,12 @@
using System.Runtime.InteropServices;
#endregion
#region Discord RPC
//code by discord obv. just renamed it to fit better.
public class DiscordRPC
namespace Novetus.Core
{
#region Discord RPC
//code by discord obv. just renamed it to fit better.
public class DiscordRPC
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ReadyCallback();
@ -92,5 +94,6 @@ public class DiscordRPC
[DllImport("discord-rpc", EntryPoint = "Discord_Respond", CallingConvention = CallingConvention.Cdecl)]
public static extern void Respond(string userId, Reply reply);
}
#endregion
}
#endregion

View File

@ -5,11 +5,13 @@ using System.Runtime.InteropServices;
using System.Text;
#endregion
#region INI File Parser
//modified from https://www.codeproject.com/articles/1966/an-ini-file-handling-class-using-c?fid=425860&df=90&mpp=25&prof=True&sort=Position&view=Normal&spc=Relaxed&fr=51
public class INIFile
namespace Novetus.Core
{
#region INI File Parser
//modified from https://www.codeproject.com/articles/1966/an-ini-file-handling-class-using-c?fid=425860&df=90&mpp=25&prof=True&sort=Position&view=Normal&spc=Relaxed&fr=51
public class INIFile
{
public string path;
[DllImport("kernel32")]
@ -95,5 +97,6 @@ public class INIFile
return false;
}
}
}
#endregion
}
#endregion

View File

@ -0,0 +1,111 @@
#region Usings
using System;
using System.Reflection;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
using System.IO;
using System.Linq;
#endregion
// based on https://stackoverflow.com/questions/137933/what-is-the-best-scripting-language-to-embed-in-a-c-sharp-desktop-application
namespace Novetus.Core
{
#region Script
public class Script
{
public static object LoadScriptFromContent(string scriptPath)
{
try
{
using (var stream = File.OpenRead(scriptPath))
{
using (var reader = new StreamReader(stream))
{
string script = reader.ReadToEnd();
Assembly compiled = CompileScript(script, scriptPath);
object code = ExecuteScript(compiled, scriptPath);
return code;
}
}
}
catch (Exception ex)
{
ErrorHandler(scriptPath + ": " + ex.ToString(), true);
}
return null;
}
private static object ExecuteScript(Assembly assemblyScript, string filePath)
{
if (assemblyScript == null)
{
goto error;
}
foreach (Type type in assemblyScript.GetExportedTypes())
{
if (type.IsInterface || type.IsAbstract)
continue;
ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes);
if (constructor != null && constructor.IsPublic)
{
return constructor.Invoke(null);
}
else
{
ErrorHandler(filePath + ": Constructor does not exist or it is not public.", true);
return null;
}
}
error:
ErrorHandler(filePath + ": Failed to load script.", true);
return null;
}
private static Assembly CompileScript(string code, string filePath)
{
CSharpCodeProvider provider = new CSharpCodeProvider();
CompilerParameters perams = new CompilerParameters();
perams.GenerateExecutable = false;
perams.GenerateInMemory = true;
var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).Select(a => a.Location);
perams.ReferencedAssemblies.AddRange(assemblies.ToArray());
CompilerResults result = provider.CompileAssemblyFromSource(perams, code);
foreach (CompilerError error in result.Errors)
{
ErrorHandler(error, filePath, error.IsWarning, false);
}
if (result.Errors.HasErrors)
{
return null;
}
return result.CompiledAssembly;
}
public static void ErrorHandler(string error, bool finalError = false)
{
ErrorHandler(error, false, finalError);
}
private static void ErrorHandler(string error, bool warning, bool finalError)
{
Util.ConsolePrint(warning ? "[SCRIPT WARNING] - " : "[SCRIPT ERROR] - " + error, warning ? 5 : 2);
}
private static void ErrorHandler(CompilerError error, string fileName, bool warning, bool finalError)
{
Util.ConsolePrint(warning ? "[SCRIPT WARNING] - " : "[SCRIPT ERROR] - " + fileName + " (" + error.Line + "," + error.Column + "): " + error.ErrorText, warning ? 5 : 2);
}
}
#endregion
}

View File

@ -4,11 +4,13 @@ using System.Collections.Generic;
using System.IO;
#endregion
#region Text Line Remover and Friends
// modified from https://stackoverflow.com/questions/668907/how-to-delete-a-line-from-a-text-file-in-c/668914#668914
public static class TextLineRemover
namespace Novetus.Core
{
#region Text Line Remover and Friends
// modified from https://stackoverflow.com/questions/668907/how-to-delete-a-line-from-a-text-file-in-c/668914#668914
public static class TextLineRemover
{
public static void RemoveTextLines(IList<string> linesToRemove, string filename, string tempFilename)
{
// Initial values
@ -82,22 +84,23 @@ public static class TextLineRemover
{
OnRemovedLine?.Invoke(null, args);
}
}
}
public delegate void Finished(object sender, FinishedArgs args);
public delegate void Finished(object sender, FinishedArgs args);
public struct FinishedArgs
{
public struct FinishedArgs
{
public int TotalLines { get; set; }
public int LinesRemoved { get; set; }
public TimeSpan TotalTime { get; set; }
}
}
public delegate void RemovedLine(object sender, RemovedLineArgs args);
public delegate void RemovedLine(object sender, RemovedLineArgs args);
public struct RemovedLineArgs
{
public struct RemovedLineArgs
{
public string RemovedLine { get; set; }
public int RemovedLineNumber { get; set; }
}
#endregion
}
#endregion

View File

@ -7,9 +7,10 @@ using System.IO;
using System.Runtime.InteropServices;
#endregion
//https://github.com/davcs86/csharp-uhwid
//merged into one class
namespace UHWID
namespace Novetus.Core
{
#region UHWIDEngine
public static class UHWIDEngine

View File

@ -12,11 +12,64 @@ using Titanium.Web.Proxy.EventArguments;
using Titanium.Web.Proxy.Http;
using Titanium.Web.Proxy.Models;
public class WebProxy
namespace Novetus.Core
{
public class IWebProxyExtension
{
public virtual string Name { get; set; } = "Unnamed Web Proxy Extension";
public virtual void OnExtensionLoad() { }
public virtual void OnProxyStart() { }
public virtual void OnProxyStopped() { }
public virtual bool IsValidURL(string absolutePath, string host) { return false; }
public virtual Task OnBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e) { return Task.CompletedTask; }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
public virtual async Task OnRequest(object sender, SessionEventArgs e) { }
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
}
public class WebProxy
{
private static List<IWebProxyExtension> ExtensionList = new List<IWebProxyExtension>();
private static ProxyServer Server = new ProxyServer();
private static ExplicitProxyEndPoint end;
public void LoadExtensions()
{
string nothingFoundError = "No extensions found. The Web Proxy will run with limited functionality.";
if (!Directory.Exists(GlobalPaths.NovetusExtsWebProxy))
{
Util.ConsolePrint(nothingFoundError, 5);
return;
}
// load up all .cs files.
string[] filePaths = Directory.GetFiles(GlobalPaths.NovetusExtsWebProxy, "*.cs", SearchOption.TopDirectoryOnly);
if (filePaths.Count() == 0)
{
Util.ConsolePrint(nothingFoundError, 5);
return;
}
foreach (string file in filePaths)
{
try
{
IWebProxyExtension newExt = (IWebProxyExtension)Script.LoadScriptFromContent(file);
ExtensionList.Add(newExt);
Util.ConsolePrint("Web Proxy: Loaded extension " + newExt.Name + " from " + Path.GetFileName(file), 3);
newExt.OnExtensionLoad();
}
catch (Exception e)
{
Util.LogExceptions(e);
}
}
}
public bool HasStarted()
{
return Server.ProxyRunning;
@ -62,12 +115,16 @@ public class WebProxy
{
try
{
//load ext
LoadExtensions();
Server.CertificateManager.RootCertificateIssuerName = "Novetus";
Server.CertificateManager.RootCertificateName = "Novetus Web Proxy";
Server.BeforeRequest += new AsyncEventHandler<SessionEventArgs>(OnRequest);
UpdateEndPoint(true);
Util.ConsolePrint("Web Proxy started on port " + GlobalVars.WebProxyPort, 3);
foreach (IWebProxyExtension extension in ExtensionList.ToArray())
{
extension.OnProxyStart();
}
}
catch (Exception e)
{
@ -104,7 +161,7 @@ public class WebProxy
Util.ConsolePrint("Web Proxy Endpoint updated with port " + GlobalVars.WebProxyPort, 3);
}
private bool IsURIAllowed(HttpWebClient client)
private bool IsValidURL(HttpWebClient client)
{
string uri = client.Request.RequestUri.Host;
@ -138,11 +195,32 @@ public class WebProxy
private Task OnBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
{
if (!IsURIAllowed(e.HttpClient))
if (!IsValidURL(e.HttpClient))
{
e.DecryptSsl = false;
}
Uri uri = e.HttpClient.Request.RequestUri;
foreach (IWebProxyExtension extension in ExtensionList.ToArray())
{
if (extension.IsValidURL(uri.AbsolutePath.ToLowerInvariant(), uri.Host))
{
try
{
extension.OnBeforeTunnelConnectRequest(sender, e);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
}
}
else
{
e.DecryptSsl = false;
}
}
return Task.CompletedTask;
}
@ -150,11 +228,31 @@ public class WebProxy
private async Task OnRequest(object sender, SessionEventArgs e)
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
{
if (!IsURIAllowed(e.HttpClient))
if (!IsValidURL(e.HttpClient))
{
return;
}
Uri uri = e.HttpClient.Request.RequestUri;
foreach (IWebProxyExtension extension in ExtensionList.ToArray())
{
if (extension.IsValidURL(uri.AbsolutePath.ToLowerInvariant(), uri.Host))
{
try
{
await extension.OnRequest(sender, e);
return;
}
catch (Exception ex)
{
Util.LogExceptions(ex);
e.GenericResponse("", HttpStatusCode.InternalServerError);
return;
}
}
}
e.GenericResponse("", HttpStatusCode.NotFound);
}
@ -163,11 +261,19 @@ public class WebProxy
Util.ConsolePrint("Web Proxy stopping on port " + GlobalVars.WebProxyPort, 3);
Server.BeforeRequest -= new AsyncEventHandler<SessionEventArgs>(OnRequest);
Server.Stop();
foreach (IWebProxyExtension extension in ExtensionList.ToArray())
{
try
{
extension.OnProxyStopped();
}
catch (Exception e)
{
Util.LogExceptions(e);
}
}
}
}
}
public interface IWebProxyExtention
{
}
#endif

View File

@ -9,6 +9,7 @@
<Import_RootNamespace>NovetusCore</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Classes\Script.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Classes\WebProxy.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\ClientManagement.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Classes\Downloader.cs" />

View File

@ -12,9 +12,11 @@ using System.Security.Cryptography;
using System.Reflection;
#endregion
#region Client Management
public class ClientManagement
namespace Novetus.Core
{
#region Client Management
public class ClientManagement
{
public static void ReadClientValues(bool initial = false)
{
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, initial);
@ -1072,9 +1074,9 @@ public class ClientManagement
public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e)
#endif
{
#if LAUNCHER
#if LAUNCHER
DecompressMap(type, nomap);
#endif
#endif
switch (type)
{
@ -1396,13 +1398,13 @@ public class ClientManagement
return false;
}
}
#endregion
}
#endregion
#region Script Functions
public class ScriptFuncs
{
#region Script Generator/Signer
#region Script Functions
public class ScriptFuncs
{
#region Script Generator/Signer
public class Generator
{
public static void SignGeneratedScript(string scriptFileName, bool newSigFormat = false, bool encodeInBase64 = true)
@ -1587,9 +1589,9 @@ public class ScriptFuncs
return ClientManagement.GetGenLuaFileName(ClientName, type);
}
}
#endregion
#endregion
#region ClientScript Parser
#region ClientScript Parser
public class ClientScript
{
public static string GetArgsFromTag(string code, string tag, string endtag)
@ -1887,6 +1889,7 @@ public class ScriptFuncs
return compiled;
}
}
#endregion
#endregion
}
#endregion
}
#endregion

View File

@ -14,9 +14,11 @@ using System.Xml.Serialization;
using System.Runtime.Versioning;
#endregion
#region File Formats
public class FileFormat
namespace Novetus.Core
{
#region File Formats
public class FileFormat
{
#region Client Information
public class ClientInfo
{
@ -217,12 +219,12 @@ public class FileFormat
public bool InitialBootup { get; set; }
}
#endregion
}
#endregion
}
#endregion
#region Part Color Options
public class PartColor
{
#region Part Color Options
public class PartColor
{
public string ColorName;
public int ColorID;
public string ColorRGB;
@ -234,17 +236,17 @@ public class PartColor
public string ColorRawName;
[XmlIgnore]
public Bitmap ColorImage;
}
}
[XmlRoot("PartColors")]
public class PartColors
{
[XmlRoot("PartColors")]
public class PartColors
{
[XmlArray("ColorList")]
public PartColor[] ColorList;
}
}
public class PartColorLoader
{
public class PartColorLoader
{
public static PartColor[] GetPartColors()
{
if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.PartColorXMLName))
@ -392,26 +394,26 @@ public class PartColorLoader
return null;
}
}
}
#endregion
}
#endregion
#region Content Provider Options
public class Provider
{
#region Content Provider Options
public class Provider
{
public string Name;
public string URL;
public string Icon;
}
}
[XmlRoot("ContentProviders")]
public class ContentProviders
{
[XmlRoot("ContentProviders")]
public class ContentProviders
{
[XmlArray("Providers")]
public Provider[] Providers;
}
}
public class OnlineClothing
{
public class OnlineClothing
{
public static Provider[] GetContentProviders()
{
if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
@ -455,12 +457,12 @@ public class OnlineClothing
return null;
}
}
}
#endregion
}
#endregion
#region Settings
public class Settings
{
#region Settings
public class Settings
{
public enum Mode
{
Automatic = 0,
@ -541,14 +543,14 @@ public class Settings
return appdataRobloxPath;
}
}
}
}
#endregion
#endregion
#region Icon Loader
#region Icon Loader
public class IconLoader
{
public class IconLoader
{
private OpenFileDialog openFileDialog1;
private string installOutcome = "";
public bool CopyToItemDir = false;
@ -603,12 +605,12 @@ public class IconLoader
}
}
}
}
#endregion
}
#endregion
#region File Management
public class FileManagement
{
#region File Management
public class FileManagement
{
public static void ReadInfoFile(string infopath, bool other = false, string exepath = "")
{
//READ
@ -1501,5 +1503,6 @@ public class FileManagement
Util.ConsolePrint("File list generation finished.", 4);
}
}
#endregion
}
#endregion

View File

@ -3,10 +3,12 @@ using System.IO;
using System.Reflection;
#endregion
#region Global Paths
public class GlobalPaths
namespace Novetus.Core
{
#region Global Paths
public class GlobalPaths
{
#region Base Game Paths
public static readonly string RootPathLauncher = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public static readonly string BasePathLauncher = RootPathLauncher.Replace(@"\", @"\\");
@ -23,6 +25,8 @@ public class GlobalPaths
public static readonly string MapsDir = BasePath + @"\\maps";
public static readonly string AddonDir = BasePath + @"\\addons";
public static readonly string AddonCoreDir = AddonDir + @"\\core";
public static readonly string AddonNovetusExts = AddonDir + @"\\novetusexts";
public static readonly string NovetusExtsWebProxy = AddonNovetusExts + @"\\webproxy";
public static readonly string MapsDirCustom = MapsDir + @"\\Custom";
public static readonly string MapsDirBase = "maps";
public static readonly string BaseGameDir = "rbxasset://../../../";
@ -114,5 +118,6 @@ public class GlobalPaths
public static readonly string AddonLoaderFileName = "AddonLoader.lua";
public static readonly string AssetFixerPatternFileName = "assetfixer_pattern.txt";
#endregion
}
#endregion
}
#endregion

View File

@ -14,21 +14,23 @@ using System.Diagnostics;
using System.Windows.Forms;
#endregion
#region Script Type
public enum ScriptType
namespace Novetus.Core
{
#region Script Type
public enum ScriptType
{
Client = 0,
Server = 1,
Solo = 2,
Studio = 3,
EasterEgg = 4,
None = 5
}
#endregion
}
#endregion
#region Game Server Definition
public class GameServer
{
#region Game Server Definition
public class GameServer
{
public GameServer(string ip, int port)
{
ServerIP = ip;
@ -60,12 +62,12 @@ public class GameServer
public string ServerIP { get; set; }
public int ServerPort { get; set; }
}
#endregion
}
#endregion
#region Global Variables
public static class GlobalVars
{
#region Global Variables
public static class GlobalVars
{
#region Discord
public enum LauncherState
{
@ -101,7 +103,7 @@ public static class GlobalVars
public static int WebProxyPort = 0;
public static WebProxy Proxy = new WebProxy();
#endif
#endregion
#endregion
#if LAUNCHER
#region Novetus Launcher
@ -149,5 +151,6 @@ public static class GlobalVars
public static bool isConsoleOnly = false;
public static bool isMapCompressed = false;
#endregion
}
#endregion
}
#endregion

View File

@ -4,10 +4,12 @@ using Mono.Nat;
using System;
#endregion
#region NetFuncs
public static class NetFuncs
namespace Novetus.Core
{
#region NetFuncs
public static class NetFuncs
{
public static void InitUPnP(EventHandler<DeviceEventArgs> DeviceFound, EventHandler<DeviceEventArgs> DeviceLost)
{
if (GlobalVars.UserConfiguration.UPnP)
@ -48,6 +50,7 @@ public static class NetFuncs
}
}
}
}
#endregion
}
#endregion
#endif

View File

@ -10,9 +10,11 @@ using System.Windows.Forms;
using System.Collections.Generic;
#endregion
#region Novetus Functions
public class NovetusFuncs
namespace Novetus.Core
{
#region Novetus Functions
public class NovetusFuncs
{
public static string CopyMapToRBXAsset()
{
string clientcontentpath = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\temp.rbxl";
@ -126,7 +128,7 @@ public class NovetusFuncs
public static string GenerateAndReturnTripcode()
{
//Powered by https://github.com/davcs86/csharp-uhwid
return UHWID.UHWIDEngine.AdvancedUid;
return UHWIDEngine.AdvancedUid;
}
public static void PingMasterServer(bool online, string reason)
@ -299,13 +301,13 @@ public class NovetusFuncs
GlobalVars.Important = Name1 + Name2;
GlobalVars.Important2 = SecurityFuncs.Encipher(GlobalVars.Important, random.Next(2, 13));
}
}
#endregion
}
#endregion
#region Roblox Helpers
#region Vector3
public class Vector3
{
#region Roblox Helpers
#region Vector3
public class Vector3
{
public double X;
public double Y;
public double Z;
@ -316,12 +318,12 @@ public class Vector3
Y = aY;
Z = aZ;
}
}
#endregion
}
#endregion
#region Roblox File Types
public enum RobloxFileType
{
#region Roblox File Types
public enum RobloxFileType
{
//RBXL and RBXM
RBXL,
RBXM,
@ -334,12 +336,12 @@ public enum RobloxFileType
Pants,
Script,
HeadNoCustomMesh
}
#endregion
}
#endregion
#region Asset Cache Definition
public class AssetCacheDefBasic
{
#region Asset Cache Definition
public class AssetCacheDefBasic
{
public AssetCacheDefBasic(string clas, string[] id)
{
Class = clas;
@ -348,10 +350,10 @@ public class AssetCacheDefBasic
public string Class { get; set; }
public string[] Id { get; set; }
}
}
public class AssetCacheDef : AssetCacheDefBasic
{
public class AssetCacheDef : AssetCacheDefBasic
{
public AssetCacheDef(string clas, string[] id, string[] ext,
string[] dir, string[] gamedir) : base(clas, id)
{
@ -363,12 +365,12 @@ public class AssetCacheDef : AssetCacheDefBasic
public string[] Ext { get; set; }
public string[] Dir { get; set; }
public string[] GameDir { get; set; }
}
#endregion
}
#endregion
#region Roblox Type Definitions
public struct RobloxDefs
{
#region Roblox Type Definitions
public struct RobloxDefs
{
//item defs below
public static AssetCacheDef ItemHatFonts
{
@ -477,24 +479,24 @@ public struct RobloxDefs
new string[] { GlobalPaths.pantsGameDirTextures });
}
}
}
#endregion
}
#endregion
#region XML Types
public enum XMLTypes
{
#region XML Types
public enum XMLTypes
{
Token,
Bool,
Float,
String,
Vector2Int16,
Int
}
#endregion
}
#endregion
#region Roblox XML Parser
public static class RobloxXML
{
#region Roblox XML Parser
public static class RobloxXML
{
public static void EditRenderSettings(XDocument doc, string setting, string value, XMLTypes type)
{
var v = from nodes in doc.Descendants("Item")
@ -670,6 +672,7 @@ public static class RobloxXML
string r = "[\x00-\x08\x0B\x0C\x0E-\x1F]";
return Regex.Replace(txt, r, "", RegexOptions.Compiled);
}
}
#endregion
#endregion
}
#endregion
#endregion

View File

@ -14,9 +14,11 @@ using System.Net;
using System.Threading.Tasks;
#endregion
#region Security Functions
public class SecurityFuncs
namespace Novetus.Core
{
#region Security Functions
public class SecurityFuncs
{
[DllImport("user32.dll")]
static extern int SetWindowText(IntPtr hWnd, string text);
@ -99,7 +101,7 @@ public class SecurityFuncs
string decode = base64EncodedData.Decrypt();
return decode;
}
catch(Exception)
catch (Exception)
{
var base64EncodedBytes = Convert.FromBase64String(base64EncodedData);
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
@ -176,10 +178,14 @@ public class SecurityFuncs
{
string rbxscript = GlobalPaths.BasePath + "\\clients\\" + client + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua";
return CheckMD5(GlobalVars.SelectedClientInfo.ScriptMD5, rbxscript);
} else {
}
else
{
return true;
}
} else {
}
else
{
return true;
}
}
@ -378,5 +384,6 @@ public class SecurityFuncs
{
return Encipher(input, 26 - key);
}
}
#endregion
}
#endregion

View File

@ -20,10 +20,12 @@ using Mono.Nat;
#endif
#endregion
#region Utils
public static class Util
namespace Novetus.Core
{
#region Utils
public static class Util
{
#region Extensions
//This code was brought to you by:
//https://stackoverflow.com/questions/1926264/color-different-parts-of-a-richtextbox-string
@ -730,7 +732,7 @@ public static class Util
{
try
{
string[] NewlineChars = {Environment.NewLine, "\n"};
string[] NewlineChars = { Environment.NewLine, "\n" };
string[] lines = text.Split(NewlineChars, StringSplitOptions.None);
ConsolePrintMultiLine(lines, type, notime, noLog);
}
@ -1042,14 +1044,14 @@ public static class Util
}
#endregion
#endif
}
#endregion
}
#endregion
#region Tab Control without Header
//https://stackoverflow.com/questions/23247941/c-sharp-how-to-remove-tabcontrol-border
#region Tab Control without Header
//https://stackoverflow.com/questions/23247941/c-sharp-how-to-remove-tabcontrol-border
public partial class TabControlWithoutHeader : TabControl
{
public partial class TabControlWithoutHeader : TabControl
{
public TabControlWithoutHeader()
{
if (!DesignMode) Multiline = true;
@ -1062,5 +1064,6 @@ public partial class TabControlWithoutHeader : TabControl
else
base.WndProc(ref m);
}
}
#endregion
}
#endregion

View File

@ -1,5 +1,6 @@
#region Usings
using Ionic.Zip;
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.IO;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.Globalization;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.IO;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Diagnostics;
using System.IO;

View File

@ -1,4 +1,5 @@
using System.Windows.Forms;
using Novetus.Core;
using System.Windows.Forms;
namespace NovetusLauncher
{

View File

@ -6,6 +6,8 @@
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using Novetus.Core;
namespace NovetusLauncher
{
partial class LauncherFormCompact

View File

@ -1,5 +1,6 @@
#region Usings
using Mono.Nat;
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -6,6 +6,8 @@
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using Novetus.Core;
namespace NovetusLauncher
{
partial class LauncherFormExtended

View File

@ -10,6 +10,7 @@ using System.Reflection;
using Mono.Nat;
using System.Globalization;
using System.Linq;
using Novetus.Core;
#endregion
namespace NovetusLauncher

View File

@ -1,5 +1,6 @@
#region Usings
using Mono.Nat;
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.IO;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Diagnostics;
using System.Windows.Forms;

View File

@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NLog;
using Novetus.Core;
namespace NovetusLauncher
{

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -2,10 +2,11 @@
using System;
using System.Windows.Forms;
using System.IO;
using Novetus.Core;
#endregion
#region ClientScriptDocumentation
public partial class ClientScriptDocumentation : Form
public partial class ClientScriptDocumentation : Form
{
#region Constructor
public ClientScriptDocumentation()

View File

@ -4,6 +4,7 @@ using System.Windows.Forms;
using System.IO;
using System.Globalization;
using System.Collections.Generic;
using Novetus.Core;
#endregion
#region Client SDK

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.IO;
using System.Text;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.Drawing;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Windows.Forms;
#endregion

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -1,4 +1,5 @@
using System;
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Drawing;
using System.Linq;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.IO;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Collections.Generic;
using System.Drawing;

View File

@ -1,5 +1,6 @@
#region Usings
using NLog;
using Novetus.Core;
using System;
using System.Diagnostics;
using System.Globalization;

View File

@ -1,5 +1,6 @@
#region Usings
using Microsoft.Win32;
using Novetus.Core;
using System;
using System.IO;
using System.Windows.Forms;

View File

@ -1,4 +1,5 @@
#region Usings
using Novetus.Core;
using System;
using System.Windows.Forms;
#endregion

View File

@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using NLog;
using Novetus.Core;
#endregion
namespace NovetusURI

View File

@ -3,6 +3,7 @@ using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using Novetus.Core;
#endregion
namespace NovetusURI

View File

@ -1,5 +1,6 @@
#region Usings
using NLog;
using Novetus.Core;
using System;
using System.IO;
using System.Threading;