Homebrew [Request] Looking for someone with info on an image format.

PF2M

Ex-Miiverse Hacker
OP
Member
Joined
Sep 8, 2015
Messages
552
Trophies
0
Age
23
Location
Ohio
XP
1,000
Country
United States
So the Wii U game Pixel Paint, an early-MS-Paint-style game, recently got a 3DS port. As the creator of Miiverse Custom Image Tool, I have a lot of Miiverse friends who want to post custom images, but can't downgrade because they're on the latest firmware (and sometimes don't want to downgrade because they're complete noobs to hacking). I decided to download this app, and after making some images with the app and looking into the game's ExtData with a hex editor, this is the information I've gathered on the save file's formatting.

Screen Shot 2016-09-26 at 7.02.33 PM.png

  • The game stores the files as the name you typed in in-game, with no file extension, in the root of the ExtData.
  • All files start with "PXI." in ASCII characters.
  • The next 4 characters are the image's sizing, in hexadecimal format and reversed byte order. In this example, I used 320x240, which translates to 140 to F0, as seen above.
  • Everything after this is all color codes, as in "#FF0000". The file I used in this screenshot starts with "000000" "FFFFFF" "000000", which translates to black, white, and black pixels respectively.
Screen Shot 2016-09-27 at 9.30.38 AM.png

  • The file always seems to end with eight zeroes. (The other zeroes in this image are from my drawing, as I ended it with two black pixels)
This is everything I can determine from this file. You can also download this file here, so you can see for yourself.

The reason I'm making this post is because I'd like to see if we can find a way to convert another image format (like PNG, JPG, or BMP) into this format, so we could import hacked images into here and my friends who want latest-firmware Miiverse hacks could be satisfied. It sounds like a pretty stupid reason, I know, but this probably won't be too hard to do, and I don't know enough about programming to get something like this running, so I figured I'd ask you guys for help. I did my detective work, now I'd like to see what you guys come up with. :P
 

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
3,386
Country
Uruguay
According to the size check I performed the data appears to be RAW RGB/BGR888 - if you do 320 * 240 * 3 (the bpp of RGB888) you get the exact size of your file, except for the header/footer which appears to be 12 bytes long.

I'd suggest using ffmpeg for this.
Extract the header until you get exactly 230400 bytes, run
Code:
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb24 -s 320x240 -i in.raw -f image2 -vcodec png out.png
or
Code:
ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt bgr24 -s 320x240 -i in.raw -f image2 -vcodec png out.png
if the first one doesn't work out
with in.raw being your file and out.png the output file. If you want to do automatic conversion within the 3DS itself, check out smea's screenshot tool, it does something very similar (converts from RAW to PNG).

I hope I was right, and good luck!
 
Last edited by Wolfvak,
  • Like
Reactions: ihaveahax and PF2M

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,824
Country
United States
this was almost too easy, you know.


I converted the image to rgb with imagemagick:
Code:
$ convert bottomlogo.png rgb:DN.raw
this is a 320x240 image. in hex that is 0x140 and 0xF0. they are in the file header in little endian. add four null bytes (00) to the end of image data (don't know if this is necessary)
Code:
0x0 - "PXI" magic with a null byte
0x4 - width
0x6 - height
0x8 - image data
Code:
00000000: 5058 4900 4001 f000 0000 0000 0000 0000  PXI.@...........
 

PF2M

Ex-Miiverse Hacker
OP
Member
Joined
Sep 8, 2015
Messages
552
Trophies
0
Age
23
Location
Ohio
XP
1,000
Country
United States
Got the file converted into Photoshop by removing the first 8 bytes and last 4 bytes, then renaming it into a .raw file.
Screen Shot 2016-09-27 at 10.20.38 AM.png

This is what I did to get it. I'm sure we can do it the other way around too. I might have gotten this before if I had thought of RAW files, but I was thinking more about BMPs, so thank you for the help!
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,824
Country
United States
Got the file converted into Photoshop by removing the first 8 bytes and last 4 bytes, then renaming it into a .raw file.View attachment 64130
This is what I did to get it. I'm sure we can do it the other way around too. I might have gotten this before if I had thought of RAW files, but I was thinking more about BMPs, so thank you for the help!
I don't think it's really a "raw" file, I just added raw to the end of it. "raw" images are generally from cameras as far as I know.

I could also not know what I'm talking about...
 
Last edited by ihaveahax,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: good night