Simplify injector csproj

This commit is contained in:
Mino 2020-02-27 00:38:09 +09:00
parent 2b7e821d4a
commit 6cdbfd452a
3 changed files with 104 additions and 46 deletions

View file

@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Target">
<PlatformTarget>AnyCPU</PlatformTarget>
<TargetFramework>net48</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup Label="Build">
<OutputType>Exe</OutputType>
@ -12,24 +10,8 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>Portable</DebugType>
</PropertyGroup>
<PropertyGroup Label="Feature">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyVersion>4.7.7.0</AssemblyVersion>
<FileVersion>4.7.7.0</FileVersion>
<Description>XIVLauncher addon injection</Description>
<Version>4.7.7.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyHook" Version="2.7.6270" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dalamud\Dalamud.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
<ProjectReference Include="..\lib\CoreHook\src\CoreHook.BinaryInjection\CoreHook.BinaryInjection.csproj" />
</ItemGroup>
</Project>

View file

@ -1,30 +1,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Dalamud.DiscordBot;
using Dalamud.Game.Chat;
using EasyHook;
using Newtonsoft.Json;
namespace Dalamud.Injector {
internal static class Program {
private static void Main(string[] args) {
#if !DEBUG
AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs)
{
File.WriteAllText("InjectorException.txt", eventArgs.ExceptionObject.ToString());
MessageBox.Show("Failed to inject the XIVLauncher in-game addon.\nPlease try restarting your game and your PC.\nIf this keeps happening, please report this error.", "XIVLauncher Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0);
};
#endif
var pid = int.Parse(args[0]);
Process process = null;
@ -72,6 +50,7 @@ namespace Dalamud.Injector {
return;
}
Remote
RemoteHooking.Inject(process.Id, InjectionOptions.DoNotRequireStrongName, libPath, libPath, info);
Console.WriteLine("Injected");