Skip to content

Commit

Permalink
alpha version
Browse files Browse the repository at this point in the history
  • Loading branch information
saltukkos committed Aug 16, 2018
1 parent 6a7c696 commit 457158f
Show file tree
Hide file tree
Showing 16 changed files with 975 additions and 0 deletions.
25 changes: 25 additions & 0 deletions BiosPatcher.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BiosPatcher", "BiosPatcher\BiosPatcher.csproj", "{F0D44547-57A0-4062-BD18-BD8CC8DF0D68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0D44547-57A0-4062-BD18-BD8CC8DF0D68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0D44547-57A0-4062-BD18-BD8CC8DF0D68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0D44547-57A0-4062-BD18-BD8CC8DF0D68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0D44547-57A0-4062-BD18-BD8CC8DF0D68}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {80697FE6-200B-4059-B63D-FC0DB7AEB8A1}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions BiosPatcher/App.config
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.6.2" />
</startup>
</configuration>
8 changes: 8 additions & 0 deletions BiosPatcher/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application x:Class="BiosPatcher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views/Patching.xaml">
<Application.Resources>

</Application.Resources>
</Application>
9 changes: 9 additions & 0 deletions BiosPatcher/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace BiosPatcher
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
}
}
110 changes: 110 additions & 0 deletions BiosPatcher/BiosPatcher.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?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>{F0D44547-57A0-4062-BD18-BD8CC8DF0D68}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>BiosPatcher</RootNamespace>
<AssemblyName>BiosPatcher</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="JetBrains.Annotations, Version=2018.2.1.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2018.2.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Models\BitConverterLE.cs" />
<Compile Include="Models\CheckSumCalculator.cs" />
<Compile Include="Models\DefaultValues.cs" />
<Compile Include="Models\PatchingModel.cs" />
<Compile Include="ViewModels\PatchingViewModel.cs" />
<Compile Include="Views\BooleanHidingConverter.cs" />
<Compile Include="Views\InverseBooleanToVisibilityConverter.cs" />
<Compile Include="Views\Patching.xaml.cs">
<DependentUpon>Patching.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Page Include="Views\Patching.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
32 changes: 32 additions & 0 deletions BiosPatcher/Models/BitConverterLE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using JetBrains.Annotations;

namespace BiosPatcher.Models
{
public static class BitConverterLittleEndian
{
public static int ReadInt([NotNull] byte[] bytes, int offset)
{
var data = new byte[4];
Array.Copy(bytes, offset, data, 0, 4);

if (!BitConverter.IsLittleEndian)
{
Array.Reverse(data);
}

return BitConverter.ToInt32(data, 0);
}

public static void WriteInt(int value, [NotNull] byte[] bytes, int offset)
{
var data = BitConverter.GetBytes(value);
if (!BitConverter.IsLittleEndian)
{
Array.Reverse(data);
}

Array.Copy(data, 0, bytes, offset, data.Length);
}
}
}
18 changes: 18 additions & 0 deletions BiosPatcher/Models/CheckSumCalculator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using JetBrains.Annotations;

namespace BiosPatcher.Models
{
public static class CheckSumCalculator
{
public static int Calculate([NotNull] byte[] data, int from, int length)
{
int result = 0;
for (int i = from; i < length + from; ++i)
{
result += data[i];
}

return result;
}
}
}
13 changes: 13 additions & 0 deletions BiosPatcher/Models/DefaultValues.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using JetBrains.Annotations;

namespace BiosPatcher.Models
{
public static class DefaultValues
{
[NotNull]
public static readonly int[] OffLevels = {38, 43, 47, 53, 59};

[NotNull]
public static readonly int[] OnLevels = {42, 46, 52, 58, 64};
}
}
Loading

0 comments on commit 457158f

Please sign in to comment.