Exemplo n.º 1
0
        bool IPackageLoader.TryParsePackage(Stream s, string filename, FileSystem context, out IReadOnlyPackage package)
        {
            // Take a peek at the file signature
            var signature = s.ReadUInt32();

            s.Position -= 4;

            if (signature != 0x8C655D13)
            {
                package = null;
                return(false);
            }

            package = new InstallShieldPackage(s, filename);
            return(true);
        }
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            var filename = Path.GetFileName(args[1]);
            var path = Path.GetDirectoryName(args[1]);

            var fs = new FileSystem.FileSystem(utility.Mods);
            fs.Mount(path, "parent");
            var package = new InstallShieldPackage(fs, "parent|" + filename);

            foreach (var kv in package.Index)
            {
                Console.WriteLine("{0}:", kv.Key);
                Console.WriteLine("\tOffset: {0}", 255 + kv.Value.Offset);
                Console.WriteLine("\tLength: {0}", kv.Value.Length);
            }
        }