Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

Decrypting UE4 AES encryption

Featured Replies

  • Author
  • Localization

akintos, posted Mon Feb 18, 2019 12:11 pm (43615)


I'm trying to implement my own UE4 archive un/repacker in .Net and its working well for not encrypted files.

The problem is that I can't decrypt encrypted UE4 data blocks.

the code I used is below.

Code:
byte[] key = {
    0x45, 0xDD, 0x15, 0xD6, 0xDD, 0x2D, 0xA5, 0x0A, 0xEB, 0x71, 0xCE, 0x7A, 0x52, 0x84, 0xCF, 0x8E,
    0xA4, 0x98, 0xB2, 0xEC, 0x3D, 0x52, 0xB7, 0xE3, 0x36, 0xF3, 0xEA, 0x00, 0x71, 0xCE, 0x44, 0xB3
};

byte[] encryptedData = File.ReadAllBytes(encryptedFIlePath);
byte[] decryptedData;

using (RijndaelManaged rDel = new RijndaelManaged())
{
    rDel.Key = key;
    rDel.KeySize = 256;
    rDel.BlockSize = 128;
    rDel.Mode = CipherMode.ECB;
    rDel.Padding = PaddingMode.None;

    using (var decryptor = rDel.CreateDecryptor())
    {
        decryptedData = decryptor.TransformFinalBlock(encryptedData, 0, encryptedData.Length);
    }
}

File.WriteAllBytes(decryptedFIlePath, decryptedData);


I have tried 256 BlockSize, other CipherModes but nothing worked.

The sample data I'm using is from PUBG and quickbms can easily decrypt it.

Code:
encryption aes "45DD15D6DD2DA50AEB71CE7A5284CF8EA498B2EC3D52B7E336F3EA0071CE44B3" "" 0 32
get FILESIZE asize
log "decrypted.bin" 0 FILESIZE


What am I doing wrong?
Please help me. Thanks.
  • Author
  • Localization

akintos, posted Mon Feb 18, 2019 1:23 pm (43619)


I was dumb, using key as ASCII string worked. I thought the key is hexstring... I wasted almost 8 hours on this.

Code:
byte[] key = Encoding.ASCII.GetBytes("45DD15D6DD2DA50AEB71CE7A5284CF8E");
  • Author
  • Localization

aluigi, posted Tue Feb 19, 2019 4:05 am (45010)


eh sometimes it's just unluck.
In fact often the recent ue4 keys are hex but they usually start with a "0x" prefix or the "\x" escapes for tagging them as hex.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.