Jump to content



Photo
- - - - -

.vpt file format?


  • Please log in to reply
5 replies to this topic

#1 JavaJack

JavaJack

    Enthusiast

  • Members
  • PipPipPip
  • 175 posts

  • Flag: United States of America

  • Favorite Pinball: Diner

Posted 06 April 2013 - 02:17 PM

If I wanted to, say, write a Python script to open a .vpt file and enumerate all the walls, flippers, etc. in it, where would I find something explaining the file's structure?

 

I checked out a copy of the source this morning, but I didn't see any obvious readmes or code comments or anything that described it. I may just be overlooking it.



#2 Zarquon

Zarquon

    Hobbyist

  • Members
  • PipPip
  • 37 posts
  • Location:Vancouver, BC

  • Flag: Canada

  • Favorite Pinball: Medevil Maddness

Posted 07 April 2013 - 06:34 PM

JavaJack Iooked for this myself awhile back and didn't find anything. I came up with a clugy solution that wotked for my purpose as I only needed the script portion but it was ugly and wouldn't meet your need. If you find the format out you should document and post it. Sent from my GT-I9100 using Tapatalk 2

#3 JavaJack

JavaJack

    Enthusiast

  • Members
  • PipPipPip
  • 175 posts

  • Flag: United States of America

  • Favorite Pinball: Diner

Posted 08 April 2013 - 02:52 AM

Yeah, maybe one of the main devs will chime in at some point.



#4 Yaa101

Yaa101

    Neophyte

  • Members
  • Pip
  • 2 posts

  • Flag: ---------

  • Favorite Pinball: 8 Ball Deluxe

Posted 19 December 2013 - 01:13 AM

From the source (pinbinary.cpp) I can see that it's a BIFF stream that is read or written.

At this point I only know that it's a MS Excel related fileformat.

 

I am trying to find out because VP is crashing on a file that I need to open, I hope to be able to extract a few things when I know more about the fileformat.

 

Good luck.



#5 Yaa101

Yaa101

    Neophyte

  • Members
  • Pip
  • 2 posts

  • Flag: ---------

  • Favorite Pinball: 8 Ball Deluxe

Posted 19 December 2013 - 02:25 AM

It seems that my conclusions were too fast, BIFF reader in this context (media/fileio.cpp) means just a binary field reader.

It also seems that pinball.cpp opens its own streams, also defined in (media/fileio.cpp)

 

Sorry for the misinfo, looking further here.

 

Edit:

It seems that the main .vpt loader is HRESULT PinTable::LoadGameFromStorage(IStorage *pstgRoot) inside pintable.cpp

It uses IStorage and IStream classes defined in (media/fileio.cpp) to do that job.

It first reads a bunch of headers to see where the data in the file resides and then loads that data.

 

At this point I do not know the exact format of these headers, but they do not look complicated.

It should be quite straightforward to extract various parts of an unencrypted .vpt file by the looks of this.

 

Edit 2:

The IStorage and IStream classes defined in (media/fileio.cpp) are derivatives and not used in pintable.cpp to load the table from file

 

A .vpt file is an ole32 Compound File Binary Format -> http://en.wikipedia....e_Binary_Format

 

HRESULT PinTable::LoadGameFromFilename(char *szFileName) uses StgOpenStorage to open a compound document file and represents it as an IStorage object

It then invokes HRESULT PinTable::LoadGameFromStorage(IStorage *pstgRoot) to access the IStorage object.

 

It seems that you can use the Python module called OleFileIO_PL to access this.

 

To be continued, first fiddle with python here.

 

Edit 3:

The python module is not up to it.

 

There is another program that is up to this task, google "mitec ssviewer" (not going to include the link to a exe here for security reasons), no need to install it, just use it from the unpacked zip file, but to use it is your own responsibility, not mine and not this forum.

 

From the viewer you can save individual streams, each stream represents an image or sound or whatever.

The stream does include storage info, so you have to cut the part until the magic file info with a hex editor, then you can save that resource.

 

I was able to get the graphics out of a table that made visual pinball crash, so it saved my day.

Success!


Edited by Yaa101, 20 December 2013 - 12:24 PM.


#6 Sophira

Sophira

    Hobbyist

  • Members
  • PipPip
  • 19 posts

  • Flag: ---------

  • Favorite Pinball: Williams

Posted 21 February 2014 - 08:57 PM

It's worth noting that 7-Zip can handle these files, too!