Need .bms file for Ace Attorney Spirit Of Justice

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Fr4nz
Posts: 2
Joined: Sat Apr 11, 2020 12:01 pm

Need .bms file for Ace Attorney Spirit Of Justice

Post by Fr4nz »

I need .bms for Ace Attorney Spirit of Justice for decrypt .obb file. Can anyone help me?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need .bms file for Ace Attorney Spirit Of Justice

Post by aluigi »

There is already a script for that game and format on my website, have you tried it?
http://aluigi.org/bms/ace_attorney_obb.bms
Fr4nz
Posts: 2
Joined: Sat Apr 11, 2020 12:01 pm

Re: Need .bms file for Ace Attorney Spirit Of Justice

Post by Fr4nz »

aluigi wrote:There is already a script for that game and format on my website, have you tried it?
http://aluigi.org/bms/ace_attorney_obb.bms

Ok it's work, but when I modify a text and switch the original .obb file with the modified .obb file the game doesn't start. Anyway thanks your help
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need .bms file for Ace Attorney Spirit Of Justice

Post by aluigi »

There is a field in each entry that is used for, probably, the hash of the filename, but it's also possible that it's 32bit checksum for filename and 32bit for the checksum of the content of the file.
So when you edit the file the game refuses to use it because the checksum is different.
I can't help because there are various algorithms for calculating these checksums and in any case you should manually fix it by your own after reimporting (obviously if that's the reason and it's not caused by checking the hash of the whole obb against an hash stored somewhere else).
TakingOver
Posts: 1
Joined: Sun Mar 13, 2022 7:52 am

Re: Need .bms file for Ace Attorney Spirit Of Justice

Post by TakingOver »

aluigi wrote:There is a field in each entry that is used for, probably, the hash of the filename, but it's also possible that it's 32bit checksum for filename and 32bit for the checksum of the content of the file.
So when you edit the file the game refuses to use it because the checksum is different.
I can't help because there are various algorithms for calculating these checksums and in any case you should manually fix it by your own after reimporting (obviously if that's the reason and it's not caused by checking the hash of the whole obb against an hash stored somewhere else).


I guess I'm pretty late, but anyway. Well, this script works fine until I'm trying to insert files which're bigger than original ones (at least in my case). I tried both reimport2 and reimport3, but the game won't start. So I think checksums are not a problem there (I'm definetly not an expert though, so I may be wrong).

Is there something from the reimport2 exceptions list in Ace Attorney DD/SoJ .obb format or the problem here is something else?

P.S. I'm talking about this “exceptions list”:
The reimport2 method doesn't work if:
- the TOC is compressed or located on a MEMORY_FILE
- the TOC/magic is (relatively) located at the end of the archive
- the content is sequential, so there is no offset
- the 3 fields mentioned above are very different than those
originally read from the TOC, in this mode only one maximum
"math" operation is allowed on the variable which means that the
following example works:
get OFFSET long ; math OFFSET * 0x800 ; log NAME OFFSET SIZE
while this example produces an incorrect OFFSET field:
get OFFSET long ; math OFFSET * 0x800 ; math OFFSET + BASE_OFF ; log NAME OFFSET SIZE
the same is valid for the size fields too, anyway note that
"offset" is rewritten only if the new file is bigger than before
- the game strictly trusts the original size of the archive and
ignores data appended to it, for example some archives may have a
field in the TOC that specifies the size of the archive
- SLog is implemented but may not work with some archives
- the archive is subject to other limits described below, excluded
the advantages listed before