Page 1 of 3

decompress xbb file from "Harvest Moon A new Beginning 3DS"?

Posted: Thu Feb 26, 2015 3:19 pm
by ChrisX930
Hey Guys,

today I decrypted a Nintendo 3DS Game and found MAAAAAANY scripts and code-related stuff as plain text in it.
The Game I've decrypted was "Harvest Moon A new Beginning" for 3DS.
But the Game contains some xbb-files which are encrypted or compressed and I don't know how to decrypt/decompress them.

I've uploaded some and hope, that someone could help me with it.
I want do decrypt/decompress them. I think, they're compressed/encrypted on the same way.

Would be great if you can help me with it :)

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sat Feb 28, 2015 11:40 am
by ChrisX930
Is someone able to help me with this? :/

Someone sent me a txt-file with informations about xbb files from an older Harvest Moon Game.
https://www.dropbox.com/s/56ertxekzzkqw ... n.txt?dl=0

Another documentation
https://gist.github.com/andibadra/2632d ... xbb_3ds-md




I really want to unpack and repack this files :)

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sat Feb 28, 2015 2:15 pm
by ekanspt
Using the links that you gave me, i wrote this algorithm to extract xbb files:

Code: Select all

#XBB

IDString 0 XBB;
GoTo 4 0;
Get NFiles Long 0;
GoTo 32 0;

For T = 1 To NFiles;
Get FileOffset Long 0;
Get FileSize Long 0;
Get FileNameOffset Long 0;
Get FileID Long 0;

SavePos HeaderOffset 0;
GoTo FileNameOffset 0;

Get FileName String 0;

Log FileName FileOffset FileSize 0 0;
GoTo HeaderOffset 0;
Next T;
The extracted files have the header PAPA and I developed this code to extract them.

Code: Select all

#PAPA

IDString 0 PAPA;

GoTo 8 0;

Get HeaderOffset Long 0;
Get HeaderSize Long 0;
Get NFiles Long 0;

Math NFiles -= 1;

For T = 1 To NFiles;

Get FileOffset Long 0;
SavePos HeaderCurOffset 0;

Get NextFileOffset Long 0;

Set FileSize Long NextFileOffset;
Math FileSize -= FileOffset;

GoTo HeaderCurOffset 0;

Log T FileOffset FileSize 0 0;

Next T;
From what I've seen, this is probably a file with information that only the game knows. The extracted files seem to have a pattern, but it depends on the file. If you are interested we can analyze the extracted files.

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sat Feb 28, 2015 11:19 pm
by ChrisX930
Oh nice! I will try it! :)
I need quickbms for this, i guess?

Yea, would be great if you could help me with analyzing the extracted files.
It would be VERY helpful <3

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 1:44 am
by ekanspt
I used multiex commander to extract the files. May i ask for what purpose do you want to extract the files? Do you want to repack them?

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 2:39 am
by ChrisX930
ekanspt wrote:I used multiex commander to extract the files. May i ask for what purpose do you want to extract the files? Do you want to repack them?
I want to edit and repack them, yes.
And If possible, add NEW FILES to the xbb-files!

Uploaded the Msg.xbb which should contain all Strings etc. Could you make the files "editable"?

http://filehorst.de/d/bBFxHsvs

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 12:19 pm
by ChrisX930
btw. I was able to modify some script-related things and to compile it back to the Game! :D It works!
http://abload.de/img/modixmuwz.jpg

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 4:35 pm
by ekanspt
So the xxb files you can extract with multiex commander. Do you know how to do that?

For the extracted files, i developed a simple program to extract them. Please note that I only take in consideration the Msg.xxb file, wich contains strings. Maybe the PAPA files have a standard format, but I don't have figured it out.

To extract the files, just drag and drop the PAPA file in the executable, or on the command line write 3ds.exe <inputFile>.

https://mega.co.nz/#!iZ5yBZyY!MjgGLb8ii ... T8eHRR6qv4

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 5:03 pm
by ChrisX930
ekanspt wrote:So the xxb files you can extract with multiex commander. Do you know how to do that?

For the extracted files, i developed a simple program to extract them. Please note that I only take in consideration the Msg.xxb file, wich contains strings. Maybe the PAPA files have a standard format, but I don't have figured it out.

To extract the files, just drag and drop the PAPA file in the executable, or on the command line write 3ds.exe <inputFile>.

https://mega.co.nz/#!iZ5yBZyY!MjgGLb8ii ... T8eHRR6qv4
Yes, I know how to extract the xbb-files with multiex commander :)
Did it already and tried your 3ds.exe for decrypting "PlayerAvatarData.xbb/PlayerBodyData/" and got a clean txt!
it seems to work for all the papa-files.
https://hackpad.com/PlayerBodyData.papa-XYdnMUGrVrv

This is really great! :D

Are you able to make a papa-repacker and xbb-repacker to add new things to the game?
Want to add a new AvatarBody (Character Outfit INgame) to the game. I have to add new lines to the papa-files like this one
PlayerBody
CUSTOM_OUTFIT
b_999


EDIT: For some pp-files, it seems that the 3ds.exe don't decrypt all needed infos.
In AvatarBodyData, it forgets the Object Name
Image

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 5:19 pm
by ekanspt
It may work for all PAPA files but some have additional data that isn't considered in extraction.

For instance in FlowerList.xxb/FlowerData extracts (i think):

Code: Select all

FlowerGroup
FLOWER_GROUP_00
ITEM_TULIP
But it has some more information:
ITEM_RED_ROSE
ITEM_GARBERA

So as I said, I think that it extracts all the information from Msg.xbb PAPA files, but not from others. If you want I can help you, but you have to take a look with me to this files.

I think that yes, I can make the repackers, I will start with the xbb repacker.

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 5:22 pm
by ChrisX930
ekanspt wrote:It may work for all PAPA files but some have additional data that isn't considered in extraction.

For instance in FlowerList.xxb/FlowerData extracts (i think):

Code: Select all

FlowerGroup
FLOWER_GROUP_00
ITEM_TULIP
But it has some more information:
ITEM_RED_ROSE
ITEM_GARBERA

So as I said, I think that it extracts all the information from Msg.xbb PAPA files, but not from others. If you want I can help you, but you have to take a look with me to this files.

I think that yes, I can make the repackers, I will start with the xbb repacker.
Yes, I tried this with AvatarBodyData already and it doesn't extract all the informations.
Sure, tell me what I have to do

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 5:32 pm
by ekanspt
So from the image that you posted, there are some script files associated with xbb/papa files? I don't know anything from 3DS file format, so I need the much information that I can get.

If you can post one of the scripts and the corresponding xbb file it would be a great help. :)

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 5:34 pm
by ChrisX930
ekanspt wrote:So from the image that you posted, there are some script files associated with xbb/papa files? I don't know anything from 3DS file format, so I need the much information that I can get.

If you can post one of the scripts and the corresponding xbb file it would be a great help. :)
Yes, some Scripts are associated with this files.

I uploaded a example :)

The Game is written in Squirrel Language with uncompiled scripts (.nut)

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 5:37 pm
by ekanspt
Can you post here the AvatarBodyData file?

Re: decompress xbb file from "Harvest Moon A new Beginning 3

Posted: Sun Mar 01, 2015 6:09 pm
by ChrisX930
ekanspt wrote:Can you post here the AvatarBodyData file?
Could you upload the source, too? want to see how this works :3