[Bug 38269] Project64k fails to load controller plugins
wine-bugs at winehq.org
wine-bugs at winehq.org
Mon Jul 24 13:00:14 CDT 2017
https://bugs.winehq.org/show_bug.cgi?id=38269
Alexandre Julliard <julliard at winehq.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |NOTOURBUG
Status|NEW |RESOLVED
--- Comment #10 from Alexandre Julliard <julliard at winehq.org> ---
The app is loading the Jabo_DInput.dll plugin and calling its GetDllInfo entry
point. It then checks the returned structure for Type == 4 (controller) and
Version == 0x100, which matches. It then checks that offset 0x6c in that
structure contains non-zero:
0x00449532: call *0x46007c -> 0x7b457f80 LoadLibraryA in kernel32
0x00449538: testl %eax,%eax
0x0044953a: movl %eax,0x0048de90
0x0044953f: jz 0x00449592
0x00449541: movl 0x00460078,%esi
0x00449547: pushl $0x469594
0x0044954c: pushl %eax
0x0044954d: call *%esi -> GetProcAddress
0x0044954f: testl %eax,%eax
0x00449551: movl %eax,0x00493e48
0x00449556: jz 0x00449592
0x00449558: leal 0xc(%esp),%ecx
0x0044955c: pushl %ecx
0x0044955d: call *%eax -> GetDllInfo
0x0044955f: movl 0x12(%esp),%edx
0x00449563: andl $0xffff,%edx
0x00449569: leal 0xffffffff(%edx),%eax
0x0044956c: addl $4,%esp
0x0044956f: cmpl $3,%eax
0x00449572: jnbe 0x00449592
0x00449574: jmp *0x4496e8(,%eax,4)
[...]
0x004495c6: movw 0xc(%esp),%ax
0x004495cb: cmpw $256,%ax
0x004495cf: jnz 0x00449592
0x004495d1: movl 0x78(%esp),%ecx
0x004495d5: testl %ecx,%ecx
0x004495d7: jz 0x00449592 (jump in failure case)
The structure is apparently:
typedef struct {
WORD Version;
WORD Type;
char Name[100];
BOOL NormalMemory;
BOOL MemoryBswaped;
} PLUGIN_INFO;
So it wants MemoryBswaped to be non-zero. But the plugin never puts anything in
there:
0x011f2e10 GetDllInfo in jabo_dinput: movl 0x4(%esp),%eax
0x011f2e14: pushl $0x11f7aa4
0x011f2e19: pushl $0x11f7b3c
0x011f2e1e: movw $0x100,0x0(%eax)
0x011f2e23: movw $0x4,0x2(%eax)
0x011f2e29: addl $4,%eax
0x011f2e2c: pushl %eax
0x011f2e2d: call *0x11f6068 -> 0x7bdc2240 MSVCRT_sprintf
0x011f2e33: addl $12,%esp
0x011f2e36: ret
As expected, it's checking uninitialized stack data, and will fail randomly if
that stack address happens to contain 0. It's a plugin bug, and I don't see a
good way of working around it in Wine.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list