Unpacking .NOS file Issue

10/05/2020 17:11 sd5986#1
Hi I have been working on repacking .nos file in order to import a lot of files.
I tried to rewrite onex explorer in C#
However, the unpacking doesn't work, when it tries to read the file count It always return a wrong number, regardless of big endian or little endian...
Same Issue exists when I try to use HXD to view the filecount.
Here's the C# code I translated from Onex's c++ code
Code:
BinaryReader reader = new BinaryReader(fs);      
            byte[] header = reader.ReadBytes(10);
            MessageBox.Show(Encoding.Default.GetString(header));
            /*
             * int LittleEndianConverter::fromInt(QByteArray array) {
               return qFromLittleEndian<qint32>(reinterpret_cast<const uchar *>(array.data()));
               }
             */
            int fileAmount = reader.ReadInt32();
            MessageBox.Show(fileAmount.ToString());
            //OnexTreeItem* item = createItemFromHeader(header, neatFileName(file.fileName()), header);
            reader.ReadByte();
Any hints on fixing this issue? thanks!!
10/05/2020 18:47 WalrossGreat#2
[Only registered and activated users can see links. Click Here To Register...]

The header is 0x10 length (16 in dec), and not 10.
10/05/2020 19:01 sd5986#3
Quote:
Originally Posted by WalrossGreat View Post
[Only registered and activated users can see links. Click Here To Register...]

The header is 0x10 length (16 in dec), and not 10.
thanks this solved the issue

Quote:
Originally Posted by WalrossGreat View Post
[Only registered and activated users can see links. Click Here To Register...]

The header is 0x10 length (16 in dec), and not 10.
After rewriting packing, unpack and cryptography in C# I finally achieved repacking files without importing files one by one. Wayyyy better than the onex explorer. Thanks so much for your help.