Hacking Trying to convert a .bin file to an image

AnonymousWaddleDee

Member
OP
Newcomer
Joined
Jul 13, 2023
Messages
15
Trophies
0
Age
22
XP
99
Country
United States
Hello, I'm here to ask another question for my Apollo Justice: Ace Attorney (DS) project.

Apollo Justice has two folders, cpac_2d.bin for various 2D assets and cpac_3d.bin for (presumably) 3D assets. However, there's a certain image that I've been looking for (a UI button), and I found that it was stored in cpac_3d.bin. Assuming that the developers aren't just messing with me, that must mean that this UI button, which I thought was a 2D image, is actually 3D. So my working theory is that it's a texture on a flat model to make the button's animations easier. The 3D folder has two subarchives. The second is the standard model, texture, and animation formats, but the first is all this .bin format that I can't figure out.

The problem is that it's not any known SDK or other format, it's a generic .bin file, and it has no magic ID. The format of the .bin file is simple, like this:
- A 0x14 byte header with information about header length, palette offset, palette size, and image length. I haven't been able to interpret what the first four bytes of the header are for, but they correspond to the image length.*

- The pixel data of length specified in the header, either 4bpp or 8bpp.

- The palette comes at the bottom of the file. It's usually 0xC0 long, containing six different individual palettes for the button to use in its animations.

My question is, what kind of file am I looking at, and how do I convert it into the UI button I see in-game? Could it be a texture on a flat model, or is it a 2D image even though it's in the 3D folder? It's worth noting that the format is similar to other 2D images in the game, but unlike those, the image converter program from the phoenix-tools github project isn't able to convert it into an image. It produces something with the correct colors, but which is completely illegible and looks nothing like the UI button actually does. I'm planning to write my own conversion program so I can edit it, but I need to know what type of file this is first. I have minimal experience with 3D, if this actually is 3D, so I'm a little stuck.

I'd appreciate any help. Let me know if you need more information.


*I've seen these correspondences between the first four bytes of the header and image length in bytes. At first I assumed this part of the header was for dimensions, but the first example rules that out, because a dimension can't be 0.
03 00 00 00 = 0x20
03 04 01 00 = 0x400
03 04 02 00 = 0x800
03 05 02 00 = 0x1000
03 05 03 00 = 0x2000
04 05 03 00 = 0x4000
03 05 05 00 = 0x8000
04 05 05 00 = 0x10000
Post automatically merged:

I wanted to add a slightly related question, since I mentioned 3D: what's the best way to import a custom model into a ROM? I know converting to .nsbmd format isn't easy, but what are the options?
 
Last edited by AnonymousWaddleDee,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • S @ salazarcosplay:
    hunter x hunter
  • S @ salazarcosplay:
    he has not allowed anyone to continue it for him for example
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, theres a dragon ball af mod for budokai 3
  • Xdqwerty @ Xdqwerty:
    updated ship of harkinian, gonna install some hd texture pack
  • Xdqwerty @ Xdqwerty:
    I might download rayman revolution for my ps3
  • BigOnYa @ BigOnYa:
    I may try the new ram site, and download more RAM to my Switch. Not sure if ddr3 is the right ram
    for it tho. Edit- no it uses floppy Ram, just like @AncientBoi
    +1
  • Xdqwerty @ Xdqwerty:
    aeiou
  • BigOnYa @ BigOnYa:
    And sometimes Z
  • SylverReZ @ SylverReZ:
    @K3Nv2, MAGA supporters be wearing tin foil hats lol.
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, whats maga?
  • BigOnYa @ BigOnYa:
    It stands for Maniacs Against General Acceptance
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, people rejecting general consensus about stuff?
    +1
  • BigOnYa @ BigOnYa:
    Yup, nuh its really just Trump followers
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, im not american so i dont care about trump
    +1
  • Xdqwerty @ Xdqwerty:
    or us elections
  • BigOnYa @ BigOnYa:
    Me niether, us north Koreans don't care
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    i don't care either, even if i'm american
  • BakerMan @ BakerMan:
    truth be told, i agree with psi, i dislike both candidates, but i'd probably vote trump simply because the economy was better during his presidency
  • AngryCinnabon @ AngryCinnabon:
    Just be careful, if trump ends up winning and using project 2025 America might really change...for the worse.
  • AngryCinnabon @ AngryCinnabon:
    I'm not american and even that sends shivers down my spine.
  • AngryCinnabon @ AngryCinnabon:
    anything that offers trump an opportunity to become an actual dictator
    is bad in my book, i could care less if it wasn't for that...
  • K3Nv2 @ K3Nv2:
    Canada: America's Russia
  • NinStar @ NinStar:
    people are so dramatic that I can't even tell if they are being serious
    NinStar @ NinStar: people are so dramatic that I can't even tell if they are being serious