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.

GTA 1 PSX - *.vsr

Featured Replies

  • Author
  • Localization

czdvoika, posted Thu Nov 05, 2020 8:36 pm (59984)


Hi there, i wrote my first bms script whohou :D but files after unpack is compress or crypted, pls help.
I try localization this game

Code:
IDstring 3RSV
get FILESIZE long
goto 0x00000B0

for i = 0
get OFFSET long
get SIZE long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
log "" OFFSET SIZE
next i


files: https://filebin.net/kobwodyxfdkgwp33

tnx tnx
  • Author
  • Localization

aluigi, posted Mon Nov 16, 2020 6:14 pm (60333)


There is no download starting at that link.
  • Author
  • Localization

aluigi, posted Wed Nov 25, 2020 7:13 pm (60600)


It's a chunked format (like RIFF) and the "DATA" chunk has various "BIN " sub-chunks containing pointers to information, but I don't understand if it's encrypted because doesn't have any sense.
  • Author
  • Localization

czdvoika, posted Thu Nov 26, 2020 5:34 am (60608)


thank you for the advice, obviously it will not work without documentation :)
  • Author
  • Localization

Kruci, posted Fri Nov 27, 2020 7:59 pm (60680)


In short:
probably Huffman coding
https://en.wikipedia.org/wiki/Huffman_coding


If you extract files by your script from 0x000038 than each file with 0 size is directory.
Third dir (0000000f) is named "HUFF_TABLES" (filenames are in MISSION.VSR)
That could be Huffman coding (kind of compression).
Huffman coding compress based on characters counts, usually saved as "char" and its "count".
Files in that folders looks like it stores 2B "character" a 2B "usage count".
Probably then used on matching files with same name (first in this dir for first on others dir).

Guessed file formats:
Code:
BIN HUFF_TABLES FORMAT (total guess):
-------------------------------------

4B  " NIB"
4B  filesize
4B  data size
??? elements
2B  ??? character
2B  ??? count


Code:
VSR format:
-----------

4B  3RSV
4B  data size of block BLOCKSIZE (FILESIZE = BLOCKSIZE 8B)
4B  data size of dirs/files block CRID
4B  data size of block NRSV
4B  data size of strings block TRTS
4B  data size of data block ATAD
4B  number of files dirs
4B  number of file names
4B  ??? zeros
4B  offset block SFFO
4B  data size of offset block SFFO

data size of offset block SFFO
4B  CRID
4B  data size of dirs/files block CRID

Element of this block 40B:
4B  ??? either first top dir have here 0x1, or it do not belong to element data and at end is not padding/mark 4B
4B  data start offset (0 for dir)
4B  data size
2B  id for this folder (?unique to folder?), ?name of this file/dir, ?equals to string from strings block?
2B  id for all files (?unique to all files/folders?)
2B  file or dir mark (0x16 = dir, 0xE = file)
2B  ??? 0xCCCC
4B  ??? 0xFFFFFFFF
4B  ??? 0x0
4B  number of files/dirs in this dir
4B  ??? 0x0
4B  ??? 0x0

4B  ??? either padding/end mark of block or last part of element (then first 4B is not part of element)

size of dirs/files block CRID
4B  NRSV
4B  data size of block NRSV

??? 4B 0x0

data size of block NRSV
4B  TRTS
4B  data size of strings block TRTS
4B  elements count STR_ECOUNT
STR_ECOUNT * 4B  offsets to strings (from start of data of this block)
XB strings - files/dirs names, ends with 0x00 char

data size of strings block TRTS
4B  ATAD
4B  data size of data block ATAD
XB  files data
  • Author
  • Localization

czdvoika, posted Wed Dec 02, 2020 5:42 pm (60866)


Kruci wrote:
In short:
probably Huffman coding
https://en.wikipedia.org/wiki/Huffman_coding

O diky za vycerpavajici analyzu, zkusim neco pocist o huffman codovani a dam vedet :) supr

Translator:
Quote:
.Thanks for the exhausting analysis, I'll try to read something about huffman coding and let me know :)
  • Author
  • Localization

Kruci, posted Thu Dec 03, 2020 9:28 pm (60890)


Huffman coding is "simple", but building it is complicated (trees).
Huffman coding just converts "bytes" to variable length data (different length in bits).
For example: text ABCCC could convert to bits "0" "10" "11" or "1" "00" "01"
Because it convert each character to same "bits character", you could see patterns if you see data as bits.

Do not study it much, try find some tools, and try if it work.
It may be some modified Huffman coding, or something different.
I never used any program for Huffman coding, so I know only that QuickBMS have some support,
and there are online "Huffman coding visualization", "Huffman coding encoder", "Huffman coding calculator"
For example:
http://huffman.ooz.ie/?text=ABCCC
https://resources.nerdfirst.net/huffman
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.