Skip to content

Commit 0231fc8

Browse files
Add files via upload
1 parent 3104cdc commit 0231fc8

File tree

7 files changed

+304
-0
lines changed

7 files changed

+304
-0
lines changed

Starter/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.8"/>
5+
</startup>
6+
</configuration>

Starter/Program.cs

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Windows.Forms;
6+
7+
namespace Starter
8+
{
9+
internal class Program
10+
{
11+
public static bool CompareHash256(string file, string hash)
12+
{
13+
string[] temp = file.Split('\\');
14+
string efile = temp[temp.Length - 1];
15+
temp = temp.Skip(0).Take((temp.Length) - 1).ToArray();
16+
string rpath = string.Join("\\", temp);
17+
18+
if (file.Contains('\\'))
19+
{
20+
rpath = rpath + "\\";
21+
}
22+
23+
try
24+
{
25+
using (var sha256 = System.Security.Cryptography.SHA256.Create())
26+
{
27+
using (var stream = File.OpenRead(file))
28+
{
29+
if ((BitConverter.ToString(sha256.ComputeHash(stream)).Replace("-", string.Empty)).Equals(hash, StringComparison.OrdinalIgnoreCase))
30+
{
31+
return true;
32+
}
33+
else
34+
{
35+
return false;
36+
}
37+
}
38+
}
39+
}
40+
catch (Exception ex) when (ex is System.IO.FileNotFoundException || ex is System.IO.DirectoryNotFoundException)
41+
{
42+
return false;
43+
}
44+
}
45+
46+
static void Main(string[] args)
47+
{
48+
bool valide = false;
49+
bool ignore = false;
50+
51+
if (CompareHash256("data\\WinUtil.exe", "3ff8e1351e27483392280bbf4592e4c8db0bb445fcb1bf26eebd5f89aa582f34"))
52+
{
53+
valide = true;
54+
}
55+
do
56+
{
57+
if (valide || ignore)
58+
{
59+
Process proc = new Process();
60+
ProcessStartInfo info = new ProcessStartInfo()
61+
{
62+
FileName = "WinUtil.exe",
63+
64+
Arguments = "e22afd680ce7b8f23fad799fa3beef2dbce66e42e8877a9f2f0e3fd0b55619c9",
65+
UseShellExecute = true,
66+
WorkingDirectory = "data",
67+
Verb = "runas"
68+
69+
};
70+
proc.StartInfo = info;
71+
proc.Start();
72+
break;
73+
}
74+
else
75+
{
76+
var result = MessageBox.Show("Hash of 'WinUtil.exe' invalid, continue?", "Verification Error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
77+
78+
if (result == DialogResult.Yes)
79+
{
80+
ignore = true;
81+
}
82+
}
83+
} while (ignore);
84+
}
85+
}
86+
}

Starter/Properties/AssemblyInfo.cs

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("Starter")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Starter")]
13+
[assembly: AssemblyCopyright("Copyright © 2022")]
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("461023d1-3812-45f3-8006-f3b6dcab4d3f")]
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+
// indem Sie "*" wie unten gezeigt eingeben:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Starter/Starter.csproj

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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>{461023D1-3812-45F3-8006-F3B6DCAB4D3F}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>Starter</RootNamespace>
10+
<AssemblyName>Starter</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
<Prefer32Bit>false</Prefer32Bit>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
<Prefer32Bit>false</Prefer32Bit>
37+
</PropertyGroup>
38+
<PropertyGroup>
39+
<ApplicationIcon>imageres_1028.ico</ApplicationIcon>
40+
</PropertyGroup>
41+
<PropertyGroup />
42+
<PropertyGroup>
43+
<StartupObject />
44+
</PropertyGroup>
45+
<PropertyGroup>
46+
<ApplicationManifest>app.manifest</ApplicationManifest>
47+
</PropertyGroup>
48+
<ItemGroup>
49+
<Reference Include="PresentationFramework" />
50+
<Reference Include="System" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Windows.Forms" />
53+
<Reference Include="System.Xml.Linq" />
54+
<Reference Include="System.Data.DataSetExtensions" />
55+
<Reference Include="Microsoft.CSharp" />
56+
<Reference Include="System.Data" />
57+
<Reference Include="System.Net.Http" />
58+
<Reference Include="System.Xml" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Compile Include="Program.cs" />
62+
<Compile Include="Properties\AssemblyInfo.cs" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<None Include="App.config" />
66+
<None Include="app.manifest" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<Content Include="imageres_1028.ico" />
70+
</ItemGroup>
71+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
72+
</Project>

Starter/Starter.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.2.32616.157
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Starter", "Starter.csproj", "{461023D1-3812-45F3-8006-F3B6DCAB4D3F}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{461023D1-3812-45F3-8006-F3B6DCAB4D3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{461023D1-3812-45F3-8006-F3B6DCAB4D3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{461023D1-3812-45F3-8006-F3B6DCAB4D3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{461023D1-3812-45F3-8006-F3B6DCAB4D3F}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {21B25707-9343-418C-8CD8-B6C39A13739A}
24+
EndGlobalSection
25+
EndGlobal

Starter/app.manifest

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC-Manifestoptionen
8+
Wenn Sie die Ebene der Benutzerkontensteuerung für Windows ändern möchten, ersetzen Sie den
9+
Knoten "requestedExecutionLevel" wie folgt.
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
Durch Angabe des Elements "requestedExecutionLevel" wird die Datei- und Registrierungsvirtualisierung deaktiviert.
16+
Entfernen Sie dieses Element, wenn diese Virtualisierung aus Gründen der Abwärtskompatibilität
17+
für die Anwendung erforderlich ist.
18+
-->
19+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- Eine Liste der Windows-Versionen, unter denen diese Anwendung getestet
27+
und für die sie entwickelt wurde. Wenn Sie die Auskommentierung der entsprechenden Elemente aufheben,
28+
wird von Windows automatisch die kompatibelste Umgebung ausgewählt. -->
29+
30+
<!-- Windows Vista -->
31+
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32+
33+
<!-- Windows 7 -->
34+
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35+
36+
<!-- Windows 8 -->
37+
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
38+
39+
<!-- Windows 8.1 -->
40+
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
41+
42+
<!-- Windows 10 -->
43+
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
44+
45+
</application>
46+
</compatibility>
47+
48+
<!-- Gibt an, dass die Anwendung mit DPI-Werten kompatibel ist und von Windows nicht automatisch auf höhere
49+
DPI-Werte skaliert wird. WPF-Anwendungen (Windows Presentation Foundation) sind automatisch mit DPI-Werten kompatibel, eine Aktivierung
50+
ist nicht erforderlich. Für Windows Forms-Anwendungen für .NET Framework 4.6, die diese Einstellung aktivieren, muss
51+
auch die Einstellung "'EnableWindowsFormsHighDpiAutoResizing" in der Datei "app.config" auf TRUE festgelegt werden.
52+
53+
Hierdurch können für die Anwendung lange Pfade verwendet werden. Weitere Informationen finden Sie unter https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation.-->
54+
<!--
55+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
56+
<windowsSettings>
57+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
58+
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
59+
</windowsSettings>
60+
</application>
61+
-->
62+
63+
<!-- Designs für allgemeine Windows-Steuerelemente und -Dialogfelder (Windows XP und höher) aktivieren -->
64+
<!--
65+
<dependency>
66+
<dependentAssembly>
67+
<assemblyIdentity
68+
type="win32"
69+
name="Microsoft.Windows.Common-Controls"
70+
version="6.0.0.0"
71+
processorArchitecture="*"
72+
publicKeyToken="6595b64144ccf1df"
73+
language="*"
74+
/>
75+
</dependentAssembly>
76+
</dependency>
77+
-->
78+
79+
</assembly>

Starter/imageres_1028.ico

51 KB
Binary file not shown.

0 commit comments

Comments
 (0)