├── NetCoreBuilder
├── Mono.Cecil.dll
├── Confuser.Core.dll
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Program.cs
├── TypeCheck.cs
├── NetCoreBuilder.csproj
├── Forms
│ ├── mainWindow.resx
│ ├── mainWindow.cs
│ └── mainWindow.Designer.cs
└── CecilHeper.cs
├── README.md
├── NetCoreServer
├── App.config
├── Properties
│ └── AssemblyInfo.cs
├── NetCoreServer.csproj
└── Program.cs
├── NetCoreServer_GUI
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Funcions
│ ├── ExecuteAction.cs
│ └── RemoteFunction.cs
├── Program.cs
├── Forms
│ ├── formShowString.cs
│ ├── formShowString.Designer.cs
│ ├── formTestCall.cs
│ ├── formTestCall.Designer.cs
│ ├── formTestCall.resx
│ ├── formShowString.resx
│ ├── mainWindow.resx
│ ├── mainWindow.cs
│ └── mainWindow.Designer.cs
├── Controls
│ └── RemoteFunctionListViewItem.cs
└── NetCoreServer_GUI.csproj
├── Example
├── NetCore_TExample
│ ├── App.config
│ ├── Program.cs
│ ├── ClassTester.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── NetCore_TExample.csproj
└── NetCore_TExampleVB
│ ├── App.config
│ ├── My Project
│ ├── Settings.settings
│ ├── Application.Designer.vb
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Resources.Designer.vb
│ ├── Settings.Designer.vb
│ └── Resources.resx
│ ├── Module1.vb
│ └── NetCore_TExampleVB.vbproj
├── NetCore
├── Networking
│ ├── NetworkHeaders.cs
│ └── Hashing.cs
├── Attributes.cs
├── Properties
│ └── AssemblyInfo.cs
├── NetCore.csproj
└── NetCore.cs
├── .gitattributes
├── NetCore.sln
└── .gitignore
/NetCoreBuilder/Mono.Cecil.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XenocodeRCE/NetCore/master/NetCoreBuilder/Mono.Cecil.dll
--------------------------------------------------------------------------------
/NetCoreBuilder/Confuser.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XenocodeRCE/NetCore/master/NetCoreBuilder/Confuser.Core.dll
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NetCore
2 | より安全なNetCore
3 |
4 | もともとBahNahNahから : https://github.com/BahNahNah/NetCore
5 |
6 | # 私は何をするつもり何
7 |
8 | - 安全な暗号化を追加します。
9 | - 「NetSeal」の実装を追加します。
10 |
11 |
12 |
--------------------------------------------------------------------------------
/NetCoreBuilder/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/NetCoreServer/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Example/NetCore_TExample/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Example/NetCore_TExampleVB/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/NetCore/Networking/NetworkHeaders.cs:
--------------------------------------------------------------------------------
1 | namespace NetCore.Networking
2 | {
3 | public enum NetworkHeaders : byte
4 | {
5 | Handshake,
6 | AcceptHandshake,
7 | DenyHandShake,
8 | RemoteCall
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/NetCoreBuilder/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Funcions/ExecuteAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace NetCoreServer_GUI.Funcions
8 | {
9 | public enum ExecuteAction
10 | {
11 | Normal,
12 | Disabled
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Example/NetCore_TExampleVB/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/NetCore_TExampleVB/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
--------------------------------------------------------------------------------
/Example/NetCore_TExampleVB/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | false
5 | 0
6 | true
7 | 0
8 | 2
9 | true
10 |
11 |
--------------------------------------------------------------------------------
/NetCore/Attributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NetCore
4 | {
5 | [AttributeUsage(System.AttributeTargets.Method)]
6 | public class RemoteCallAttribute : Attribute
7 | {
8 | }
9 |
10 | [AttributeUsage(System.AttributeTargets.Method)]
11 | public class RemoteMoveAttribute : Attribute
12 | {
13 | }
14 |
15 | [AttributeUsage(System.AttributeTargets.Method)]
16 | public class RemoteCopyAttribute : Attribute
17 | {
18 | }
19 |
20 | [AttributeUsage(System.AttributeTargets.Class)]
21 | public class ClearFieldsAttribute : Attribute
22 | {
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/Example/NetCore_TExample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NetCore;
3 |
4 | namespace NetCore_TExample
5 | {
6 | class Program
7 | {
8 | static int Kek = 10;
9 | static void Main(string[] args)
10 | {
11 | if(!NetCoreClient.Connect("127.0.0.1", 3345))
12 | {
13 | Console.WriteLine("Failed to connect to NetCore server.");
14 | Console.ReadLine();
15 | return;
16 | }
17 | Console.WriteLine("Hidden value: {0}", ClassTester.ReturnSqlCommand());
18 |
19 | Console.ReadLine();
20 | }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Example/NetCore_TExampleVB/Module1.vb:
--------------------------------------------------------------------------------
1 | Imports System.Data.SqlClient
2 | Imports System.Windows.Forms
3 | Imports NetCore
4 |
5 | Module Module1
6 |
7 | Sub Main()
8 | If Not NetCoreClient.Connect("127.0.0.1", 3345) Then
9 | Console.WriteLine("Failed to connect")
10 | Console.ReadLine()
11 | Return
12 | End If
13 |
14 | Dim dt = returnFun()
15 | Console.WriteLine(dt.TableName)
16 | Console.ReadLine()
17 | End Sub
18 |
19 |
20 | Function returnFun() As DataTable
21 | Return New DataTable("Test1")
22 | End Function
23 |
24 | End Module
25 |
--------------------------------------------------------------------------------
/NetCoreBuilder/Program.cs:
--------------------------------------------------------------------------------
1 | using NetCoreBuilder.Forms;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.Windows.Forms;
7 |
8 | namespace NetCoreBuilder
9 | {
10 | static class Program
11 | {
12 | ///
13 | /// The main entry point for the application.
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 | Application.EnableVisualStyles();
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | Application.Run(new mainWindow());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Program.cs:
--------------------------------------------------------------------------------
1 | using NetCoreServer_GUI.Forms;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.Windows.Forms;
7 |
8 | namespace NetCoreServer_GUI
9 | {
10 | static class Program
11 | {
12 | ///
13 | /// The main entry point for the application.
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 | Application.EnableVisualStyles();
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | Application.Run(new mainWindow());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Forms/formShowString.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace NetCoreServer_GUI.Forms
12 | {
13 | public partial class formShowString : Form
14 | {
15 | public formShowString(string title, object value)
16 | {
17 | InitializeComponent();
18 | this.Text = title;
19 | rtbData.Text = value.ToString();
20 | }
21 |
22 | private void formShowString_Load(object sender, EventArgs e)
23 | {
24 |
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/NetCore/Networking/Hashing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Security.Cryptography;
5 | using System.Text;
6 |
7 | namespace NetCore.Networking
8 | {
9 | public class Hashing
10 | {
11 | public static string SHA(string input)
12 | {
13 | using (SHA256 sha = new SHA256CryptoServiceProvider())
14 | {
15 | byte[] bPl = Encoding.UTF8.GetBytes(input);
16 | byte[] hash = sha.ComputeHash(bPl);
17 | StringBuilder sb = new StringBuilder(hash.Length * 2);
18 | foreach(byte b in hash)
19 | {
20 | sb.Append(b.ToString("X2"));
21 | }
22 | return sb.ToString();
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Controls/RemoteFunctionListViewItem.cs:
--------------------------------------------------------------------------------
1 | using NetCoreServer_GUI.Funcions;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 |
9 | namespace NetCoreServer_GUI.Controls
10 | {
11 | public class RemoteFunctionListViewItem : ListViewItem
12 | {
13 | public RemoteFunction Function { get; private set; }
14 | public RemoteFunctionListViewItem(RemoteFunction function) : base(function.Hash)
15 | {
16 | Function = function;
17 | SubItems.Add(function.FullName);
18 | SubItems.Add(function.File);
19 | SubItems.Add(function.ExecuteAction.ToString());
20 | SubItems.Add(function.ExecuteCount.ToString());
21 | function.ListViewItem = this;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Example/NetCore_TExample/ClassTester.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using NetCore;
3 | using System.Windows.Forms;
4 | using System.Data;
5 | using System.Data.SqlClient;
6 | using System;
7 |
8 | namespace NetCore_TExample
9 | {
10 | public class ClassTester
11 | {
12 | static string HiddenField = "Nice meme.";
13 |
14 | [RemoteCall]
15 | public static string ReturnSqlCommand()
16 | {
17 | SqlCommand command = new SqlCommand();
18 | return check2(command);
19 | }
20 |
21 | [RemoteMove]
22 | public static string check2(SqlCommand sq)
23 | {
24 | SqlDataReader reader = null;
25 | return "Strange.";
26 | }
27 |
28 | [RemoteCall]
29 | public static string ThrowError()
30 | {
31 | throw new Exception("This is an exception being thrown");
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/NetCoreBuilder/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace NetCoreBuilder.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace NetCoreServer_GUI.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Example/NetCore_TExampleVB/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' General Information about an assembly is controlled through the following
6 | ' set of attributes. Change these attribute values to modify the information
7 | ' associated with an assembly.
8 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/NetCore/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NetCore")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NetCore")]
13 | [assembly: AssemblyCopyright("Copyright © BahNahNah 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("6c622e5f-02ad-4666-acab-86ec4a92516a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.4")]
36 | [assembly: AssemblyFileVersion("1.0.0.4")]
37 |
--------------------------------------------------------------------------------
/NetCoreServer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NetCoreServer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NetCoreServer")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c144265f-038a-4fde-8524-8438fd5106a6")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.4")]
36 | [assembly: AssemblyFileVersion("1.0.0.4")]
37 |
--------------------------------------------------------------------------------
/NetCoreBuilder/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NetCoreBuilder")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NetCoreBuilder")]
13 | [assembly: AssemblyCopyright("Copyright © BahNahNah 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("6897bac7-2c19-43d4-8239-4041ae61dfb0")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.4")]
36 | [assembly: AssemblyFileVersion("1.0.0.4")]
37 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NetCoreServer_GUI")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NetCoreServer_GUI")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("1d7a6d6e-d94d-4585-8f7a-e104434d1a80")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Example/NetCore_TExample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NetCore_TExample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NetCore_TExample")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f07e12a2-05e6-411f-ac82-bcf10ff591c7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/NetCoreBuilder/TypeCheck.cs:
--------------------------------------------------------------------------------
1 | using Mono.Cecil;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace NetCoreBuilder
9 | {
10 | public class TypeCheck
11 | {
12 | public static bool KeepMethod(TypeDefinition type, MethodDefinition method, out TransportAction visibility)
13 | {
14 | bool hasAttribute = false;
15 | TransportAction vis = TransportAction.Public;
16 |
17 |
18 | if (method.Name == ".cctor")
19 | {
20 | hasAttribute = true;
21 | vis = TransportAction.Copy;
22 |
23 | foreach (var i in type.CustomAttributes)
24 | {
25 | if (i.AttributeType.FullName == "NetCore.ClearFieldsAttribute")
26 | {
27 | vis = TransportAction.MoveClear;
28 | break;
29 | }
30 | }
31 |
32 | }
33 | else
34 | {
35 | foreach (var i in method.CustomAttributes)
36 | {
37 | if (i.AttributeType.FullName == "NetCore.RemoteCallAttribute")
38 | {
39 | hasAttribute = true;
40 | break;
41 | }
42 | if (i.AttributeType.FullName == "NetCore.RemoteMoveAttribute")
43 | {
44 | hasAttribute = true;
45 | vis = TransportAction.Move;
46 | break;
47 | }
48 | if (i.AttributeType.FullName == "NetCore.RemoteCopyAttribute")
49 | {
50 | hasAttribute = true;
51 | vis = TransportAction.Copy;
52 | break;
53 | }
54 | }
55 | }
56 | visibility = vis;
57 | return hasAttribute;
58 |
59 | }
60 | }
61 |
62 | public enum TransportAction
63 | {
64 | Public,
65 | Copy,
66 | Move,
67 | MoveClear
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Forms/formShowString.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace NetCoreServer_GUI.Forms
2 | {
3 | partial class formShowString
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.rtbData = new System.Windows.Forms.RichTextBox();
32 | this.SuspendLayout();
33 | //
34 | // rtbData
35 | //
36 | this.rtbData.Dock = System.Windows.Forms.DockStyle.Fill;
37 | this.rtbData.Location = new System.Drawing.Point(0, 0);
38 | this.rtbData.Name = "rtbData";
39 | this.rtbData.ReadOnly = true;
40 | this.rtbData.Size = new System.Drawing.Size(503, 220);
41 | this.rtbData.TabIndex = 0;
42 | this.rtbData.Text = "";
43 | //
44 | // formShowString
45 | //
46 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
48 | this.ClientSize = new System.Drawing.Size(503, 220);
49 | this.Controls.Add(this.rtbData);
50 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
51 | this.Name = "formShowString";
52 | this.Text = "--";
53 | this.Load += new System.EventHandler(this.formShowString_Load);
54 | this.ResumeLayout(false);
55 |
56 | }
57 |
58 | #endregion
59 |
60 | private System.Windows.Forms.RichTextBox rtbData;
61 | }
62 | }
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Funcions/RemoteFunction.cs:
--------------------------------------------------------------------------------
1 | using NetCore.Networking;
2 | using NetCoreServer_GUI.Controls;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Reflection;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace NetCoreServer_GUI.Funcions
13 | {
14 | public class RemoteFunction : IDisposable
15 | {
16 | public RemoteFunctionListViewItem ListViewItem { get; set; }
17 | public MethodInfo Method { get; private set; }
18 | public ExecuteAction ExecuteAction
19 | {
20 | get { return _ExecuteAction; }
21 | set
22 | {
23 | _ExecuteAction = value;
24 | UpdateListView();
25 | }
26 | }
27 | public string FullName { get; private set; }
28 | public string Hash { get; private set; }
29 | public string File { get; private set; }
30 | public long ExecuteCount
31 | {
32 | get { return _ExecuteCount; }
33 | set
34 | {
35 | _ExecuteCount = value;
36 | UpdateListView();
37 | }
38 | }
39 | private Type ParentType;
40 | private Assembly loadedAssembly;
41 | private ExecuteAction _ExecuteAction;
42 | private long _ExecuteCount;
43 | private Control _invoke;
44 |
45 | public RemoteFunction(Assembly asm, Type t, MethodInfo mi, Control invokeItem)
46 | {
47 | _invoke = invokeItem;
48 | loadedAssembly = asm;
49 | ParentType = t;
50 | Method = mi;
51 |
52 | File = Path.GetFileName(loadedAssembly.Location);
53 |
54 | ExecuteAction = ExecuteAction.Normal;
55 | FullName = string.Format("{0}.{1}", ParentType.FullName, Method.Name);
56 | Hash = Hashing.SHA(FullName);
57 | }
58 |
59 | public object Execute(object[] args)
60 | {
61 | if (ExecuteAction == ExecuteAction.Disabled)
62 | return null;
63 | ExecuteCount++;
64 | return Method.Invoke(null, args);
65 | }
66 |
67 |
68 | private void UpdateListView()
69 | {
70 | if (ListViewItem == null)
71 | return;
72 | _invoke.Invoke(new MethodInvoker(() =>
73 | {
74 | ListViewItem.SubItems[3].Text = _ExecuteAction.ToString();
75 | ListViewItem.SubItems[4].Text = _ExecuteCount.ToString();
76 | }));
77 | }
78 |
79 | public void Dispose()
80 | {
81 |
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/NetCore/NetCore.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {6C622E5F-02AD-4666-ACAB-86EC4A92516A}
8 | Library
9 | Properties
10 | NetCore
11 | NetCore
12 | v3.5
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
57 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/NetCore/NetCore.cs:
--------------------------------------------------------------------------------
1 | using NetCore.Networking;
2 | using System;
3 |
4 | namespace NetCore
5 | {
6 | public static class NetCoreClient
7 | {
8 | private static eSock.Client _client = null;
9 |
10 | public static bool Connect(string ip, int port)
11 | {
12 | _client = new eSock.Client();
13 | if (!_client.Connect(ip, port))
14 | return false;
15 |
16 | try
17 | {
18 | object[] data = _client.Send((byte)NetworkHeaders.Handshake);
19 | if ((NetworkHeaders)data[0] != NetworkHeaders.AcceptHandshake)
20 | return false;
21 | string encryptionKey = (string)data[1];
22 |
23 | _client.Encryption.EncryptionKey = encryptionKey;
24 | _client.Encryption.Enabled = true;
25 | return true;
26 | }
27 | catch
28 | {
29 | return false;
30 | }
31 | }
32 | public static bool ConnectWithProxy(string proxyIP, int proxyPort, string targetIp, int targetPort, string username="", string password="")
33 | {
34 | _client = new eSock.Client();
35 | if (!_client.ConnectProxy(proxyIP, proxyPort, targetIp, targetPort, username, password))
36 | return false;
37 | try
38 | {
39 | object[] data = _client.Send((byte)NetworkHeaders.Handshake);
40 | if ((NetworkHeaders)data[0] != NetworkHeaders.AcceptHandshake)
41 | return false;
42 | string encryptionKey = (string)data[1];
43 |
44 | _client.Encryption.EncryptionKey = encryptionKey;
45 | _client.Encryption.Enabled = true;
46 | return true;
47 | }
48 | catch
49 | {
50 | return false;
51 | }
52 | }
53 |
54 | public static object CreateRemoteCall(string function, object[] args)
55 | {
56 | if (_client == null)
57 | {
58 | Console.WriteLine("[NetCore] Attempted RemoteCall with null client");
59 | return null;
60 | }
61 |
62 | if (!_client.Connected)
63 | {
64 | Console.WriteLine("[NetCore] Attempted RemoteCall without connection");
65 | return null;
66 | }
67 |
68 | try
69 | {
70 | object[] derp = _client.Send((byte)NetworkHeaders.RemoteCall, function, args);
71 | return derp[0];
72 | }
73 | catch (Exception ex)
74 | {
75 | Console.WriteLine(ex.ToString());
76 | }
77 |
78 | return null;
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/NetCoreServer_GUI/Forms/formTestCall.cs:
--------------------------------------------------------------------------------
1 | using NetCoreServer_GUI.Funcions;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Diagnostics;
7 | using System.Drawing;
8 | using System.Linq;
9 | using System.Reflection;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Windows.Forms;
13 |
14 | namespace NetCoreServer_GUI.Forms
15 | {
16 | public partial class formTestCall : Form
17 | {
18 | public formTestCall(RemoteFunction[] functions)
19 | {
20 | InitializeComponent();
21 |
22 | Stopwatch execTimer = new Stopwatch();
23 | foreach(RemoteFunction f in functions)
24 | {
25 | ListViewItem i = new ListViewItem(f.Hash);
26 | try
27 | {
28 | ParameterInfo[] paramInfo = f.Method.GetParameters();
29 | List