PS2 Savedata

From PS3 Developer wiki
Revision as of 17:16, 2 September 2020 by (talk) (Filename Format)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Common terms used in this page[edit]

  • <userid> The number assigned by the system to this user when his account was created (is a counter). Stored in XRegistry.sys, e.g: 00000001
  • <SAVEDATA_DIRECTORY> Name of the folder where the savedata files are stored, composed by TITLE_ID + some variable characters added by the game, e.g: BLES00001-nick01save01
  • <TITLE_ID> Name of the folder where the game was installed (different than the TITLE_ID in his PARAM.SFO that refers to the original ID when the game was released years ago as a disc)
  • <virtual_memcard> The name assigned to the card when it was created from the "Memory Card Utility (PS/PS2)" in XMB
  • Any_Other_Files Represents all the other files in the folder generated by the game with any filename and filextensions that are dependant of each game and can vary, e.g: "PROFILE.BIN"(in PS3 Game Saves) or "SECURE.BIN" (in Minis Game Saves) etc...
  • <MC_Save_ID> Identifyer of each Game Save of a PS1 or PS2 Memory Card. Used as the file name when a single Game Save is exported to USB, e.g: BESLES-53702535953.PSV
  • MC_Slot Inside a PS1 or PS2 Memory card, real or virtual, every one of the savedata items represented with an icon, A single savedata can use one or several slots in PS1, and always only one slot in PS2
  • PARAM.SFO Information about the Game Save. This one is never encrypted.
  • PARAM.PFD Signatures of some of the other files in the folder.

Game Saves PS2[edit]

Memory Card Utility (PS PS2).jpg

Saved Data Utility (PS2).jpg
Storage Media Path Import/Export file conversions
Internal HDD dev_hdd0/savedata/vmc/<virtual_memcard>.VM2
Internal HDD
Only "PS2 Classics"
dev_hdd0/home/<userid>/ps2emu2_savedata/<TITLE_ID>/ICON0.PNG Copied from dev_hdd0/game/<TITLE_ID>/ICON0.PNG
dev_hdd0/home/<userid>/ps2emu2_savedata/<TITLE_ID>PARAM.SFO Copied from dev_hdd0/game/<TITLE_ID>/PARAM.SFO ?
dev_hdd0/home/<userid>/ps2emu2_savedata/<TITLE_ID>/SCEVMC0.VME Copied from dev_hdd0/game/<TITLE_ID>/USRDIR/SAVEDATA/SCEVMC0.VME
dev_hdd0/home/<userid>/ps2emu2_savedata/<TITLE_ID>/SCEVMC1.VME Copied from dev_hdd0/game/<TITLE_ID>/USRDIR/SAVEDATA/SCEVMC1.VME
External USB dev_usb0/PS3/EXPORT/PSV/<Save_ID>.PSV When exporting to USB the MC_Slot is extracted from VM2 an saved individually as a PSV
External USB
Only "PS2 Classics"
dev_usb0/PS3/EXPORT/PS2SD/<TITLE_ID>/ICON0.PNG Copied from the savedata folder
dev_usb0/PS3/EXPORT/PS2SD/<TITLE_ID>PARAM.SFO Added a signature at the end of the file (out of the SFO structure)
External MC mc_root/ Raw copy from/to a real PS2 Memory Card using a Memory Card Adapter

Memory Card Formats PS2[edit]

Memory card PS2 (original)[edit]

The PS2 memory card file system has a fairly simple design, with some allowances made for the limitations of flash memory. It's overall structure is similar to the well known MS-DOS FAT file system. It uses a file allocation table (FAT) to keep track of allocated space and a hierarchical directory system where all of a file's metadata is stored in its directory entry. Like the FAT file system, which groups disk sectors into clusters, the PS2 memory card file system groups flash memory pages in to clusters. On standard PS2 memory cards, the cluster size 1024 bytes, or 2 pages long.

  • The Superblock

The key to the PS2 memory card file system is the superblock. Located in the first page of the memory, this is the only part of the file system with a fixed location. While some things like the do end up in fixed locations on standard 8M memory cards, you shouldn't rely on this.

Block Nº Cluster Nº Page Nº Offset Length Name Example Description
0 0 0x000000 0x01C (28 bytes) magic Sony PS2 Memory Card Format Memory Card identifyer
0x00001C 0x00C (12 bytes) version Memory Card format version. ( = full support for bad_block_table map)
0x000028 0x002 (2 bytes) page_len 512 Page size in bytes (without ECC)
0x00002A 0x002 (2 bytes) pages_per_cluster 2 Number of pages in a cluster
0x00002C 0x002 (2 bytes) pages_per_block 16 Number of pages in an block
0x00002E 0x002 (2 bytes) not used FF00
0x000030 0x004 (4 bytes) clusters_total 8192 Total number of clusters
0x000034 0x004 (4 bytes) alloc_start 41 First allocatable cluster number. Cluster values in the FAT and directory entries are relative to this
0x000038 0x004 (4 bytes) alloc_end 8135 Cluster offset number after the highest allocatable cluster. Relative to alloc_start. Not used.
0x00003C 0x004 (4 bytes) cluster_rootdir 0 Cluster offset of the first cluster of the root directory. Relative to alloc_start. Must be zero.
0x000040 0x004 (4 bytes) bblock1 1023 Backup1 block number
0x000044 0x004 (4 bytes) bblock2 1022 Backup2 block number
0x000050 0x080 (128 bytes) ind_fat_table 8 Indirect FAT Table cluster number
0x0000D0 0x080 (128 bytes) bad_block_table -1 Bad blocks table (damaged blocks index)
0x000150 0x001 (1 byte) card_type 2 Memory card type (2 = PS2 memory card)
000x0151 0x001 (1 byte) card_flags 0x52 Memory Card features (0x01 = ECC support, 0x08 = Bad Block support, 0x10 = Erased state zeroed)
0x000152 0x002 (2 byte) not used FF
0x000154 0x0BC (188 bytes) unknown
0x000200 0x010 (16 bytes) ECC Error Correction Code. The last 16 bytes of all the pages are reserved for this code. See explain below
1 not used
Up to 7 Up to 15 not used
1 8
16 0x002100 0x210 (528 bytes) Indirect FAT Table FAT File System
9 18 0x002520 0x210 (528 bytes) FAT Table
Up to 15 Up to 31
Up to 4
5 40 80
82 0x00A920 0x210 (528 bytes) Allocatable Clusters
Up to 47 Up to 95
Up to 1004
1005 8040 16080
8041 16082 0x819120 0x210 (528 bytes) Reserved Clusters
Up to 8047 Up to 16095
Up to 1021
16352 0x83BE00 0x210 (528 bytes) Temporal Data Backup Block 2
Used to store the number of the block that is going to be programmed
Up to 8183 Up to 16367
8184 16368 0x83DF00 0x210 (528 bytes) Temporal Data Backup Block 1
Used to store a copy of the data that is going to be programmed to a block
Up to 8191
Up to 16383

A standard Ps2 Memory Card is composed by 1024 blocks, each block contains 16 pages of 528 bytes, for a total of 528*16*1024=8.650.752 bytes (0x840000)

Total ECC data is 16*16*1024=262.144 bytes

This gives an available space to store data of: Total-ECC = 8650752-262144 = 8388608 bytes = 8mb

  • Backup Blocks

Two complete blocks are reserved to deal with the possibility of the memory card being removed by the user when data is being saved. Writing data to card requires erasing and reprogramming an entire block

Before writing a block, both bblock1 and bblock2 are erased. Then a copy of the new data that is going to be written is stored in bblock1, and the number of the block that is going to be written is stored in bblock2. The block being programmed is then erased and writed. Finally, bblock2 is erased

Recovery caused by removal of the memory card is implemented whenever a memory card is inserted into the PS2 by checking bblock2, if it's not erased, then programming is assumed to have not been completed. The contents of bblock1 are then copied to the block given in bblock2. Then bblock2 is erased

  • Error Correction Code (ECC)

The data area of each page (512 bytes) is divided into 128 byte long chunks and for each chunk a simple [20-bit Hamming code] is calculated and stored in three bytes

The first byte contains the column (or bit-wise) parity bits, with the even groups in the lower nibble and the odd groups in the upper nibble. The second and third bytes contain the even and odd groups respectively for the line (or byte-wise) parity bits

The 3 ECC bytes for each of the 4 chunks are stored in order in the page's spare area for a total of 12 bytes

Source: [PlayStation 2 Memory Card File System - By Ross Ridge]

Virtual Memory Card PS2 (.VM2)[edit]

File structure is the same than a "original PS2 memory card", there are not apparent differences. Maximum VM2 Memory Card size that PS3 can handle is 32MB (or 63MB, but is speculation). 64MB card cause bootloop because indexer can't handle nothing bigger than uint_16 range for memory card free space entry, 65535KB (63.99 MB) = 0xFFFF, while 64 MB memory card is 65536KB (0x10000) so it exceed uint_16 limit, causing unrecoverable database corruption until memory card is deleted somehow from hdd. Probably 63MB VM2 card will work fine, but is just speculation.

  • Speculation

Last place to store a PS3 identifyer is inside the FAT filesystem ?... maybe there is none

PS2 Single Save (.PSV)[edit]

PSV is a PS2 savegame in "PS3 format". When exporting a save from a PS2 internal memory card to a USB device the Game Saves are converted to a .PSV file in PS3 format. The name of the exported file is the identifier of the block on Hexa format

The file format has a 0x84 bytes header, in a PS1 Memory Card every slot is 0x2000 so if the savedata is composed by only one slot the total file size is 0x2084 (8.324 bytes). In PS3 XMB is displayed as 8KB

Note: A part of the header is common for PS1 (PS2 header is bigger than PS1)

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  00 56 53 50 00 00 00 00  77 77 77 2e 62 75 63 61  |.VSP....www.buca|
00000010  6e 65 72 6f 2e 63 6f 6d  2e 61 72 00 fa 09 5f f3  ||
00000020  8b c9 da 44 2f 08 4f 56  28 91 19 ea a3 23 08 e1  |...D/.OV(....#..|
00000030  00 00 00 00 00 00 00 00  2c 00 00 00 02 00 00 00  |........,.......|
00000040  64 69 01 00 f4 66 01 00  c4 03 00 00 54 01 00 00  |di...f......T...|
00000050  98 83 00 00 54 01 00 00  98 83 00 00 54 01 00 00  |....T.......T...|
00000060  98 83 00 00 03 00 00 00  00 2e 17 10 1a 08 e4 07  |................|
00000070  00 2e 17 10 1a 08 e4 07  05 00 00 00 27 84 00 00  |............'...|
00000080  42 41 53 4c 55 53 2d 32  30 39 36 33 46 46 31 32  |BASLUS-20963FF12|
00000090  30 30 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |00..............|
000000a0  00 2e 17 10 1a 08 e4 07  00 2e 17 10 1a 08 e4 07  |................|
000000b0  98 83 00 00 97 84 00 00  73 74 61 74 69 63 2e 69  |........static.i|
000000c0  63 6f 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |co..............|
000000d0  00 00 00 00 00 00 00 00  54 01 00 00 00 2e 17 10  |........T.......|
000000e0  1a 08 e4 07 00 2e 17 10  1a 08 e4 07 08 e2 00 00  |................|
000000f0  97 84 00 00 42 41 53 4c  55 53 2d 32 30 39 36 33  |....BASLUS-20963|
00000100  46 46 31 32 30 30 00 00  00 00 00 00 00 00 00 00  |FF1200..........|
00000110  00 00 00 00 ec 84 00 00  00 2e 17 10 1a 08 e4 07  |................|
00000120  00 2e 17 10 1a 08 e4 07  c4 03 00 00 97 84 00 00  |................|
00000130  69 63 6f 6e 2e 73 79 73  00 00 00 00 00 00 00 00  |icon.sys........|
00000140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000150  f4 66 01 00 00 00 01 00  01 00 00 00 06 00 00 00  |.f..............|

Filename Format[edit]

The Filename is generated from the saved ps2 data with the format:

  Internal PS2 ID String followed by the Description Text in HEX
  For the above header the Exported PSV file name would be "BASLUS-20963464631323030.PSV"
Offset Length Example Description
0x00 0x08 00 56 53 50 00 00 00 00 " VSP"
0x08 0x14 77 77 77 2E 62 75 63 61 6E 65 72 6F 2E 63 6F 6D 2E 61 72 00 Key seed, any value is accepted (not validated by the PS3)
0x1C 0x14 FA 09 5F F3 8B C9 DA 44 2F 08 4F 56 28 91 19 EA A3 23 08 E1 Sha1 hmac digest
0x30 0x08 00 00 00 00 00 00 00 00 padding related with the alignment of the previous 2 values ?
0x38 0x04 2C 00 00 00 PS1=0x14, PS2=0x2C
0x3C 0x04 02 00 00 00 PS1=0x1, PS2=0x2
0x40 0x04 64 69 01 00 Used Bytes (Size displayed on XMB).
0x44 0x04 F4 66 01 00 start offset in file of icon.sys (start of "PS2D" area in PS2)
0x48 0x04 C4 03 00 00 icon.sys file size
0x4C 0x04 54 01 00 00 position of 1st icon (start offset)
0x50 0x04 98 83 00 00 size of 1st icon
0x54 0x04 54 01 00 00 position of 2nd icon (start offset)
0x58 0x04 98 83 00 00 size of 2nd icon
0x5C 0x04 54 01 00 00 position of 3rd icon (start offset)
0x60 0x04 98 83 00 00 size of 3rd icon
0x64 0x04 03 00 00 00 number of files in the .PSV container
0x68 0x38 00 2E 17 10 .. PS2 Main Dir Info
0xA0 0x3C 00 2E 17 10 .. PS2 File Info (one for each file in the folder)
0x0166F4 0x3C4 50 53 32 44 "PS2D" icon.sys file, see PS2 format
  • Notes:
  • When trying to copy not valid save data:
    • from modified data : During process of copy: "the data is corrupted."

Virtual Memory Card Encrypted (.VME)[edit]

When exporting Game Saves for "PS2 classics" (CATEGORY 2P) to a external USB drive there is a "rare" PARAM.SFO exported. This PARAM.SFO seems to be a copy of the main PARAM.SFO from the installed game folder with an added "signature" "injected" at the end of the file (out of his structure) with a lenght of 20 bytes. Is supposed to be a security feature when exporting the gamesave, is not confirmed if this PARAM.SFO (with the injected "signature" out of his structure) exists in the internal HDD (when importing, or present at some time with the "PS2 virtual memory cards").

Wrote by ps3hen in ps3hax forums

PSN PS2 games do not save to VM cards in the same way to original PS2 games and PS1 games do
Each user who plays a PSN PS2 Game and makes a save, generates two VM cards (one for each slot) especially for that user account, for that game.
Each time the game is loaded the user selected VM cards(chosen from the VMC ulitity) are um-mounted and the user's save file for that game mounts the dedicated PS2 VM cards to the PS3 Virtual MC slots.
When the game is quit, the dedicated VM cards are un-mounted. But for some reason the user selected VM cards are not re-mounted, this is when I knew they mounted dedicated VM cards for each save.

The save file structure goes like this:

Side note: "XXXX11111" will be different to the Title ID inside the Param.sfo. Inside the Param.sfo is the original title ID of the game when it was a PS2 Disc Game.

The black area of the param.sfo is only in the exported save file of the PS2 game
Also if the black area is not present in the save param.sfo, the PS3 considers it corrupt
Also if the PSN title id, used as the name for directory on the USB (/PS3/EXPORT/PS2SD/<PSN title id>/) is changed it is considered corrupt

Memory Card Tools PS2[edit]


mymc is a public domain command line utility for working with PlayStation 2 memory card images (.ps2) as used by the PlayStation 2 emulator PCSX2.
It allows save files in the MAX Drive (.max), EMS (.psu), SharkPort (.sps), X-Port (.xps) and Code Breaker (.cbs) formats to be imported directly into these images.
It can also export save files in eiter the MAX Drive and EMS formats. See the README.txt file included in the distribution below for more details. 

Extracting and Injecting single PS2 Game Saves in PC[edit]

The method is the same one used in PS1, see: Extracting and Injecting single PS1 Game Saves in PC , but here the file format is: .VM2 (a virtual PS2 memory card in PS3 format), and .PS2 (a 1:1 raw copy of a PS2 memory card). Both are the same

The PC program to manage this .PS2 memory cards is "mymc" and also can be generated by the emulator "PCSX2". See:

  • External forums manuals:

Editing PS2 Game Saves icons in PC[edit]

In PS2 save Games the icon is a file with the extension .icn (any name is valid), is "linked" to the save game by the file icon.sys. The PC program "PS2 SaveBuilder v0.8" can generate this 2 files (included a black default icon)... the icon can be replaced later.

The format supports 3D objects (e.g: save games of tomb raider with a figurine of lara croft)

The program "bmp2icon.exe by sjeep" can generate a .icn in the correct format for importing to "PS2 SaveBuilder v0.8", additionally it can add a 3d object where your image is applyed as a texture over the faces of a basic 3D object, the options are: 3D rectangle, 3D cube, of flat square

The source image to importing in "bmp2icon.exe by sjeep" must be a 24-bit 128x128 pixel .BMP