Commandos

From XentaxWiki
Jump to: navigation, search

Choose archive extension:

DIR


Format Specifications

// for each file

char {32}    - Filename (null)
uint32 {4}   - Entry Type ID
uint32 {4}   - File Length
uint32 {4}   - Data Offset


if (entryTypeID == -842150401){
// End of current directory marker
}


else if (entryTypeID == -842150655){
// Start of sub-directory marker
// repeat from "// for each file"
}


else {
// file
}


MultiEx BMS Script

set EOF long 1
set HEAD long 0
set TAIL long 0
set PATH string ""

do
    
    getdstring NAME 32
    get TYPE byte
    padding 4
    get SIZE long
    get OFFSET long
    
    if TYPE == 0
        # file
        set FNAME string PATH
        string FNAME += NAME
        log FNAME OFFSET SIZE
    elif TYPE == 1 
        # directory
        set FNAME string PATH
        string FNAME += NAME
        string FNAME += \
        putarray TAIL 0 FNAME
        math TAIL += 1
        math EOF += 1
    else
        # end of current directory
        getarray PATH HEAD 0
        math HEAD += 1
        math EOF -= 1
    endif
    
while EOF > 0

Compatible Programs