CreateFileA with /dev/random as WinNT filename

Karl Vogel karl.vogel at gmail.com
Sat Jun 13 09:43:40 CDT 2009


In ran into a problem with a game, Dark Age of Camelot, where it locked up
after logging into the game. After some tracing it became apparent that the
game was trying to read bytes from /dev/random, but due to me working
remotely on the computer, not enough entropy was generated which stalled the
game.

I was just wondering if it would be acceptable to specifically check for
/dev/random in wine_nt_to_unix_file_name() and turn that into /dev/urandom
?!


Small snippet of the login.dll executable code:

.text:0042C150 sub_42C150      proc near               ; CODE XREF:
sub_4267E0+5B0C p
.text:0042C150
.text:0042C150 arg_0           = dword ptr  8
.text:0042C150 arg_4           = dword ptr  0Ch
.text:0042C150
.text:0042C150                 push    esi
.text:0042C151                 push    offset aRb      ; "rb"
.text:0042C156                 push    offset aDevRandom ; "/dev/random"
.text:0042C15B                 call    _fopen
.text:0042C160                 mov     esi, eax
.text:0042C162                 add     esp, 8
.text:0042C165                 test    esi, esi
.text:0042C167                 jz      short loc_42C185
.text:0042C169                 push    0               ; size_t
.text:0042C16B                 push    4               ; int
.text:0042C16D                 push    0               ; char *
.text:0042C16F                 push    esi             ; FILE *
.text:0042C170                 call    _setvbuf
.text:0042C175                 add     esp, 10h
.text:0042C178                 test    eax, eax
.text:0042C17A                 jz      short loc_42C189
.text:0042C17C                 push    esi             ; FILE *
.text:0042C17D                 call    _fclose
.text:0042C182                 add     esp, 4
.text:0042C185
.text:0042C185 loc_42C185:                             ; CODE XREF:
sub_42C150+17 j
.text:0042C185                 xor     eax, eax
.text:0042C187                 pop     esi
.text:0042C188                 retn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090613/979e1e58/attachment.htm>


More information about the wine-devel mailing list