Post Reply 
VSMX File Format
Author Message
ZiNgA BuRgA
Smart Alternative

Posts: 17,011.1222
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 444.9132
Offline
Post: #1
VSMX File Format
I never really thought I'd actually bother, but I have been doing some investigation into the VSMX file format, found in RCOs from video/music UMDs and two of the lftv RCOs in the PSP's flash0.
The VSMX file is basically a compiled script file which controls stuff like the UMD menus.  I don't know whether VSMX scripts can be used in the XMB or not.
From a string constant I've seen in one of them, I'm guessing that the official Sony script compiler takes a Javascript file as input and outputs the compiled VSMX file, so I will consider a number of things here from a Javascript perspective.

So anyway, this post is just for anyone who happens to be interested in the file format, and doesn't really serve much other purpose.  It's also rather "preliminary" in that it's _really_ incomplete (I've spent some time on this, but not that much).

Okay...


General File Layout
...basically looks like this:
VSMX header
Compiled instructions
String constants
Object property/method names?
Variable/function names

VSMX header

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 Offset  Description
  0x00    ASCII text "VSMX"
  0x04    always 0x10000 (probably version)
  0x08    always 0x34 - probably length of this header or offset of compiled instructions section
  0x0C    length of compiled instructions section
  
  0x10    offset of string constants section
  0x14    length of above section
  0x18    number of string constants? (haven't double checked this)
  
  0x1C    offset of property/method names section
  0x20    length of above section
  0x24    number of property/method names in above section
  
  0x28    offset of variable/function names section
  0x2C    length of above section
  0x30    number of variable/function names in above section



Compiled Instructions
The compiled instructions start at offset 0x34.  An important concept here, I'll refer to as a "group".  A group is a 64-bit sequence, consisting of 2 32-bit values.  The compiled instructions section is entirely made of these groups.
The first value of the group is the identifier and the second specifies any additional information, or is 0 if not used (I will refer to this second value as the argument).
Here's a list of the identifiers that I know:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 Identifier  Description
      0x01    assign operator (=)
      0x02    string concatenation operator, or perhaps just addition
      
      0x08    negate operator (unary)
      
      0x0E    equivalence operator (==)
      0x0F    less than or equal operator (<=) [am not totally sure about this one]
      
      0x22    end of statement operator? (basically what ";" does)
      0x23    "null" constant?
      0x24    
      0x25    boolean constant?
      0x26    integer constant
      0x27    float constant
      0x28    string constant; the argument is an index to a constant in the string constants section of this file (that is, 0 = first string constant, 1 = second string constant etc)
      
      0x2C    
      0x2D    unnamed variable? argument is some sort of index/identifier
      0x2E    variable; argument is an index in the variable/function names section
      0x2F    object property; argument is an index in the property/method names section
      0x30    object method (argument, same as above)
      0x31    ? seems to reference property/method names section
      
      0x34    array index operator (basically what [ ... ] does)
      
      0x36    assign as array item???
      
      0x39    begin function?  argument is the group index where the function ends, eg if the argument is 0x50, the function would end at 0x50 * 8 + 0x34 = 0x2B4 (absolute file offset)
      0x3A    pointer to "0x3B group" - this acts like an OR operator
      0x3B    start conditional (if) block?  like above two, argument is the group index of where the block ends
      0x3C    call function; the argument here specifies the number of arguments to be passed to the function
      0x3D    like above, except it calls an object method
      0x3E    invoke inbuilt function???
      0x3F    return statement???



For structure, the variables/constants are just listed and operators apply to previous things.
For example, take the following hex sequence of 32-bit values:

Code:
0x2E 0x00 0x26 0x0C 0x01 0x00 0x22 0x00

(for reference purposes, wee'll assume the first variable name is "myVariable")
The above translates to the following Javascript:

Javascript Code
myVariable = 12;

Back to the hex, basically it means:

Code:
{variable-index}0 ("myVariable"), {integer}12, {assign}, {end-statement}


The assign operator gets applied to the previous two values, which happen to be "myVariable" and "12" and does its job on the two.


String constants
This is just a list of unicode (UTF-16) string constants, separated by a single null character (remember, null characters are 16 bits wide in unicode).  There is no alignment.

Object property/method names
Pretty much the same as the string constants section.

Variable/function names
Like above section, except ASCII instead of unicode.

(This post was last modified: 15/02/2010 03:24 AM by ZiNgA BuRgA.)
15/02/2010 03:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
VSMX File Format - ZiNgA BuRgA - 15/02/2010 03:22 AM
RE: VSMX File Format - gsmoke - 15/02/2010, 04:47 AM
RE: VSMX File Format - Mr. Shizzy - 15/02/2010, 07:15 AM
RE: VSMX File Format - deathmock5 - 15/02/2010, 05:51 PM
RE: VSMX File Format - Gadget - 15/02/2010, 06:04 PM
RE: VSMX File Format - ZiNgA BuRgA - 15/02/2010, 08:22 PM
RE: VSMX File Format - Mr. Shizzy - 15/02/2010, 08:29 PM
RE: VSMX File Format - zeusfriends - 04/01/2011, 12:14 PM
RE: VSMX File Format - ZiNgA BuRgA - 04/01/2011, 07:57 PM
RE: VSMX File Format - zeusfriends - 07/01/2011, 10:24 PM
RE: VSMX File Format - ZiNgA BuRgA - 08/01/2011, 03:00 AM
RE: VSMX File Format - frankzito - 08/01/2011, 03:17 AM
RE: VSMX File Format - ZiNgA BuRgA - 08/01/2011, 03:34 AM
RE: VSMX File Format - frankzito - 08/01/2011, 05:37 AM
RE: VSMX File Format - ffffu - 07/02/2011, 04:02 PM
RE: VSMX File Format - ZiNgA BuRgA - 08/01/2011, 06:25 AM
RE: VSMX File Format - frankzito - 08/01/2011, 06:57 AM
RE: VSMX File Format - ZiNgA BuRgA - 20/01/2011, 06:52 PM
RE: VSMX File Format - eustolio - 09/05/2011, 09:31 AM
RE: VSMX File Format - ZiNgA BuRgA - 07/02/2011, 10:46 PM
RE: VSMX File Format - ffffu - 08/02/2011, 05:55 PM
RE: VSMX File Format - ZiNgA BuRgA - 08/02/2011, 07:08 PM
RE: VSMX File Format - ZiNgA BuRgA - 09/02/2011, 04:52 AM
RE: VSMX File Format - ffffu - 09/02/2011, 06:25 AM
RE: VSMX File Format - ZiNgA BuRgA - 09/02/2011, 07:22 PM
RE: VSMX File Format - ffffu - 09/02/2011, 07:27 PM
RE: VSMX File Format - ZiNgA BuRgA - 09/02/2011, 10:43 PM
RE: VSMX File Format - ZiNgA BuRgA - 09/05/2011, 03:03 PM
RE: VSMX File Format - eustolio - 12/05/2011, 08:27 AM
RE: VSMX File Format - ZiNgA BuRgA - 12/05/2011, 03:51 PM
RE: VSMX File Format - ZiNgA BuRgA - 13/05/2011, 04:09 AM
RE: VSMX File Format - eustolio - 14/05/2011, 11:13 PM
RE: VSMX File Format - highboy - 15/05/2011, 05:47 AM
RE: VSMX File Format - zeusfriends - 24/05/2011, 06:18 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: