retrowin32 icon indicating copy to clipboard operation
retrowin32 copied to clipboard

Builtin msvcrt.dll/ucrtbase.dll do not export variables, making _adjust_fdiv invalid

Open evmar opened this issue 1 year ago • 1 comments

msvcrt.dll exports a _adjust_fdiv symbol which points at a plain int. retrowin32 currently doesn't support anything other than function exports from its builtin dlls, so any program (including win2k sol.exe) that uses msvcrt.dll and this symbol will crash when you run it with retrowin32's built in msvcrt:

ERROR cli/src/main.rs:242 "oob at f1a7005d"
0100614d 8b08       mov ecx,[eax]

(It's trying to read *_adjust_fdiv and it's null here.)

Wine has a mechanism where you can force it to choose between its builtin dll or an external one see docs. We could maybe built a similar feature in retrowin32 so you could use external msvcrt.dll.

I am also working on a fix so retrowin32 can implement _adjust_fdiv, making this particular problem obsolete.

FYI for @lqs

evmar avatar Jul 29 '24 21:07 evmar

Note to self, I was confused why this wasn't a problem on web, but it's because dereferencing a null pointer works there, of course!

evmar avatar Sep 19 '24 15:09 evmar