Difference between revisions of "Swapdoodle"

From 3dbrew
Jump to navigation Jump to search
m (Various corrections)
m (→‎BPK1: Fix typos)
 
Line 40: Line 40:
 
|-
 
|-
 
| 0x0
 
| 0x0
| 0x44
+
| 0x40
 
| BPK1 header
 
| BPK1 header
 
|-
 
|-
| 0x44
+
| 0x40
 
|  
 
|  
 
| Block header
 
| Block header
Line 78: Line 78:
 
| 0x8
 
| 0x8
 
| 0x4
 
| 0x4
| Maximum block name length
+
| Maximum block name length?
 
|-
 
|-
 
| 0xC
 
| 0xC
Line 115: Line 115:
 
| 0x10
 
| 0x10
 
| 0x8
 
| 0x8
| Block name (if the name is smaller tahn 0x8, the rest is filled with NULL bytes)
+
| Block name (if the name is smaller than 0x8, the rest is filled with NULL bytes)
 
|}
 
|}
  

Latest revision as of 21:15, 4 January 2025

Swapdoodle is the successor of the Swapnote application that allows you to send doodles to friends using SpotPass.

Credits for Miles (with the BPK1 structures) and MrNbaYoh (with the custom CRC32 checksum) for providing information!

SpotPass usage[edit]

Currently, only these SpotPass endpoints are known to exist:

  • https://npdl.cdn.nintendowifi.net/p01/nsa/<regionID>/RNG_LS1/dstsetting LZ11 compressed BPK1 structure
  • https://npdl.cdn.nintendowifi.net/p01/nsa/<regionID>/RNG_EC1/x.dlp BPK1 structure with all game lessons (x = 1, 2 or 3)
  • https://npdl.cdn.nintendowifi.net/p01/nsa/<regionID>/RNG_MD1/dstdatList.bin BPK1 structure with game metadata
  • https://npdl.cdn.nintendowifi.net/p01/nsa/<regionID>/RNG_NTX/<language>/ntx For game notifications (x = 1 or 2)

Where regionID goes the value from the below table.

Region ID
USA 0hFlOFo7pNTU2dyE
EUR 3vveLadT8H6xKkQH

Also, the game uses Hpp[1] servers for posting doodles and making status updates.

BPK1[edit]

The BPK1 structure is used in almost all game data files. Some of the files that use this structure are either LZ11 or LZ10 compressed (like the ones used for doodles and stationery).

The structure starts with a BPK1 header, followed by all of its block headers, which can share names between each other. The headers are the followed by each block's data, which can hold any data (including another BPK1 structure).

All of the structure entries are stored as little-endian data.

Offset Size Description
0x0 0x40 BPK1 header
0x40 Block header
Additional block headers
Block data
Additional blocks data

BPK1 header[edit]

Offset Size Description
0x0 0x4 Header magic (BPK1)
0x4 0x4 Number of blocks
0x8 0x4 Maximum block name length?
0xC 0x4 Structure length
0x10 0x4 Header length
0x14 0x2C Padding

Block header[edit]

Offset Size Description
0x0 0x4 Block data offset
0x4 0x4 Block size
0x8 0x4 Checksum of block data
0x10 0x8 Block name (if the name is smaller than 0x8, the rest is filled with NULL bytes)

Block checksum[edit]

The checksum of each block is calculated as a custom CRC-32 checksum of the block's data:

  • Polynomial: 4C11DB7
  • Initial value: 4C11DB7
  • Output XOR: 0

Stationery blocks[edit]

The following blocks are used in the stationery files.

STAHED1[edit]

This block holds the stationery file name and 0x79 byte padding.

THUMB2[edit]

This block holds the thumbnail of the stationery as a JPEG image.

STBARD1[edit]

There are two of these blocks. The first one holds a JPEG of the 2D part of the stationery, and the second one holds the 3D part.

STMASK1[edit]

This block holds a 256x256 L4 data of the 3D part of the stationery.