Jump to content

[LeapFrog] .arc file


applecuckoo
Go to solution Solved by BloodRaynare,

Recommended Posts

I haven't written bms scripts for a while so I already forgot how to do it lol, but I can describe the structure of the archive maybe someone will write the script, as the structure is pretty simple. 

It's compressed with MSF algo.

Structure is 

Size long 

Zsize long

Compressed chunk(this is the actual TOC)

TOC structure is also pretty simple

FileName (null-determined string)

Relative offset long

Size long (oddly enough there is only an uncompressed size, so to determine Zsize you need to read the offset of the next file).

That's all. Some files aren't compressed as I saw there a couple of plain PNG and XML files.

 

 

Edited by Thief1987
  • Like 1
Link to comment
Share on other sites

  • Solution

Thanks for the tip @Thief1987, To @applecuckoo, here's your QuickBMS script:
 

## My Little Pony: Friendship is Magic (LeapFrog) - data.arc extraction script by BloodRaynare
## For use with QuickBMS

comtype msf

get TOC_SZ long
get TOC_ZSZ long
savepos TMP
log MEMORY_FILE 0 0
clog MEMORY_FILE TMP TOC_ZSZ TOC_SZ
xmath BASE_OFF "TMP + TOC_ZSZ"

for i = 0
	savepos TOC_POS MEMORY_FILE
	if TOC_POS >= TOC_SZ
		break
	endif
	get NAME string MEMORY_FILE
	get OFFSET long MEMORY_FILE
	get SIZE long MEMORY_FILE
	math OFFSET + BASE_OFF
	putarray 0 i NAME OFFSET SIZE
next i
math FILES = i

get ARC_SZ asize

for i = 0 < FILES
	getarray NAME OFFSET SIZE 0 i
	math i + 1
	if i == FILES
		xmath ZSIZE "ARC_SZ - OFFSET"
	else
		getarray NEXT_OFFSET 1 i
		xmath ZSIZE "NEXT_OFFSET - OFFSET"
	endif
	if ZSIZE == SIZE
		log NAME OFFSET SIZE
	else
		clog NAME OFFSET ZSIZE SIZE
	endif
next

 

  • Like 1
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...