Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Larsenv
Posts: 137
Joined: Thu Jun 04, 2015 11:20 pm

Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Post by Larsenv »

Swapnote:

Here.

The one without an extension looks like it stores JPEGs inside it (and maybe more stuff), and the .apd files look like it stores graphics in there...

Pokémon Shuffle Mobile:

Here.

It looks like these store Zlib compressed files.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Post by aluigi »

You can use a file ripper (like HyperRipper/DragonUnpacker) to extract the jpg.
Larsenv
Posts: 137
Joined: Thu Jun 04, 2015 11:20 pm

Re: Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Post by Larsenv »

Yeah, but the Swapnote ones contain other stuff in them so please make a QuickBMS script for it if you can...
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Post by aluigi »

I checked it and the format is not that simple.
There is a 32bit size value before each jpg but then the format changes.
einstein95
Posts: 64
Joined: Tue Sep 08, 2015 11:27 am

Re: Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Post by einstein95 »

Basic Pokemon Shuffle mobile BMS script:

Code: Select all

goto 0x10
get FILEZ long
goto 0x18
for i = 0 < FILEZ
   get HASH long
   get UNK1 long
   get SIZE long
   get OFF long
   get UNK2 long
   get UNK3 long
   get UNK4 long
   get NULL long
   log "" OFF SIZE
next i

Despite the extension QuickBMS gives them, they're not .zip archives, but custom compressed archives it seems.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Swapnote .apd Files and Pokémon Shuffle Mobile Archives

Post by aluigi »

Oops, I tought the second folder was related to the first link :) It's better to open a thread for each game to avoid confusion, imho.

The extracted files are correct zip archives with their names replaced by zeroes, they can be extracted with 7-zip without problems.

You can use this modified script to unzip them on-the-fly:

Code: Select all

comtype deflate
goto 0x10
get FILES long
get ZERO long
for i = 0 < FILES
    get DUMMY1 long
    get DUMMY2 long
    get ZSIZE long
    get OFFSET long
    get SIZE long
    get DUMMY3 long
    get DUMMY4 long
    get DUMMY5 long

    savepos TMP
    goto OFFSET
    get SIGN long
        get ver             short
        get flag            short
        get method          short
        get modtime         short
        get moddate         short
        get crc             long
        get comp_size       long
        get uncomp_size     long
        get name_len        short
        get extra_len       short
        getdstring name     name_len
        getdstring extra    extra_len
        savepos offset
    goto TMP

    if method == 0
        log "" OFFSET comp_size
    else
        clog "" OFFSET comp_size uncomp_size
    endif
next i