Home Blog Forum Wiki About Discord
Welcome Guest [Log In] [Register]
Add Reply
Persona 4 Golden Script; a script for use with QuickBMS
Topic Started: Jan 28 2016, 10:17 AM (1,156 Views)
ThatTrueStruggle
Member Avatar
Programming Team
Code:
 

get ext extension
if ext == "amd"
callfunction AMD
elif ext == "pac"
callfunction PAC
elif ext == "arc"
callfunction PAC
elif ext == "bin"
callfunction BIN
else
print "Not a supported file format! Make sure the extension is correct!"
endif

startfunction AMD
idstring "CHNK"
get FileCount long
idstring "MODEL_DATA"
get NULL long
get UNK long
get NULL short
for i = 0 < FileCount
get SIZE long
savepos OFFSET
get NAME basename
string NAME += ".gmo"
log NAME OFFSET SIZE
math OFFSET + SIZE
goto OFFSET
next i
endfunction

startfunction PAC
goto 0
get FileCount long
for i = 0 < FileCount
getdstring NAME 0x20
get SIZE long
savepos OFFSET
log NAME OFFSET SIZE
math OFFSET + SIZE
goto OFFSET
next i
endfunction

startfunction BIN
get Identifier long
if Identifier == 0x64
callfunction PSCPersonaBasic
else // not a PSCPersonaBasic.bin
goto 0
get FILENAME string
strlen FILENAMESZ FILENAME
if FILENAMESZ > 0 // old persona bin
callfunction OLDPersonaBin
else // newest bin type
callfunction PAC
endif
endfunction

startfunction PSCPersonaBasic
goto 4
get FileCount long
for i = 0 < FileCount
get OFFSET long
get NAME basename
string NAME += OFFSET
get SIZE long
log NAME OFFSET SIZE
next i
endfunction

startfunction OLDPersonaBin
goto 0
for
get NAME string
do
get NULL byte
while NULL == 0
savepos OFFSET
math OFFSET - 1
goto OFFSET
get SIZE long
savepos OFFSET
log NAME OFFSET SIZE
math OFFSET + SIZE
goto OFFSET
next
endfunction


This script here supports most of the formats in Persona 4 Golden. It'll select the proper extraction type for extracting the format. Make sure that the extension is proper; Don't change it!
Edited by ThatTrueStruggle, Jan 28 2016, 03:30 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · P3/4 Tools · Next Topic »
Add Reply