Compare commits

..

No commits in common. "4ad34ea6abc80aa95b5e67133de007c500fe4587" and "0e53a50977044f839d73e28f4852d5171f94b0fa" have entirely different histories.

19 changed files with 355 additions and 1636 deletions

View File

@ -2684,25 +2684,18 @@
}
},
{
"NewTypeName": "DamageInfoStruct",
"OriginalTypeName": "GStruct421",
"NewTypeName": "DamageInfo",
"OriginalTypeName": "GStruct394",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"OverDamageFrom",
"Player",
"BodyPartColliderType",
"HittedBallisticColliders"
"OverDamageFrom"
],
"ExcludeFields": [],
"IncludeProperties": [
"Penetrated",
"HaveOwner",
"Blunt"
],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
@ -5285,6 +5278,25 @@
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "SwapOperationClass",
"OriginalTypeName": "GClass3090",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"ConstructorParameterCount": 7,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"DestroysMainItem"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "ThrowOperationClass",
"OriginalTypeName": "GClass3091",
@ -6298,21 +6310,17 @@
},
{
"NewTypeName": "TimeHasComeScreenClass",
"OriginalTypeName": "GClass3563",
"OriginalTypeName": "GClass3436",
"UseForceRename": false,
"SearchParams": {
"ConstructorParameterCount": 3,
"IsPublic": true,
"IsNested": true,
"IsSealed": false,
"IsSealed": true,
"NTParentName": "MatchmakerTimeHasCome",
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"ScreenType",
"IsReconnecting",
"SwitchTaskBarButtonsAvailability",
"LimitedServersAvailability"
"SearchingForServer"
],
"ExcludeFields": [],
"IncludeProperties": [],
@ -7659,8 +7667,7 @@
"FieldCount": 1,
"IncludeMethods": [
"Enter",
"Exit",
"ManualAnimatorMoveUpdate"
"Exit"
],
"ExcludeMethods": [
"ProcessAnimatorMovement",
@ -8052,725 +8059,5 @@
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "GrenadeFactoryClass",
"OriginalTypeName": "Gclass737",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsAbstract": false,
"IsDerived": false,
"IncludeMethods": [
"AddSmokeGrenade",
"AddStunGrenade",
"AddGrenade"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "NetworkHealthSyncPacketStruct",
"OriginalTypeName": "GStruct358",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"Nested",
"SyncType",
"Data"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"ESyncType"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "SeasonsSettingsClass",
"OriginalTypeName": "GClass2359",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"SpringSnowFactorDefault",
"SpringSnowFactor"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "PausedEffectsStruct",
"OriginalTypeName": "GStruct357",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [
"SaveInfo"
],
"ExcludeMethods": [],
"IncludeFields": [
"ID",
"HealthController",
"Type",
"BodyPart",
"Strength",
"State"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "LootSyncStruct",
"OriginalTypeName": "GStruct128",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"Id",
"Position",
"Rotation",
"Velocity",
"AngularVelocity",
"Done"
],
"ExcludeFields": [
"CollisionNumber"
],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "IPlayerBridge",
"OriginalTypeName": "GInterface20",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsInterface": true,
"IsNested": true,
"IncludeMethods": [
"ApplyDamageInfo",
"ApplyShot",
"CheckArmorHitByDirection"
],
"ExcludeMethods": [],
"IncludeFields": [
"iPlayer",
"WorldTime",
"UsingSimplifiedSkeleton"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "FlareGunFireOperationClass",
"OriginalTypeName": "GClass1768",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsNested": true,
"IsDerived": true,
"IncludeMethods": [
"PrepareShot",
"OnFireEvent",
"SetTriggerPressed",
"OnFireEndEvent",
"CanNotBeInterrupted"
],
"ExcludeMethods": [
"FastForward"
],
"IncludeFields": [
"bulletClass"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "IsOneOffFireOperationClass",
"OriginalTypeName": "GClass1770",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsNested": true,
"IsDerived": true,
"IncludeMethods": [
"StartFireAnimation",
"PrepareShot",
"OnFireEvent",
"SetTriggerPressed",
"OnFireEndEvent",
"FastForward"
],
"ExcludeMethods": [],
"IncludeFields": [
"bulletClass"
],
"ExcludeFields": [
"singleShotData_0"
],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "RevolverFireOperationClass",
"OriginalTypeName": "GClass1767",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsNested": true,
"IsDerived": true,
"IncludeMethods": [
"OnFireEvent",
"OnAddAmmoInChamber",
"SetTriggerPressed",
"SetInventoryOpened",
"OnFireEndEvent",
"OnIdleStartEvent",
"OnShellEjectEvent"
],
"ExcludeMethods": [
"SetScopeMode"
],
"IncludeFields": [
"cylinderMagazineClass"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "GenericFireOperationClass",
"OriginalTypeName": "GClass1765",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsNested": true,
"IsDerived": true,
"IncludeMethods": [
"StartFireAnimation",
"OnFireEvent",
"PrepareShot",
"RemoveAmmoFromChamber",
"OnAddAmmoInChamber",
"OnShellEjectEvent"
],
"ExcludeMethods": [],
"IncludeFields": [
"singleShotData_0"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "BaseDescriptorClass",
"OriginalTypeName": "GClass1693",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsAbstract": true,
"IncludeMethods": [
"ToInventoryOperation"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"OperationId",
"OwnerId",
"Operation"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "BaseInventoryOperationClass",
"OriginalTypeName": "GClass3192",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsAbstract": true,
"IncludeMethods": [
"WaitingForForeignEvents"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"Id",
"Status",
"OwnerId"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "FoldOperationClass",
"OriginalTypeName": "GClass3208",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"Foldable",
"NewValue"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"FoldCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "SwapOperationClass",
"OriginalTypeName": "GClass3196",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"ExecuteInternal",
"ToDescriptor",
"ToBaseInventoryCommand"
],
"ExcludeMethods": [
"Dispose"
],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"Item",
"From",
"DestroysMainItem"
],
"ExcludeProperties": [
"To"
],
"IncludeNestedTypes": [
"SwapCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "MergeOperationClass",
"OriginalTypeName": "GClass3209",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"ToDescriptor"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"Item1",
"Item2"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"MergeCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "TransferOperationClass",
"OriginalTypeName": "GClass3219",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"ExecuteInternal",
"ToDescriptor",
"ToBaseInventoryCommand"
],
"ExcludeMethods": [
"Dispose"
],
"IncludeFields": [
"item_0"
],
"ExcludeFields": [],
"IncludeProperties": [
"Item1",
"From1",
"To1",
"Item2",
"From2",
"To2"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"TransferCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "ApplyKeyOperationClass",
"OriginalTypeName": "GClass3200",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"ExecuteInternal",
"ToDescriptor",
"ToBaseInventoryCommand"
],
"ExcludeMethods": [],
"IncludeFields": [
"keyComponent_0",
"lockableComponent_0"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"ApplyCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "RemoveOperationClass",
"OriginalTypeName": "GClass3213",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"ExecuteInternal",
"ToDescriptor"
],
"ExcludeMethods": [],
"IncludeFields": [
"item_0",
"itemAddress_0"
],
"ExcludeFields": [],
"IncludeProperties": [
"Item"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"RemoveCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "SplitOperationClass",
"OriginalTypeName": "GClass3216",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"ToDescriptor"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"Item1",
"From1",
"To1"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"SplitCommand"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "PlayerSearchControllerClass",
"OriginalTypeName": "GClass1967",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"SetItemAsTemporaryKnown",
"RemoveItemFromTemporaryKnown",
"ForgetItem"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "AISearchControllerClass",
"OriginalTypeName": "GClass1969",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsSealed": true,
"IncludeMethods": [
"SetItemAsSearched",
"SetItemAsKnown",
"StopSearching",
"SearchContents",
"GetObserverItemState"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [
"SearchOperations"
],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "MemoryControllerClass",
"OriginalTypeName": "GClass839",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IncludeMethods": [
"EmptyWorkingSet",
"Collect"
],
"ExcludeMethods": [],
"IncludeFields": [],
"ExcludeFields": [],
"IncludeProperties": [
"GCEnabled"
],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "ArmorResistanceStruct",
"OriginalTypeName": "GStruct23",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [
"GetPenetrationChance"
],
"ExcludeMethods": [],
"IncludeFields": [
"RealResistance",
"ArmorClassResistance"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "ShotIdStruct",
"OriginalTypeName": "GStruct420",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [
"Equals"
],
"ExcludeMethods": [],
"IncludeFields": [
"EMPTY_SHOT_ID"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "LoadingProgressStruct",
"OriginalTypeName": "GStruct122",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"Progress",
"Stage"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "TransitControllerAbstractClass",
"OriginalTypeName": "GClass1640",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsAbstract": true,
"IncludeMethods": [
"DisableTransitPoints",
"IsTransit",
"IsTransitPlayer"
],
"ExcludeMethods": [],
"IncludeFields": [
"transitPlayers"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "NetworkHealthExtraDataTypeStruct",
"OriginalTypeName": "GStruct359",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IsNested": true,
"IncludeMethods": [
"ToString"
],
"ExcludeMethods": [],
"IncludeFields": [
"EffectId",
"Type",
"BodyPart",
"ExtraDataType",
"ExtraData"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [
"EExtraDataType"
],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "NetworkHealthDataPacketStruct",
"OriginalTypeName": "GStruct377",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IsNested": true,
"IncludeMethods": [],
"ExcludeMethods": [],
"IncludeFields": [
"AddEffect",
"RemoveEffect",
"EffectNextState",
"EffectStateTime",
"EffectStrength"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
},
{
"NewTypeName": "DestroyedItemsStruct",
"OriginalTypeName": "GStruct384",
"UseForceRename": false,
"SearchParams": {
"IsPublic": true,
"IsStruct": true,
"IncludeMethods": [
"Deconstruct"
],
"ExcludeMethods": [],
"IncludeFields": [
"Item",
"NumberToDestroy",
"NumberToPreserve"
],
"ExcludeFields": [],
"IncludeProperties": [],
"ExcludeProperties": [],
"IncludeNestedTypes": [],
"ExcludeNestedTypes": []
}
}
]

View File

@ -35,9 +35,5 @@
{"Role":"followerKojaniy","Limit":2,"Difficulty":"normal"},
{"Role":"skier","Limit":2,"Difficulty":"normal"},
{"Role":"peacemaker","Limit":2,"Difficulty":"normal"},
{"Role":"infectedAssault","Limit":2,"Difficulty":"normal"},
{"Role":"infectedPmc","Limit":2,"Difficulty":"normal"},
{"Role":"infectedCivil","Limit":2,"Difficulty":"normal"},
{"Role":"infectedLaborant","Limit":2,"Difficulty":"normal"},
{"Role":"infectedTagilla","Limit":2,"Difficulty":"normal"}
{"Role":"bossPartisan","Limit":2,"Difficulty":"normal"}
]

View File

@ -168,7 +168,7 @@ namespace DumpLib
// get End raid class from json
DataHelper.EndRaidClass = DataHelper.GetEndRaidClass();
// get player profile
DataHelper.PlayerProfile = ReflectionHelper.GetProfileCompleteData();
DataHelper.PlayerProfile = ReflectionHelper.GetPlayerProfile();
// Set up end raid class
DataHelper.EndRaidClass.GetType().GetField("profile").SetValue(DataHelper.EndRaidClass, DataHelper.PlayerProfile);

View File

@ -32,7 +32,7 @@ public class MethodHelper
}
/// <summary>
/// Method to get Quit method from EFT (as of 02/11/2024 - GClass2193)
/// Method to get Quit method from EFT (as of 20/05/2024 - GClass1955)
/// </summary>
/// <returns>MethodInfo</returns>
public static MethodInfo GetApplicationQuitMethod()
@ -40,11 +40,8 @@ public class MethodHelper
try
{
return DataHelper._eftAssembly.GetTypes().First(x =>
{
var methods = x.GetMethods();
return methods.Any(m => m.Name == "Quit") && methods.Any(m => m.Name == "QuitWithCode");
}
x.GetMethods().Any(y =>
y.Name == "Quit")
).GetMethod("Quit");
}
catch (Exception e)

View File

@ -220,9 +220,6 @@ namespace DumpLib.Helpers
}
}
/// <summary>
/// DONT USE ANYMORE, USE GETPROFILECOMPLETEDATA()
/// </summary>
public static object GetPlayerProfile()
{
try
@ -238,47 +235,5 @@ namespace DumpLib.Helpers
throw;
}
}
/// <summary>
/// TODO: Rename as its not an actual shim
///
/// </summary>
/// <returns></returns>
public static object GetProfileShim()
{
try
{
var typeToUse = TypeHelper.GetProfileShimType();
var instance = Activator.CreateInstance(typeToUse,
new object[]
{
DataHelper.Session.GetType().GetProperty("Profile").GetValue(DataHelper.Session),
TypeHelper.GetProfileSearchControllerType().GetField("Instance").GetValue(null)
});
return instance;
}
catch (Exception e)
{
Utils.LogError("GetProfileShim");
Utils.LogError(e);
throw;
}
}
public static object GetProfileCompleteData()
{
try
{
var completeData = ReflectionHelper.GetProfileShim();
var converterMethod = CreateGenericMethod(MethodHelper.GetToUnparsedDataMethod(), TypeHelper.GetProfileShimType());
return converterMethod.Invoke(null, new[] { completeData, Array.Empty<JsonConverter>() });
}
catch (Exception e)
{
Utils.LogError("GetProfileCompleteData");
Utils.LogError(e);
throw;
}
}
}
}

View File

@ -253,56 +253,4 @@ public static class TypeHelper
throw;
}
}
public static Type GetProfileShimType()
{
try
{
return DataHelper._eftAssembly.GetTypes().First(x =>
{
var fields = x.GetFields();
var constructors = x.GetConstructors();
var properties = x.GetProperties();
var methods = x.GetMethods();
return fields.Length == 25 && constructors.Length == 2 &&
properties.Length == 0 && methods.Length == 4 &&
fields.Any(f => f.Name == "KarmaValue") &&
fields.Any(f => f.Name == "Encyclopedia") &&
fields.Any(f => f.Name == "Id") &&
fields.Any(f => f.Name == "AccountId") &&
fields.Any(f => f.Name == "PetId") &&
fields.Any(f => f.Name == "Customization");
});
}
catch (Exception e)
{
Utils.LogError("GetProfileShimType");
Utils.LogError(e);
throw;
}
}
public static Type GetProfileSearchControllerType()
{
try
{
return DataHelper._eftAssembly.GetTypes().First(x =>
{
var fields = x.GetFields();
var methods = x.GetMethods();
return fields.Length == 1 && methods.Length == 17 &&
!x.IsInterface && methods.Any(m => m.Name == "IsItemKnown") &&
methods.Any(m => m.Name == "TryFindChangedContainer") &&
methods.Any(m => m.Name == "GetObserverItemState");
});
}
catch (Exception e)
{
Utils.LogError("GetProfileSearchControllerType");
Utils.LogError(e);
throw;
}
}
}

View File

@ -9,12 +9,9 @@ namespace ReCodeIt.Commands;
[Command("DeObfuscate", Description = "Generates a de-obfuscated -cleaned dll in the folder your assembly is in")]
public class DeObfuscate : ICommand
{
[CommandParameter(0, IsRequired = true, Description = "The absolute path to your obfuscated assembly or exe file, folder must contain all references to be resolved.")]
[CommandParameter(0, IsRequired = true, Description = "The absolute path to your obfuscated assembly file, folder must contain all references to be resolved.")]
public string AssemblyPath { get; init; }
[CommandParameter(1, IsRequired = false, Description = "Is the target the EFT launcher?")]
public bool IsLauncher { get; init; } = false;
public ValueTask ExecuteAsync(IConsole console)
{
DataProvider.IsCli = true;
@ -22,7 +19,7 @@ public class DeObfuscate : ICommand
Logger.Log("Deobfuscating assembly...");
Deobfuscator.Deobfuscate(AssemblyPath, IsLauncher);
Deobfuscator.Deobfuscate(AssemblyPath);
Logger.Log("Complete", ConsoleColor.Green);

View File

@ -6,7 +6,6 @@ public static class Program
public static async Task<int> Main() =>
await new CliApplicationBuilder()
.AddCommandsFromThisAssembly()
.AllowDebugMode()
.SetExecutableName("ReCodeIt")
.Build()
.RunAsync();

File diff suppressed because it is too large Load Diff

View File

@ -113,22 +113,6 @@ public partial class ReCodeItForm : Form
}
};
EventsIncludeTextField.KeyDown += (sender, e) =>
{
if (e.KeyCode == Keys.Enter)
{
EventsAddButton_Click(sender, e);
}
};
EventsExcludeTextField.KeyDown += (sender, e) =>
{
if (e.KeyCode == Keys.Enter)
{
EventsExcludeAddButton_Click(sender, e);
}
};
#endregion MANUAL_REMAPPER
#region AUTOMAPPER
@ -303,8 +287,6 @@ public partial class ReCodeItForm : Form
ExcludeProperties = GUIHelpers.GetAllEntriesFromListBox(PropertiesExcludeBox),
IncludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesIncludeBox),
ExcludeNestedTypes = GUIHelpers.GetAllEntriesFromListBox(NestedTypesExcludeBox),
IncludeEvents = GUIHelpers.GetAllEntriesFromListBox(EventsIncludeBox),
ExcludeEvents = GUIHelpers.GetAllEntriesFromListBox(EventsExcludeBox)
}
};
@ -649,45 +631,6 @@ public partial class ReCodeItForm : Form
}
}
private void EventsAddButton_Click(object sender, EventArgs e)
{
if (EventsIncludeTextField.Text == string.Empty) return;
if (!EventsIncludeBox.Items.Contains(EventsIncludeTextField.Text))
{
EventsIncludeBox.Items.Add(EventsIncludeTextField.Text);
EventsIncludeTextField.Clear();
}
}
private void EventsRemoveButton_Click(object sender, EventArgs e)
{
if (EventsIncludeBox.SelectedItem != null)
{
EventsIncludeBox.Items.Remove(EventsIncludeBox.SelectedItem);
}
}
private void EventsExcludeAddButton_Click(object sender, EventArgs e)
{
if (EventsExcludeTextField.Text == string.Empty) return;
if (!EventsExcludeBox.Items.Contains(EventsExcludeTextField.Text))
{
EventsExcludeBox.Items.Add(EventsExcludeTextField.Text);
EventsExcludeTextField.Clear();
}
}
private void EventsExcludeRemoveButton_Click(object sender, EventArgs e)
{
if (EventsExcludeBox.SelectedItem != null)
{
EventsExcludeBox.Items.Remove(EventsExcludeBox.SelectedItem);
}
}
private void AutoMapperExcludeAddButton_Click(object sender, EventArgs e)
{
if (AutoMapperTypesToIgnoreTextField.Text == string.Empty) return;
@ -989,8 +932,6 @@ public partial class ReCodeItForm : Form
PropertiesExcludeTextField.Clear();
NestedTypesIncludeTextField.Clear();
NestedTypesExcludeTextField.Clear();
EventsIncludeTextField.Clear();
EventsExcludeTextField.Clear();
// Numeric UpDowns
@ -1019,8 +960,6 @@ public partial class ReCodeItForm : Form
PropertiesExcludeBox.Items.Clear();
NestedTypesIncludeBox.Items.Clear();
NestedTypesExcludeBox.Items.Clear();
EventsIncludeBox.Items.Clear();
EventsExcludeBox.Items.Clear();
}
private void ManualEditSelectedRemap(object? sender, TreeNodeMouseClickEventArgs e)
@ -1183,16 +1122,6 @@ public partial class ReCodeItForm : Form
{
NestedTypesExcludeBox.Items.Add(method);
}
foreach (var method in remap.SearchParams.IncludeEvents)
{
EventsIncludeBox.Items.Add(method);
}
foreach (var method in remap.SearchParams.ExcludeEvents)
{
EventsExcludeBox.Items.Add(method);
}
}
private void PopulateDomainUpDowns()
@ -1254,5 +1183,4 @@ public partial class ReCodeItForm : Form
UseShellExecute = true
});
}
}

View File

@ -126,7 +126,4 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>47</value>
</metadata>
</root>

View File

@ -251,7 +251,7 @@ internal static class GUIHelpers
remapTreeItem.Nodes.Add(includeNestedTypes);
}
if (model.SearchParams.ExcludeNestedTypes?.Count > 0)
if (model.SearchParams.IncludeNestedTypes?.Count > 0)
{
var excludeNestedTypes =
GenerateNodeFromList(model.SearchParams.ExcludeNestedTypes, "Exclude Nested Types");
@ -259,22 +259,6 @@ internal static class GUIHelpers
remapTreeItem.Nodes.Add(excludeNestedTypes);
}
if (model.SearchParams.IncludeEvents?.Count > 0)
{
var includeEvents =
GenerateNodeFromList(model.SearchParams.IncludeEvents, "Include Events");
remapTreeItem.Nodes.Add(includeEvents);
}
if (model.SearchParams.ExcludeEvents?.Count > 0)
{
var excludeEvents =
GenerateNodeFromList(model.SearchParams.ExcludeEvents, "Exclude Events");
remapTreeItem.Nodes.Add(excludeEvents);
}
ReCodeItForm.RemapNodes.Add(remapTreeItem, model);
return remapTreeItem;

View File

@ -222,8 +222,7 @@ public class DumperClass
var firstMethod = methods.FirstOrDefault(m => m.Parameters.Any(p => p.Name == "certificate"));
var secondMethod = methods.FirstOrDefault(m => m.Parameters.Any(p => p.Name == "certificateData"));
// as of 01/11/24 firstMethod returns true, so its now only 2 instructions, was 55 (this may change, BSG have byppassed their own SSL checks atm)
if (firstMethod?.Body.Instructions.Count != 2 || secondMethod?.Body.Instructions.Count != 14)
if (firstMethod?.Body.Instructions.Count != 55 || secondMethod?.Body.Instructions.Count != 14)
{
Logger.Log($"Instruction count has changed, method with 'certificate' as a param - before: 51, now: {firstMethod.Body.Instructions.Count}, " +
$"method with 'certificateData' as a param - before: 14, now: {secondMethod.Body.Instructions.Count}", ConsoleColor.Red);

View File

@ -26,6 +26,4 @@ public enum ENoMatchReason
NestedTypeInclude,
NestedTypeExclude,
NestedTypeCount,
EventsInclude,
EventsExclude
}

View File

@ -101,8 +101,6 @@ public class SearchParams
public List<string> ExcludeProperties { get; set; }
public List<string> IncludeNestedTypes { get; set; }
public List<string> ExcludeNestedTypes { get; set; }
public List<string> IncludeEvents { get; set; } = [];
public List<string> ExcludeEvents { get; set; } = [];
#endregion LISTS

View File

@ -2,13 +2,12 @@
using dnlib.DotNet.Emit;
using ReCodeIt.Utils;
using System.Diagnostics;
using ReCodeIt.ReMapper;
namespace ReCodeItLib.Remapper;
public static class Deobfuscator
{
public static void Deobfuscate(string assemblyPath, bool isLauncher = false)
public static void Deobfuscate(string assemblyPath)
{
var executablePath = Path.Combine(DataProvider.DataPath, "De4dot", "de4dot.exe");
@ -55,29 +54,19 @@ public static class Deobfuscator
token = $"0x{(deobfRid.Raw | deobfRid.Rid):x4}";
Console.WriteLine($"Deobfuscation token: {token}");
var cmd = isLauncher
? $"--un-name \"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*$\" \"{assemblyPath}\" --strtok \"{token}\""
: $"--un-name \"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*$\" \"{assemblyPath}\" --strtyp delegate --strtok \"{token}\"";
var process = Process.Start(executablePath, cmd);
var process = Process.Start(executablePath,
$"--un-name \"!^<>[a-z0-9]$&!^<>[a-z0-9]__.*$&![A-Z][A-Z]\\$<>.*$&^[a-zA-Z_<{{$][a-zA-Z_0-9<>{{}}$.`-]*$\" \"{assemblyPath}\" --strtyp delegate --strtok \"{token}\"");
process.WaitForExit();
var extName = isLauncher ? "-cleaned.exe" : "-cleaned.dll";
// Fixes "ResolutionScope is null" by rewriting the assembly
var cleanedDllPath = Path.Combine(Path.GetDirectoryName(assemblyPath), Path.GetFileNameWithoutExtension(assemblyPath) + extName);
var cleanedDllPath = Path.Combine(Path.GetDirectoryName(assemblyPath), Path.GetFileNameWithoutExtension(assemblyPath) + "-cleaned.dll");
ModuleDefMD assemblyRewrite = null;
using (var memoryStream = new MemoryStream(File.ReadAllBytes(cleanedDllPath)))
{
assemblyRewrite = ModuleDefMD.Load(memoryStream, modCtx);
if (isLauncher)
{
SPTPublicizer.PublicizeClasses(assemblyRewrite, true);
}
}
assemblyRewrite.Write(cleanedDllPath);

View File

@ -7,7 +7,7 @@ internal static class SPTPublicizer
{
private static ModuleDefMD MainModule;
public static void PublicizeClasses(ModuleDefMD definition, bool isLauncher = false)
public static void PublicizeClasses(ModuleDefMD definition)
{
var types = definition.GetTypes();
@ -15,11 +15,11 @@ internal static class SPTPublicizer
{
if (type.IsNested) continue; // Nested types are handled when publicizing the parent type
PublicizeType(type, isLauncher);
PublicizeType(type);
}
}
private static void PublicizeType(TypeDef type, bool isLauncher)
private static void PublicizeType(TypeDef type)
{
// if (type.CustomAttributes.Any(a => a.AttributeType.Name ==
// nameof(CompilerGeneratedAttribute))) { return; }
@ -33,7 +33,7 @@ internal static class SPTPublicizer
}
}
if (type.IsSealed && !isLauncher)
if (type.IsSealed)
{
type.Attributes &= ~TypeAttributes.Sealed; // Remove the Sealed attribute if it exists
}
@ -69,7 +69,7 @@ internal static class SPTPublicizer
*/
foreach (var nestedType in type.NestedTypes)
{
PublicizeType(nestedType, isLauncher);
PublicizeType(nestedType);
}
}

View File

@ -158,7 +158,6 @@ public class ReCodeItRemapper
if (!FilterTypesByMethods(mapping, ref types)) return;
if (!FilterTypesByFields(mapping, ref types)) return;
if (!FilterTypesByProps(mapping, ref types)) return;
if (!FilterTypesByEvents(mapping, ref types)) return;
if (!FilterTypesByNested(mapping, ref types)) return;
types = CtorTypeFilters.FilterByParameterCount(types, mapping.SearchParams);
@ -387,29 +386,6 @@ public class ReCodeItRemapper
return true;
}
private static bool FilterTypesByEvents(RemapModel mapping, ref IEnumerable<TypeDef> types)
{
types = EventTypeFilters.FilterByInclude(types, mapping.SearchParams);
if (!types.Any())
{
AllTypesFilteredOutFor(mapping, ENoMatchReason.EventsInclude);
mapping.TypeCandidates.UnionWith(types);
return false;
}
types = EventTypeFilters.FilterByExclude(types, mapping.SearchParams);
if (!types.Any())
{
AllTypesFilteredOutFor(mapping, ENoMatchReason.EventsExclude);
mapping.TypeCandidates.UnionWith(types);
return false;
}
return true;
}
private void HandleDirectRename(RemapModel mapping, ref IEnumerable<TypeDef> types)
{
foreach (var type in types)

View File

@ -1,58 +0,0 @@
using dnlib.DotNet;
using ReCodeIt.Models;
namespace ReCodeItLib.Remapper.Search;
internal static class EventTypeFilters
{
/// <summary>
/// Filters based on events name
/// </summary>
/// <param name="types"></param>
/// <param name="parms"></param>
/// <returns>Filtered list</returns>
public static IEnumerable<TypeDef> FilterByInclude(IEnumerable<TypeDef> types, SearchParams parms)
{
if (parms.IncludeEvents.Count == 0) return types;
List<TypeDef> filteredTypes = [];
foreach (var type in types)
{
if (parms.IncludeEvents
.All(includeName => type.Events
.Any(ev => ev.Name.String == includeName)))
{
filteredTypes.Add(type);
}
}
return filteredTypes.Any() ? filteredTypes : types;
}
/// <summary>
/// Filters based on events name
/// </summary>
/// <param name="types"></param>
/// <param name="parms"></param>
/// <returns>Filtered list</returns>
public static IEnumerable<TypeDef> FilterByExclude(IEnumerable<TypeDef> types, SearchParams parms)
{
if (parms.ExcludeEvents.Count == 0) return types;
List<TypeDef> filteredTypes = [];
foreach (var type in types)
{
var match = type.Events
.Where(prop => parms.ExcludeEvents.Contains(prop.Name.String));
if (!match.Any())
{
filteredTypes.Add(type);
}
}
return filteredTypes.Any() ? filteredTypes : types;
}
}