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.

[PC] Lumines Remastered .bytes / .manifest.bytes archive encryption

Featured Replies

  • Author
  • Localization

mbc07, posted Sun Oct 13, 2019 7:31 pm (51497)


So, I'm trying to mod the skins from Lumines Puzzle & Music to work on the PC version of Lumines Remastered. I already figured out the compression details of Lumines Puzzle & Music (mostly CRI Middleware stuff) and successfully decompressed them, but I'm having a hard time with Lumines Remastered.

I know the game was made on Unity and already uncompressed the sharedassets*.assets files with common Unity unpackers, however nothing really relevant was there, as most of the game files seems to be stored in a custom format on the AssetBundles subfolder found inside StreamingAssets folder. All files on this subfolder have a .bytes extension and is accompanied by a smaller .manifest.bytes file which I think is the TOC, but I actually didn't manage to do anything with them. Perhaps I'm missing something?

I attached two pair of .bytes / .manifest.bytes on this post if it helps...
  • Author
  • Localization

mbc07, posted Mon Oct 14, 2019 2:17 am (51505)


Okay, some news. Messing around with the .dll files of the game I discovered mentions of the following constants which I believe were used to encrypt the files. Tried to run some decryption tools with them but still got nowhere:
Code:
AesInitVector = "kiadsjfgpomcjknorjgujksoifhjoasf";
AesKey = "nhbiotasihdughicopasxjlbcnvwaeuh";
BlockSize = 256;
KeySize = 256;
  • Author
  • Localization

mbc07, posted Mon Oct 14, 2019 4:38 am (51509)


With the help of ILSpy, I found the actual decryption algorithm used by the game and isolated it on a small C# console app that takes a file path from the first argument and decrypt the file to the same path with a "_dec" appended to the file name. The decrypted file then can be unpacked normally with any Unity extractor of your preference. This is the source code (I attached a pre-compiled binary for Windows on this post):

Code:
using System.IO;
using System.Security.Cryptography;
using System.Text;

public class Program
{
    public static void Main(string[] args)
    {
        string path   = args[0];
        byte[] input  = File.ReadAllBytes(path);
        byte[] output = new byte[input.Length];

        byte[] key = Encoding.UTF8.GetBytes("nhbiotasihdughicopasxjlbcnvwaeuh");
        byte[] iv  = Encoding.UTF8.GetBytes("kiadsjfgpomcjknorjgujksoifhjoasf");

        RijndaelManaged rijndaelManaged = new RijndaelManaged();
        rijndaelManaged.Padding = PaddingMode.Zeros;
        rijndaelManaged.Mode = CipherMode.CBC;
        rijndaelManaged.KeySize = 256;
        rijndaelManaged.BlockSize = 256;

        ICryptoTransform transform = rijndaelManaged.CreateDecryptor(key, iv);
        MemoryStream stream = new MemoryStream(input);
        CryptoStream cryptoStream = new CryptoStream(stream, transform, CryptoStreamMode.Read);
        cryptoStream.Read(output, 0, output.Length);

        File.WriteAllBytes(path "_dec", output);
    }
}


Could someone help me transform that into a QuickBMS script? I tried doing one based on the example "_aes.bms" script but the resulting output file isn't the actual decrypted content...

test_rev2.zip

  • Author
  • Localization

aluigi, posted Mon Oct 14, 2019 6:18 am (51511)


The results are different using aes_256_cbc (even by switching iv and key since there you swapped them) so can't help.
  • Author
  • Localization

mbc07, posted Mon Oct 14, 2019 7:06 am (51512)


Whoops, indeed I switched them on the sample C# code above (just corrected that to avoid further confusion). QuickBMS is out of question then?
  • Author
  • Localization

Ekey, posted Mon Oct 14, 2019 2:11 pm (51521)


The code that you provided is working fine. Here example decrypted manifest (skin001sound.manifest.bytes)

Code:
ManifestFileVersion: 0
CRC: 3553356263
Hashes:
  AssetFileHash:
    serializedVersion: 2
    Hash: aa0ae0fcadd720fe5a91f4b7625028da
  TypeTreeHash:
    serializedVersion: 2
    Hash: c516f2a3b2b6b67ef759f6410a790acd
HashAppended: 0
ClassTypes:
- Class: 83
  Script: {instanceID: 0}
Assets:
- Assets/Resources/Audio/Skin001/se_lr.wav
- Assets/Resources/Audio/Skin001/shtr13.wav
- Assets/Resources/Audio/Skin001/se_dec_lp.wav
- Assets/Resources/Audio/Skin001/se_rrot.wav
- Assets/Resources/Audio/Skin001/shtr18.wav
- Assets/Resources/Audio/Skin001/shtr11.wav
- Assets/Resources/Audio/Skin001/shtr09.wav
- Assets/Resources/Audio/Skin001/shtr01v.wav
- Assets/Resources/Audio/Skin001/shtr07v10_01.wav
- Assets/Resources/Audio/Skin001/shse_dec1.wav
- Assets/Resources/Audio/Skin001/shtr03.wav
- Assets/Resources/Audio/Skin001/shtr30.wav
- Assets/Resources/Audio/Skin001/se_on.wav
- Assets/Resources/Audio/Skin001/shtr16v4.wav
- Assets/Resources/Audio/Skin001/shse_fall1.wav
- Assets/Resources/Audio/Skin001/shse_fall3.wav
- Assets/Resources/Audio/Skin001/shtr14.wav
- Assets/Resources/Audio/Skin001/shtr28v8.wav
- Assets/Resources/Audio/Skin001/se_dash.wav
- Assets/Resources/Audio/Skin001/shtr04.wav
- Assets/Resources/Audio/Skin001/shse_dec2.wav
- Assets/Resources/Audio/Skin001/shtr29.wav
- Assets/Resources/Audio/Skin001/shtr05.wav
- Assets/Resources/Audio/Skin001/shse_fall4.wav
- Assets/Resources/Audio/Skin001/shtr07v10.wav
- Assets/Resources/Audio/Skin001/shtr22.wav
- Assets/Resources/Audio/Skin001/se_lrot.wav
- Assets/Resources/Audio/Skin001/shtr24.wav
- Assets/Resources/Audio/Skin001/shtr08.wav
- Assets/Resources/Audio/Skin001/shtr21.wav
- Assets/Resources/Audio/Skin001/shtr27.wav
- Assets/Resources/Audio/Skin001/shtr20.wav
- Assets/Resources/Audio/Skin001/shtr02.wav
- Assets/Resources/Audio/Skin001/shtr26.wav
- Assets/Resources/Audio/Skin001/shtr06.wav
- Assets/Resources/Audio/Skin001/shtr12.wav
- Assets/Resources/Audio/Skin001/shse_fall2.wav
- Assets/Resources/Audio/Skin001/shtr15.wav
- Assets/Resources/Audio/Skin001/shtr10v8.wav
- Assets/Resources/Audio/Skin001/shse_bonus.wav
- Assets/Resources/Audio/Skin001/shtr31v.wav
- Assets/Resources/Audio/Skin001/shtr07v10_02.wav
- Assets/Resources/Audio/Skin001/shtr23.wav
- Assets/Resources/Audio/Skin001/shtr25v6.wav
- Assets/Resources/Audio/Skin001/shtr19.wav
Dependencies: []


Tool with code is attached. Usage as well simple:

Code:
LRDecryptor 


If you want to encrypt it back just change > CreateDecryptor to CreateEncryptor

LRDecryptor-src-bin.rar

  • Author
  • Localization

mbc07, posted Mon Oct 14, 2019 7:05 pm (51527)


Ekey wrote:
The code that you provided is working fine. [...]
Yes, I know, I tested it before posting here. What I wanted was to have that decryption working through a BMS script, to easily integrate with other BMS scripts I already have and to skip the need to recompile the program every time I change something in the script. However it seems out of reach as like aluigi said encryption aes_256_cbc function from QuickBMS doesn't decrypt the files correctly...
  • Author
  • Localization

aluigi, posted Mon Oct 14, 2019 7:42 pm (51529)


Mcrypt can do the job, apparently the RijndaelManaged uses a block size of 256 bit instead of the 128 one used by openssl and most of the other libraries.
Code:
get SIZE asize
encryption "mcrypt rijndael-256 cbc" "nhbiotasihdughicopasxjlbcnvwaeuh" "kiadsjfgpomcjknorjgujksoifhjoasf"
get NAME filename
string NAME "_dec"
log NAME 0 SIZE
  • Author
  • Localization

MexicanPB, posted Thu Jun 24, 2021 5:35 am (64875)


Ekey wrote:
The code that you provided is working fine. Here example decrypted manifest (skin001sound.manifest.bytes)

Code:
ManifestFileVersion: 0
CRC: 3553356263
Hashes:
  AssetFileHash:
    serializedVersion: 2
    Hash: aa0ae0fcadd720fe5a91f4b7625028da
  TypeTreeHash:
    serializedVersion: 2
    Hash: c516f2a3b2b6b67ef759f6410a790acd
HashAppended: 0
ClassTypes:
- Class: 83
  Script: {instanceID: 0}
Assets:
- Assets/Resources/Audio/Skin001/se_lr.wav
- Assets/Resources/Audio/Skin001/shtr13.wav
- Assets/Resources/Audio/Skin001/se_dec_lp.wav
- Assets/Resources/Audio/Skin001/se_rrot.wav
- Assets/Resources/Audio/Skin001/shtr18.wav
- Assets/Resources/Audio/Skin001/shtr11.wav
- Assets/Resources/Audio/Skin001/shtr09.wav
- Assets/Resources/Audio/Skin001/shtr01v.wav
- Assets/Resources/Audio/Skin001/shtr07v10_01.wav
- Assets/Resources/Audio/Skin001/shse_dec1.wav
- Assets/Resources/Audio/Skin001/shtr03.wav
- Assets/Resources/Audio/Skin001/shtr30.wav
- Assets/Resources/Audio/Skin001/se_on.wav
- Assets/Resources/Audio/Skin001/shtr16v4.wav
- Assets/Resources/Audio/Skin001/shse_fall1.wav
- Assets/Resources/Audio/Skin001/shse_fall3.wav
- Assets/Resources/Audio/Skin001/shtr14.wav
- Assets/Resources/Audio/Skin001/shtr28v8.wav
- Assets/Resources/Audio/Skin001/se_dash.wav
- Assets/Resources/Audio/Skin001/shtr04.wav
- Assets/Resources/Audio/Skin001/shse_dec2.wav
- Assets/Resources/Audio/Skin001/shtr29.wav
- Assets/Resources/Audio/Skin001/shtr05.wav
- Assets/Resources/Audio/Skin001/shse_fall4.wav
- Assets/Resources/Audio/Skin001/shtr07v10.wav
- Assets/Resources/Audio/Skin001/shtr22.wav
- Assets/Resources/Audio/Skin001/se_lrot.wav
- Assets/Resources/Audio/Skin001/shtr24.wav
- Assets/Resources/Audio/Skin001/shtr08.wav
- Assets/Resources/Audio/Skin001/shtr21.wav
- Assets/Resources/Audio/Skin001/shtr27.wav
- Assets/Resources/Audio/Skin001/shtr20.wav
- Assets/Resources/Audio/Skin001/shtr02.wav
- Assets/Resources/Audio/Skin001/shtr26.wav
- Assets/Resources/Audio/Skin001/shtr06.wav
- Assets/Resources/Audio/Skin001/shtr12.wav
- Assets/Resources/Audio/Skin001/shse_fall2.wav
- Assets/Resources/Audio/Skin001/shtr15.wav
- Assets/Resources/Audio/Skin001/shtr10v8.wav
- Assets/Resources/Audio/Skin001/shse_bonus.wav
- Assets/Resources/Audio/Skin001/shtr31v.wav
- Assets/Resources/Audio/Skin001/shtr07v10_02.wav
- Assets/Resources/Audio/Skin001/shtr23.wav
- Assets/Resources/Audio/Skin001/shtr25v6.wav
- Assets/Resources/Audio/Skin001/shtr19.wav
Dependencies: []


Tool with code is attached. Usage as well simple:

Code:
LRDecryptor 


If you want to encrypt it back just change > CreateDecryptor to CreateEncryptor



Sorry for responding to this dead topic but do you know how to encrypt the file, I found the line in the source code and was able to change it to CreateEncryptor but it seems like the game isn't loading the file and instead results in a endless loading loop on start, did I do something wrong?
  • Author
  • Localization

MexicanPB, posted Sun Aug 22, 2021 5:57 am (65819)


Bump: just wanted to see if someone could help :)
  • Author
  • Localization

mbc07, posted Wed Sep 01, 2021 2:28 am (66090)


Sorry for the delay, I don't check this forum too often. I did a quick test (decrypting a file, then encrypting it back without changing anything) and the game booted just fine.

If it got stuck on the loading screen it probably didn't like whatever you've changed in the file, but I can confirm changing rijndaelManaged.CreateDecryptor to rijndaelManaged.CreateEncryptor in any of the two C# codes posted before is all that you need to encrypt the files back.

Did you try updating the manifest of the file you've changed? Every .bytes file has an accompanying .manifest.bytes file and it contains a checksum field, so you should update it too to match the checksum of the modded the .bytes file...
  • Author
  • Localization

ExData7, posted Tue Sep 28, 2021 1:35 am (66699)


mbc07 wrote:
Sorry for the delay, I don't check this forum too often. I did a quick test (decrypting a file, then encrypting it back without changing anything) and the game booted just fine.

If it got stuck on the loading screen it probably didn't like whatever you've changed in the file, but I can confirm changing rijndaelManaged.CreateDecryptor to rijndaelManaged.CreateEncryptor in any of the two C# codes posted before is all that you need to encrypt the files back.

Did you try updating the manifest of the file you've changed? Every .bytes file has an accompanying .manifest.bytes file and it contains a checksum field, so you should update it too to match the checksum of the modded the .bytes file...


can you take a look at the .bytes file for SaGa Scarlet Grace on pc for me pls? I have no clue on how to get into that games .bytes files which i need for the story text.
  • Author
  • Localization

mbc07, posted Tue Sep 28, 2021 9:01 pm (66714)


I don't own that game, so no, I can't. Also keep in mind .bytes is a very generic extension, the .bytes files from Lumines Remastered is very unlikely to have anything in common...
  • Author
  • Localization

MexicanPB, posted Sat Dec 17, 2022 7:06 am (74648)


Hello, I would like to revive this topic. I am trying to mod the .bytes files but the game refuses to load. I have no ideas why this is the case but what I do know is that the byte files are just encrypted Unity Assets files, but the game required the files to be encrypted. I tried the linked encrypter with zero success. Is anyone willing to look into a better tool for these .byte files and allow for reimport?
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.