Operator`s Side/Lifeline - os.fat/os.snp

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Operator`s Side/Lifeline - os.fat/os.snp

Post by AnonBaiter »

So, I get to write this script:

Code: Select all

open FDDE "fat" 0
open FDDE "snp" 1

idstring "\x20fat"
get DUMMY01 long
get DUMMY02 long

goto 0x80

set NAME string ""
set PATH string ""
callfunction EXTRACT 1

startfunction EXTRACT
   string PATH + NAME
   string PATH + /
   for i = 0 < DUMMY02
      getdstring NAME 0x10
      get SIZE long
      get DUMMY04 long
      get OFFSET long
      get DUMMY06 long
      get TYPE long
      get PREVDIR long
      get DUMMY09 long
      get CURRDIR long
      math PREVDIR / 40
      math DUMMY09 / 40
      math CURRDIR / 40
      putarray 0 i PREVDIR
      putarray 1 i DUMMY09
      putarray 2 i CURRDIR
      if TYPE == 0x10
         math OFFSET * 0x800
         callfunction EXTRACT 1
      else
         math OFFSET * 0x800
         string NAME p= "%s%s" PATH NAME
         log NAME OFFSET SIZE 1
      endif
   next i
endfunction EXTRACT
...and because this is my first time writing a script based on a nested archive structure, turns out I`m just not that good.

Here is a sample.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Operator`s Side/Lifeline - os.fat/os.snp

Post by aluigi »

Yeah it was one of those boring nested archives difficult to handle.
Script:
http://aluigi.org/bms/lifeline.bms
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Operator`s Side/Lifeline - os.fat/os.snp

Post by AnonBaiter »

At least it was one of the easiest.