http://bugs.winehq.org/show_bug.cgi?id=27827
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Creo Elements/Direct |Creo Elements/Direct |Modeling Express 4.0 loader |Modeling Express 4.0 loader |failure due to missing |failure due to missing |msvcrt.dll dependency |msvcrt.dll dependency | |(native netapi32.dll | |imports msvcrt functions)
--- Comment #7 from Anastasius Focht focht@gmx.net 2011-07-21 16:09:34 CDT --- Hello,
why adding msvcrt reference to import list "magically" worked...
Dumping Wine netapi32.dll in-memory PE (along with import descriptor table) with your patch applied reveals:
--- snip --- ->Import Table 1. ImageImportDescriptor: OriginalFirstThunk: 0x0001F470 TimeDateStamp: 0x00000000 (GMT: Thu Jan 1 00:00:00 1970) ForwarderChain: 0x00000000 Name: 0x0001F99C ("iphlpapi.dll") FirstThunk: 0x0001F558
Ordinal/Hint API name ------------ --------------------------------------- 0x0020 "GetIfEntry" 0x0026 "GetIpAddrTable"
2. ImageImportDescriptor: OriginalFirstThunk: 0x0001F47C TimeDateStamp: 0x00000000 (GMT: Thu Jan 1 00:00:00 1970) ForwarderChain: 0x00000000 Name: 0x0001F9A9 ("ws2_32.dll") FirstThunk: 0x0001F564
Ordinal/Hint API name ------------ --------------------------------------- 0x006F "WSAGetLastError" 0x0047 "WSARecv" 0x0049 "WSARecvFrom" 0x004C "WSASend" 0x004E "WSASendTo" 0x0052 "WSASocketA" 0x0003 "closesocket" 0x0004 "connect" 0x0034 "gethostbyname" 0x000B "inet_addr" 0x000C "inet_ntoa" 0x0012 "select" 0x0015 "setsockopt"
3. ImageImportDescriptor: OriginalFirstThunk: 0x0001F4B4 TimeDateStamp: 0x00000000 (GMT: Thu Jan 1 00:00:00 1970) ForwarderChain: 0x00000000 Name: 0x0001F9B4 ("advapi32.dll") FirstThunk: 0x0001F59C
Ordinal/Hint API name ------------ --------------------------------------- 0x003B "CopySid" 0x00A8 "GetLengthSid" 0x00CB "GetUserNameW" 0x00EF "LsaClose" 0x00FD "LsaFreeMemory" 0x0105 "LsaNtStatusToWinError" 0x0107 "LsaOpenPolicy" 0x010C "LsaQueryInformationPolicy" 0x014D "RegCloseKey" 0x016F "RegOpenKeyExW" 0x0170 "RegOpenKeyW" 0x0178 "RegQueryValueExA" 0x0179 "RegQueryValueExW"
4. ImageImportDescriptor: OriginalFirstThunk: 0x0001F4EC TimeDateStamp: 0x00000000 (GMT: Thu Jan 1 00:00:00 1970) ForwarderChain: 0x00000000 Name: 0x0001F9C1 ("msvcrt.dll") FirstThunk: 0x0001F5D4
Ordinal/Hint API name ------------ --------------------------------------- 0x03B3 "memcpy"
5. ImageImportDescriptor: OriginalFirstThunk: 0x0001F4F4 TimeDateStamp: 0x00000000 (GMT: Thu Jan 1 00:00:00 1970) ForwarderChain: 0x00000000 Name: 0x0001F9CC ("kernel32.dll") FirstThunk: 0x0001F5DC
Ordinal/Hint API name ------------ --------------------------------------- 0x00AA "CloseHandle" 0x00CB "CreateEventW" 0x00EB "CreateThread" 0x00FF "DeleteCriticalSection" 0x0107 "DisableThreadLibraryCalls" 0x0111 "EnterCriticalSection" 0x01A0 "GetComputerNameW" 0x01E1 "GetEnvironmentVariableW" 0x0269 "GetTickCount" 0x0277 "GetVersionExW" 0x029D "HeapAlloc" 0x02A3 "HeapFree" 0x02A7 "HeapReAlloc" 0x02AA "HeapSize" 0x02B4 "InitializeCriticalSection" 0x02FF "LeaveCriticalSection" 0x0366 "RaiseException" 0x03B4 "ResetEvent" 0x03B7 "ResumeThread" 0x040C "SetEvent" 0x0487 "WaitForSingleObject" 0x048C "WideCharToMultiByte" 0x04BC "lstrcmpW" 0x04BF "lstrcmpiW" --- snip ---
Surprise: memcpy ;-)
"Offline" dump with msvcrt reference through imports list:
--- snip --- $ objdump -d netapi32.dll.so | grep memcpy -A 5 -B 1
00015970 <memcpy>: 15970: e8 27 01 00 00 call 15a9c <__wine_spec_get_pc_thunk_eax> 15975: ff a0 5f 6c 01 00 jmp *0x16c5f(%eax) 1597b: 90 nop
-- 1a1ec: 89 04 24 mov %eax,(%esp) 1a1ef: e8 7c b7 ff ff call 15970 <memcpy> 1a1f4: 8b 45 dc mov -0x24(%ebp),%eax 1a1f7: 01 45 e0 add %eax,-0x20(%ebp) 1a1fa: 8b 45 e0 mov -0x20(%ebp),%eax 1a1fd: 03 45 0c add 0xc(%ebp),%eax 1a200: c6 00 00 movb $0x0,(%eax) ... --- snip ---
"Offline" dump without msvcrt imports list reference:
--- snip --- $ objdump -d netapi32.dll.so | grep memcpy 000129e8 memcpy@plt: 1a213: e8 d0 87 ff ff call 129e8 memcpy@plt 1b64e: e8 95 73 ff ff call 129e8 memcpy@plt 1ba88: e8 5b 6f ff ff call 129e8 memcpy@plt 1dca0: e8 43 4d ff ff call 129e8 memcpy@plt 21ebd: e8 26 0b ff ff call 129e8 memcpy@plt 21ef4: e8 ef 0a ff ff call 129e8 memcpy@plt
$ objdump -S -j .plt netapi32.dll.so | grep -A 4 -B 1 memcpy
000129e8 memcpy@plt: 129e8: ff a3 28 00 00 00 jmp *0x28(%ebx) 129ee: 68 38 00 00 00 push $0x38 129f3: e9 70 ff ff ff jmp 12968 <__wine_spec_pe_header+0x1100f> --- snip ---
That one goes through GOT/PLT -> libc.
Adjusting summary.
Regards