示例#1
0
        private void LoadFile(string s)
        {
            upk = new UPKFile(s);
            hb1.ByteProvider = new DynamicByteProvider(upk.decrypted.ToArray());
            listBox1.Items.Clear();
            int count = 0;

            foreach (UPKFile.NameListEntry e in upk.NameList)
            {
                listBox1.Items.Add((count++).ToString("d5") + " : (0x" + e.unk1.ToString("X8") + " - 0x" + e.unk2.ToString("X8") + ") " + e);
            }
            listBox2.Items.Clear();
            count = 0;
            foreach (UPKFile.ImportListEntry e in upk.ImportList)
            {
                listBox2.Items.Add(count.ToString("d5") + " : " + upk.GetObjectNamePath(-count - 1));
                count++;
            }
            listBox3.Items.Clear();
            count = 0;
            foreach (UPKFile.ExportListEntry e in upk.ExportList)
            {
                listBox3.Items.Add(count.ToString("d5") + " : " + upk.GetObjectNamePath(count + 1));
                count++;
            }
            Status.Text = "Loaded File : " + s;
        }
示例#2
0
 public RLPackageStream(string path)
 {
     upkFile         = new UPKFile(path);
     Name            = Path.GetFileNameWithoutExtension(path);
     decryptedStream = new MemoryStream();
     upkFile.Decrypt(new RLDecryptor().GetCryptoTransform(), decryptedStream);
     _stream          = decryptedStream;
     _stream.Position = 0;
     UR = new UnrealReader(this, _stream);
     UW = new UnrealWriter(_stream);
 }
示例#3
0
 private static void ProcessFile(string filePath, string outputPath)
 {
     using (var output = File.Open(outputPath, FileMode.Create))
     {
         var upkFile         = new UPKFile(filePath);
         var decryptionState = upkFile.Decrypt(output);
         if (decryptionState == DecryptionState.NoMatchingKeys)
         {
             string fileName = Path.GetFileNameWithoutExtension(filePath);
             Console.WriteLine($"{fileName}: Unable to decrypt. possibly wrong AES-key");
             output.Close();
             File.Delete(outputPath);
         }
     }
 }
示例#4
0
 public override bool InstallMod()
 {
     UPKFile.OverrideSingleByte(0, 0x15444BC);
     return(true);
 }
示例#5
0
 public TrapsInTraps(UPKFile UPKFile) : base(UPKFile)
 {
 }
示例#6
0
 public Mod(UPKFile UPKFile)
 {
     this.UPKFile = UPKFile;
 }
示例#7
0
 public NoTrapCap(UPKFile UPKFile) : base(UPKFile)
 {
 }
示例#8
0
 public override bool UninstallMod()
 {
     UPKFile.OverrideSingleByte(1, 0x15444A3);
     return(true);
 }