## SCRIPT BY 누구야

get TBL_FILENAME filename
get TBL_BASENAME basename
get TBL_EXTENSION extension
get TBL_FILESIZE asize

xmath LINES "TBL_FILESIZE / 0x454"

log MEMORY_FILE 0 0
log MEMORY_FILE2 0 0
log MEMORY_FILE3 0 0

for i = 0 < LINES
    codepage 932

    get UNKNOWN0 short
    put UNKNOWN0 short MEMORY_FILE

    getdstring ID 0x10
    putdstring ID 0x10 MEMORY_FILE

    get BLANK0 byte
    put BLANK0 byte MEMORY_FILE

    getdstring NAME 0x20
    log MEMORY_FILE2 0 0
    put NAME string MEMORY_FILE2
    get MEMORY2_SIZE asize MEMORY_FILE2
    goto 0 MEMORY_FILE2
    getdstring NAME MEMORY2_SIZE MEMORY_FILE2
    putdstring NAME 0x20 MEMORY_FILE

    log MEMORY_FILE3 0 0
    put 0x20 byte MEMORY_FILE3
    put NAME string MEMORY_FILE3
    get MEMORY3_SIZE asize MEMORY_FILE3
    goto 0 MEMORY_FILE3
    getdstring NAME_DP MEMORY3_SIZE MEMORY_FILE3

    get BLANK1 byte
    put BLANK1 byte MEMORY_FILE

    for j = 0 < 0x420
      get VALUE byte
      put VALUE byte MEMORY_FILE
    next j

    if ID != ""
      print "%UNKNOWN0|X% : %ID%%NAME_DP%"
    endif
next i


get MEMORY1_SIZE asize MEMORY_FILE
xmath CUT_SIZE "TBL_FILESIZE - MEMORY1_SIZE"

#string EXT_NAME0 = "TBL-CLEAN\"
string EXT_NAME0 = TBL_FILENAME

log EXT_NAME0 0 MEMORY1_SIZE MEMORY_FILE
#append
#log EXT_NAME0 MEMORY1_SIZE CUT_SIZE
#append


cleanexit
