Skip to content

Commit

Permalink
Add ReadKey pauses
Browse files Browse the repository at this point in the history
  • Loading branch information
valters-tomsons committed Apr 19, 2023
1 parent 2396568 commit 2c7a5cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions DayZLauncher.UnixPatcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ static void Main(string[] args)
if (args.Length != 1 || Directory.Exists(args[0]))
{
Console.WriteLine("Must provide path to DayZ installation folder as argument!");
Console.ReadKey();
return;
}

var targetAssembly = @$"{args[0].Trim()}\Launcher\Utils.dll";
if (!File.Exists(targetAssembly))
{
Console.WriteLine("Could not find Launcher/Utils.dll in target folder!");
Console.ReadKey();
return;
}

Expand All @@ -41,7 +43,13 @@ static void Main(string[] args)
PatchJunctionsMethod(unixJunctionsType, targetDefinition, junctionsClass, "Exists", new List<OpCode> { OpCodes.Ldarg_0 });
PatchJunctionsMethod(unixJunctionsType, targetDefinition, junctionsClass, "GetTarget", new List<OpCode> { OpCodes.Ldarg_0 });

Console.WriteLine("Writing patches to disk...");

targetDefinition.Write(targetAssembly);
File.Copy("DayZLauncher.UnixPatcher.Utils.dll", @$"{args[0].Trim()}\Launcher\DayZLauncher.UnixPatcher.Utils.dll");

Console.WriteLine("Patch applied!");
Console.ReadKey();
}

private static void PatchJunctionsMethod(TypeDefinition unixJunctionsType, AssemblyDefinition targetDefinition, TypeDefinition junctionsClass, string methodName, List<OpCode> args)
Expand Down

0 comments on commit 2c7a5cc

Please sign in to comment.