Jump to content

Star Wars: Anakin's Speedway (PC) .dat


Puterboy1
Go to solution Solved by AlphaTwentyThree,

Recommended Posts

  • Engineer
  • Solution

Checked out the game files and after a LOT of trial and error, here's a working script. The reason it got complicated was because there's sometimes an additional random zero byte after the name and I had to implement some serious heuristics to get the proper data out of there.

# Luca Learning Ltd. - DAT extractor
# 
# (c) 2024-02-25 by AlphaTwentyThree of ResHax
# script for QuickBMS http://quickbms.aluigi.org

get FSIZE asize
get TOC long
goto TOC
get DUMMY short
get UNK1 long
get FOLDERS long
set CURROFF 4 # for heuristics

for i = 0 < FOLDERS
	savepos MYOFF
	get TEST byte
	if TEST != 0 # re-align
		goto MYOFF
	endif
	getDstring F1 1
	getDstring F2 1
	getDstring F3 1
	getDstring F4 1
	string FOLDER p= "%s%s%s%s" F4 F3 F2 F1
	get SECSIZE long
	get FILES long
	print "%FOLDER%: %FILES% files"
	
	for k = 1 <= FILES
		savepos MYOFF
		get DUMMY byte
		goto MYOFF
		callfunction getBLOCK 1
		xmath TEST "OFFSET + SIZE"
		if (OFFSET < 0 || TEST > FSIZE || NAMEL > 20 || OFFSET != CURROFF) && DUMMY = 0
			goto MYOFF
			get DUMMY byte
			callfunction getBLOCK 1
		endif

		getDstring NAME NAMEL
		string NAME p= "%s/%s" FOLDER NAME
		log NAME OFFSET SIZE
		math CURROFF += SIZE
	next k
next i

startfunction getBLOCK
	get OFFSET long
	get SIZE long
	get NAMEL byte
endfunction

 

Edited by AlphaTwentyThree
final script
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...