Difference between revisions of "Phtcache.bin"

From 3dbrew
Jump to navigation Jump to search
(Created page with "<nowiki><pre>00000-00007: Header 1UJQ00_1 00008-0000B: Number of pictures plus 1 (why?) 0000C-00011: Unknown value (seems to be static?) B80B01000000 00012-00013: Total number of...")
 
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<nowiki><pre>00000-00007: Header 1UJQ00_1
+
== File Header ==
00008-0000B: Number of pictures plus 1 (why?)
+
{| class="wikitable" border="1"
0000C-00011: Unknown value (seems to be static?) B80B01000000
+
|-
00012-00013: Total number of photos (excluding 2D dups)
+
! Offset
00014-00017: Appears to be file size. It's only 32 bits = 4GB max. A few hundred K
+
! Size
                larger than the actual size of every file in DCIM (?)
+
! Description
                1607971 vs DCIM/100NIN = 1441792 vs DCIM = 147560 vs files = 1409024
+
|-
                vs non-disk usage = 1224857
+
| 0x0
                phtcache non-disk = 456024, disk = 458752
+
| 0x8
                phtcache (non) + files (non) = 1680881 - 1607971 = 72910 = 72K hmm...
+
| Always "1UJQ00_1"
                maybe the 72910 is some kind of checksum?
+
|-
                ( I have no clue, all these notes were probably worthless)
+
| 0x8
00018-0001B: Preferred image file format. Should be MPO\x00 or JPG\x00. The inner cam is the only
+
| 0x4
                one that will yield JPG. 3D pictures are taken even with screen switched to 2D.
+
| Number of Pictures + 1
0001C-00023: Name of image
+
|-
00024-0002B: Subfolder of image
+
| 0xC
0002C-00033: Time taken based on "DS epoch" (start of 1/1/2000) (UNIX+946684800)
+
| 0x2
00034-00037: Time last viewed?
+
| Total number of photo entries(including unused entries) stored here, this is normally value 3000 (500 on NAND).
0003C-0003F: UNKNOWN
+
|-
00040-00043: UNKNOWN
+
| 0xE
00044-00045: UNKNOWN
+
| 0x2
00046-00047: UNKNOWN
+
| This u16 must be < 2, this is normally value 1 (0 for NAND).
00048-0004B: UNKNOWN
+
|-
00058-0005B: File size
+
| 0x10
 +
| 0x2
 +
| Unknown, normally value zero.
 +
|-
 +
| 0x12
 +
| 0x2
 +
| Total number of photos(used entries), excluding 2D dups.
 +
|-
 +
| 0x14
 +
| 0x2
 +
| CRC16 over the entire file with this CRC field set to zero when calculating the CRC, with initialval=0 and polynomial=0xA001.
 +
|-
 +
| 0x16
 +
| 0x2
 +
| Size of this header, must be >=0x18(this is always value 0x18).
 +
|-
 +
| 0x18
 +
| 0x98 * Number of Pictures
 +
| Pictures Property, index refereed by 3DS Camera
 +
|}
  
</pre></nowiki>
+
The phtcache.bin actual filesize must be at least the following size: hdrsizefield + totalstoredentries*0x98.
 +
 
 +
== Pictures Property ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x0
 +
| 0x04
 +
| Null-terminated file extension: MPO, JPG, or AVI.
 +
|-
 +
| 0x4
 +
| 0x8
 +
| Image file name, without the extension.
 +
|-
 +
| 0xC
 +
| 0x8
 +
| Directory name under the DCIM directory.
 +
|-
 +
| 0x14
 +
| 0x4
 +
| Time taken based on "DS epoch" (start of 1/1/2000) (UNIX+946684800)
 +
|-
 +
| 0x1C
 +
| 0x4
 +
| Time last viewed?
 +
|-
 +
| 0x24
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x28
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x2C
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x30
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x34
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x38
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x3C
 +
| 0x4
 +
| ?
 +
|-
 +
| 0x40
 +
| 0x4
 +
| File size
 +
|-
 +
| 0x50
 +
| 0x18*4
 +
| 4 blocks, where each block is 0x18-bytes.
 +
|}

Latest revision as of 18:10, 11 December 2014

File Header[edit]

Offset Size Description
0x0 0x8 Always "1UJQ00_1"
0x8 0x4 Number of Pictures + 1
0xC 0x2 Total number of photo entries(including unused entries) stored here, this is normally value 3000 (500 on NAND).
0xE 0x2 This u16 must be < 2, this is normally value 1 (0 for NAND).
0x10 0x2 Unknown, normally value zero.
0x12 0x2 Total number of photos(used entries), excluding 2D dups.
0x14 0x2 CRC16 over the entire file with this CRC field set to zero when calculating the CRC, with initialval=0 and polynomial=0xA001.
0x16 0x2 Size of this header, must be >=0x18(this is always value 0x18).
0x18 0x98 * Number of Pictures Pictures Property, index refereed by 3DS Camera

The phtcache.bin actual filesize must be at least the following size: hdrsizefield + totalstoredentries*0x98.

Pictures Property[edit]

Offset Size Description
0x0 0x04 Null-terminated file extension: MPO, JPG, or AVI.
0x4 0x8 Image file name, without the extension.
0xC 0x8 Directory name under the DCIM directory.
0x14 0x4 Time taken based on "DS epoch" (start of 1/1/2000) (UNIX+946684800)
0x1C 0x4 Time last viewed?
0x24 0x4 ?
0x28 0x4 ?
0x2C 0x4 ?
0x30 0x4 ?
0x34 0x4 ?
0x38 0x4 ?
0x3C 0x4 ?
0x40 0x4 File size
0x50 0x18*4 4 blocks, where each block is 0x18-bytes.