Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

How to extract ADPCM/PSF2 from Armored Core PS2 titles? (specifically Formula Front)

Featured Replies

I've been trying to find ways to extract Armored Core Formula Front in order to extract the music. So far, the only music that has been ripped by anyone is some of the menu music. None of the stage music or cutscene audios. Does anyone know how to reverse engineer PS2 Armored Core titles? I have no clue how to even start

  • Supporter

With file samples....

It's hard to get something from nothing... Post file samples. And not whole game.

Edited by h3x3r

  • Supporter

Here is bms for unpack.

###################################
get BaseFileName basename
get FileSize asize

get Sign uint32
get Unknown_0 uint32
get Unknown_1 uint32
get FileSize uint32
get ResourceCount uint32
get Unknown_2 uint32
get Unknown_3 uint32
get Unknown_4 uint32

set MAX_OUT long 0
set MAX_IN long 0

for i = 0 < ResourceCount
    get ResourceId uint32
    get ResourceOffset uint32
    get ResourceSize uint32
    get Unknown_0 uint32
    string FileName p= "%s/%u.dat" BaseFileName ResourceId
    savepos cPos

    goto ResourceOffset
    getdstring LZSSSign 0x8

    if LZSSSign == "fsliblzs"
        callfunction DECOMPRESS_FSLIBLZS 1
    else
        log FileName ResourceOffset ResourceSize
    endif
    goto cPos
next i

startfunction DECOMPRESS_FSLIBLZS
    getdstring Dummy 0x8
    get ZSIZE uint32
    getdstring Dummy 0xC
    endian big
    getdstring Dummy 0x4
    get SIZE uint32
    getdstring Dummy 0x4
    endian little

    savepos DATA_POS
    math ZPAYLOAD = ZSIZE
    math ZPAYLOAD -= 44

    log MEMORY_FILE2 DATA_POS ZPAYLOAD

    if SIZE > MAX_OUT
        putvarchr MEMORY_FILE SIZE 0
        set MAX_OUT long SIZE
    endif

    set IN long 0
    set OUT long 0

    for
        if IN >= ZPAYLOAD || OUT >= SIZE
            break
        endif

        getvarchr FLAGS MEMORY_FILE2 IN
        math IN += 1

        for BIT = 0 < 8
            if IN >= ZPAYLOAD || OUT >= SIZE
                break
            endif

            math IS_REF = FLAGS
            math IS_REF &= 1
            math FLAGS >>= 1

            if IS_REF == 0
                getvarchr B MEMORY_FILE2 IN
                math IN += 1
                putvarchr MEMORY_FILE OUT B
                math OUT += 1
            else
                getvarchr B0 MEMORY_FILE2 IN
                math IN += 1
                getvarchr B1 MEMORY_FILE2 IN
                math IN += 1

                math SRC = B0
                math SRC <<= 4
                math TMP = B1
                math TMP >>= 4
                math SRC |= TMP

                math LEN = B1
                math LEN &= 0x0F
                math LEN += 1

                if OUT >= 4096
                    math SRC += OUT
                    math SRC -= 4096
                endif

                math REMAIN = SIZE
                math REMAIN -= OUT
                if LEN > REMAIN
                    set LEN long REMAIN
                endif

                math SRC_END = SRC
                math SRC_END += LEN
                if SRC_END <= OUT
                    goto SRC MEMORY_FILE
                    getdstring CHUNK LEN MEMORY_FILE
                    goto OUT MEMORY_FILE
                    putdstring CHUNK LEN MEMORY_FILE
                    math OUT += LEN
                else
                    for K = 0 < LEN
                        getvarchr V MEMORY_FILE SRC
                        putvarchr MEMORY_FILE OUT V
                        math SRC += 1
                        math OUT += 1
                    next K
                endif
            endif
        next BIT
    next

    log FileName 0 SIZE MEMORY_FILE
endfunction

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.