private static void Main(string[] args) { string directory = Environment.CurrentDirectory; IEnumerable <string> files = Directory.EnumerateFiles(directory, "*.dll").Where(f => !f.EndsWith("CryptedCode.Packing.dll")); var packer = new DefaultPacker(); var filesBytes = ReadFiles(files).ToArray(); var result = packer.Pack(filesBytes); File.WriteAllText("AppData.pak", result); }
private static void LoadAssembliesFromArchive(string archiveName = "AppData.pak") { var data = File.ReadAllText(archiveName); var packer = new DefaultPacker(); var assemblies = packer.Unpack(data); foreach (var assembly in assemblies) { Assembly.Load(assembly); } _assemblies = AppDomain.CurrentDomain.GetAssemblies().ToDictionary(k => k.FullName, v => v); }