Skip to content

Commit 963eb31

Browse files
committed
update
1 parent 7d20752 commit 963eb31

File tree

13 files changed

+129
-224
lines changed

13 files changed

+129
-224
lines changed

ATOM/ATOM.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.IO;
55
using System.Net;
66
using System.Reflection;
7-
using System.Text;
87
using System.IO.Compression;
98
using System.Xml.Serialization;
109
using System.Linq;
@@ -13,9 +12,9 @@ namespace CMK
1312
{
1413
public class ATOM
1514
{
16-
public interface ICallable
15+
public interface IStart
1716
{
18-
void Call();
17+
void EntryPoint();
1918
}
2019

2120
public interface ICallableWithParameters
@@ -107,11 +106,11 @@ public static void ExecuteCodeFromUrl(string Url, Func<byte[], byte[]> intermedi
107106
Config cfg = (Config)serializer.Deserialize(entries.FirstOrDefault(x => x.Name == "config.xml").Open());
108107
var asms = new List<Assembly>();
109108
foreach (var entry in entries)
110-
if(entry.Name.EndsWith(".dll"))
109+
if(entry.Name.EndsWith(".dll") || entry.Name.EndsWith(".exe"))
111110
asms.Add(GetAssemblyFromStream(entry.Open(), intermediateStep));
112111
var namespaceClass = cfg.classToCall.Split('.');
113-
ICallable callableClass = Get<ICallable>(namespaceClass[0], namespaceClass[1], asms.FirstOrDefault(x => x.FullName.Contains(namespaceClass[0])), null);
114-
callableClass.Call();
112+
IStart callableClass = Get<IStart>(namespaceClass[0], namespaceClass[1], asms.FirstOrDefault(x => x.FullName.Contains(namespaceClass[0])), null);
113+
callableClass.EntryPoint();
115114
}
116115
}
117116
}

AssemblyPacker/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{8F5F2A23-F9A6-4F45-9239-005B718C6649}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>AssemblyPacker</RootNamespace>
10+
<AssemblyName>AssemblyPacker</AssemblyName>
11+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Program.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="App.config" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<ProjectReference Include="..\ATOM\ATOM.csproj">
53+
<Project>{08574e6f-a73c-4135-97ed-28dae646197b}</Project>
54+
<Name>ATOM</Name>
55+
</ProjectReference>
56+
</ItemGroup>
57+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
58+
</Project>

AssemblyPacker/Program.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace AssemblyPacker
9+
{
10+
class Program
11+
{
12+
static void Main(string[] args)
13+
{
14+
if (args != null && args.Length == 1)
15+
{
16+
var files = new DirectoryInfo(args[0]).EnumerateFiles();
17+
18+
}
19+
}
20+
}
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Allgemeine Informationen über eine Assembly werden über die folgenden
6+
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
7+
// die einer Assembly zugeordnet sind.
8+
[assembly: AssemblyTitle("AssemblyPacker")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("AssemblyPacker")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
18+
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
19+
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
20+
[assembly: ComVisible(false)]
21+
22+
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
23+
[assembly: Guid("8f5f2a23-f9a6-4f45-9239-005b718c6649")]
24+
25+
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
26+
//
27+
// Hauptversion
28+
// Nebenversion
29+
// Buildnummer
30+
// Revision
31+
//
32+
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
33+
// übernehmen, indem Sie "*" eingeben:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

TestAssembly/Class1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace TestAssembly
66
{
7-
public class Class1 : ICallable
7+
public class Class1 : IStart
88
{
9-
public void Call()
9+
public void EntryPoint()
1010
{
1111
Console.WriteLine("Hallo.");
1212
Console.WriteLine("It's working.");

TestAssembly/TestAssembly.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,5 @@
4949
<Name>ATOM</Name>
5050
</ProjectReference>
5151
</ItemGroup>
52-
<ItemGroup>
53-
<EmbeddedResource Include="te.txt" />
54-
</ItemGroup>
5552
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5653
</Project>

TestAssembly/te.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

TestConsole/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Program
1212
{
1313
static void Main(string[] args)
1414
{
15-
ExecuteCodeFromUrl("http://cmk.bplaced.net/download/Debug.zip");
15+
ExecuteCodeFromUrl("https://code.msdn.microsoft.com/Execute-assemblies-from-864a0c57/file/216490/1/Debug.zap");
1616
Console.ReadLine();
1717
}
1818
}

TestConsole/Resouces/Resource1.Designer.cs

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)