VOGONS


Replacing DOS/4GW with DOS32A

Topic actions

First post, by sharangad

User metadata
Rank l33t
Rank
l33t

Hi

I'm trying to replace DOS/4GW from Indycar Racing 2 with Dos32A. I need to do this so the game can support more than 64 MB of RAM.

But I'm not having much luck. Unbinding produces a cart.lc file which won't run with Dos4GW or DOS32A:

V:\CR>dos4gw cart. lc
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW fatal error (1008): can't load executable format for file CART.LC [1]

V:\CR>dos32a cart. lc
DOS/32A -- Protected Mode Run-time Version 7.35
Copyright (C) Supernar Systems, Ltd. 1996-2005
DOS/32A fatal (3006): exec format not supported in file "cart.lc"

Does anyone know how I can deal with this. I'm looking through the disassembly of DOS32A, but it's slow going.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 1 of 23, by vstrakh

User metadata
Rank Member
Rank
Member

Back in the day I'd replace DOS/4GW with PMODE/W, it includes the tools to bind/unbind the stub.

Reply 2 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t
vstrakh wrote on 2025-03-02, 10:52:

Back in the day I'd replace DOS/4GW with PMODE/W, it includes the tools to bind/unbind the stub.

Dos32a came with sb. Exe which does the same thing, but it doesn't seem to correctly identify the exe type.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 3 of 23, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It should work with LE (Linear Executable) format, but not sure if .LC is the same... maybe compressed?

Reply 4 of 23, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote on 2025-03-02, 21:39:

It should work with LE (Linear Executable) format, but not sure if .LC is the same... maybe compressed?

"LC" is DOS32A's variant on a compressed LE/LX file, or its intermediary file format when you bind sometimes.

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 5 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t

Even running directly fails with:

V:\CR>dos4gw cart.exe
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW fatal error (1008): can't load executable format for file CART.EXE [1]

V:\CR>dos32a cart.exe
DOS/32A -- Protected Mode Run-time Version 7.35
Copyright (C) Supernar Systems, Ltd. 1996-2005
DOS/32A fatal (3006): exec format not supported in file "cart.exe"

It's almost like Dos4gw is static linked into the game.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 6 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t

There's supposed to be a PATH hack which allowed embedded versions to be overriden. How does that work? Is it as simple as adding it to the path?

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 7 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t

I've figured out why SB.exe isn't working.

The first exec section is an MZ which is incompatible, the second is a BW. SB.exe, which replaces the stub doesn't test to see if the second exec is BW; if the first is incompatible it looks for LE, LX and LC as the second exec, but not BW, which is a supported type.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 8 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t

Base MZ, extended , start 00000000, size 0000F474
Base BW, extended , start 0000F474, size 008FB400

The second exec is a PE/COFF or whatever but there's no sign of an LX, LC or LE in there.

Does this mean Dos4gw is statically linked?

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 9 of 23, by wbahnassi

User metadata
Rank Oldbie
Rank
Oldbie

A hint would be to check the file size. Is the exe so large it could house a DOS4GW.exe in it?

Turbo XT 12MHz, 8-bit VGA, Dual 360K drives
Intel 386 DX-33, TSeng ET3000, SB 1.5, 1x CD
Intel 486 DX2-66, CL5428 VLB, SBPro 2, 2x CD
Intel Pentium 90, Matrox Millenium 2, SB16, 4x CD
HP Z400, Xeon 3.46GHz, YMF-744, Voodoo3, RTX2080Ti

Reply 10 of 23, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

BW are watcom EXP's. I think run386.exe runs them. fading memories but they mighty be pharlap or causeway extender files. You used to see the more with DOS16M instead of DOS4GW.

dos4gw should still be able to load a BW.

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 11 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t
BloodyCactus wrote on 2025-03-04, 13:11:

BW are watcom EXP's. I think run386.exe runs them. fading memories but they mighty be pharlap or causeway extender files. You used to see the more with DOS16M instead of DOS4GW.

dos4gw should still be able to load a BW.

Well it's the second exec, the first is a 64kb mz.

Dos4gw and dos32a can't run it.

[edit] it only runs with it's built-in dos4gw in the 2nd exec. I have a bad feeling I can't replace the built in one with dos32a. The dos4gw binary and the actual game seem to be merged together.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 12 of 23, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

use UNP utility to copy off the overlay then rebind (copy /b newstub.exe+overlay.bw newexec).

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 13 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t
BloodyCactus wrote on 2025-03-04, 14:07:

use UNP utility to copy off the overlay then rebind (copy /b newstub.exe+overlay.bw newexec).

I'm a bit new to this, the stub from dos32a is the mz section from dos32a. Exe?

[edit]
Also which extender does unp come with? Dos32a comes with sb. Exe.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 15 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t
V:\UNP411>unp o v:\cr\cart.exe v:\cr\cart.ovl

UNP 4.11 Executable file restore utility, written by Ben Castricum, 05/30/95

processing file : V:\CR\CART.EXE
DOS file size 1247899
file-structure executable (EXE)
EXE part sizes: header 512 bytes, image 62068 bytes, overlay 1185319 bytes
action: copying overlay ... done
new file size: 1185319
writing to file : V:\CR\CART.OVL

V:\UNP411>cd \cr

V:\CR>dos4gw cart.ovl
Illegal command: dos4gw.

V:\CR>dos32a cart.ovl
DOS/32A -- Protected Mode Run-time Version 7.35
Copyright (C) Supernar Systems, Ltd. 1996-2005
DOS/32A fatal (3004): exec format not supported in file "cart.ovl"

[EDIT] Running cart.exe does work with its own dos4gw, embedded into the overlay.
[EDIT2] How can I extract the stub from dos32a?
[EDIT3] Nm, Dos32A comes with a stub:

V:\CR>copy /b v:\dos32a\dos32a\binw\stub32a.exe+ v:\cr\cart.ovl v:\cr\cart2.exe
STUB32A.EXE
CART.OVL
1 File(s) copied.

V:\CR>cart2
DOS/32A -- Protected Mode Run-time Version 7.35
Copyright (C) Supernar Systems, Ltd. 1996-2005
DOS/32A fatal (3006): exec format not supported in file "V:\CR\CART2.EXE"

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 16 of 23, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

weird. it should have worked. Ive done this many many times before.

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 17 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t

Does anyone know if there's any documentation for watcom exp binary formats. I seem to be struggling to find anything. I'd like to try converting it to an mz/LE if possible .

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda

Reply 18 of 23, by M-HT

User metadata
Rank Member
Rank
Member

sb.exe utility has wrong algorithm for finding executable headers. Instead of finding LE header at offset 0x28C9C, it finds what it thinks is a LC header (but it's not) at offset 0x7A35B.
You must unbind the linear executable manually, then you can bind it (using sb.exe) to dos32a.
Here is my algorithm to find the linear executable header.

Reply 19 of 23, by sharangad

User metadata
Rank l33t
Rank
l33t
M-HT wrote on 2025-03-07, 08:57:

sb.exe utility has wrong algorithm for finding executable headers. Instead of finding LE header at offset 0x28C9C, it finds what it thinks is a LC header (but it's not) at offset 0x7A35B.
You must unbind the linear executable manually, then you can bind it (using sb.exe) to dos32a.
Here is my algorithm to find the linear executable header.

Thanks will give that a go as soon as I get back to my desk.

Developer of RReady - Rendition Verité Wrapper.
https://www.youtube.com/@sharangadayananda