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; }
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); }
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); } } }
public override bool InstallMod() { UPKFile.OverrideSingleByte(0, 0x15444BC); return(true); }
public TrapsInTraps(UPKFile UPKFile) : base(UPKFile) { }
public Mod(UPKFile UPKFile) { this.UPKFile = UPKFile; }
public NoTrapCap(UPKFile UPKFile) : base(UPKFile) { }
public override bool UninstallMod() { UPKFile.OverrideSingleByte(1, 0x15444A3); return(true); }