mirror of
https://github.com/ZuneDev/ZuneShell.dll.git
synced 2026-07-27 13:11:51 -07:00
Attempted to add debug symbols to UIX build
This commit is contained in:
@@ -47,6 +47,26 @@
|
|||||||
<AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>
|
||||||
</AssemblyOriginatorKeyFile>
|
</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Accessibility" />
|
<Reference Include="Accessibility" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|||||||
+47
-5
@@ -1,4 +1,9 @@
|
|||||||
using dnlib.DotNet;
|
using dnlib.DotNet;
|
||||||
|
using dnlib.DotNet.Pdb;
|
||||||
|
using dnlib.DotNet.Writer;
|
||||||
|
using dnlib.IO;
|
||||||
|
using dnlib.PE;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace UIXSign
|
namespace UIXSign
|
||||||
@@ -8,17 +13,54 @@ namespace UIXSign
|
|||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
string dll = args[0];
|
string dll = args[0];
|
||||||
|
string outputName = args.Length >= 2 ? args[1] : "UIX_signed.dll";
|
||||||
string outputDir = Path.GetDirectoryName(dll);
|
string outputDir = Path.GetDirectoryName(dll);
|
||||||
string dllCopy = Path.Combine(outputDir, "UIX_signed.dll");
|
string dllCopy = Path.Combine(outputDir, outputName);
|
||||||
File.Copy(dll, dllCopy, true);
|
File.Copy(dll, dllCopy, true);
|
||||||
|
Console.WriteLine("Created working copy");
|
||||||
|
|
||||||
var module = ModuleDefMD.Load(dllCopy);
|
// Load DLL
|
||||||
|
using var module = ModuleDefMD.Load(dllCopy);
|
||||||
var asm = module.Assembly;
|
var asm = module.Assembly;
|
||||||
asm.PublicKey = new PublicKey("00240000048000009400000006020000002400005253413100040000010001001dc70401884cdfad2010ce192e1f08a30fb034cf504759943eec3359d4ed09af3ce1616dbb124e479617ec73e4162903766e7a5e7bf1984bb318040118fe0f69dfb8b6e5c7c47a0e1bc9a8984b22f7221cc235986c09c74cab38ea3562c18adb8e3a95b73faf1ed71d7c309058b86d951af2165eb215b47de335e360a6a25da7");
|
var writeOptions = new ModuleWriterOptions(module);
|
||||||
asm.Write(dll);
|
Console.WriteLine("Loaded copy");
|
||||||
|
|
||||||
module.Dispose();
|
if (module.Metadata.PEImage.ImageDebugDirectories.Count > 0)
|
||||||
|
Console.WriteLine(module.Metadata.PEImage.ImageDebugDirectories[0]);
|
||||||
|
Console.WriteLine("Original public key: " + asm.PublicKey.ToString());
|
||||||
|
|
||||||
|
// 'Sign' the library so it can be loaded by unmodified Zune executables
|
||||||
|
asm.PublicKey = new PublicKey("00240000048000009400000006020000002400005253413100040000010001001dc70401884cdfad2010ce192e1f08a30fb034cf504759943eec3359d4ed09af3ce1616dbb124e479617ec73e4162903766e7a5e7bf1984bb318040118fe0f69dfb8b6e5c7c47a0e1bc9a8984b22f7221cc235986c09c74cab38ea3562c18adb8e3a95b73faf1ed71d7c309058b86d951af2165eb215b47de335e360a6a25da7");
|
||||||
|
module.IsStrongNameSigned = true;
|
||||||
|
Console.WriteLine("Signed assembly");
|
||||||
|
|
||||||
|
if (module.Metadata.PEImage.ImageDebugDirectories.Count > 0)
|
||||||
|
Console.WriteLine(module.Metadata.PEImage.ImageDebugDirectories[0]);
|
||||||
|
|
||||||
|
// Set up PDB to enable debugging
|
||||||
|
if (module.Metadata.PEImage.ImageDebugDirectories.Count <= 0)
|
||||||
|
module.CreatePdbState(PdbFileKind.WindowsPDB);
|
||||||
|
using FileStream pdbFile = File.OpenRead(Path.ChangeExtension(dll, "pdb"));
|
||||||
|
writeOptions.WritePdb = true;
|
||||||
|
writeOptions.PdbOptions = PdbWriterOptions.PdbChecksum;
|
||||||
|
writeOptions.PdbFileName = Path.GetFileName(pdbFile.Name);
|
||||||
|
writeOptions.PdbFileNameInDebugDirectory = Path.GetFileName(pdbFile.Name);
|
||||||
|
//writeOptions.PdbFileNameInDebugDirectory = Path.ChangeExtension(Path.GetFileName(dll), ".dn2.pdb");
|
||||||
|
//module.CreatePdbState(PdbFileKind.EmbeddedPortablePDB);
|
||||||
|
//var pdbBytes = File.ReadAllBytes(Path.ChangeExtension(dll, "pdb"));
|
||||||
|
//var pdbStream = DataStreamFactory.Create(pdbBytes);
|
||||||
|
//var pdbReader = ByteArrayDataReaderFactory.CreateReader(pdbBytes);
|
||||||
|
//module.Metadata.PEImage.ImageDebugDirectories.Add(new ImageDebugDirectory(ref pdbReader, true));
|
||||||
|
Console.WriteLine("Loaded PDB");
|
||||||
|
|
||||||
|
if (module.Metadata.PEImage.ImageDebugDirectories.Count > 0)
|
||||||
|
Console.WriteLine(module.Metadata.PEImage.ImageDebugDirectories[0]);
|
||||||
|
|
||||||
|
// Replace the raw build with the modded DLL
|
||||||
|
module.Write(dll, writeOptions);
|
||||||
File.Delete(dllCopy);
|
File.Delete(dllCopy);
|
||||||
|
Console.WriteLine("DLL modded:");
|
||||||
|
Console.WriteLine(dll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -32,9 +33,29 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="dnlib, Version=3.3.2.0, Culture=neutral, PublicKeyToken=50e96378b6e77999, processorArchitecture=MSIL">
|
<Reference Include="dnlib, Version=3.3.4.0, Culture=neutral, PublicKeyToken=50e96378b6e77999, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\dnlib.3.3.2\lib\net45\dnlib.dll</HintPath>
|
<HintPath>..\..\packages\dnlib.3.3.4\lib\net45\dnlib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="dnlib" version="3.3.2" targetFramework="net48" />
|
<package id="dnlib" version="3.3.4" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -36,6 +36,24 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -37,6 +37,26 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
|
|||||||
@@ -13,25 +13,43 @@ EndProject
|
|||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|x64 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Debug|x64.Build.0 = Debug|x64
|
||||||
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{E93CFFA3-1EEB-4E71-9E83-7377C1422119}.Release|x64.Build.0 = Release|x64
|
||||||
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Debug|x64.Build.0 = Debug|x64
|
||||||
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{5681A1BD-B3EC-450B-BF6E-38187204B6BE}.Release|x64.Build.0 = Release|x64
|
||||||
{56AE007D-B441-4294-8582-D5C63CC1C206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{56AE007D-B441-4294-8582-D5C63CC1C206}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Debug|x64.Build.0 = Debug|x64
|
||||||
{56AE007D-B441-4294-8582-D5C63CC1C206}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{56AE007D-B441-4294-8582-D5C63CC1C206}.Release|Any CPU.Build.0 = Release|Any CPU
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{56AE007D-B441-4294-8582-D5C63CC1C206}.Release|x64.Build.0 = Release|x64
|
||||||
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Debug|x64.Build.0 = Debug|x64
|
||||||
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Release|Any CPU.Build.0 = Release|Any CPU
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{F0323473-F9B6-4875-93B2-DF657C3F7197}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user