ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Jan 22, 2019 11:58 pm

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 10, 2019 8:41 pm 

Joined: Thu Jan 10, 2019 8:38 pm
Posts: 1
Hello,
I rewrote the script for root.pfs archives.
Only tested on a single game though. Can you please add it to the compendium?

artemis-root-pfs.bms
Code:
# Generic Artemis Engine (root.pfs.*) v1.0
# Based on initial work by aluigi for Amnesia: Memories and Norn9
# script for QuickBMS https://aluigi.altervista.org/quickbms.htm or https://aluigi.zenhax.com/

# Credits to @GARbro for figuring out the XOR key calculation
# https://github.com/morkt/GARbro/blob/12bbd3a3/ArcFormats/Artemis/ArcPFS.cs#L101

QuickBMSver 0.7.3

# SHA1 hash length (160 bits)
math KEYSZ = 20

# Example for Noraneko Heart HD (NSW)
#get NAME filename
#if NAME == "root.pfs"
#    set KEY binary "\xB7\x36\x16\xDD\x3F\xE1\x0A\xF1\x22\x06\xAD\x3C\xB6\x67\x80\x72\x46\x25\x7A\x61"
#elif NAME == "root.pfs.000"
#    set KEY binary "\x83\x3D\xCB\x3D\xD8\x7D\x70\xD4\x9C\xCE\x2E\x25\xCC\xAB\x89\x43\xFB\xD0\xE3\x36"
#elif NAME == "root.pfs.001"
#    set KEY binary "\xDB\x1E\x30\x29\x7B\x8C\xC7\x58\xE1\xD7\x33\xD0\xC4\x66\x36\x87\x62\xC6\xE6\xDF"
#elif NAME == "root.pfs.002"
#    set KEY binary "\x8D\x98\xA0\x17\x31\x14\xD1\x04\xE7\x72\xFF\xC1\xA3\x60\x6E\xEC\x59\x64\x37\xC7"
#elif NAME == "root.pfs.003"
#    set KEY binary "\xD7\x98\x0D\x0E\x54\x83\x44\x90\x2C\x4C\x0D\xC9\x11\x0E\x76\x25\x94\x31\xEB\x29"
#endif

idstring "pf"
getdstring VER 1    # '6', '8' and so on
if VER == "8"
    codepage 932
endif

get INFO_SIZE long
SavePos INFO_OFFSET
Log MEMORY_FILE INFO_OFFSET INFO_SIZE
Encryption sha1 MEMORY_FILE
Log MEMORY_FILE 0 0
print "KEY %QUICKBMS_HEXHASH%"
GoTo INFO_OFFSET
get FILES long
for i = 0 < FILES
    get NAMESZ long
    getdstring NAME NAMESZ
    get ZERO long
    get OFFSET long
    get SIZE long

    set EXT extension NAME
    if EXT == "mp4"
    else
        encryption xor QUICKBMS_HASH 0 KEYSZ
    endif
    log NAME OFFSET SIZE
    encryption "" ""
next i


Top
   
PostPosted: Thu Jan 10, 2019 9:05 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9676
:D


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited