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.

The Surge .toc/.dat

Featured Replies

  • Author
  • Localization

Panzerdroid, posted Tue May 16, 2017 7:21 am (23272)


Could anyone take a look?

http://www2.zippyshare.com/v/wNALqK6Z/file.html

I bet the game uses the same LZ4 compression as Lords of the Fallen, but now the container switched from pkg to toc/dat format, so old tools don't work :(
  • Author
  • Localization

spider91, posted Tue May 16, 2017 9:26 am (23275)


Code:
comtype lz4f
endian big
goto 0x5A
get DAT_NAME_SIZE short
getdstring DAT_NAME DAT_NAME_SIZE
string DAT_NAME = "_"
xmath ZERO_SIZE "4 - (DAT_NAME_SIZE % 4)"
if ZERO_SIZE < 4
   getdstring DUMMY ZERO_SIZE
endif
get DATS byte
get FILES long
math DAT_INDEX = -1
for i = 0 < FILES
   getdstring DUMMY 0x0E
   get NAME_SIZE short
   getdstring NAME NAME_SIZE
   xmath ZERO_SIZE "4 - (NAME_SIZE % 4)"
   if ZERO_SIZE < 4
      getdstring DUMMY ZERO_SIZE
   endif
   get OFFSET long
   if OFFSET == 0
      math DAT_INDEX = 1
      string NAME_INDEX p= "%01d" DAT_INDEX
      set NEW_DAT_NAME string DAT_NAME
      string NEW_DAT_NAME = NAME_INDEX
      string NEW_DAT_NAME = ".dat"
      open FDSE NEW_DAT_NAME 1
   endif
   get ZSIZE long
   get SIZE long
   getdstring DUMMY 0x0A
   clog NAME OFFSET ZSIZE SIZE 1
next i
  • Author
  • Localization

Minimum, posted Tue May 16, 2017 10:56 am (23277)


sorry. fixed :mrgreen:
  • Author
  • Localization

spider91, posted Tue May 16, 2017 11:04 am (23278)


What file you are trying to unpack?
  • Author
  • Localization

Panzerdroid, posted Tue May 16, 2017 3:48 pm (23283)


Thank you, Spider81!
Is recompression possible?
  • Author
  • Localization

spider91, posted Tue May 16, 2017 4:59 pm (23286)


I've made a script for repack and game crashes with repacked files. Probably it uses some custom CRC calculations for packages like last game from this developers, but i don't have any skills on debugging and don't know what kind of CRC is this.

You can ask Ekey, he made a unpacker for LotF, maybe he can help.
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.