NTVDM on windows 10 x64

Emulation of old PCs, PC hardware, or PC peripherals.

NTVDM on windows 10 x64

Postby leecher » 2016-6-08 @ 14:42

I just wanted to announce that I managed to compile and patch Microsoft Windows NTVDM on 64bit Windows and it seems to work at least for realmode applications and even supports console graphics.
This might become handy for users that want to benefit from the good console and shell integration of NTVDM compared to DosBox (i.e. run 32bit console programs from DOS-applications).
In case you are interested, take a look at https://github.com/leecher1337/ntvdmx64
Maybe some of you are interested to further improve the port (i.e. the DPMI stuff still needs some work).

Regards
leecher
Newbie
 
Posts: 9
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby Jorpho » 2016-6-08 @ 15:09

I guess that's kind of neat, but its reliance on stolen code might make it of dubious utility and I doubt Microsoft will be persuaded to included it in future versions (especially since "the DPMI stuff still needs some work"). Why exactly doesn't this work on Windows 7 or 8? And does it run 16-bit Windows programs?
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: NTVDM on windows 10 x64

Postby leecher » 2016-6-08 @ 15:23

Yeah, it's just a proof-of-concept, that's why I just published patches and nothing more to ensure that there are no legal problems with the release itself.
I guess that the DPMI stuff is fixable, it was just too frustrating to debug without yoda.

It works on Windows 10 because I tested it there and some API calls and internal structs used in the loader code may be a bit different there, but it wouldn't be too hard to port, I guess, I just didn't know if it is necessary to port it to older Windows versions.
No WOW-Support for 16bit Windows, that would be too much work for a simple PoC.
leecher
Newbie
 
Posts: 9
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby collector » 2016-6-08 @ 19:57

Very interesting. Too bad about WOW, but understand about too much work. Certainly would be nice for those 16-bit installers.
User avatar
collector
l33t
 
Posts: 4138
Joined: 2003-1-15 @ 10:39

Re: NTVDM on windows 10 x64

Postby Azarien » 2016-6-21 @ 19:42

More specifically, it's a set of patches to the sourcecode of original Microsoft NTVDM from NT4 in order to work on 64bit Windows.

This is a serious problem. Eventually, all of Microsoft's code would have to be rewritten from scratch.
Azarien
Oldbie
 
Posts: 508
Joined: 2015-5-14 @ 07:14

Re: NTVDM on windows 10 x64

Postby Stiletto » 2016-6-21 @ 22:41

Azarien wrote:
More specifically, it's a set of patches to the sourcecode of original Microsoft NTVDM from NT4 in order to work on 64bit Windows.

This is a serious problem. Eventually, all of Microsoft's code would have to be rewritten from scratch.


eh? I'm not sure you understand this thread. How is the inability for compiled illegal leaked Windows NT4 sourcecode to work in 64bit Windows a serious problem?
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 3954
Joined: 2002-7-01 @ 21:57

Re: NTVDM on windows 10 x64

Postby Azarien » 2016-6-25 @ 14:33

Stiletto wrote:eh? I'm not sure you understand this thread. How is the inability for compiled illegal leaked Windows NT4 sourcecode to work in 64bit Windows a serious problem?


As I understand, he is trying to reuse leaked and modified NT4 code on Windows 10. This is asking for legal problems, and if this project is going anywhere it should focus solely on writing new code.
Azarien
Oldbie
 
Posts: 508
Joined: 2015-5-14 @ 07:14

Re: NTVDM on windows 10 x64

Postby Stiletto » 2016-6-25 @ 15:27

Azarien wrote:
Stiletto wrote:eh? I'm not sure you understand this thread. How is the inability for compiled illegal leaked Windows NT4 sourcecode to work in 64bit Windows a serious problem?


As I understand, he is trying to reuse leaked and modified NT4 code on Windows 10. This is asking for legal problems, and if this project is going anywhere it should focus solely on writing new code.


oh, hah, I misunderstood you. Quite amazingly, too. My bad.

Well... he's not distributing compiled binaries and the sourcecode he's released is just a patch upon the illegal source, so it's about as legal as it can get in this situation. Still, I largely agree with you. It's a neat hack, but also troubling.
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 3954
Joined: 2002-7-01 @ 21:57

Re: NTVDM on windows 10 x64

Postby leecher » 2018-1-14 @ 00:33

I now managed to get it working on Windows 7.
Additionally I wanted to work on WOW16, I got it so far that i can convert 16bit to 32bit calls, but unfortunately the 16bit appliations crash randomly mustly during startup. As there is no reproducable pattern behind it, this is pretty hard to debug. Maybe a bug with memory management, der LDT or even the CCPU?
Is there any experienced programmer willing to help me with this?
leecher
Newbie
 
Posts: 9
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby filipetolhuizen » 2018-1-21 @ 13:45

leecher wrote:I now managed to get it working on Windows 7.
Additionally I wanted to work on WOW16, I got it so far that i can convert 16bit to 32bit calls, but unfortunately the 16bit appliations crash randomly mustly during startup. As there is no reproducable pattern behind it, this is pretty hard to debug. Maybe a bug with memory management, der LDT or even the CCPU?
Is there any experienced programmer willing to help me with this?

Well, I don't know if it helps, but I'd be happy to test it. And congrats for your breakthrough.
User avatar
filipetolhuizen
Oldbie
 
Posts: 1140
Joined: 2006-10-24 @ 02:25
Location: Curitiba, Brazil

Re: NTVDM on windows 10 x64

Postby leecher » 2018-1-22 @ 20:51

Hi,
If you are interested in the DOS-part, you can download it from the project page. emendelson also made a build publically availabe in the issue tracker issue #7.
For WOW16, this implements a cooperative multitasking scheduler, but the scheduling doesn't take place in NTVDM, but is issued to the kernel scheduler, i.e. by invoking NtYieldExecution() syscall. Now I think the problem is that NTVDM on x64 in turn already runs in WOW32 and therefore it may be incapable of doing the scheduling of a WOW16 process (WOW32 i.e. also usees the WOW-Structure offset in the TEB for its stuff already so that I have to use another TLS-Pointer for Wow16 stuff).
So I guess there is no scheduling taking part leading the CCPU to concurrently execute 2 threads at the same time causing random crashes. The interaction with the scheduler is not so easy to understand, I'm not sure if cooperative scheduling on the CCPU would be possible without relying on the mechanisms of the kernel task scheduler...
Did someone take a look at this how it works?
leecher
Newbie
 
Posts: 9
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby truemaster » 2018-2-24 @ 19:56

good job i installed it on win10 x64 and it works. not good as 32bit but works. the only problem is the antivirus the zip archives are ok but after install even if i open the powershell on standar cmd the commant line closes imediatly and the antivirus says blocked malicious attemp. looks like someone didnt wont that patch to go on.
truemaster
Newbie
 
Posts: 45
Joined: 2015-11-30 @ 08:00

Re: NTVDM on windows 10 x64

Postby leecher » 2018-2-24 @ 22:37

I recently switched from CreateProcess() hooking propagation to injection via conhost.exe
This is because CreateProcess hooks were a bit unstable with certain applications. However the loader sourcecode still supports both injection mechanisms.
Seems that some stupid antivirus products mistakenly see the DLL injection as malicious. If it helps, I could make both injection methods configurable, i.e. via registry key.
It may help to switch to an Antivirus software that is only signature-based and does not do behavioural detection, as it cannot know if injected DLL is malicious or not and therefore assumes the worst.
leecher
Newbie
 
Posts: 9
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby robertmo » 2018-3-03 @ 07:15

can you elaborate on this:

6) Pack release-Directory as installation package for target machine.
User avatar
robertmo
l33t
 
Posts: 4346
Joined: 2003-6-18 @ 10:35

Re: NTVDM on windows 10 x64

Postby leecher » 2018-3-03 @ 08:43

It just means that, if everything works so far, the "release\" subdirectory should contain all the files needed for the installation package, so chdir to the releae directory and put its contente i.e. in a .zip file and you should have a complete package containing installer and files.
leecher
Newbie
 
Posts: 9
Joined: 2010-11-07 @ 17:10
Location: Vienna

Re: NTVDM on windows 10 x64

Postby robertmo » 2018-3-03 @ 22:32

works on 8.1 too
User avatar
robertmo
l33t
 
Posts: 4346
Joined: 2003-6-18 @ 10:35

Re: NTVDM on windows 10 x64

Postby robertmo » 2018-3-05 @ 05:27

proof-of-concept :)
Attachments
c3.png
User avatar
robertmo
l33t
 
Posts: 4346
Joined: 2003-6-18 @ 10:35

Re: NTVDM on windows 10 x64

Postby Ahmad Moemen » 2018-3-08 @ 14:36

robertmo wrote:proof-of-concept :)


Did you choose Windows 7's loader?
Ahmad Moemen
Newbie
 
Posts: 2
Joined: 2018-3-08 @ 14:34

Re: NTVDM on windows 10 x64

Postby robertmo » 2018-3-08 @ 15:11

10
User avatar
robertmo
l33t
 
Posts: 4346
Joined: 2003-6-18 @ 10:35

Re: NTVDM on windows 10 x64

Postby Ahmad Moemen » 2018-3-09 @ 23:55

robertmo wrote:10

So how did you do this? Did you replace 6.1's one by the 10.0 ones?
Fun fact: Windows 8 and later use the same loader.
Ahmad Moemen
Newbie
 
Posts: 2
Joined: 2018-3-08 @ 14:34

Next

Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 1 guest