Jump to content

Recommended Posts

Posted

Well, of course I added this function to the dll file.

But I've tested it now.

On Win98 it works just fine. The application uses the function from the dll1.dll file. I've tested this by removing the function again and the application complains about dll1.dll missing that function (which makes perfect sense and proves that the application checks the dll1.dll file for that function)

So, as it seems I did everything correctly as far as this import/export/redirecting stuff is concerned.

The application just doesn't work on Win95 and as it seems, it doesn't even bother to check that dll1.dll. It just complains about a missing function in user32.dll

Strange but true.


Posted (edited)

That's because missing function is still in the imports list, you need to "open" your application into HEX editor and rename this missing function to name of some unused function from user32.dll

for example "PaintDesktop" or some other unused function, and that will do the trick.

1YKFVCz.png

Edited by ABCDEFG
Posted

Oh, interesting.

But I don't know how to replace the name of the function.

I've tried it in several different ways but when I save the file as an exe file the icon is gone and Windows says it's not a valid file so how am I supposed to change it?
 

Posted

Probably because you change size of application. Overwrite name letter by letter! Do not use insert / copy&paste method!

And it must be NULL terminated string

54 72 61 63 6B 4D 6F 75 73 65 45 76 65 6E 74 00 00 - TrackMouseEvent
50 61 69 6E 74 44 65 73 6B 74 6F 70 00 00 00 00 00 - PaintDesktop
Posted

That's cumbersome...

It worked now by manually typing it but the application still doesn't work because now there is an error message complaining about a missing function in dll1.dll

Guess which function...
PaintDesktop!
;)

Are you sure it works this way?
 

Posted

Of course i am sure!

And i don't know why you need that dll1.dll for foxit reader?

It does not use TrackMouseEvent from user32.dll it uses it from comctl32.dll

Posted (edited)

 I don't know which file it really uses, but the error message says that there is a missing function in user32.dll and its name is TrackMouseEvent

That's why I started the whole thread and I can only rely on what Windows and dependency walker tells me.

All I know is that it's now looking for PaintDesktop in dll1.dll and even though I really don't know much about this stuff, it kinda makes sense to me, because I pointed it to this function by editing the application, so no big surprise...

Edited by NoNameNeeded
Posted

I just cheked it about 1hour ago and i saw that it does not use that function from user32.dll

so, forward exported functions and additional dlls are not needed for foxit reader.

Posted

But the application thinks it needs this function from user32.dll and won't start without it.

And this redirection stuff only seems to work if there is the same function in user32.dll (like in Win98), which makes no sense, because why would anyone bother to redirect this function if the application still looks for it in its original place?

Posted

...or to put it differently:
Even though this redirection process seems to have worked, there is apparently more that needs to be done because there are still references to this function in user32.dll, even after redirecting.

So these other references apparently also need to be changed to the new dll and just renaming the function to another missing function doesn't seem to help.

Posted

Ok, I finally got it to work by changing one of the two references to "GetWindowInfo" so yes, it works now.

But this redirection ordeal kinda led to nowhere...

Posted (edited)
User32.dll : TrackMouseEvent takes one parameter, returns a BOOL (boolean), and sets extended error information.
GetWindowInfo takes two parameters and will corrupt the stack if called when used to replace TrackMouseEvent.

Instead use one of the following:
  CloseDesktop
  CloseWindow
  CopyIcon
  DestroyCursor
  DestroyIcon
  DestroyMenu
  DestroyWindow
  DrawMenuBar
  GetDlgCtrlID
  GetKeyboardType

Do not attempt to use User32.dll from Win98 in Win95.
Do not attempt to redirect DLL's in Win95.

Edited by jumper
Posted (edited)
7 hours ago, jumper said:

Do not attempt to use User32.dll from Win98 in Win95.
Do not attempt to redirect DLL's in Win95.
 

Thx for your information!

No, user32.dll from Win98 doesn't work in Win95 anyway, I've tried that even though I didn't expect it to work and I was right.

However, I have another user32.dll from a beta version of Win98, which does work (if replaced together with user.exe from that same build). That's how I found out that several applications would actually work with just a little bit of more functions in user32.dll and that's basically why I started this thread.

So it's in general a bad idea to redirect dlls in Win95?

Why?

Doesn't it work or are applications very prone to crash when redirected?
-------


Could you name a few safe "replacement" functions for kernel32.dll?

Edited by NoNameNeeded
  • 4 years later...
Posted

It is somewere in my archive but i don't know where exactly beacause my archive is ~100TB and

is not well organised so i can not find it right now, but if you need something specific to do just say it,

maybe i can help or someone else...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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