This repository was archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- ver-fddf5f2541d1b8f3b6536da811e42fba36aa316a
- ver-f189844ca7028e2260861d33e2d187a292e2db6a
- ver-d0e88f3f4b984da1069722ff68a2778e147ac2c7
- ver-94976180b46813cf8e2bafa26df5fa0a687003f6
- ver-12687f69fe3979205e4634247b0cd4f5b6ee23e8
- ver-8958f0db472a16fdd2bcfb476b8ad05478ced8f3
- ver-6531f7974f6385860351c5acacc3fdb348e35537
- ver-466d15c2bee3ae4127768dbe039065037dfe26d6
- ver-169edadef23f6f8996197872abfb11e79c1e7701
- ver-46ad078af2ed78e0d42a9dc689113954fba41ef4
- ver-8a56ae7b25b4ef4822b280761329cd97d000bdd1
- ver-1e6a4d0fb6485f4265ac286f1da4aa9f703c7dd0
- ver-0e6156d44e1a85260fd42a34c7dee3d34e2d105b
- ver-0a5cf4ed9dbc375658fb185d95f8bda817b49b89
- v2.19-Marsey
- v2.18.1-Marsey
- v2.18-Marsey
- v2.17.2-Marsey
- v2.17.1-Marsey
- v2.17-Marsey
- v2.16.7-Marsey
- v2.12.6-Marsey
- v2.12.5-Marsey
- v2.12.4-Marsey-M
- v2.12.3-Marsey-M
- v2.12.2-Marsey
- v2.12.1-Marsey
- v2.12-Marsey
- v2.11.1
- v2.11-Marsey
- v2.10-Marsey
- v2.9.0-Marsey
- v2.8.3-Marsey
- v2.8.2-Marsey
- v2.8.1-Marsey-M
- v2.8-Marsey
- v2.7.1-Marsey
- v2.7-Marsey
- v2.6.1-Marsey
- v2.6-Marsey
- v2.5-Marsey
- v2.4-Marsey
- v2.3.7-Marsey
- v2.3.6-Marsey-M
- v2.3.5-Marsey-M
- v2.3.4-Marsey-M
- v2.3.3-Marsey-M
- v2.3.2-Marsey
- v2.3.1-Marsey
- v2.3-Marsey
- mrsy-fa9aa1fc9a9eea2d4d99a5ce24e038deaf3573ff
- mrsy-f172e20ba0d22ccf2e1a44d2219311db223038cc
- mrsy-e5012faf6e7821cf3f96346cc8908e7ef17e6f4d
- mrsy-e4f07c4f86754fd13a15403169e2a3b213c0d79f
- mrsy-dd3b6c726bab11111f29bf0846df16fa674f4e93
- mrsy-d4ff4d48c851a118c4a51d401720dd8857121bd2
- mrsy-cf27140c2257ab232d93dddd73a1c10aa5b0ba6c
- mrsy-b65a265cf67797125bfe329c6480e074fe7e4d66
- mrsy-ad09ab575a39f2b14c7a2dbd39c136e3d09bf5d7
- mrsy-2272b5065a28e5f43f19a8fbe75bf6a5dbc19933
- mrsy-53ddf6069b8020a5ff65bac425248f4c0d882ecb
- mrsy-9d3ead6374898421f69de5479b71287423fa9b4e
- mrsy-6f6178dd11a37ab737c00d73680980814f7e12f9
- mrsy-06d326f712868f48b14379678fe59f840d67c838
- mrsy-4fe90e06494352abd42916e4d96c5ed9cdecbd66
- mrsy-3d01b41aa4aecd37a1d22c45b3ee5684f4d25d19
Showing
4 changed files
with
104 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
namespace Marsey.Stealthsey; | ||
|
||
public static class Facade | ||
{ | ||
private static List<Type> _types = new List<Type>(); | ||
private static List<string> _keywords = new List<string> { "Robust", "Content", "Wizards", "Microsoft", "System" }; | ||
|
||
/// <summary> | ||
/// Hides type from executing assembly | ||
/// </summary> | ||
private static void Imposition(Type patch) | ||
{ | ||
if (!_types.Contains(patch)) _types.Add(patch); | ||
} | ||
|
||
/// <summary> | ||
/// Hides an array of type from patch | ||
/// </summary> | ||
public static void Imposition(Type[] patch) | ||
{ | ||
foreach (Type t in patch) | ||
Imposition(t); | ||
} | ||
|
||
/// <summary> | ||
/// Hides types of a namespace from assembly | ||
/// </summary> | ||
public static void Imposition(string name) | ||
{ | ||
Type[] assemblyTypes = Assembly.GetExecutingAssembly().GetTypes(); | ||
foreach (Type t in assemblyTypes.Where(t => t.Namespace!.StartsWith(name))) | ||
{ | ||
Imposition(t); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Hides all types of assembly from patch | ||
/// </summary> | ||
/// <param name="patch"></param> | ||
public static void Cloak(Assembly patch) | ||
{ | ||
Type[] typeArray; | ||
try | ||
{ | ||
typeArray = patch.GetTypes(); | ||
Imposition(typeArray.Where(type => type.Namespace != null && !_keywords.Any(keyword => type.Namespace.StartsWith(keyword))).ToArray()); | ||
} | ||
catch (ReflectionTypeLoadException) | ||
{ | ||
MarseyLogger.Log(MarseyLogger.LogType.DEBG, $"[Facade] {patch.GetName().Name} ({Path.GetFileName(patch.Location)}): Unable to cloak types"); | ||
} | ||
} | ||
|
||
|
||
public static Type[] GetTypes() => _types.ToArray(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ private bool Run() | |
return false; | ||
} | ||
|
||
|
||
if (!TryGetLoader(clientAssembly, out var loader)) | ||
return false; | ||
|
||
|