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.
  • K3Nv2 @ K3Nv2:
    Crazy people actually spend $50 on that stuff
  • BigOnYa @ BigOnYa:
    Towelie runs my farm, he's awesome.
  • SylverReZ @ SylverReZ:
    @K3Nv2, Polly is still around from what I've heard.
  • K3Nv2 @ K3Nv2:
    @SylverReZ, is Pollys alt I knew it
  • BigOnYa @ BigOnYa:
    Yea I see him every once whi!e , incognito
  • SylverReZ @ SylverReZ:
    @K3Nv2, I'm not him. Keep looking.
    +1
  • K3Nv2 @ K3Nv2:
    Still don't know why he left unless someone really hurt his feelings
  • K3Nv2 @ K3Nv2:
    Don't know why people get so emotional online just get over it ffs
    +2
  • BigOnYa @ BigOnYa:
    He was the ass of gbatemp, everyone knocked on him, I honestly felt bad, even though I was guilty myself, but he egged it all on himself,
  • BigOnYa @ BigOnYa:
    But he still here, but under dif name, he pm me sometimes still even.
  • K3Nv2 @ K3Nv2:
    It's like they think we'll be in their bed pissing on it the next day
  • BigOnYa @ BigOnYa:
    I feel like gbatemp should make t-shirts or memorabilia to remember the lost ones. I bet the Polly shirts would sell out quick.
  • K3Nv2 @ K3Nv2:
    Nah that could actually bring lawsuits
  • K3Nv2 @ K3Nv2:
    Tempsuits
  • BigOnYa @ BigOnYa:
    PollySuits
  • BigOnYa @ BigOnYa:
    Your correct, Somebody would be guilty and there would be riots, then they storm the gbatemp capitol,
  • K3Nv2 @ K3Nv2:
    Online or not there are still certain rights that judges would have no issue handing out a warrant over
  • K3Nv2 @ K3Nv2:
    Just look at Kim dotcom
  • BigOnYa @ BigOnYa:
    Honestly I'm scared to, from you, but ok, lemme turn on vpn, virtual machine, private browser first
  • K3Nv2 @ K3Nv2:
    Remember that Alexa robot I gifted you
  • K3Nv2 @ K3Nv2:
    And that laptop Webcam you never tapped up
  • BigOnYa @ BigOnYa:
    That robot is here somewhere, I hear it moving around at night, but I haven't seen it for months.
  • BigOnYa @ BigOnYa:
    Oh that laptop I give to ancientboi, so you been watching him for months, and he's been watching you
  • K3Nv2 @ K3Nv2:
    Oh good more than enough material for the fbi
    +1
  • BigOnYa @ BigOnYa:
    Damn its 5 in morn, I gotta Go wake your mum and send her to work. Check ya later.
    BigOnYa @ BigOnYa: Damn its 5 in morn, I gotta Go wake your mum and send her to work. Check ya later.