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.

C# Stream Positions

Featured Replies

  • Author
  • Localization

Aidan729, posted Thu Jul 09, 2015 3:24 pm (6260)


Hey guys,

So I am currently working on a Call Of Duty: Fast File Compiler, and im at the stage where I am opening and decompressing the rawfiles (http://codresearch.com/index.php/Rawfile_Asset) then getting the strings from the decompressed data to then load in a text box.

current code
Code:
                rawfile rf = new rawfile();
                Stream stream = new MemoryStream(ff._zone);
                int pname = stream.ReadInt32();
                rf.compSize = stream.ReadInt32();
                rf.deflateSize = stream.ReadInt32();
                int pdata = stream.ReadInt32();
                if (pname == -1)
                    rf.name = stream.ReadCString();
                if (pdata == -1)
                {
                    if (rf.compSize > 0)
                        rf.data = ZlibStream.UncompressBuffer(stream.ReadBytes(rf.compSize));
                    else
                        rf.data = stream.ReadBytes(rf.deflateSize);
                }
                CodeBox1.Text = Encoding.UTF8.GetString(rf.data);



Now the problem doesn't lie within how anything is being done like the decompressing or anything like that.

where the problem lies is my position in the Fast Files Zone.

The zone is just a header you get when decompressing the Fast File

the zone stores a bunch of asset files including rawfiles

so my question is. What would be the easiest way to get to the correct position in memory without lets say pattern searching. (currently by reading the zone in a memory stream it thinks im at the beginning of the header)

thanks
  • Author
  • Localization

atom0s, posted Sun Jul 19, 2015 5:26 am (6461)


If you are referring to the base streams position, you can do:
stream.Position
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.