Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CapitaineToinon committed Apr 3, 2019
1 parent ccfdd07 commit 16b1da2
Show file tree
Hide file tree
Showing 19 changed files with 1,160 additions and 68 deletions.
6 changes: 6 additions & 0 deletions WPF.Gadgetlemage.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Debug|x64.ActiveCfg = Debug|x64
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Debug|x64.Build.0 = Debug|x64
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Release|Any CPU.Build.0 = Release|Any CPU
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Release|x64.ActiveCfg = Release|x64
{E1892EF2-6542-4B25-B706-A9E016636DC6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
24 changes: 24 additions & 0 deletions WPF.Gadgetlemage/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WPF.Gadgetlemage.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<userSettings>
<WPF.Gadgetlemage.Properties.Settings>
<setting name="HotkeyCreate" serializeAs="String">
<value>27</value>
</setting>
<setting name="Hotkey" serializeAs="String">
<value>True</value>
</setting>
<setting name="Consume" serializeAs="String">
<value>True</value>
</setting>
<setting name="Sound" serializeAs="String">
<value>False</value>
</setting>
<setting name="Auto" serializeAs="String">
<value>False</value>
</setting>
</WPF.Gadgetlemage.Properties.Settings>
</userSettings>
</configuration>
2 changes: 1 addition & 1 deletion WPF.Gadgetlemage/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
xmlns:local="clr-namespace:WPF.Gadgetlemage"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
27 changes: 27 additions & 0 deletions WPF.Gadgetlemage/Assembly.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace WPF.Gadgetlemage
{
public static class Assembly
{
private static Regex asmLineRx = new Regex(@"^[\w\d]+:\s+((?:[\w\d][\w\d] ?)+)");

private static byte[] loadDefuseOutput(string lines)
{
List<byte> bytes = new List<byte>();
foreach (string line in Regex.Split(lines, "[\r\n]+"))
{
Match match = asmLineRx.Match(line);
string hexes = match.Groups[1].Value;
foreach (Match hex in Regex.Matches(hexes, @"\S+"))
bytes.Add(Byte.Parse(hex.Value, System.Globalization.NumberStyles.AllowHexSpecifier));
}
return bytes.ToArray();
}

public static byte[] PTDE = loadDefuseOutput(Properties.Resources.PTDE);
public static byte[] REMASTERED = loadDefuseOutput(Properties.Resources.REMASTERED);
}
}
Loading

0 comments on commit 16b1da2

Please sign in to comment.