BetaArchive Logo
Total Current Archive Size: 4765.54GB in 15409 files
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 5d, 4h, 1m | CPU: 4% | MEM: 4938MB of 12279MB used
{The community for beta collectors}

Post new topic Reply to topic  [ 25 posts ] 
Author Message
 PostPost subject: NT 3.1 exe format        Posted: Fri Jun 01, 2012 11:03 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
It's pretty well-known that the EXE format differs between NT 3.1 and all later versions of Windows, and trying to start any such executable file in NT 3.1 will result in an "unexpected error 11". Less known, however, is that four bytes is all that needs to be changed to turn any 32-bit executable into a NT 3.1 executable.

How it's done, you ask? Well, here's how:

* Open the EXE file you'd like to convert in a hex editor.
* Locate the "PE" signature. It signifies the start of the 32-bit executable, and should be somewhere near the beginning of the file. For this example, let's say the PE signature is found at 0xF0.
* From the beginning of the signature, go 0x48 bytes forward. In this example, you would now be at 0x138.
* You should see four bytes saying "04 00 00 00". Change this to "03 00 0A 00".
* Save the file.

This file is now a NT 3.1 executable.

The problem? It's mostly useless. Since Windows NT 3.1 is missing many, many functions implemented in later versions of Windows, I've as of now been unsuccessful in getting anything to work with this method. Maybe something will spring up this way, but I doubt it.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Fri Jun 01, 2012 11:10 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
does this also work with 32-bit drivers (SYS)?

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Fri Jun 01, 2012 11:13 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
I haven't tried it with drivers, but I think their format is slightly different, so it would need some adaption.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Fri Jun 01, 2012 11:13 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
for example, I want to use the NT 3.5 atapi cdrom driver on NT 3.1.

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Fri Jun 01, 2012 11:40 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
I'm still investigating drivers, but here's what I found so far:

* From the PE header, after 0x38 bytes you'll find "20 00 00 00 20 00 00 00". For NT 3.1, this needs to be "00 02 00 00 00 02 00 00".
* Again from the PE header, go 0x50 bytes forward and you'll find two 32-bit (four bytes long) numbers, for example "00 23 00 00" and "60 02 00 00". They're little endian (least significant bit first), so flip the numbers around ("00 00 23 00" and "00 00 02 60"). NT 3.1 needs them to be a multiple of 512 (decimal, hex 0x200), so you'll have to round them up - in this example, from 0x2300 to 0x2400 and from 0x260 to 0x400. Flip the numbers back ("00 24 00 00" and "00 04 00 00") and enter them like this.
* Directly after that comes a checksum. NT checks this checksum, so you'll need something that can recalculate and write a new checksum. For example, editbin, found with some Microsoft SDKs (dunno which ones) can do this: "editbin /release driver.sys".

I haven't tested any of this yet, but this should be a start.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 12:18 am 
Site Moderator
Site Moderator
Online

Joined
Sat Feb 24, 2007 4:14 pm

Posts
5826

Location
United Kingdom

Favourite OS
Server 2012
3155ffGd wrote:
It's pretty well-known that the EXE format differs between NT 3.1 and all later versions of Windows, and trying to start any such executable file in NT 3.1 will result in an "unexpected error 11". Less known, however, is that four bytes is all that needs to be changed to turn any 32-bit executable into a NT 3.1 executable.

How it's done, you ask? Well, here's how:

* Open the EXE file you'd like to convert in a hex editor.
* Locate the "PE" signature. It signifies the start of the 32-bit executable, and should be somewhere near the beginning of the file. For this example, let's say the PE signature is found at 0xF0.
* From the beginning of the signature, go 0x48 bytes forward. In this example, you would now be at 0x138.
* You should see four bytes saying "04 00 00 00". Change this to "03 00 0A 00".
* Save the file.

This file is now a NT 3.1 executable.

The problem? It's mostly useless. Since Windows NT 3.1 is missing many, many functions implemented in later versions of Windows, I've as of now been unsuccessful in getting anything to work with this method. Maybe something will spring up this way, but I doubt it.


Just as a technical summary, what you are doing is changing the Major/Minor Subsystem Version (04 00 00 00 - 4.0, 03 00 0A 00 - 3.10). This is actually a technique not limited to getting 4.0 apps running on 3.10 - its the same mechanism that prevents say, certain Vista apps (mostly those included with the OS) from running on XP, and 7 on Vista.

Obviously the reason here is because it's expected that it requires that version in order to have its dependencies satisfied. You commented yourself on how this rarely works.

It's always good to read the proper Microsoft documentation of the PE format, it's a very illuminating read:

http://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx

_________________
ImageImage
Windows Longhorn - a look at a defining Microsoft project | Reverse Engineering - Get started with these guides


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 6:55 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Wed Dec 21, 2011 1:22 am

Posts
33
TheCollector1988 wrote:
for example, I want to use the NT 3.5 atapi cdrom driver on NT 3.1.


Why not use the IDE CD-ROM driver from Aztech for Windows NT 3.1? This may sound a little nieve, but has anyone compiled the Atapi source code from Windows NT 3.5 DDK using Windows NT 3.1 tools in order to see if the driver will work in Windows NT 3.1?


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 7:05 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
MM-DD-YY wrote:
TheCollector1988 wrote:
for example, I want to use the NT 3.5 atapi cdrom driver on NT 3.1.


Why not use the IDE CD-ROM driver from Aztech for Windows NT 3.1? This may sound a little nieve, but has anyone compiled the Atapi source code from Windows NT 3.5 DDK using Windows NT 3.1 tools in order to see if the driver will work in Windows NT 3.1?


that one works on NT 3.1, but not for the text-based CD setup (booting from CDINSTALL.img)

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 7:19 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
MM-DD-YY wrote:
This may sound a little nieve, but has anyone compiled the Atapi source code from Windows NT 3.5 DDK using Windows NT 3.1 tools in order to see if the driver will work in Windows NT 3.1?

Wait... that's open source? I was honestly never aware of it. I might give it a shot.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 7:38 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
the NT 3.5 DDK is not open source.

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:19 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
I've tried building the ATAPI driver from the NT 3.5 DDK, and it compiled perfectly fine. I injected it into my NT 3.1, however it seems to suffer from the 150 MB bug as well, so it really isn't any different from the Aztech driver. I haven't tried whether it can be inserted during setup, but I doubt it.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:21 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
3155ffGd wrote:
I've tried building the ATAPI driver from the NT 3.5 DDK, and it compiled perfectly fine. I injected it into my NT 3.1, however it seems to suffer from the 150 MB bug as well, so it really isn't any different from the Aztech driver. I haven't tried whether it can be inserted during setup, but I doubt it.


can you release it please? I would like to test it for the text-based setup.

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:27 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
Here you go:

http://depositfiles.com/files/yz6ocvlb9


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:37 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
hmm it does not get recognized by the text CD setup.

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:42 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
Oh, heh. You'll need an OEMSETUP.INF and a DISK1 file.

The OEMSETUP.INF can be copied from the Aztech driver, just change AZTIDECD.SYS to ATAPI.SYS. DISK1 is simply an empty file, the only important thing is that it's present.

edit: actually, for SETUP, you'll need the TXTSETUP.OEM from the Aztech driver, and change the driver name within that file. Sorry again.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:51 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
3155ffGd wrote:
Oh, heh. You'll need an OEMSETUP.INF and a DISK1 file.

The OEMSETUP.INF can be copied from the Aztech driver, just change AZTIDECD.SYS to ATAPI.SYS. DISK1 is simply an empty file, the only important thing is that it's present.

edit: actually, for SETUP, you'll need the TXTSETUP.OEM from the Aztech driver, and change the driver name within that file. Sorry again.


I mean, I put your drive as a SCSI adapter (for example, I renamed it to aha154x.sys to make it immediately recognized) but it does not get recognized in the CDINSTALL.IMG image.

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:54 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
...oh. Well in that case, it really is the same as the Aztech driver. So while it was a nice try, the effort was ultimately wasted. :(


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sat Jun 02, 2012 9:56 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
3155ffGd wrote:
...oh. Well in that case, it really is the same as the Aztech driver. So while it was a nice try, the effort was ultimately wasted. :(


we will have to wait for someone to implement an ISA/EISA SCSI adapter for Qemu x86 then :(

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sun Jun 03, 2012 1:17 am 
Site Moderator
Site Moderator
User avatar
Offline

Joined
Sat Oct 07, 2006 12:04 pm

Posts
1865

Favourite OS
Anything checked :P
nope, just someone needs to modify the atapi.sys code so it doesn't use the SCSI IDs that Windows NT 3.1's setup reserves for hard drives.

_________________
Thought #nttalk was the only beta-related chatroom? You thought wrong! Join #abandonet on RoL today - the honest alternative!

C H E C K E D . B U I L D S . A R E . A W E S O M E N E S S


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sun Jun 03, 2012 9:56 am 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
...oh? Are you able to elaborate? With the atapi.sys source code, this shouldn't be hard at all to do.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sun Jun 03, 2012 11:18 am 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
The Distractor wrote:
nope, just someone needs to modify the atapi.sys code so it doesn't use the SCSI IDs that Windows NT 3.1's setup reserves for hard drives.


well, the Aztech one is an example. ;)

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Sun Jun 03, 2012 2:43 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Wed Dec 21, 2011 1:22 am

Posts
33
TheCollector1988 wrote:
The Distractor wrote:
nope, just someone needs to modify the atapi.sys code so it doesn't use the SCSI IDs that Windows NT 3.1's setup reserves for hard drives.


well, the Aztech one is an example. ;)


Ok, I'm confused. If the Aztech is an example of what your shooting for then why doesn't it work? Aztidecd.sys appears to be just a modified version of Atapi.sys.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Sun Jun 03, 2012 2:47 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Wed Feb 23, 2011 12:11 am

Posts
2827

Location
Italy

Favourite OS
NT Oct91, Dec91, XP 2509
MM-DD-YY wrote:
TheCollector1988 wrote:
The Distractor wrote:
nope, just someone needs to modify the atapi.sys code so it doesn't use the SCSI IDs that Windows NT 3.1's setup reserves for hard drives.


well, the Aztech one is an example. ;)


Ok, I'm confused. If the Aztech is an example of what your shooting for then why doesn't it work? Aztidecd.sys appears to be just a modified version of Atapi.sys.


from the cdinstall.img, when I put it as a SCSI adapter (for example, renamed to aha154x.sys), it bombs out saying there's an error, I can provide you a screenshot if you want ;) (but it works when NT 3.1 is already fully installed).

_________________
Tutorials, Video Games, Windows, basically geeky stuff!


Top  Profile  WWW
 PostPost subject: Re: NT 3.1 exe format        Posted: Mon Jun 04, 2012 6:38 pm 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Wed May 02, 2012 12:57 am

Posts
160

Favourite OS
Windows NT 3.x
I'm smelling that the problem with setup is the very same problem that prevents CDs less than 150 MB from being read. Now the question is what causes this problem - is it a timing issue, or something entirely different?

Later on I might try commenting out all the error code to see where the problem is.


Top  Profile
 PostPost subject: Re: NT 3.1 exe format        Posted: Mon Jun 04, 2012 7:48 pm 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Thu Jun 10, 2010 7:44 pm

Posts
1494

Location
Inside your local solar system

Favourite OS
LH 4015, Chicago 73g, XP 2416
Work this work the other way around?

_________________
<°)))><●▬▬▬▬๑۩۩๑▬▬▬▬●><(((°>
Image
Image
Tis' pointless to flamewar over ponies and potatoes.


Top  Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ] 




Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2013

 

Sitemap | XML | RSS