-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lckt0
committed
Oct 24, 2021
1 parent
eec51d9
commit fce4420
Showing
877 changed files
with
161,882 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>23c3b079-9b79-41c2-ae44-9c58675c3772</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>AfterKoi</RootNamespace> | ||
<AssemblyName>AfterKoi</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</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"/> | ||
<Reference Include="System.Xml.Linq"/> | ||
<Reference Include="System.Data.DataSetExtensions"/> | ||
|
||
|
||
<Reference Include="Microsoft.CSharp"/> | ||
|
||
<Reference Include="System.Data"/> | ||
|
||
<Reference Include="System.Net.Http"/> | ||
|
||
<Reference Include="System.Xml"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Class1.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using dnlib.DotNet; | ||
using dnlib.DotNet.Emit; | ||
using Astro_Renewed.Services; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Astro_Renewed.Protections | ||
{ | ||
internal class LocalToField | ||
{ | ||
private static Dictionary<Local, FieldDef> _convertedLocals = new(); | ||
|
||
public static void Execute(ModuleDef module) | ||
{ | ||
foreach (var type in module.Types.Where(x => x != module.GlobalType)) | ||
{ | ||
foreach (var method2 in type.Methods.Where(x => x.HasBody && x.Body.HasInstructions && !x.IsConstructor)) | ||
{ | ||
_convertedLocals = new Dictionary<Local, FieldDef>(); | ||
Process(module, method2); | ||
} | ||
} | ||
Services.ConsoleLogger.Log("Processing \"Local To Field\" protection."); | ||
} | ||
|
||
private static void Process(ModuleDef module, MethodDef method) | ||
{ | ||
var instructions = method.Body.Instructions; | ||
foreach (var t in instructions) | ||
{ | ||
if (t.Operand is not Local local) continue; | ||
FieldDef def; | ||
if (!_convertedLocals.ContainsKey(local)) | ||
{ | ||
def = new FieldDefUser(RandomGenerator.randomMD5(), new FieldSig(local.Type), FieldAttributes.Public | FieldAttributes.Static); | ||
module.GlobalType.Fields.Add(def); | ||
_convertedLocals.Add(local, def); | ||
} | ||
else | ||
def = _convertedLocals[local]; | ||
|
||
var eq = t.OpCode.Code switch | ||
{ | ||
Code.Ldloc => OpCodes.Ldsfld, | ||
Code.Ldloc_S => OpCodes.Ldsfld, | ||
Code.Ldloc_0 => OpCodes.Ldsfld, | ||
Code.Ldloc_1 => OpCodes.Ldsfld, | ||
Code.Ldloc_2 => OpCodes.Ldsfld, | ||
Code.Ldloc_3 => OpCodes.Ldsfld, | ||
Code.Ldloca => OpCodes.Ldsflda, | ||
Code.Ldloca_S => OpCodes.Ldsflda, | ||
Code.Stloc => OpCodes.Stsfld, | ||
Code.Stloc_0 => OpCodes.Stsfld, | ||
Code.Stloc_1 => OpCodes.Stsfld, | ||
Code.Stloc_2 => OpCodes.Stsfld, | ||
Code.Stloc_3 => OpCodes.Stsfld, | ||
Code.Stloc_S => OpCodes.Stsfld, | ||
_ => null | ||
}; | ||
t.OpCode = eq; | ||
t.Operand = def; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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("AfterKoi")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("AfterKoi")] | ||
[assembly: AssemblyCopyright("Copyright © 2021")] | ||
[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("23c3b079-9b79-41c2-ae44-9c58675c3772")] | ||
|
||
// 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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace Astro_Renewed.Services | ||
{ | ||
class RandomGenerator | ||
{ | ||
private static string ConvertStringtoMD5(string strword) | ||
{ | ||
MD5 md5 = MD5.Create(); | ||
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(strword); | ||
byte[] hash = md5.ComputeHash(inputBytes); | ||
StringBuilder sb = new StringBuilder(); | ||
for (int i = 0; i < hash.Length; i++) | ||
{ | ||
sb.Append(hash[i].ToString("x2")); | ||
} | ||
return sb.ToString(); | ||
} | ||
|
||
public static string randomMD5_disable() | ||
{ | ||
var bytes = new byte[16]; | ||
using (var rng = new RNGCryptoServiceProvider()) | ||
{ | ||
rng.GetBytes(bytes); | ||
} | ||
return "{" + ConvertStringtoMD5(BitConverter.ToString(bytes)).ToLower() + "}"; | ||
} | ||
|
||
private static Random random = new Random(); | ||
|
||
public static string randomMD5() | ||
{ | ||
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; | ||
return new string(Enumerable.Repeat(chars, 10) | ||
.Select(s => s[random.Next(s.Length)]).ToArray()); | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
AfterKoi/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// <autogenerated /> | ||
using System; | ||
using System.Reflection; | ||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30621.155 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AstroNet", "AstroNet\AstroNet.csproj", "{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KoiVM", "KoiVM\KoiVM.csproj", "{9E333771-BC67-4120-9C67-D15311C0F67C}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runtime", "KoiVM.Runtime\Runtime.csproj", "{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KoiVM.GUI", "KoiVM.GUI\KoiVM.GUI.csproj", "{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug_ThreadSafe|Any CPU = Debug_ThreadSafe|Any CPU | ||
Debug|Any CPU = Debug|Any CPU | ||
Release_ThreadSafe|Any CPU = Release_ThreadSafe|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
Trace|Any CPU = Trace|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Debug_ThreadSafe|Any CPU.ActiveCfg = Debug|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Debug_ThreadSafe|Any CPU.Build.0 = Debug|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Debug|Any CPU.ActiveCfg = Release|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Debug|Any CPU.Build.0 = Release|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Release_ThreadSafe|Any CPU.ActiveCfg = Release|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Release_ThreadSafe|Any CPU.Build.0 = Release|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Trace|Any CPU.ActiveCfg = Debug|Any CPU | ||
{171CB9D1-C535-4AEA-BF3C-6F4BA1F2D0DB}.Trace|Any CPU.Build.0 = Debug|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Debug_ThreadSafe|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Debug_ThreadSafe|Any CPU.Build.0 = Debug|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Release_ThreadSafe|Any CPU.ActiveCfg = Release|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Release_ThreadSafe|Any CPU.Build.0 = Release|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Trace|Any CPU.ActiveCfg = Trace|Any CPU | ||
{9E333771-BC67-4120-9C67-D15311C0F67C}.Trace|Any CPU.Build.0 = Trace|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Debug_ThreadSafe|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Debug_ThreadSafe|Any CPU.Build.0 = Debug|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Release_ThreadSafe|Any CPU.ActiveCfg = Release|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Release_ThreadSafe|Any CPU.Build.0 = Release|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Trace|Any CPU.ActiveCfg = Trace|Any CPU | ||
{1A1DA722-FE8A-4B49-86ED-DC582F0B0B47}.Trace|Any CPU.Build.0 = Trace|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Debug_ThreadSafe|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Debug_ThreadSafe|Any CPU.Build.0 = Debug|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Release_ThreadSafe|Any CPU.ActiveCfg = Release|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Release_ThreadSafe|Any CPU.Build.0 = Release|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Trace|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F4542E19-6BCA-4FA5-A263-B4419ACACF9A}.Trace|Any CPU.Build.0 = Debug|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {72CEEFF3-9E8A-40BA-8010-74DC8B66E1AC} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
</configuration> |
Oops, something went wrong.