TIP: .sw/.idb distribution image format

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
bri3d
Posts: 669
Joined: Sat Jun 28, 2008 11:08 am
Location: Boulder, CO

TIP: .sw/.idb distribution image format

Unread postby bri3d » Tue Jul 01, 2008 10:12 am

So, I had a unique problem yesterday.
I only had Install Tools Supportfolio overlay sets, not real CDs.
And the Install Tools overlay sets don't have a stand directory, and therefore don't have fx.
So I did a little poking around, and learned that fx can be found in the eoe set.
The problem? I don't have a working IRIX host at the moment, so I found myself without inst.

So I did a little looking.
For each distribution set there's a simple .idb file which contains, in plaintext, offsets and compressed sizes (CMPSIZE).
Then, the .sw file contains the data associated with each file, compressed using the oldschool BSD compress utility (the one from the 80s).
So all you've got to do is:
1) Open up the .idb file in a text editor, and search for the file you're looking for (telling fx from fx64 takes a minute, because fx64 is also named just fx, but you can figure it out). Find the OFFSET= and CMPSIZE= lines.
2) Go to this OFFSET (it's in bytes) in the .sw, using a hex editor. Look for the filename (it should be a few bytes after the OFFSET= value).
3) Copy out CMPSIZE bytes *AFTER* the FILENAME (the area you're copying, if you're doing it right, should start with 1f 9d, the magic numbers for compress files) into a new file with extension .Z i.e. fx.Z (be *sure* to copy and count bytes starting from 1f 9d / right after the filename, NOT right after the offset, or you'll get a truncated file. uncompress will still uncompress it without error, and then you'll be in a world of confusion as everything barfs on a file you thought was correct).
4) Run uncompress on the .Z file you just got.

Ta-da! There's a file, extracted from a .sw/.idb distribution set. Not *too* hard, was it?

User avatar
josehill
Moderator
Moderator
Posts: 3317
Joined: Mon Jun 06, 2005 9:53 pm
Location: New England, USA
Contact:

Re: TIP: .sw/.idb distribution image format

Unread postby josehill » Tue Jul 01, 2008 7:02 pm

Nice one! :D

anotherlin
Posts: 83
Joined: Sat Sep 08, 2007 3:00 pm

Re: TIP: .sw/.idb distribution image format

Unread postby anotherlin » Thu Oct 23, 2008 3:40 pm

Ok, I've wrote a small C program to extract a file.

http://linkefong.free.fr/downloads/misc ... wextract.c

I tested it on fx.64 of my 6.5.30 overlays and it works. My fuel is re-installing right now!

Right after the offset, there's two bytes (big endian) with the size of the file name (not \0 ended), which can contain directory path.
Then we have the .Z file.

User avatar
jan-jaap
Donor
Donor
Posts: 4910
Joined: Thu Jun 17, 2004 11:35 am
Location: Wijchen, The Netherlands
Contact:

Re: TIP: .sw/.idb distribution image format

Unread postby jan-jaap » Fri Oct 24, 2008 4:51 am

anotherlin wrote:Ok, I've wrote a small C program to extract a file.

There's a program named 'midb' that does exactly this, but works for older IRIX releases. I think I dug it up as a shar file from the comp.sys.sgi archives, but who knows ...

I'd like to reverse engineer the product descriptor file once, then I could write my own gendist. This is relevant for pre-IRIX5.3 systems, for which this utility was never released.
:PI: :Indigo: :Indigo: :Indy: :Indy: :Indy: :Indigo2: :Indigo2: :Indigo2IMP: :Octane: :Octane2: :O2: :O2+: Image :Fuel: :Tezro: :4D70G: :Skywriter: :PWRSeries: :Crimson: :ChallengeL: :Onyx: :O200: :Onyx2: :O3x02L:
To accentuate the special identity of the IRIS 4D/70, Silicon Graphics' designers selected a new color palette. The machine's coating blends dark grey, raspberry and beige colors into a pleasing harmony. (IRIS 4D/70 Superworkstation Technical Report)

anotherlin
Posts: 83
Joined: Sat Sep 08, 2007 3:00 pm

Re: TIP: .sw/.idb distribution image format

Unread postby anotherlin » Fri Oct 24, 2008 6:02 am

jan-jaap wrote:There's a program named 'midb' that does exactly this, but works for older IRIX releases. I think I dug it up as a shar file from the comp.sys.sgi archives, but who knows ...


Why haven't you told me before ? I wouldn't have written this crappy program, if there was already one doing it right...

:evil:

User avatar
bri3d
Posts: 669
Joined: Sat Jun 28, 2008 11:08 am
Location: Boulder, CO

Re: TIP: .sw/.idb distribution image format

Unread postby bri3d » Fri Nov 07, 2008 9:17 am

Hahah man, I could have avoided going thru this entire process...

I guess you learn about a new tool every day :)

User avatar
necron2600
Posts: 275
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: TIP: .sw/.idb distribution image format

Unread postby necron2600 » Fri Oct 23, 2015 9:49 am

Anyone have a copy of swextract.c ?
The link in this thread is dead:
http://linkefong.free.fr/downloads/misc ... wextract.c

Thanks,
-Kevin

zuluchas
Donor
Donor
Posts: 270
Joined: Wed Jun 25, 2008 10:41 am
Location: Washington, DC, USA

Re: TIP: .sw/.idb distribution image format

Unread postby zuluchas » Sat Jan 09, 2016 10:54 am

Here's a link to the 'midb' program mentioned above: http://persephone.cps.unizar.es/~spd/src/other/mydb.c
Looks like it will need some updating for modern systems, but should work on your Power Series and older!
:A350R: :Onyx2: :4D220VGX: :Indigo: :Octane2: :O2: :Indigo2IMP: :O3x0: :Indy:


Return to “IRIX and Software”

Who is online

Users browsing this forum: No registered users and 2 guests