It is the same format as Kingdom under fire Age of Storm. (Nif models)
Some of these xor keys might be wrong but the ones that matter work and i dint feel like figuring out the others.
http://kof.gg.in.th/home/default.aspx
Code: Select all
open FDDE kof 0
open FDDE kpf 1
get files long 1
math files - 1
putarray 0 0 "\"
goto 0xE 1
for i = 0 < files
get type long 1
get index long 1
savepos nstart 1
findloc nsize string \x00\x00 1
math nsize - nstart
math nsize + 3
getdstring uname nsize 1
set name unicode uname
string name + \
putarray 0 i name
#print "%name%"
next i
get ver long
get start long
get unk1 long
get unk2 long
get asize longlong
get files long
for i = 0 < files
get fldr long
get hash long
savepos nstart
findloc nsize string \x00\x00
math nsize - nstart
math nsize + 3
getdstring uname nsize
set name unicode uname
get offset long
get size long
if size != 0
log MEMORY_FILE offset size
set EXT extension name
get key long MEMORY_FILE
if EXT == "kf"
math key ^ 0x656D6147
elseif EXT == "asi"
math key ^ 0x00905A4D
elseif EXT == "avi"
math key ^ 0x46464952
elseif EXT == "bdr"
math key ^ 0x4C49667B
elseif EXT == "bmp"
goto 0x2C MEMORY_FILE
get key long MEMORY_FILE
elseif EXT == "cache"
math key ^ 0x5047694E
elseif EXT == "dds"
math key ^ 0x20534444
elseif EXT == "ecs"
goto 0x10 MEMORY_FILE
get key long MEMORY_FILE
elseif EXT == "env"
math key ^ 0x00000003
elseif EXT == "flt"
math key ^ 0x00905A4D
elseif EXT == "fxo"
math key ^ 0xFEFF0901
elseif EXT == "h"
math key ^ 0x74000F0F
elseif EXT == "kcs"
goto 0x10 MEMORY_FILE
get key long MEMORY_FILE
elseif EXT == "kfm"
math key ^ 0x6D61473B
elseif EXT == "nff"
math key ^ 0x0046464E
elseif EXT == "nif"
math key ^ 0x656D6147
elseif EXT == "nsb"
math key ^ 0x0062736E
elseif EXT == "list"
math key ^ 0x1C9F9BCF
elseif EXT == "settings"
goto 0xC MEMORY_FILE
get key long MEMORY_FILE
elseif EXT == "ogg"
math key ^ 0x5367674F
elseif EXT == "kfl"
math key ^ 0x4D581F1C
elseif EXT == "gsa"
math key ^ 0x4D581F1C
elseif EXT == "ado"
math key ^ 0x4D581F1C
elseif EXT == "npc"
math key ^ 0x4D581F1C
elseif EXT == "scs"
goto 0x10 MEMORY_FILE
get key long MEMORY_FILE
elseif EXT == "tga"
get tmp asize MEMORY_FILE
math tmp - 16
goto tmp MEMORY_FILE
get key long MEMORY_FILE
math key ^ 0x49564555
elseif EXT == "ttf"
math key ^ 0x00000100
elseif EXT == "fig"
math key ^ 0x63627566
elseif EXT == "hlsl"
math key ^ 0x4E494C03
elseif EXT == "wav"
math key ^ 0x46464952
elseif EXT == "xml"
math key ^ 0x4D581F1C
elseif EXT == "db"
goto 12 MEMORY_FILE
get key long MEMORY_FILE
elseif EXT == "mpf"
set key 0
math key ^ 0x0
elseif EXT == "lua"
set key 0
math key ^ 0x0
elseif EXT == "txt"
set key 0
math key ^ 0x0
elseif EXT == "yui"
set key 0
math key ^ 0x0
elseif EXT == "ifl"
set key 0
math key ^ 0x0
else
print "%EXT% is unsupported"
endif
filexor key
math fldr - 1
getarray name2 0 fldr
string name2 + name
log NAME2 0 SIZE MEMORY_FILE
filexor ""
set key 0
endif
next i