News: 11 March 2016 - Forum Rules

Author Topic: Getting things out of a bin file  (Read 715 times)

SK91

  • Newbie
  • *
  • Posts: 1
    • View Profile
Getting things out of a bin file
« on: September 04, 2020, 09:37:20 pm »
As I've read, bin files don't exactly indicate one set type of file
in this case I'm working with audio from a PSP game, of course I don't think tools for this sort of thing exist since they're specific, so how would I be able to find out what the audio is and how to get the BGM out of the file?

Jorpho

  • Hero Member
  • *****
  • Posts: 5069
  • The cat screams with the voice of a man.
    • View Profile
Re: Getting things out of a bin file
« Reply #1 on: September 05, 2020, 01:56:22 pm »
Can you be more specific about what you have done so far?  Because there are many, many threads on PSP hacking and extracting data from PSP .bin files.
https://www.romhacking.net/forum/index.php?topic=27787.0
http://www.romhacking.net/forum/index.php?topic=14729
http://www.romhacking.net/forum/index.php?topic=30899.0
https://www.romhacking.net/forum/index.php?topic=15341.0
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

[Unknown]

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
    • PPSSPP
Re: Getting things out of a bin file
« Reply #2 on: September 05, 2020, 11:38:53 pm »
I recommend using PPSSPP, and enabling logging of SCEIO, SCEATRAC, SCESAS, SCEMP3, and SCEAUDIO.  Most likely the music will be decoded at some point through sceAtrac or sceSas, although this isn't for sure.  It's uncommon, but some games decode their audio themselves.

In a simple case, the game may just read to audio into memory using sceIo functions, and then send it to the decoder.  In more complex scenarios, it may stream it from file.  Either way, you're likely to see an sceIoRead or similar soon before the audio is decoded and played.  And before that, an sceIoLseek.

That sceIoLseek would tell you where in the file to look.

You can also search for magic bytes.  Unfortunately, you'll often see games decompress or otherwise unpack from some file, so the exact storage in the bin file is not sure.

For example, imagine you found someone's lost laptop.  This question is akin to "How do I get their name from their Documents folder?"  It seems like "bin" ought to really narrow down the question, but it doesn't at all.  That is just PSP game speak for "document".  It could have anything in it: Word docs, OpenOffice docs, images, music, who knows.  It could even be a zip file (or something like one) of more documents.  All of these are perfectly valid bin files.

Just to warn you, there's unfortunately no law mandating file extensions.  For example, I could create an MP3, build a PSP game that plays it, and name the MP3 file disc0:/PSP_GAME/USRDIR/characters/npc.img.  Even if a professional developer did this, no one would take away their developer license.  If it helped them deliver the game by the deadline, they might even get promoted for doing it.

The bin extension means absolutely nothing.  Usually, "pmf", "prx", "mp3", "sfo", "png", and "at3" mean something... it's uncommon for them to be lies.  But unlike PCs, no other extensions are really defined for PSP games.  They mean whatever crazy thing the developer had in their brain while they were writing the code.  No one but the developer can tell you what "bin" meant.  There's no official "bin" format.

-[Unknown]