Skip to content

Commit

Permalink
Switched to using .NET6+ only to simplify things. Still dependent on …
Browse files Browse the repository at this point in the history
…System.Drawing.Common for now though.
  • Loading branch information
Lloyd Kinsella committed May 19, 2023
1 parent 34c1dd7 commit 93aab4e
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 178 deletions.
100 changes: 50 additions & 50 deletions src/Workshell.PE.Resources/Workshell.PE.Resources.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>Workshell.snk</AssemblyOriginatorKeyFile>
<Configurations>Debug;Release;CI</Configurations>
</PropertyGroup>

<PropertyGroup>
<PackageId>Workshell.PE.Resources</PackageId>
<PackageDescription>A set of classes that extends the Workshell.PE class library to help deal with the standard resource types within an executable such as bitmaps, icons, cursors etc.</PackageDescription>
<PackageProjectUrl>https://github.com/Workshell/pe</PackageProjectUrl>
<PackageIconUrl>http://img.workshell.co.uk/logo_128.png</PackageIconUrl>
<PackageTags>workshell pe executable native resources</PackageTags>
<PackageLicenseFile>license.txt</PackageLicenseFile>
<Copyright>Workshell Ltd</Copyright>
<Authors>Workshell Ltd</Authors>
<RepositoryUrl>https://github.com/Workshell/pe</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>0.0.0.1</Version>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\license.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\bin\debug</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\bin\release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>Workshell.snk</AssemblyOriginatorKeyFile>
<Configurations>Debug;Release;CI</Configurations>
</PropertyGroup>

<PropertyGroup>
<PackageId>Workshell.PE.Resources</PackageId>
<PackageDescription>A set of classes that extends the Workshell.PE class library to help deal with the standard resource types within an executable such as bitmaps, icons, cursors etc.</PackageDescription>
<PackageProjectUrl>https://github.com/Workshell/pe</PackageProjectUrl>
<PackageIconUrl>http://img.workshell.co.uk/logo_128.png</PackageIconUrl>
<PackageTags>workshell pe executable native resources</PackageTags>
<PackageLicenseFile>license.txt</PackageLicenseFile>
<Copyright>Workshell Ltd</Copyright>
<Authors>Workshell Ltd</Authors>
<RepositoryUrl>https://github.com/Workshell/pe</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>0.0.0.1</Version>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\license.txt" Pack="true" PackagePath="$(PackageLicenseFile)" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\bin\debug</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\bin\release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CI|AnyCPU'">
<OutputPath>..\..\bin\ci</OutputPath>
<DefineConstants>TRACE;SIGNED</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs" Link="Properties\CommonAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />
</ItemGroup>

</PropertyGroup>

<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs" Link="Properties\CommonAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Workshell.PE\Workshell.PE.csproj" />
</ItemGroup>

</Project>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Workshell.PE/Content/CLR/CLRMetaDataStreams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Workshell.PE.Extensions;

namespace Workshell.PE.Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Expand Down Expand Up @@ -106,7 +107,9 @@ private static async Task<DelayedImportAddressTables> GetTablesAsync(PortableExe
entries.Add(entry);

if (entry == 0)
{
break;
}
}

var table = new Tuple<uint, ulong[], ImportDirectoryEntryBase>(thunk, entries.ToArray(), dirEntry);
Expand All @@ -117,7 +120,9 @@ private static async Task<DelayedImportAddressTables> GetTablesAsync(PortableExe
var rva = 0u;

if (tables.Count > 0)
{
rva = tables.MinBy(table => table.Item1).Item1;
}

var imageBase = image.NTHeaders.OptionalHeader.ImageBase;
var va = imageBase + rva;
Expand Down
3 changes: 3 additions & 0 deletions src/Workshell.PE/Content/Imports/ImportAddressTables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Expand Down Expand Up @@ -99,7 +100,9 @@ private static async Task<ImportAddressTables> GetTablesAsync(PortableExecutable
var rva = 0u;

if (tables.Count > 0)
{
rva = tables.MinBy(table => table.Item1).Item1;
}

var imageBase = image.NTHeaders.OptionalHeader.ImageBase;
var va = imageBase + rva;
Expand Down
111 changes: 0 additions & 111 deletions src/Workshell.PE/Extensions/Enumerable.cs

This file was deleted.

Loading

0 comments on commit 93aab4e

Please sign in to comment.