What's new

Luigi's mansion

Lunaboy

New member
The archive-creation process of my packer can be divided into 6 steps:

1. Scan directory recursively to get info
2. Create headers and save them to archive
3. Allocate memory for nametable, DirInfo-array and FileInfo-array
4. Scan directory again to fill Info-arrays and nametable, and copy filedata to archive
5. Write Info-arrays (DirInfo and FileInfo) to archive
6. Free memory and quit

The packer scans the directory twice, first time to gather information and a second time to add the files to the archive and to make a map of the filesystem. To get unlimited directory-depth it calls the scan-function recursively. First it changes to a specified directory, next it scans through all items inside the directory and before returning, it changes back to the parent directory. When the scan-function hits a directory, it simply calls itself again. Each time the function is called, it will jump one directory deeper and each time it returns, it jumps out of the directory to its parent.

An example of how it works is shown below.
Code:
void DoScan(char *DirName){
  SetCurrentDirectory(DirName);
  for(Nr = 0 to NrItemsInDir){
    if(Item[Nr].IsDir){
      DoScan(Item[Nr].Name);
    }else{
      GetInfo(Item[Nr]);
    }
  }
  SetCurrentDirectory("..");
}

--------------------------------------
     Example directory-structure
--------------------------------------

TestDir
 |__Arrow.bti
 |__Bow.bti
 |__Ilia
 |   |__Yelia.bdl
 |   |__Anims
 |   |   |__Walk.bck
 |   |   |__Stand.bck
 |   |__Yelia.bti
 |__Medly
     |__Md.bdl
     |__Md.bck

--------------------------------------
           Function calling           
--------------------------------------

DoScan("TestDir"){
  SetCurrentDirectory("TestDir");
  GetInfo("TestDir\Arrow.bti");
  GetInfo("TestDir\Bow.bti");
  DoScan("TestDir\Ilia"){
    SetCurrentDirectory("Ilia");
    GetInfo("TestDir\Ilia\Yelia.bdl");
    DoScan("TestDir\Ilia\Anims"){
      SetCurrentDirectory("Anims");
      GetInfo("TestDir\Ilia\Anims\Walk.bck");
      GetInfo("TestDir\Ilia\Anims\Stand.bck");
      SetCurrentDirectory("..");
    }
    GetInfo("TestDir\Ilia\Yelia.bti")
    SetCurrentDirectory("..");
  }
  DoScan("TestDir\Medly"){
    SetCurrentDirectory("Medly");
    GetInfo("TestDir\Medly\Md.bdl");
    GetInfo("TestDir\Medly\Md.bck");
    SetCurrentDirectory("..");
  }
  SetCurrentDirectory("..");
}

I’ve posted the main.cpp file below.
This file alone will not compile, because it needs my cFile class (I don’t want to release the class yet).
You can use the code as a reference to see how the packer is working.

Because I get an 'Unable to move/copy file' error while uploading the attachment, I'm using RapidShare:
http://rapidshare.de/files/48468383/ArcPack_Src.zip.html
 

jimbo390

New member
sorry for bumping this old thread but does someone still have the arcpacker because all the rapidshare links are dead?
 

SebCroc

New member
I am EXTREMELY REALLY REALLY SORRY for bumping this thread, but this is very urgant... I need that new compiled rarcdump for the .szp files of Luigi's Mansion. I NEED it. Please, can someone, who still has it PLEASE put it up for me? Or if not, compile the source code into an .exe? I beg... Please, I REALLY need it.:cry: Could someone PLEASE reply?
 

SebCroc

New member
Ok, then if no one wants to, then can someone tell me how to do it? I used that Microsoft Visual c++ 2010, and when I try to compile it into an .exe, it says it needs the 'openfile.h' and shows an error. I looked at the code, and it says that at some point it needs it. What do I do then? where can I get this 'openfile.h'? Do I really need it? Where can I get it? PLEASE HELP ME!!! :ph34r:
 

Sakurai

New member
Hi

I extracted some files from szp of Luigi's Mansion and edited them.
Next, I want to replace them with files before edit.
But I can't repack them into szp file.

Is there any tool for correct packing szp files?
Can someone tell me how to do it?

Please exuse my poor english.
 

Mag0man

New member
SebCroc, here's the tools + sources:
BLOCKED LINK

one is by thakis, second (with "new" in file name) is compiled by jorge_bastos
enjoy

also you can check my site (it's in russian) for other game cube/Wii tools that I've found:
BLOCKED LINK


yea...um sorry for bumping this but Rapid share links are dead and so is Mega upload...:/ Can i get a Media fire link please? Anyone? I really want Lunaboy's Rarc and SZP Unpacker for luigi's mansion! Again sorry for bumping this....
 

Lunaboy

New member
Mag0man, I've re-posted both the packer and the unpacker in the 'Wind Waker Sea Maps' thread a while ago.
Today I've found some minor bugs in these tools, so I've digged up the sourcecode to correct them.
The packer and the unpacker are both console programs (no graphical gui).

Usage instructions for use with Windows Explorer:
1. Place both executables into an empty directory
2. Copy the szp file from the game to the same directory as the executables
3. Drag the szp file and place it on top of the 'ArcExtract.exe' filename (a console window opens and closes)
4. A new directory has been created containing the extracted files and directory structure
- - - - - - - - - - - -
5. Modify the files (do not change the filenames or the directory structure, otherwise the game can't find them)
- - - - - - - - - - - -
6. Go to the directory containing the two executables
7. Drag the previously extracted directory and place it on top of the 'ArcPack.exe' filename (a console window opens and closes)
8. A new arc file has been created (directory name with the '.arc' extension added)
9. Replace the arc extension with szp

The fixes:
- ArcExtract now creates a new directory with the ARC Root name and extracts everything into this directory
- ArcPack now writes the real filesize instead of a rounded-up-to-32-bytes filesize

When I try to upload the file to the emutalk server, I get an error message: 'File system directory "[path]/attachments/3/2/0/8/7" is not writeable or cannot be found.'
As a work-around, I'm using the file-sharing website minus.com (the file stays available for only 30 days, so get it quickly).
Hopefully the emutalk uploadsystem gets fixed soon.
http://minus.com/l9Af3OqxkWZIJ

Have fun. :)

Lunaboy
 

Sage of Mirrors

New member
Mag0man, I've re-posted both the packer and the unpacker in the 'Wind Waker Sea Maps' thread a while ago.
Today I've found some minor bugs in these tools, so I've digged up the sourcecode to correct them.
The packer and the unpacker are both console programs (no graphical gui).

Usage instructions for use with Windows Explorer:
1. Place both executables into an empty directory
2. Copy the szp file from the game to the same directory as the executables
3. Drag the szp file and place it on top of the 'ArcExtract.exe' filename (a console window opens and closes)
4. A new directory has been created containing the extracted files and directory structure
- - - - - - - - - - - -
5. Modify the files (do not change the filenames or the directory structure, otherwise the game can't find them)
- - - - - - - - - - - -
6. Go to the directory containing the two executables
7. Drag the previously extracted directory and place it on top of the 'ArcPack.exe' filename (a console window opens and closes)
8. A new arc file has been created (directory name with the '.arc' extension added)
9. Replace the arc extension with szp

The fixes:
- ArcExtract now creates a new directory with the ARC Root name and extracts everything into this directory
- ArcPack now writes the real filesize instead of a rounded-up-to-32-bytes filesize

When I try to upload the file to the emutalk server, I get an error message: 'File system directory "[path]/attachments/3/2/0/8/7" is not writeable or cannot be found.'
As a work-around, I'm using the file-sharing website minus.com (the file stays available for only 30 days, so get it quickly).
Hopefully the emutalk uploadsystem gets fixed soon.
[URL removed]

Have fun. :)

Lunaboy

Actually, while Luigi's Mansion does have RARC archives in it (like the archives containing room models), this method doesn't work for other files.

I've been investigating Luigi's Mansion; trying to document what file does what and how. However, I've hit a road block with this lack of an ability to repackage edited files. As a test of the method you suggested above, I unzipped the file called Event7 (the cutscene archive that contains information for the scene in the beginning where there's a ghost floating around with a key in it in the Foyer), rezipped it using your Arc packer and rebuilt the game with the rezipped file. It didn't work. When the cutscene tries to play, the game (not Dolphin) comes up with a "An error has occurred" message. So, your suggested method doesn't work for .szp files.

I'd suggest that the .szp files aren't compressed RARC archives, but then again, your Arc extractor extracts them just fine. Perhaps the game prefers .szp files to be YAY0'd? What can you make of this, Lunaboy?
 
Last edited:

Top