Jump to content

Modifying/Replacing Shell32.DLL on NT 4.0


ironman14

Recommended Posts

I am also planning to try to get some slightly newer apps on NT 4.0. Hope it works!

As for how this "modern apps" thing for NT 4.0 has been going, I have a few things to say:

@ jumper

-I recently read that if you hex edited anything major, the file size will change and the DLL will be unusable, so:

-I downloaded your shell32.vlc patch and renamed your file to shell31.dll (Hope you don't mind).

-I replaced references from shell32.dll to shell31.dll.

-I opened vlc.exe in dependency walker, and all APIs were there!

But,

when I opened VLC,

it just loaded for a few seconds (the mouse icon said it was busy), then did nothing.

I thank you very much for this patch, Jumper, but do you know how to fix the launching error?

I also tried recent versions of Opera. Since version 11, the installer has shown "the procedure entry point GetUserDefaultUILanguage could not be located in the dynamic link library KERNEL32.dll"

So, I extracted the exe, and ran the opera executable , and it said it wasn't a valid windows NT app, despite it working perfectly on Win2000.

This is for all opera versions since 11.00 (late 2010) to 12.17 (2 days ago). Opera 11.00-12.02 has basically NO API changes from Opera 10.63. 12.10+ need PSAPI.dll, which can be copied from the NT 4 CD. I found this out by scanning all the opera.exe files in Dependency Walker.

Edited by ironman14
Link to comment
Share on other sites


I also found out a way to integrate newer API's into Windows NT 4.0. I started by:

1. Opening a particular EXE in Dependency Walker.

2. Find the DLLS that are called by the particular app/sub DLL connected to app.

I did this with Firefox 3.6 (no update). The DLLs with missing functions in Firefox.exe were actually only in the sub-dll xul.dll, which called for missing APIs in User32.dll,kernel32.dll and Gdi32.dll.

So, I placed a copy of the Windows 2000 SP4 DLLs of each of those, and renamed them to user33.dll, kernel33.dll and gdi33.dll, in order to not meddle with hex editors. I put those in Windows NT 4.0, in the system32 directory. I also saw that the windows 2000 "kernel33.dll" needed nonexistent functions in Ntdll.dll, so I copied that from windows 2000, to my host pc, and renamed it 'otdll.dll" As we'll, user33.dll called for missing functions in kernel33.dll and gdi33.dll. And, gdi33.dll called for missing APIs in kernel33.dll and user33.dll. So, I went back to my host PC, and hex edited user33.dll to say kernel33 instead of kernel32 and to say gdi33 instead of gdi32. I did something similar with gdi33, only I said user33 instead of gdi33. And, in kernel33.dll I redirected Ntdll.dll to otdll.dll.

Finally, after all the editing, Firefox stopped giving procedure entry point not found errors.

But, the result wasn't much better. The exact error message was: The application failed to initialize properly. (0xc0000033). Click on ok to terminate the application.

As well, I tried Flash 10.0.12.36, which was similar except had no issues with gdi32. I didn't have to hex edit the w2k DLLs again, but still had to hex edit npswf32.dll to tell it which dll to use. The flash checker says I have version 10.0.12, which is correct, but whenever I go on a flash site, like Youtube or Dailymotion, the video refuses to play, by simply showing a black screen with no sound. On youtube, Opera shows the "playing" icon on the top of the window, but it doesn't play any video. When I right-click on a video/black screen, it doesn't even show the "About Flash Player 10" option, or the "Settings", so disabling hardware acceleration is not an option.

It wasn't even that hard to integrate Win2K APIs into NT 4.0. I was just clueless about it before. Now, the only challenge we have is getting apps to run.

Link to comment
Share on other sites

I also found out a way to integrate newer API's into Windows NT 4.0. I started by:

1. Opening a particular EXE in Dependency Walker.

2. Find the DLLS that are called by the particular app/sub DLL connected to app.

I did this with Firefox 3.6 (no update). The DLLs with missing functions in Firefox.exe were actually only in the sub-dll xul.dll, which called for missing APIs in User32.dll,kernel32.dll and Gdi32.dll.

So, I placed a copy of the Windows 2000 SP4 DLLs of each of those, and renamed them to user33.dll, kernel33.dll and gdi33.dll, in order to not meddle with hex editors. I put those in Windows NT 4.0, in the system32 directory. I also saw that the windows 2000 "kernel33.dll" needed nonexistent functions in Ntdll.dll, so I copied that from windows 2000, to my host pc, and renamed it 'otdll.dll" As we'll, user33.dll called for missing functions in kernel33.dll and gdi33.dll. And, gdi33.dll called for missing APIs in kernel33.dll and user33.dll. So, I went back to my host PC, and hex edited user33.dll to say kernel33 instead of kernel32 and to say gdi33 instead of gdi32. I did something similar with gdi33, only I said user33 instead of gdi33. And, in kernel33.dll I redirected Ntdll.dll to otdll.dll.

Finally, after all the editing, Firefox stopped giving procedure entry point not found errors.

But, the result wasn'tO much better. The exact error message was: The application failed to initialize properly. (0xc0000033). Click on ok to terminate the application.

As well, I tried Flash 10.0.12.36, which was similar except had no issues with gdi32. I didn't have to hex edit the w2k DLLs again, but still had to hex edit npswf32.dll to tell it which dll to use. The flash checker says I have version 10.0.12, which is correct, but whenever I go on a flash site, like Youtube or Dailymotion, the video refuses to play, by simply showing a black screen with no sound. On youtube, Opera shows the "playing" icon on the top of the window, but it doesn't play any video. When I right-click on a video/black screen, it doesn't even show the "About Flash Player 10" option, or the "Settings", so disabling hardware acceleration is not an option.

It wasn't even that hard to integrate Win2K APIs into NT 4.0. I was just clueless about it before. Now, the only challenge we have is getting apps to run.

In response to this topic before, I tried OpenOffice 3.0, which claimed also to be "Not a valid Windows NT application." So, I opened up the EXE in Dependency Walker, and found out that MSVCR90.dll was missing. I then added it into the app folder , and found out that it had 2 missing functions in Kernel32.dll, so in HxD, I replaced it with Kernel33.dll. No API functions missing. But, the error "<folder path> is not a valid Windows NT application> persisted.

Then, I tried Chrome 23 <not sure why I chose that version>, which clearly has missing API functions. I could not install it, I extracted it from the ZIP. So, I grabbed Blackwingcat's Chrometool for windows 2000, and renamed all the xp dlls ending in XP (blackwingcat's versions) into 30.

Example- ws2_xp.dll - ws2_30.dll.

I connected all the XP DLLs together, and there were a few other things to fix. First of all, Chrome calls for SHGetKnownFolderPath in Shell32.dll (a function only present in Vista+ Shell32.dll, yet chrome works on XP. To fix this, in HxD, I overwrote SHGetKnownFolderPath with SHGetFolderPathW since they have similar functions. I overwrote the additional characters with NULs, not deleted them, which was the whole reason behind my previous VLC failure. It worked well.

The only other problem was that USERENV.dll needed another function, GetProfileType, which is only available in Windows 2000+. So, I looked in Dependency walker to see which DLLs linked to USERENV.dll, and replaced those functions with the "renamed" Windows 2000 functions in W2K Userenv.dll.

Still, same issue. Blackwingcat has made a tool called Fcwin2k.exe for Windows 2000, which can resolve "not a valid win32 application" messages. But, I have tried all versions of it on Windows NT 4.0, yet they crash. So, it is simply a compatibility problem with some of these programs, like Chrome, Openoffice and Opera. However, other programs have their own problems, like Firefox and Flash. I would bet that Thunderbird would have the same problem as FF, since they are compiled very similarly. If anybody knows of any fixes for Flash or FF, please let me know. Also, I may ask Blackwingcat if he can create an Fcwin-style tool for NT 4.0 (compatibility only).

Thanks everyone for your replies.

PS: The reason why I care so much about newer Flash is that about 70% of Flash content today needs version 10+, including some that needs Flash 11+.

UPDATE 1: I tried redownloading Firefox 3.6, and appropriately hex editing the functions, and the error message went away. But, Firefox did the same thing as VLC (displayed loading cursor, then nothing). FF 7 did the same. I tried Firefox 3.6.28 and 4, but they oddly wouldn't allow hex editing of all the needed functions.

Edited by ironman14
Link to comment
Share on other sites

 

I also found out a way to integrate newer API's into Windows NT 4.0. I started by:

1. Opening a particular EXE in Dependency Walker.

2. Find the DLLS that are called by the particular app/sub DLL connected to app.

I did this with Firefox 3.6 (no update). The DLLs with missing functions in Firefox.exe were actually only in the sub-dll xul.dll, which called for missing APIs in User32.dll,kernel32.dll and Gdi32.dll.

So, I placed a copy of the Windows 2000 SP4 DLLs of each of those, and renamed them to user33.dll, kernel33.dll and gdi33.dll, in order to not meddle with hex editors. I put those in Windows NT 4.0, in the system32 directory. I also saw that the windows 2000 "kernel33.dll" needed nonexistent functions in Ntdll.dll, so I copied that from windows 2000, to my host pc, and renamed it 'otdll.dll" As we'll, user33.dll called for missing functions in kernel33.dll and gdi33.dll. And, gdi33.dll called for missing APIs in kernel33.dll and user33.dll. So, I went back to my host PC, and hex edited user33.dll to say kernel33 instead of kernel32 and to say gdi33 instead of gdi32. I did something similar with gdi33, only I said user33 instead of gdi33. And, in kernel33.dll I redirected Ntdll.dll to otdll.dll.

Finally, after all the editing, Firefox stopped giving procedure entry point not found errors.

But, the result wasn'tO much better. The exact error message was: The application failed to initialize properly. (0xc0000033). Click on ok to terminate the application.

As well, I tried Flash 10.0.12.36, which was similar except had no issues with gdi32. I didn't have to hex edit the w2k DLLs again, but still had to hex edit npswf32.dll to tell it which dll to use. The flash checker says I have version 10.0.12, which is correct, but whenever I go on a flash site, like Youtube or Dailymotion, the video refuses to play, by simply showing a black screen with no sound. On youtube, Opera shows the "playing" icon on the top of the window, but it doesn't play any video. When I right-click on a video/black screen, it doesn't even show the "About Flash Player 10" option, or the "Settings", so disabling hardware acceleration is not an option.

It wasn't even that hard to integrate Win2K APIs into NT 4.0. I was just clueless about it before. Now, the only challenge we have is getting apps to run.

In response to this topic before, I tried OpenOffice 3.0, which claimed also to be "Not a valid Windows NT application." So, I opened up the EXE in Dependency Walker, and found out that MSVCR90.dll was missing. I then added it into the app folder , and found out that it had 2 missing functions in Kernel32.dll, so in HxD, I replaced it with Kernel33.dll. No API functions missing. But, the error "<folder path> is not a valid Windows NT application> persisted.

Then, I tried Chrome 23 <not sure why I chose that version>, which clearly has missing API functions. I could not install it, I extracted it from the ZIP. So, I grabbed Blackwingcat's Chrometool for windows 2000, and renamed all the xp dlls ending in XP (blackwingcat's versions) into 30.

Example- ws2_xp.dll - ws2_30.dll.

I connected all the XP DLLs together, and there were a few other things to fix. First of all, Chrome calls for SHGetKnownFolderPath in Shell32.dll (a function only present in Vista+ Shell32.dll, yet chrome works on XP. To fix this, in HxD, I overwrote SHGetKnownFolderPath with SHGetFolderPathW since they have similar functions. I overwrote the additional characters with NULs, not deleted them, which was the whole reason behind my previous VLC failure. It worked well.

The only other problem was that USERENV.dll needed another function, GetProfileType, which is only available in Windows 2000+. So, I looked in Dependency walker to see which DLLs linked to USERENV.dll, and replaced those functions with the "renamed" Windows 2000 functions in W2K Userenv.dll.

Still, same issue. Blackwingcat has made a tool called Fcwin2k.exe for Windows 2000, which can resolve "not a valid win32 application" messages. But, I have tried all versions of it on Windows NT 4.0, yet they crash. So, it is simply a compatibility problem with some of these programs, like Chrome, Openoffice and Opera. However, other programs have their own problems, like Firefox and Flash. I would bet that Thunderbird would have the same problem as FF, since they are compiled very similarly. If anybody knows of any fixes for Flash or FF, please let me know. Also, I may ask Blackwingcat if he can create an Fcwin-style tool for NT 4.0 (compatibility only).

Thanks everyone for your replies.

PS: The reason why I care so much about newer Flash is that about 70% of Flash content today needs version 10+, including some that needs Flash 11+.

UPDATE 1: I tried redownloading Firefox 3.6, and appropriately hex editing the functions, and the error message went away. But, Firefox did the same thing as VLC (displayed loading cursor, then nothing). FF 7 did the same. I tried Firefox 3.6.28 and 4, but they oddly wouldn't allow hex editing of all the needed functions.

 

how do you edit the functions?  I am rooting for you.

Link to comment
Share on other sites

It is a complicated process. I have experimented with NT 4.0 for about 3 months and have recently figured out how to do it. 

In brief:

1. Open up the application in Dependency Walker and view the DLL calls with missing functions.

For example: user32.dll

2. View the external functions that the DLL calls.

For example: user32.dll calls extra functions in Kernel32.dll, user32.dll, Gdi32.dll and Msvcrt.dll.

3. Get the Windows 2000/XP versions of both the DLL and the ones it calls. (whatever the program minimum requirement is, usually.)

4. Rename the DLLs. Usually I change only one character of each DLL. An updated version of Msvcrt.dll is not needed.

For example: user32.dll - user33.dll

5. Hex edit the selected DLL and replace all of it's regular NT 4.0 external functions with the Windows 2000/XP versions.

6. Place updated DLLs in system32 or application directory.

7. Using a hex editor,tell the application/required external DLL to use the custom version, not the NT 4.0 regular version of the DLL

 

Notes:

1. If you have hex edited a certain Win2K/XP DLL before with its external functions. you don't need to do it again.

2. Apps don't always run on startup. They may look like they are loading, and not start, or simply say they are not a valid Windows NT application.

3. You must overwrite the DLL name and not use the backspace arrow. If that happens, the DLL file size will change and the DLL will become corrupt.

 

It is not a simple task and if you are interested, I can do all of this editing myself. To be honest, I was thinking that once I got the "custom" NT 4.0 apps to work, I would upload them for anyone to download and use. I now know for sure that I will send a message to Blackwingcat sometime over the next few days to see if he can make a compatibility tool for NT.

 

Hope this helps you.

Link to comment
Share on other sites

It is a complicated process. I have experimented with NT 4.0 for about 3 months and have recently figured out how to do it. 

In brief:

1. Open up the application in Dependency Walker and view the DLL calls with missing functions.

For example: user32.dll

2. View the external functions that the DLL calls.

For example: user32.dll calls extra functions in Kernel32.dll, user32.dll, Gdi32.dll and Msvcrt.dll.

3. Get the Windows 2000/XP versions of both the DLL and the ones it calls. (whatever the program minimum requirement is, usually.)

4. Rename the DLLs. Usually I change only one character of each DLL. An updated version of Msvcrt.dll is not needed.

For example: user32.dll - user33.dll

5. Hex edit the selected DLL and replace all of it's regular NT 4.0 external functions with the Windows 2000/XP versions.

6. Place updated DLLs in system32 or application directory.

7. Using a hex editor,tell the application/required external DLL to use the custom version, not the NT 4.0 regular version of the DLL

 

Notes:

1. If you have hex edited a certain Win2K/XP DLL before with its external functions. you don't need to do it again.

2. Apps don't always run on startup. They may look like they are loading, and not start, or simply say they are not a valid Windows NT application.

3. You must overwrite the DLL name and not use the backspace arrow. If that happens, the DLL file size will change and the DLL will become corrupt.

 

It is not a simple task and if you are interested, I can do all of this editing myself. To be honest, I was thinking that once I got the "custom" NT 4.0 apps to work, I would upload them for anyone to download and use. I now know for sure that I will send a message to Blackwingcat sometime over the next few days to see if he can make a compatibility tool for NT.

 

Hope this helps you.

Thanks, I'm trying to do it... I sent you a pm for an information. ^^

Link to comment
Share on other sites

Guys, I don't know if it will be useful, but I found a way to replace the dll on system 32  (for example kernel32.dll etc...). 

 

You must put the new dll (for example the 2000's one) in a folder, for example on C. Rename kernel32.dll in kernel32.dl_ (you need to rename all of the dll you want to replace... For example User32.dll----> user32.dl_ , Advapi32.dll----> Advapi32.dl_  etc..)

 

Now, open the command prompt (from start\all programm\command prompt)

 

1. write "cd\winnt\system32" (without quotation marks)

2.write "ren kernel32.dll kernel32.old.dll" (without quotation marks)

3.write "Expand C:\new dll folder\kernel32.dl_ C:\winnt\system32\kernel32.dll" (without quotation marks)

 

P.S: "new dll folder"  is the folder you have put the new dll. You can rename this folder as you want.

 

Sorry for my bad English xD If you don't undertand, I will upload some screenshot with the process.

Edited by junior600
Link to comment
Share on other sites

Guys, I don't know if it will be useful, but I found a way to replace the dll on system 32 (for example kernel32.dll etc...).

You must put the new dll (for example the 2000's one) in a folder, for example on C. Rename kernel32.dll in kernel32.dl_ (you need to rename all of the dll you want to replace... For example User32.dll----> user32.dl_ , Advapi32.dll----> Advapi32.dl_ etc..)

Now, open the command prompt (from start\all programm\command prompt)

1. write "cd\winnt\system32" (without quotation marks)

2.write "ren kernel32.dll kernel32.old.dll" (without quotation marks)

3.write "Expand C:\new dll folder\kernel32.dl_ C:\winnt\system32\kernel32.dll" (without quotation marks)

P.S: "new dll folder" is the folder you have put the new dll. You can rename this folder as you want.

Sorry for my bad English xD If you don't undertand, I will upload some screenshot with the process.

That's a good find. I think it will be useful in the future.

Also, I am not going to upload any "special" NT 4.0 apps until,they are tested and capable of running at least somewhat.

Edited by ironman14
Link to comment
Share on other sites

  • 5 weeks later...

Using these custom-made apps I've tested in the past month, they appear not to start so I think I may use regular, un-tweaked applications for testing with the following method. Thank you very much.

Link to comment
Share on other sites

  • 3 weeks later...

I have tried junior600's method on kernel32.dll, and it worked, but FF7, which the EXE of it only needed that DLL, still called for a missing function, Getprocessiocounters. It could be an external file.

Link to comment
Share on other sites

Guys, I don't know if it will be useful, but I found a way to replace the dll on system 32 (for example kernel32.dll etc...).

You must put the new dll (for example the 2000's one) in a folder, for example on C. Rename kernel32.dll in kernel32.dl_ (you need to rename all of the dll you want to replace... For example User32.dll----> user32.dl_ , Advapi32.dll----> Advapi32.dl_ etc..)

Now, open the command prompt (from start\all programm\command prompt)

1. write "cd\winnt\system32" (without quotation marks)

2.write "ren kernel32.dll kernel32.old.dll" (without quotation marks)

3.write "Expand C:\new dll folder\kernel32.dl_ C:\winnt\system32\kernel32.dll" (without quotation marks)

P.S: "new dll folder" is the folder you have put the new dll. You can rename this folder as you want.

Sorry for my bad English xD If you don't undertand, I will upload some screenshot with the process.

I'm talking to you now, junior600. Have you got your NT 4 PC to boot after making this change? Because Mine just hangs at the "Windows NT 4.0 (Build 1381:Service Pack 6) portion of the startup. It may take a few minutes to work, but I don't know. By the way, I replaced kernel32.dll and Ntdll.dll.

Link to comment
Share on other sites

 

Guys, I don't know if it will be useful, but I found a way to replace the dll on system 32 (for example kernel32.dll etc...).

You must put the new dll (for example the 2000's one) in a folder, for example on C. Rename kernel32.dll in kernel32.dl_ (you need to rename all of the dll you want to replace... For example User32.dll----> user32.dl_ , Advapi32.dll----> Advapi32.dl_ etc..)

Now, open the command prompt (from start\all programm\command prompt)

1. write "cd\winnt\system32" (without quotation marks)

2.write "ren kernel32.dll kernel32.old.dll" (without quotation marks)

3.write "Expand C:\new dll folder\kernel32.dl_ C:\winnt\system32\kernel32.dll" (without quotation marks)

P.S: "new dll folder" is the folder you have put the new dll. You can rename this folder as you want.

Sorry for my bad English xD If you don't undertand, I will upload some screenshot with the process.

I'm talking to you now, junior600. Have you got your NT 4 PC to boot after making this change? Because Mine just hangs at the "Windows NT 4.0 (Build 1381:Service Pack 6) portion of the startup. It may take a few minutes to work, but I don't know. By the way, I replaced kernel32.dll and Ntdll.dll.

 

No, it doesn't work :/ It wil appear the BSOD

Link to comment
Share on other sites

Oh. We were so close! I backed up my VM, expecting the worst. But, I am not sure what to try now. Any ideas?

BTW: That method was a really good suggestion. But, I'm afraid we have a boot problem. Does anyone know how Microsoft does it?

Thanks

Edited by ironman14
Link to comment
Share on other sites

  • 1 year later...

attachicon.gifShell32vlc.7z

Shell32vlc.dll is a wrapper that forwards three calls as needed (by VLC 1.1.10):

LIBRARY   Shell32vlcEXPORTS CommandLineToArgvW	= SHELL32.CommandLineToArgvW SHGetFolderPathW	= SHFOLDER.SHGetFolderPathW ShellExecuteW		= SHELL32.ShellExecuteW

I downloaded this once more, eager to see if it would actually work, testing with vlc 0.9.8a and 1.0.5. For 0.9.8a, I renames the file to shell 32.vlc and had to hexedit it in libvlccore.dll. For version 1.0.5, I had to hexedit vlc.exe.

 

I was amazed that they actually load and work. VLC 0.9.8a loads, the menu and dialogs work, it plays music and video, the basic controls (play, pause, fast forward, stop, volume), playlists and the menu and equalizer work. I haven't tested CD's and DVD's yet. I can't seem to get my physical CD Drive to work in NT 4.0 under Virtualbox (ISO's work), although it clearly lists options to use the CD drives in a VM.

 

On the other hand, VLC 1.0.5 is so broken that it is almost unusable. The menu doesn't work, and consequently, the dialogs don't work. The only way to open a file for playing is by right-clicking it and selecting "Play with VLC Media player." Audio seems to play, and I don't know if there is supposed to be a visualiser or not, but if there is, it isn't there. Just a black screen. When I open a video file for testing, it insists in opening the video in a command prompt window, and it is all covered by DOS characters as it plays. The equaliser works and I'm not sure about playlists, Cd's and DVD's.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...