Final Fantasy Dimensions (.obb file decompression)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Hi there, since i'd like to translate this jrpg in italian, i'm looking for a method to do these things:

1. decompress this .obb file
2. extract all game texts and graphics from the resulting .dat files
3. reimport modified text and graphics into original .dat files
4. reimport modified .dat files into original .obb file

Does anybody know how to do this?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

Where samples?
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Ekey wrote:Where samples?


you mean the .obb file? here:

https://anonfile.com/Hcnf59U9n4/main.11 ... ffl_gp_obb
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

Code: Select all

# FINAL FANTASY DIMENSIONS II (Android / iOS version) OBB format
# script for QuickBMS http://quickbms.aluigi.org

set MEMORY_FILE10 string "
void iDecryptByOffset(unsigned char* lpBuffer, int dwOffset, int dwSize)
{
    int dwSeed = dwOffset + 567890;
    for (int i = 0; i < dwSize; i++)
    {
        dwSeed = 1103515245 * dwSeed + 12345;
        lpBuffer[i] ^= (dwSeed >> 24);
    }
}
"
savepos HEADER_OFFSET
math HEADER_SIZE = 20
log MEMORY_FILE HEADER_OFFSET HEADER_SIZE
calldll MEMORY_FILE10 "iDecryptByOffset" "tcc" RET MEMORY_FILE HEADER_OFFSET HEADER_SIZE

idstring MEMORY_FILE "ARC1"
get ARCHIVE_SIZE long MEMORY_FILE
get TABLE_OFFSET long MEMORY_FILE
get TABLE_ZSIZE long MEMORY_FILE
get CRC32_HASH long MEMORY_FILE

log MEMORY_FILE TABLE_OFFSET TABLE_ZSIZE
calldll MEMORY_FILE10 "iDecryptByOffset" "tcc" RET MEMORY_FILE TABLE_OFFSET TABLE_ZSIZE

get TABLE_SIZE long MEMORY_FILE
reverselong TABLE_SIZE
math TABLE_ZSIZE -= 4
clog MEMORY_FILE2 4 TABLE_ZSIZE TABLE_SIZE MEMORY_FILE

get FILES long MEMORY_FILE2
for i = 0 < FILES
  get NAME_OFF long MEMORY_FILE2
  get OFFSET long MEMORY_FILE2
  get ZSIZE long MEMORY_FILE2
  savepos TMP MEMORY_FILE2
  goto NAME_OFF MEMORY_FILE2
  get NAME string MEMORY_FILE2
  goto TMP MEMORY_FILE2
  callfunction EXTRACT_FILE 1
next i

startfunction EXTRACT_FILE
  log MEMORY_FILE3 OFFSET ZSIZE
  calldll MEMORY_FILE10 "iDecryptByOffset" "tcc" RET MEMORY_FILE3 OFFSET ZSIZE
 
  get SIZE long MEMORY_FILE3
  reverselong SIZE
 
  if ZSIZE == SIZE
     log NAME 0 SIZE MEMORY_FILE3
  else
     math ZSIZE -= 4
     clog NAME 4 ZSIZE SIZE MEMORY_FILE3
  endif
endfunction


This script for unpack obb from FINAL FANTASY DIMENSIONS II for Android / iOS. The formats are different and all that is known - data in your file is xored by 0x14
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

It doesn't work, FFD and FFD II got different structures.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

ExDuelist wrote:It doesn't work, FFD and FFD II got different structures.

Ekey wrote:This script for unpack obb from FINAL FANTASY DIMENSIONS II for Android / iOS. The formats are different and all that is known - data in your file is xored by 0x14
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Ekey wrote:
ExDuelist wrote:It doesn't work, FFD and FFD II got different structures.

Ekey wrote:This script for unpack obb from FINAL FANTASY DIMENSIONS II for Android / iOS. The formats are different and all that is known - data in your file is xored by 0x14


So what was the purpose in posting the FFD II script?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

Since you did not provide the file you want to unpack, I downloaded FINAL FANTASY DIMENSIONS II instead of FINAL FANTASY DIMENSIONS I by mistake.
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Ekey wrote:Since you did not provide the file you want to unpack, I downloaded FINAL FANTASY DIMENSIONS II instead of FINAL FANTASY DIMENSIONS I by mistake.


But i did. Anyway, if you manage to decompress it, let me know.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

I meant that you did not do this at the time of creating the topic. Anyway, If you asking about unpack / decrypt files and etc. then you must provide an example file at once.
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Ekey wrote:you must provide an example file at once.


??
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

What? You must provide an example file at during topic creation!
Image
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

I already posted the file in exam, what else i have to post?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by Ekey »

This must be done when creating a topic!
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Ekey wrote:This must be done when creating a topic!


Oh, ok.
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

up.
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Up up up!
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Up.

I won't give up.
ExDuelist
Posts: 18
Joined: Mon Feb 03, 2020 4:49 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by ExDuelist »

Help!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Final Fantasy Dimensions (.obb file decompression)

Post by aluigi »