Doom monster
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > unxwe
 
Author
All times are GMT. The time now is 13:54. Post New Thread    Post A Reply
Quasar
Moderator


Posts: 5908
Registered: 08-00


Here's a utility to undo the damage that XWE does to your IWADs. It will restore the IWAD tag to any wad file it is given as input, so long as that file is marked as a PWAD.

Usage:
> unxwe [input file name]

A backup will be created, just in case you need broken stupid files laying around.

WIN32 Source and binary, released under GPL v2.0:
http://eternity.mancubus.net/unxwe.zip

Old Post 11-04-12 00:05 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
esselfortium
A Major Doomworld Concern


Posts: 6471
Registered: 01-02


Unckswhee!

Old Post 11-04-12 00:16 #
esselfortium is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10972
Registered: 07-07



Quasar said:
It will restore the IWAD tag to any wad file it is given as input, so long as that file is marked as a PWAD.

So, it is just changing the first byte of a file from 'P' to 'I'? It's a bit underwhelming.

I expected something that would, for example, repair broken TEXTUREx/PNAMES lumps and lump directories where XWE made garbage characters part of the strings.

Old Post 11-04-12 00:28 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5908
Registered: 08-00



Gez said:

So, it is just changing the first byte of a file from 'P' to 'I'? It's a bit underwhelming.

I expected something that would, for example, repair broken TEXTUREx/PNAMES lumps and lump directories where XWE made garbage characters part of the strings.


If you can give an explicit description of what happens to the file when this occurs, maybe I can implement that too. This was a quick one-off hack, not meant to impress. Just to do what it says on the box.

Old Post 11-04-12 00:29 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10972
Registered: 07-07



Quasar said:
If you can give an explicit description of what happens to the file when this occurs, maybe I can implement that too. This was a quick one-off hack, not meant to impress. Just to do what it says on the box.


The gist is that name strings in Doom's data files are NULL-terminated 8-chars array; but that Delphi (in which XWE is coded) doesn't do NULL-termination like C. (Instead, the first character in a Pascal string is the string length, so it can be between 0 and 255. A NULL character is actually interpreted like a space.)

So suppose you have a texture or lump or whatever named LAVA. Its representation will be LAVA\0\0\0\0. But only LAVA\0 matters. It's very possible that when writing with some old lump editor thing, garbage characters are left in memory and not overwritten. So it can end up being LAVA\0`@ which is written in the file. Open and save in XWE, it becomes LAVA `@ (with a space instead of a NULL).

The idea would be to scan through the WAD directory and, if they are present, the patch names in PNAMES and the texture names in TEXTURE1 and TEXTURE2, look for spaces in names, and replace them (and everything that follows) with NULL.

Old Post 11-04-12 00:48 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5908
Registered: 08-00


Sounds simple enough. I'll implement it in the next version. That's not gonna be released tonight though as I have other things to do ;)

Old Post 11-04-12 00:54 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Sodaholic
I feel justified yet disgusted with myself at the same time


Posts: 2694
Registered: 04-07


While I don't like what XWE does to IWADs, it's probably best to just overwrite your IWADs with the originals than to try to repair it, that way you can be sure that the file is untouched and has the same MD5.

Old Post 11-04-12 10:34 #
Sodaholic is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Memfis
Forum Legend


Posts: 5323
Registered: 04-07


Or just make your iwads "read-only". :) That's what I did.

Old Post 11-04-12 10:52 #
Memfis is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Enjay
ASK ME ABOUT FOOTBALL / STEAM / DEAD CELEBRITIES / THE BLAIR WITCH PROJECT


Posts: 6381
Registered: 12-00


I've always used a hex editor if I want to change the P to an I (or vice versa). DeePsea allows you to change the P or I when you import files into a WAD as well (you can import nothing and just have it change the header if you want). Some ports don't care whether a WAD has a P or an I in the header.

All that being said, I'm sure someone will find a use for the program. If I had an otherwise unaltered IWAD, however, I'd just copy the original over the damaged one.

Old Post 11-04-12 11:18 #
Enjay is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5908
Registered: 08-00



Sodaholic said:
While I don't like what XWE does to IWADs, it's probably best to just overwrite your IWADs with the originals than to try to repair it, that way you can be sure that the file is untouched and has the same MD5.

Pity the foo who didn't have a backup, right?

Old Post 11-04-12 16:20 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Xaser
Forum Staple


Posts: 2574
Registered: 07-03


I suppose this is the part where someone goes "then why not just warez it"? :P

That totally doesn't count as me saying it, BTW. This'd be a preferable alternative, for sure. I'm curious to know if the standard level of XWE-ization is such that PWAD->IWAD and texture directory fixed would be enough to get it byte-for-byte back to the original... probably not, given how XWE stores junk lumps everywhere as it edits stuff, but maaaybe for really minor cases? *shrugs*

Old Post 11-04-12 19:05 #
Xaser is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10972
Registered: 07-07



Xaser said:
I suppose this is the part where someone goes "then why not just warez it"? :P

There is no DRM on Doom. Assuming you installed it from a legitimate installer (be it the original set of floppies, or the later CD-ROM, or Steam), you can reinstall it an unlimited amount of times. And XWE isn't going to overwrite your read-only floppies/CDs/Steam servers.

I suppose if you got the game through warez, then warezing it again counts as reinstalling it from the same source... But hey, it's five bucks on Steam. For $25 bucks, you can get Ultimate Doom, Doom II, Final Doom, Heretic, Hexen, and Deathkings (aka all the non-free IWADs except Strife).

And once you have downloaded them, you can even uninstall Steam and forget about it, and play all these games with source ports. So even if you dislike Steam, it's still a good idea.

Old Post 11-04-12 19:37 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Ladna
Member


Posts: 283
Registered: 04-10


Yeah. I wish ID would sell Doom/Doom II/Final Doom as a digital download for like $5 or $10, but the Steam method is the best deal so far.

Old Post 11-04-12 20:34 #
Ladna is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Pottus
Forum Regular


Posts: 797
Registered: 07-09


I think I'm going to lose my mind if I see any more XWE chatter.

Old Post 11-04-12 23:22 #
Pottus is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12144
Registered: 07-06


I remember there already was a "WAD gender changer" utility laying around...maybe on toastytech?

Old Post 11-06-12 11:39 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 13:54. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > unxwe

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Message Board Statistics