Oddworld Forums

Oddworld Forums (http://www.oddworldforums.net/index.php)
-   Oddworld Mods & Hacks (http://www.oddworldforums.net/forumdisplay.php?f=24)
-   -   Munch's Oddysee, ROF archives, and NIF models. (http://www.oddworldforums.net/showthread.php?t=18863)

Gretin 01-07-2010 02:43 PM

As I said earlier, you'll need to open it in a command prompt. Or you can download either of those ROF files that Naulahauta uploaded and edit the batch file to have the name of that file (at the moment it says Effects_000000.rof), then make sure the EXE, the BAT, and the ROF are all in the same directory and run the BAT.

If I can be bothered I may try making a GUI for it later though, to make it easier for everyone to use it ;)

Naulahauta 01-08-2010 01:13 AM

That reminds me..! What does the program do if there are two files of the same name inside the ROF? Upon inspecting a few I noticed that one ROF contains two NIFs, both the same name, both the same path. The files' contents are different though.
Does it add a _* to the file's name's end, or does it ask what to do?

Wil 01-08-2010 01:15 AM

How can two different files have the same name and path?

Gretin 01-08-2010 04:29 PM

Oh, that's a nuisance. At the moment I think it'd just overwrite the second file, so I'll have to add some code to make it check if the file already exists first, and if so add something to the end to differentiate between different files.

And has anyone else tried out the program to see if it works for them?

Naulahauta 01-09-2010 03:43 AM

:

()
How can two different files have the same name and path?

They're stored inside the ROF archives, not the standard filesystem.

EDIT: Here's the link to the RAR with ALL 90 ROFs inside. Have fun with this whopping 118 (well, 271 when you decompress the RAR!) Megabytes of valuable data, and if you extract each 'n every, be sure to re-upload them somewhere so I can check on the DEF files and try to crack them as well. :)
Get 'em!

Wil 01-09-2010 05:25 AM

I get that, but all the same.

Naulahauta 01-10-2010 02:58 PM

Good news! I visited a friend who owns a PC with Windows installed, so I got the chance to decompress the ROFs.
I'm now trying to fiddle with the DEFs. They're a real nuisance, and if anyone has any kind of idea how to crack the format, please let me know. I'm totally lost and practically this makes no sense.
I haven't encountered any kind of compression format like this before. It's not RLE-kind of LZ* kind or aaaaaaaaaaaaagh I'm lost. :<

Paul 01-10-2010 03:46 PM

You may have reached the point where you need to reverse the game engine code that reads the files..

Gretin 01-10-2010 05:18 PM

Fantastic, so the files came out like they were supposed to?

Also, I've started working on a GUI to extract them as well, just so anyone can use it. Might be a few days before I'm happy with it though.

Naulahauta 01-11-2010 07:39 AM

Well, yeah, they came out like they were supposed to, except I couldn't find a few files.
I know I extracted ALL ROFs, but still I couldn't find the aforementioned slig_bullshit files.
Maybe it skipped lines of code in the BAT or something.

Gretin 01-11-2010 12:19 PM

Which ROF's were the missing files supposed to be in? I can take a look and see what's going on. I suppose the aforementioned files with the same name will also be missing as well.

Naulahauta 01-11-2010 12:53 PM

The Bullshit WAVs were in the Oddio_postinitdssr000001.rof file, and I think I might know what the problem is (and it's my fault, d'oh!)
You see, $X is not one, but two bytes. In most other ROFs the first few bytes are, say, 5C 00, 8B 00, 02 00, etc.. but in Oddio_postinitdssr000001.rof, it's DF 01. I counted the Z groups of the file, and there are 0x1DF (=479) of them, as opposed to the previously-thought 0xDF (=223).
So, in a nutshell, $X is two bytes read backwards, not one.

EDIT: Whoa! Layout_n.nif000000.rof's $X is 92 05! There are 1426 files inside, whohohoa!

Gretin 01-12-2010 11:31 AM

Ah, that should be easy enough to fix. In fact, here you go, updated version of the command prompt extractor XD Also it now adds an underscore to the end of the file name if it already exists. It was kind of a lazy solution though, so it's added RIGHT at the end (after the extension), so you'll probably have to rename it. It's just to avoid the first file being overwritten.

Anyway, I'm not 100% sure if this'll work or not, since I haven't downloaded any of the big ROFs yet, but it should be fine ;)

I wonder if this topic would be better in General Oddworld Discussion? Just because it doesn't seem to be really getting noticed here and this is pretty awesome stuff you're doing.

Naulahauta 01-12-2010 10:48 PM

Superb! Gotta try that out when I get the chance.
And yeah, a mod should probably move this. This started out as a help me-topic but evolved into something new.

Paul 01-13-2010 09:31 PM

:

()
Whenever I try to open DeRof.bat and DeRof.exe; a black box will flash up and dissapear straight away.

Look at the previous posts ;)

Crashpunk 01-14-2010 07:58 AM

Do you recon it possible to convert the Munch's Oddysee Modals, Materials, Maps and other files to work in Garry's Mod?

Paul 01-14-2010 10:04 AM

From what I've seen of the source engine it should be able to handle it. You just need a converter for NIF files? I reckon there is prolly a maya plugin or some such? Would be cool to run around the maps as Gordon blasting sligs ;)

Naulahauta 01-14-2010 10:07 AM

NIFs can already be converted to 3DS and OBJ. Textures are stored as DDS files which can be converted to whatever.
I'm pretty sure it's possible, but we can't get all NIFs just yet. The DEF compression must first be broken.
I'm pulling an all-nighter tonight and will check on the DEF'd NIFs as much as I can.

MojoMan220 01-14-2010 10:37 AM

I haven't a clue what any of this technical stuff means, but keep it up! I really like the screenshots you've posted (post more!), and if this cumulates in a simple level editor or even a way to merely view the models/levels, that’d be awesome.

Crashpunk 01-14-2010 11:30 AM

If someone covert them so they work with Garry's mod, let me know as soon as possible!

Naulahauta 01-14-2010 11:34 AM

Keep watching this thread, Crashpunk..! I just downloaded the new CrossOver 8.0 that (hopefully) runs command line EXEs as it should. :)

Software Bug 01-15-2010 12:22 AM

Oh man there goes all my work to remodel everything hehe :p
Anyway, Nice job guys haha! If there's anything you want done contact me :)

O man, Im on a mac but want to work with it badly, see if I can make something cool for yah guys from it haha! So if I use bootcamp it will just work right? Hmm Gotta figure this all out... Haha!

Naulahauta 01-15-2010 04:46 AM

Haha, yeah!
Also, MojoMan. You wanted more pics, so here's a gallery of 39 random screenshots of models :>

MojoMan220 01-15-2010 01:53 PM

Thank you, thank you, and thank you!

Xavier 01-16-2010 01:27 AM

Wow, nice screenshots! Thanks for sharing.

Crashpunk 01-16-2010 02:46 AM

Nice pictures! also the thought of Oddwold in Gmod makes me so happy ^^

Naulahauta 01-20-2010 12:33 PM

Good(?) news!
I examined the DEF'd files again just yesterday and made an interesting observation.
I took six totally random DEF'd NIFs. Look at their first few bytes.


Common ASCII values ----- d  e  f  T     8                                x
NEWPISTONS.NIF ---------- 64 65 66 54 80 38 01 00 A6 72 01 00 49 DF 00 00 78
ROOM06_FAN.NIF ---------- 64 65 66 54 80 38 01 00 B7 71 01 00 FA D4 00 00 78
FIREFLIES.NIF ----------- 64 65 66 54 80 38 01 00 5E 4E 00 00 8B 2F 00 00 78
ONEWITHEVERYTHING.NIF --- 64 65 66 54 80 38 01 00 A0 70 05 00 B0 B5 00 00 78
TESTROOM.NIF ------------ 64 65 66 54 80 38 01 00 08 24 07 00 99 A5 00 00 78
OWEWATERPLANE.NIF ------- 64 65 66 54 80 38 01 00 59 86 00 00 5F 48 00 00 78



That last byte is our biggest hope. A lower-case x almost always symbolizes the zlib compression method.
Now, being a Mac user I'm told, (and I quote, from the zlib home page) "zlib is already included as part of Mac OS X". I can't find it no matter what I do, though.
Does anyone know anything about the zlib (un)compression schema and/or know a way to break it?
Thanks in advance.

MojoMan220 01-20-2010 01:14 PM

Have you asked for help via any other forums that might be more knowledgeable of such encryption methods? Surely there must be places on the internet where these tasks are like second nature to the users (perhaps a forum on C++).

Also, what has been extracted up to now? Any textures or models, and do the DEF'd files appear to account for significant material or simply a few missing strands? Can anything be posted for download yet? Sorry if I sound impatient, but I'm really curious to see what this could mean in the way of user generated content.

Once again, thank you for what I'm sure is a lot of mundane number crunching.

Gretin 01-20-2010 02:14 PM

I thought that zlib was the method used by all standard zip files, I don't know whether that's correct or even helpful though :p

@MojoMan220 - You can download the ROF files Nauhalauta uploaded to MegaUpload and then use my deROF tool (if you're running Windows) to extract files from them. I don't know how much of it you can use without having other software, but I'm just saying there is SOME stuff already :p

Naulahauta 01-20-2010 03:50 PM

@MojoMan: Out of the several files a few can be viewed (It's 2:45 AM right now and I don't feel like counting them all, but I'd say uuuh.... about 5%? Maybe less.), as they're ordinary, non-DEF'd NIFs. Almost all of them are level files, and unless I'm mistaken, the only exception is a model of Munch. Everything else is DEF'd up and unreadable.

Also,, you're right. Maybe I should ask around different forums if they know the answer.

@Greting: I'm not too sure. I just Zipped some files and they don't show any sign of any x near the header. All ZIPs do begin with PK though, which I assume is a reference to Phil Katz, the inventor of ZIP.

EDIT: Also, MojoMan. The DEF'd files show no signs of original data, as if it was a complete encryption/compression/both. This also led me to believe it's not RLE or LZ based.
If anything, this somewhat resembles RAR.

Gretin 01-20-2010 04:44 PM

Well, I did a little bit of research and it looks like PKZIP, the one you said is invented by Phil Katz, and ZLIB both use the same decompression algorithm (DEFLATE) but they have different headers so that might explain that.

I'll have to look into it further perhaps... What's one of the ROF's that contains a DEF'd file?

Naulahauta 01-20-2010 06:32 PM

Anything goes. All ROFs contain at least one DEF'd up NIF. Any of the Layout_y.nif00000* files will do fine.

Gretin 01-20-2010 08:41 PM

Well, I think it's safe to say I'm in over my head with all this zlib stuff :p I see what you mean about the DEF'd files not showing any signs of the original file though.

Perhaps it'd be best to, as MojoMan suggested, go to somewhere more generally experienced with this kind of thing. I hope you're right in guessing that it's zlib though, because if it turns out it's not, that kinda leaves us with no idea whatsoever of how to un-DEF them, doesn't it? :p

EDIT: Looking around that zlib website though, it doesn't look like zlib provides encryption. So if it is zlib it's just a matter of getting it to de-compress, which by the looks of it you have to use the DLL files there which would involve writing a program to do it I suppose (I tried searching for one but didn't come up with much, I suppose zlib can't be a very common encryption method for files - probably used more for internal stuff with a program, like sending messages and stuff, since it doesn't have the ability to store information about the files in its header). But if it's compressed AND encrypted (or just encrypted) we could be in for some fun :p

Leto 01-20-2010 08:54 PM

Original poster:

Haha, that's awesome. What with modding Morrowind years ago, i'm quite familiar with NIFs. It's like a blast from the past, lol.

MojoMan220 01-25-2010 01:27 PM

Any updates? I was able to extract most of the textures from the game (the dds. files), so if there's an interest I'll post them. I labeled them with numbers and there are quite a few repeated textures under different names, so it's kinda sloppy.

Grieva 01-25-2010 03:03 PM

is that just environment textures or character textures as well?

MojoMan220 01-25-2010 09:34 PM

It's mostly environment, but I can confirm there is a comlete Intern texture map and of course the dead Elum one as well. I've extracted the textures from about half of the levels (many share the same textures), so I'll try to get the rest tomorrow. Most of them will be repeats, but perhaps there are a few more character maps hidden in the levels.

Naulahauta 01-27-2010 09:22 AM

That'd be superb..! Please post them once you can :D

Grieva 01-27-2010 09:29 AM

yeah, I'd be pretty interesed in the character ones, and all of them really, is it just diffuse maps or other types as well?

Bullet Magnet 01-27-2010 10:05 AM

I wonder if this will realise my dream of playing as sligs in Unreal Tournament?