This commit is contained in:
watrabi
2025-09-18 17:55:52 -04:00
commit 977f1ff4b8
15030 changed files with 17324420 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScriptSigner", "ScriptSigner\ScriptSigner.csproj", "{796ED054-EA2A-40DA-BC9B-A50D03CE21B8}"
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://tfs.watrbx.wtf:8081/
SccLocalPath0 = .
SccProjectUniqueName1 = ScriptSigner\\ScriptSigner.csproj
SccProjectName1 = ScriptSigner
SccLocalPath1 = ScriptSigner
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{796ED054-EA2A-40DA-BC9B-A50D03CE21B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{796ED054-EA2A-40DA-BC9B-A50D03CE21B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{796ED054-EA2A-40DA-BC9B-A50D03CE21B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{796ED054-EA2A-40DA-BC9B-A50D03CE21B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+26
View File
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ScriptSigner
{
class Program
{
static void Main(string[] args)
{
string path = "Server/RobloxWebSite/Game/rbxPrivate.blob";
while (!System.IO.File.Exists(path))
{
path = "../" + path;
}
byte[] blob = System.IO.File.ReadAllBytes(path);
foreach (string s in args)
{
string script = System.IO.File.ReadAllText(s);
System.IO.File.WriteAllText(s + ".sgnd", SharedSecurityNotary.SignScript(script, blob));
}
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ScriptSigner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("ScriptSigner")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8f348b4b-5026-4a1a-b24e-95d67304c1fb")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{796ED054-EA2A-40DA-BC9B-A50D03CE21B8}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ScriptSigner</RootNamespace>
<AssemblyName>ScriptSigner</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SharedSecurityNotary.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,40 @@
using System;
using System.Security.Cryptography;
using System.Text;
/// <summary>
/// SharedSecurityNotary does the actual signing of scripts, but does not load the private key
/// </summary>
public class SharedSecurityNotary
{
public SharedSecurityNotary()
{
}
public static string CreateSignature(string message, byte[] blob)
{
var cspParam = new CspParameters();
cspParam.Flags = CspProviderFlags.UseMachineKeyStore;
byte[] asciiMessage = ASCIIEncoding.ASCII.GetBytes(message);
byte[] signature;
using (var rsaCryptoServiceProvider = new RSACryptoServiceProvider(cspParam))
{
rsaCryptoServiceProvider.ImportCspBlob(blob);
using (var sha1CryptoServiceProvider = new SHA1CryptoServiceProvider())
{
signature = rsaCryptoServiceProvider.SignData(asciiMessage, sha1CryptoServiceProvider);
}
}
string encodedSignature = Convert.ToBase64String(signature);
return encodedSignature;
}
public static string SignScript(string script, byte[] blob)
{
string signature = CreateSignature(script, blob);
string signedScript = string.Format("%{0}%{1}", signature, script);
return signedScript;
}
}