Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Silent Hill: Shattered Memories *.arc

The Original Forum. Game archives, full of resources. How to open them? Get help here.
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

The contents of this post was deleted because of possible forum rules violation.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Silent Hill: Shattered Memories *.arc

Post by chrrox »

goto 0x4
get FILES long
goto 0x8

got i = 0 < FILES
get UNK01 long
get OFFSET long
get ZSIZE long
get SIZE long
if ZSIZE == SIZE
log i OFFSET ZSIZE
else
clog i OFFSET SIZE ZSIZE
endif
next i

this should be the correction
also if the compressed file starts with 78DA it is zlib.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Silent Hill: Shattered Memories *.arc

Post by chrrox »

you can also just run offzip Since there are no names.

is there a name table anywhere in the files?
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

I have several notes on your script:
  • why did you leave out the idstring? It works perfectly...
  • offset 0x08 holds the data start, 0x0C is always empty (so your script will always fail since the first file info starts at 0x10; apart from that, doesn't "goto 0x04" and "get FILES long" already set the cursor at 0x08?)
  • "got i=0<FILES" - correct would be "for i = 0 < FILES" (note the spaces!). But yes, I forgot to initialize i ;)
  • from 0x10 on: first comes the compressed size, then the uncompressed size (why did you just reverse it in your script? didn't you take a look at the sample?)
  • when the second size (uncompressed) equals ZERO (not ZSIZE==SIZE!), the files are (seemingly) uncompressed
So well, I corrected your script and it works now. I didn't notice that if no ComType is statet, QuickBMS assumes it as standard zip - nice to know! :)
Also thanks for the tip with offzip. However, it doesn't find all the zip blocks (1997 of 2007) and strangely stops extracting after 62 files... Well, never mind, seems to work now. :)

I've extracted 2007 files from the data.arc and also found the music. :) The names are inside each file for this but I don't know how I could find a name table unless I scan through every file...

Here's the working script; works for Wii and PS2! :)

Code: Select all

# game: Silent Hill: Shattered Memories
# files: DATA.ARC, IGC.ARC
# platforms: PS2, Wii, PSP
# (c) 2010 by AlphaTwentyThree

idstring "\x10\xfa\x00\x00"
get FILES long
math FILES -= 1

get DATASTART long
get DUMMY long

for i = 0 < FILES
   get DUMMY long
   get OFFSET long
   get SIZE long
   get ZSIZE long
   if ZSIZE == 0
      log i OFFSET SIZE
   else
      clog i OFFSET SIZE ZSIZE
   endif
 next i
Last edited by AlphaTwentyThree on Tue Mar 23, 2010 5:37 am, edited 1 time in total.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
tpu
beginner
Posts: 25
Joined: Thu Jul 09, 2009 7:42 am
Been thanked: 10 times

Re: Silent Hill: Shattered Memories *.arc

Post by tpu »

The ARC file only save the hash of file name.
the hash:

hash ^= name*33;
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

tpu wrote:The ARC file only save the hash of file name.
the hash:

hash ^= name*33;

Sorry, I'm not familiar with hash. Could you please explain this?
For example, if the hash name is 1E049456, what's the ASCII name?
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
User avatar
aluigi
VVIP member
VVIP member
Posts: 1916
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 664 times
Contact:

Re: Silent Hill: Shattered Memories *.arc

Post by aluigi »

this format looks exactly like the one reversed here (I noticed the 0xfa10 signature and remembered it):
viewtopic.php?p=34576#p34576
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

aluigi wrote:this format looks exactly like the one reversed here (I noticed the 0xfa10 signature and remembered it):
viewtopic.php?p=34576#p34576
Whoops... :oops: Didn't see that. :roll:
However, can you explain how to get the file names out of the hash value?
Thanks.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Silent Hill: Shattered Memories *.arc

Post by chrrox »

my mistake was in the log part i just had them reversed.
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

The contents of this post was deleted because of possible forum rules violation.
You do not have the required permissions to view the files attached to this post.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

Ok, finished my script. It's rather long due to the various file identifiers. Works for all platforms now, including PSP. :)
You'll notice that if possible it writes filename and extension to the file. This is especially handy for the music files (*.fev) and pictures. I only included the main types (occuring more than 5 times) As a little bonus I've included an XM extractor - all .xm files can be played with Winamp after the extraction! :)

Code: Select all

# game: Silent Hill: Shattered Memories
# files: DATA.ARC, IGC.ARC
# platforms: PS2, Wii, PSP
# (c) 2010 by AlphaTwentyThree of Xentax

get SIZE asize
set PS2 binary 0

if SIZE > 300000000
   if SIZE < 400000000        # DATA.ARC (PS2)
      set PS2 binary 1
   else
      if SIZE > 600000000
         if SIZE < 700000000  # IGC.ARC (PS2)
            set PS2 binary 1
         endif
      endif
   endif
endif

idstring "\x10\xfa\x00\x00"
get FULLNAME basename
string FULLNAME += "_"

goto 0x04
get FILES long

math FILES -= 1
get DATASTART long
get DUMMY long

for i = 1 <= FILES
   
   get CRC long
   get OFFSET1 long
   get SIZE1 long
   get ZSIZE1 long
   savepos CURR1

   get CRC long
   get OFFSET2 long
   get SIZE2 long
   get ZSIZE2 long
   savepos CURR2

   if OFFSET1 == OFFSET2
      print "Skipping first entry of offset %OFFSET1%..."
      set OFFSET OFFSET2
      set SIZE SIZE2
      set ZSIZE ZSIZE2
      set CURR CURR2
      math i += 1           # raise counter to skip one offset entry
   else
      set OFFSET OFFSET1
      set SIZE SIZE1
      set ZSIZE ZSIZE1
      set CURR CURR1
   endif

   if ZSIZE == 0
      log MEMORY_FILE OFFSET SIZE        # write file into memory
   else
      clog MEMORY_FILE OFFSET SIZE ZSIZE
   endif
   get SIZE asize MEMORY_FILE
   
   set NAME string FULLNAME
   string NAME += i
   goto 0 MEMORY_FILE
   get TYPE short MEMORY_FILE         # analyze file type, extract name if possible
   set TYPED 1
   SET OFFSET 0
   set SKIP byte 0                    # marker to skip file (e.g. empty table)

   if TYPE == 3841
      goto 0x14 MEMORY_FILE
      get NAME2 string MEMORY_FILE
      string NAME += " - "
      string NAME += NAME2
      string NAME += ".fev"

   elif TYPE == 1814
      if PS2 == 1
         FindLoc NAMEOFF string "PS2" MEMORY_FILE ""
         if NAMEOFF != ""
            goto NAMEOFF MEMORY_FILE
            get DUMMY threebyte MEMORY_FILE        # test if string is the right one
            get Z_TEST byte MEMORY_FILE
            if Z_TEST == 0
               math NAMEOFF += 0x14
               goto NAMEOFF MEMORY_FILE
               get NAME2 string MEMORY_FILE
               if NAME2 != ""
                  string NAME += " - "
                  string NAME += NAME2
               endif
            endif
         endif
      endif
      string NAME += ".txd"                 # no PS2

   elif TYPE == 2
      string NAME += ".sub"
   elif TYPE == 64016
      string NAME += ".arc"
   elif TYPE == 18770
      string NAME += ".at3"

   elif TYPE == 800
      string NAME += ".fbxf"
   elif TYPE == 2016
      string NAME += ".fbxf"
   elif TYPE == 6528
      string NAME += ".fbxf"
   elif TYPE == 8224
      string NAME += ".fbxf"
   elif TYPE == 16416
      string NAME += ".fbxf"
   elif TYPE == 18464
      string NAME += ".fbxf"
   elif TYPE == 18528
      string NAME += ".fbxf"
   elif TYPE == 20512
      string NAME += ".fbxf"
   elif TYPE == 22560
      string NAME += ".fbxf"
   elif TYPE == 22624
      string NAME += ".fbxf"
   elif TYPE == 26720
      string NAME += ".fbxf"
   elif TYPE == 24672
      string NAME += ".fbxf"
   elif TYPE == 24608
      string NAME += ".fbxf"
   elif TYPE == 26656
      string NAME += ".fbxf"
   elif TYPE == 0x0360
      string NAME += ".lvl"
   elif TYPE == 0x036A
      string NAME += ".lvl"
   elif TYPE == 16956
      string NAME += ".boot"
   elif TYPE == 55551
      string NAME += ".jpeg"
   elif TYPE == 20617
      string NAME += ".png"
   elif TYPE == 265
      string NAME += ".drk"
   elif TYPE == 268
      string NAME += ".drk"
   elif TYPE == 280
      string NAME += ".drk"
   elif TYPE == 285
      string NAME += ".drk"
   elif TYPE == 308
      string NAME += ".drk"
   elif TYPE == 309
      string NAME += ".drk"
   elif TYPE == 312
      string NAME += ".drk"
   elif TYPE == 339
      string NAME += ".drk"
   elif TYPE == 341
      string NAME += ".drk"
   elif TYPE == 345
      string NAME += ".drk"
   elif TYPE == 864
      string NAME += ".drk"
   else
      set TYPED 0
   endif

   if TYPED == 0                     # no sign or unknown
      set OFF SIZE                   # check if format is CSV
      math OFF -= 2
      goto OFF MEMORY_FILE
      get CSV_DES short MEMORY_FILE
      if CSV_DES == 0x0A0D
         string NAME += ".csv"
      else
         goto 0 MEMORY_FILE
         FindLoc XM_DES string "Extended Module:" MEMORY_FILE ""
         if XM_DES != ""
            goto 0 MEMORY_FILE
            get NAME string MEMORY_FILE
            set OFFSET XM_DES
            math SIZE -= XM_DES
         else
            string NAME += ".type"
            string NAME += TYPE
         endif
      endif
   endif

   log NAME OFFSET SIZE MEMORY_FILE
   goto CURR

next i
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
AlphaTwentyThree
double-veteran
double-veteran
Posts: 982
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 76 times
Been thanked: 660 times

Re: Silent Hill: Shattered Memories *.arc

Post by AlphaTwentyThree »

Ok, here is an extractor for the *.fev files that were extracted by my last script:

Code: Select all

# game: Silent Hill: Shattered Memories
# format: *.fev
# platforms: Wii, PS2, PSP
# (c) 2010 by AlphaTwentyThree of Xentax forums

idstring "\x01\x0f\x00\x00"
goto 0xa4
get NAME string
goto 0xa4
FindLoc EXT string "\x2e\x66\x73\x62" 0 ""  # ".fsb"
if EXT == ""
   string NAME += ".fsb"
endif
FindLoc OFFSET string "FSB4" 0 ""
if OFFSET == ""
   print "No fsb containers found in fev file."
   cleanexit
endif
get SIZE asize
math SIZE -= OFFSET

log NAME OFFSET SIZE
And and here's the batch code you might find helpful to extract all *.fev files in a folder (requires the upper script in the same folder):

Code: Select all

for %%i in (*.fev) DO quickbms -o "%CD%\fevext.bms" "%CD%\%%i" "%CD%"
md FSB
move *.fsb FSB
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)
User avatar
shekofte
mega-veteran
mega-veteran
Posts: 221
Joined: Sun Jan 18, 2009 1:45 pm
Location: Sagittarius
Has thanked: 301 times
Been thanked: 20 times
Contact:

Re: Silent Hill: Shattered Memories *.arc

Post by shekofte »

nice works AlphaTwentyThree
ILLUSORY VIDEO GAMES ARE MORE IMPORTANT THAN PRECIOUS INTERNATIONAL FOOTBALLs
Barnaby
advanced
Posts: 47
Joined: Mon Dec 14, 2009 5:41 pm

Re: Silent Hill: Shattered Memories *.arc

Post by Barnaby »

Nice one Alpha, thanks for this!
tpu
beginner
Posts: 25
Joined: Thu Jul 09, 2009 7:42 am
Been thanked: 10 times

Re: Silent Hill: Shattered Memories *.arc

Post by tpu »

AlphaTwentyThree wrote:
tpu wrote:The ARC file only save the hash of file name.
the hash:

hash ^= name*33;

Sorry, I'm not familiar with hash. Could you please explain this?
For example, if the hash name is 1E049456, what's the ASCII name?


for file "FontJAP":
1. FontJAP -> fontjap
2.
name = "fontjap"
hash = 0;
for(i=0; i<7; i++){
hash *= 33;
hash ^= name;
}
3. hash result: 0xf63bd6a8
Post Reply