fix ref to private.corelib with dnlib, dumper now works as before, (exluding quickDumper, still need to work on that)
This commit is contained in:
parent
0c08b56faa
commit
81d0d74fd8
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
using DumpLib.Helpers;
|
||||
using DumpLib.Models;
|
||||
|
@ -8,13 +8,13 @@ namespace DumpLib.Helpers
|
||||
public static class ReflectionHelper
|
||||
{
|
||||
private static Assembly _newtonAssembly = Assembly.LoadFrom((Directory.GetCurrentDirectory() + "\\EscapeFromTarkov_Data\\Managed\\Newtonsoft.Json.dll").Replace("\\\\", "\\"));
|
||||
|
||||
|
||||
private static Assembly _msAssembly = Assembly.LoadFrom((Directory.GetCurrentDirectory() + "\\EscapeFromTarkov_Data\\Managed\\mscorlib.dll").Replace("\\\\", "\\"));
|
||||
|
||||
|
||||
private static Assembly _eftAssembly = Assembly.LoadFrom((Directory.GetCurrentDirectory() + "\\EscapeFromTarkov_Data\\Managed\\Assembly-CSharp.dll").Replace("\\\\", "\\"));
|
||||
|
||||
private static Assembly _comfortAssembly = Assembly.LoadFrom((Directory.GetCurrentDirectory() + "\\EscapeFromTarkov_Data\\Managed\\Comfort.dll").Replace("\\\\", "\\"));
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get Singleton<> type from Comfort.dll
|
||||
/// </summary>
|
||||
@ -32,7 +32,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get ClientApplication<> type from EFT's assembly
|
||||
/// </summary>
|
||||
@ -50,7 +50,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get (as of 25/01/2024 - GInterface145) type from EFT's assembly
|
||||
/// </summary>
|
||||
@ -69,7 +69,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get TarkovApplication type from EFT's assembly
|
||||
/// </summary>
|
||||
@ -87,7 +87,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get (as of 25/01/2024 - GClass1464) type from EFT's assembly
|
||||
/// </summary>
|
||||
@ -127,7 +127,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get FieldInfo of a field on the TarkovApplication Type for later use
|
||||
/// </summary>
|
||||
@ -146,7 +146,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get the Instance of a Singleton(Type) passed in
|
||||
/// </summary>
|
||||
@ -167,7 +167,7 @@ namespace DumpLib.Helpers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method to get BackendSession object from the instance passed in
|
||||
/// </summary>
|
||||
|
@ -12,9 +12,11 @@ public class DumperClass
|
||||
private ModuleDefMD? _gameModule { get; set; }
|
||||
private ModuleDefMD? _checkerModule { get; set; }
|
||||
private ModuleDefMD? _msModule { get; set; }
|
||||
private ModuleDefMD? _dumpModule { get; set; }
|
||||
private string _assemblyPath { get; set; }
|
||||
private string _fileCheckerPath { get; set; }
|
||||
private string _mscorlibPath { get; set; }
|
||||
private string _dumpLibPath { get; set; }
|
||||
private string _managedPath { get; set; }
|
||||
private List<TypeDef>? _gameTypes { get; set; }
|
||||
private List<TypeDef>? _checkerTypes { get; set; }
|
||||
@ -27,6 +29,7 @@ public class DumperClass
|
||||
_assemblyPath = Path.Combine(managedPath, "Assembly-Csharp-cleaned.dll");
|
||||
_fileCheckerPath = Path.Combine(managedPath, "FilesChecker.dll");
|
||||
_mscorlibPath = Path.Combine(managedPath, "mscorlib.dll");
|
||||
_dumpLibPath = "./DumpLib.dll";
|
||||
|
||||
if (!File.Exists(_assemblyPath))
|
||||
{
|
||||
@ -40,12 +43,18 @@ public class DumperClass
|
||||
|
||||
if (!File.Exists(_mscorlibPath))
|
||||
{
|
||||
Logger.Log($"File FilesChecker.dll does not exist at {_fileCheckerPath}", ConsoleColor.Red);
|
||||
Logger.Log($"File FilesChecker.dll does not exist at {_mscorlibPath}", ConsoleColor.Red);
|
||||
}
|
||||
|
||||
if (!File.Exists(_dumpLibPath))
|
||||
{
|
||||
Logger.Log($"File DumpLib.dll does not exist at {_dumpLibPath}", ConsoleColor.Red);
|
||||
}
|
||||
|
||||
_gameModule = DataProvider.LoadModule(_assemblyPath);
|
||||
_checkerModule = DataProvider.LoadModule(_fileCheckerPath);
|
||||
_msModule = DataProvider.LoadModule(_mscorlibPath);
|
||||
_dumpModule = DataProvider.LoadModule(_dumpLibPath);
|
||||
_gameTypes = _gameModule.GetTypes().ToList();
|
||||
_checkerTypes = _checkerModule.GetTypes().ToList();
|
||||
_gameImporter = new Importer(_gameModule);
|
||||
@ -56,19 +65,25 @@ public class DumperClass
|
||||
{
|
||||
if (_gameModule == null || _gameTypes == null)
|
||||
{
|
||||
Logger.Log($"_gameModule or _gameTypes in DumpyRemake was null", ConsoleColor.Red);
|
||||
Logger.Log($"_gameModule or _gameTypes in CreateDumper() was null", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_checkerModule == null || _checkerTypes == null)
|
||||
{
|
||||
Logger.Log($"_checkerModule or _checkerTypes in DumpyRemake was null", ConsoleColor.Red);
|
||||
Logger.Log($"_checkerModule or _checkerTypes in CreateDumper() was null", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_msModule == null)
|
||||
{
|
||||
Logger.Log($"_msModule in DumpyRemake was null", ConsoleColor.Red);
|
||||
Logger.Log($"_msModule in CreateDumper() was null", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_dumpModule == null)
|
||||
{
|
||||
Logger.Log($"_dumpModule in CreateDumper() was null", ConsoleColor.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -294,7 +309,7 @@ public class DumperClass
|
||||
Logger.Log($"MainMenu is null or isnt 62 instructions, SOMETHING HAD CHANGED!", ConsoleColor.Red);
|
||||
}
|
||||
|
||||
var liList = DumpyILHelper.GetDumpyTaskInstructions(method, _gameModule, _gameImporter);
|
||||
var liList = DumpyILHelper.GetDumpyTaskInstructions(method,_dumpModule, _gameImporter);
|
||||
|
||||
var index = method.Body.Instructions.First(x => x.OpCode == OpCodes.Ret);
|
||||
|
||||
|
@ -160,11 +160,11 @@ public static class DumpyILHelper
|
||||
};
|
||||
}
|
||||
|
||||
public static List<Instruction> GetDumpyTaskInstructions(MethodDef method, ModuleDefMD assembly, Importer? gameImporter)
|
||||
public static List<Instruction> GetDumpyTaskInstructions(MethodDef method, ModuleDefMD dumpModule, Importer? gameImporter)
|
||||
{
|
||||
return new List<Instruction>
|
||||
{
|
||||
Instruction.Create(OpCodes.Call, gameImporter?.Import(typeof(DumpyTool).GetMethod("StartDumpyTask"))),
|
||||
Instruction.Create(OpCodes.Call, gameImporter?.Import(dumpModule.GetTypes().First(x => x.Name == "DumpyTool").Methods.First(m => m.Name == "StartDumpyTask"))),
|
||||
Instruction.Create(OpCodes.Pop)
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user