Post Reply 
VSMX File Format
Author Message
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
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
gsmoke
Noob

Posts: 2,184.2572
Threads: 103
Joined: 14th Apr 2007
Reputation: 1.65351
E-Pigs: 36.9914
Offline
Post: #2
RE: VSMX File Format
Why am i so stupid ...,i wish im wrong but the vsmx is usualy used for ingame menus or highlighted game icons ...
so if the xmb is not in the mentioned mode it won't be able to use the vsmx.

so what zinga said...

“Fear not for the future, weep not for the past.”
15/02/2010 04:47 AM
Find all posts by this user Quote this message in a reply
Mr. Shizzy
ɯɹ˙ sɥızzʎ

Posts: 2,973.4020
Threads: 415
Joined: 21st Feb 2007
Reputation: -2.36574
E-Pigs: 160.1496
Offline
Post: #3
RE: VSMX File Format
Maybe wee could eventually use this to make custom dvd menu for custom UMD video ISO wee make?

PSP 2001 [TA-088v2]: 6.39 ME-9.7
[Image: 4kly6c1.gif]
Sig by Mr_Nick666
15/02/2010 07:15 AM
Find all posts by this user Quote this message in a reply
deathmock5
Where is your god now?

Posts: 141.2188
Threads: 19
Joined: 6th Sep 2009
Reputation: 3.62383
E-Pigs: 4.4998
Offline
Post: #4
RE: VSMX File Format
... im completly lost, i wish i had your guyses brains....

[Image: deathmock5.png][Image: deathmock5.png][Image: xdeathmockx.jpg]
15/02/2010 05:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Gadget
ɯƃıpɐɹɐd ssǝןpuǝ

Posts: 908.2697
Threads: 69
Joined: 23rd Apr 2008
Reputation: 0.85528
E-Pigs: 63.3012
Offline
Post: #5
RE: VSMX File Format
Nice research ZiNgA  :)

Mr. Shizzy Wrote:Maybe wee could eventually use this to make custom dvd menu for custom UMD video ISO wee make?

seems to me to be logical. :D

PSN: Brick_Factory

Spoiler for sigpic:
[Image: 157nb04.png]
Spoiler for NeCr0-B0T:
Necro-Bot
Necro may refer to:
    * necro-, the Greek prefix meaning death
Bot or BOT or similar may refer to:
    * Internet bot, computer program which does automated tasks
    * Botnet, network of "zombie" computers used to carry out automated tasks such as spamming
15/02/2010 06:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #6
RE: VSMX File Format
Thanks.

gsmoke Wrote:Why am i so stupid ...,i wish im wrong but the vsmx is usualy used for ingame menus or highlighted game icons ...
Games don't necessarily follow Sony standards.  They could use it maybe, but I highly doubt it.

Mr. Shizzy Wrote:Maybe wee could eventually use this to make custom dvd menu for custom UMD video ISO wee make?
Possible, but the main issue I think is someone coding up a compiler... >_>
15/02/2010 08:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Mr. Shizzy
ɯɹ˙ sɥızzʎ

Posts: 2,973.4020
Threads: 415
Joined: 21st Feb 2007
Reputation: -2.36574
E-Pigs: 160.1496
Offline
Post: #7
RE: VSMX File Format
ZiNgA BuRgA Wrote:
Mr. Shizzy Wrote:Maybe wee could eventually use this to make custom dvd menu for custom UMD video ISO wee make?
Possible, but the main issue I think is someone coding up a compiler... >_>

Cool !    Yay
I have 3 pilot episodes of an unreleased VH1 cartoon called "Spongebong Hemp Pants"
That would be awesome to make a custom UMD ISO of all three episodes with animated menus ect.      Madwin

Thanks for looking into/sharing this ZiNgA.
Hopefully someday it will lead to more ways for us customization nuts to toy with things   :D

PSP 2001 [TA-088v2]: 6.39 ME-9.7
[Image: 4kly6c1.gif]
Sig by Mr_Nick666
15/02/2010 08:29 PM
Find all posts by this user Quote this message in a reply
zeusfriends
Neophitic Presence

Posts: 4.3967
Threads: 0
Joined: 4th Jan 2011
Reputation: 0
E-Pigs: 0.6890
Offline
Post: #8
RE: VSMX File Format
I think that kind of encoding for the javascript (which it's according to SONY is ECMA-262 Javascript) is analog to WAP encoding!....i made a google search about WMLScript encode and i got a pdf file which talk about that encoding ... of course with some sony modification!...(could be already used in some sony product like phones) ...

i watched a video talking about UMD Composer 2 releasing!
and for that point (the RCO creation) ... i see the following...

1- xml input
2- there's embedded java class called movieplayer with some parameters exported like (event_info)
3- all variables and functions under main() .... which means no way to create a custom classes



1- it's
04/01/2011 12:14 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #9
RE: VSMX File Format
Interesting - thanks for the info.
It's a bit lower level than Javascript, in that it uses jumps rather than higher level logic structures (like if/while etc) and a concept of applying operators on a stack, rather than having them stored in statement form.
(This post was last modified: 04/01/2011 07:59 PM by ZiNgA BuRgA.)
04/01/2011 07:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
zeusfriends
Neophitic Presence

Posts: 4.3967
Threads: 0
Joined: 4th Jan 2011
Reputation: 0
E-Pigs: 0.6890
Offline
Post: #10
RE: VSMX File Format
i have a Christmas gift i got it somewhere! which describe the whole invention of the UMD technology
how can i send it to you?!...
07/01/2011 10:24 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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

 Quick Theme: