https://bugs.winehq.org/show_bug.cgi?id=40583
Bug ID: 40583 Summary: Wine - mtndew.dll fails to initialize due to memory pointer work Product: Wine Version: 1.7.53 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: pjb82@outlook.com Distribution: ---
Attempting to run 'Eldorito' in WINE (https://github.com/ElDewrito/ElDorito.git) fails, seemingly due to the pointer work which is pervasive through the code.
I have modified the code a little in the Git to try to track the failure. It appears that the memory pointer work causes the failed initialization with the first action being:
size_t TlsPtrAddress = Pointer(TlsPtrArrayAddress).Read<uint32_t>();
I am creating this report at the request of hackomatic in the #winehackers channel on freenode.net
https://bugs.winehq.org/show_bug.cgi?id=40583
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #1 from Dmitry Timoshkov dmitry@baikal.ru --- There are several problems with that code.
First it highly depends on the OS and compiler (and is i386 specific). According to my tests NtCurrentTeb()->ThreadLocalStoragePointer may be not initialized, or initialized differently depending on whether PE image provides TLS or not. Currently Wine doesn't initialize TEB TLS pointer at all if there is no TLS in the loaded PE modules. Next, the code uses pretty convoluted way of accessing teb->ThreadLocalStoragePointer of the target thread that currently doesn't work under Wine, basically GetThreadSelectorEntry(context.SegFs) fails leading to a crash.
https://bugs.winehq.org/show_bug.cgi?id=40583
--- Comment #2 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 54425 --> https://bugs.winehq.org/attachment.cgi?id=54425 patch
Does the attached patch help?
(You would need to apply the patch to Wine source and compile).
https://bugs.winehq.org/show_bug.cgi?id=40583
--- Comment #3 from Jon pjb82@outlook.com --- We have re-coded our TLS implementation within Eldorito based upon your feedback. Still not successfully running yet in WINE, but we're building additional tracing into our code to hunt it down. The new TLS method does not cause WINE to reject mtndew.dll.
https://bugs.winehq.org/show_bug.cgi?id=40583
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
--- Comment #4 from Sebastian Lackner sebastian@fds-team.de --- A patch for the FS segment issue has been accepted: http://source.winehq.org/git/wine.git/commit/d039d188f49d97b92694dbebcbbc72a... The next one is probably the ThreadLocalStoragePointer problem as described in comment 1 (if its still relevant).
@Jon: Please note that in most cases its not a good idea to modify application code to work better with Wine. Fixing those issues properly on the Wine side can also help unrelated applications.
https://bugs.winehq.org/show_bug.cgi?id=40583
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED URL| |https://archive.org/details | |/ElDewrito0.6 CC| |focht@gmx.net Resolution|--- |DUPLICATE Keywords| |download Component|-unknown |ntdll Summary|Wine - mtndew.dll fails to |ElDewrito/ElDorito (fan mod |initialize due to memory |for Halo Online) crashes on |pointer work |startup | |(GetThreadSelectorEntry | |fails)
--- Comment #5 from Anastasius Focht focht@gmx.net --- Hello folks,
adding more links.
https://github.com/ElDewrito/ElDorito
--- quote --- ElDewrito development is on hold right now. We are not accepting issue reports or pull requests. For more information, please see our blog. --- quote ---
The Github project seems pretty much dead.
Found a download for ElDewrito v0.6 here:
https://archive.org/details/ElDewrito0.6
WineHQ appdb entry says it works with Wine 4.0
https://appdb.winehq.org/objectManager.php?sClass=application&iId=18424
Tested locally, game/mod starts fine here as well.
--- snip --- $ pwd /home/focht/Downloads/ElDewrito0.6/Halo Online
$ WINEDEBUG=+seh,+relay wine ./eldorado.exe >>log.txt 2>&1 ... --- snip ---
There was no further activity here since a long time. Taking the commit https://source.winehq.org/git/wine.git/commitdiff/d039d188f49d97b92694dbebcb... ("ntdll: Add support for fs segment in ThreadDescriptorTableEntry query.") mentioned by Sebastian in comment #4 as resolution.
That one is tracked by bug 27708 ("GetThreadSelectorEntry fails"), hence resolving as dupe here.
ProtectionID scan for documentation:
--- snip --- -=[ ProtectionID v0.6.9.0 DECEMBER]=- (c) 2003-2017 CDKiLLER & TippeX Build 24/12/17-21:05:42 Ready... Scanning -> Z:\home\focht\Downloads\ElDewrito0.6\Halo Online\mtndew.dll File Type : 32-Bit Dll (Subsystem : Win CUI / 3), Size : 4661760 (0472200h) Byte(s) | Machine: 0x14C (I386) Compilation TimeStamp : 0x5AD972EA -> Fri 20th Apr 2018 04:56:10 (GMT) [TimeStamp] 0x5AD972EA -> Fri 20th Apr 2018 04:56:10 (GMT) | PE Header | - | Offset: 0x00000178 | VA: 0x10000178 | - [TimeStamp] 0xFFFFFFFF -> Sun 07th Feb 2106 06:28:15 (GMT) | Export | - | Offset: 0x003E4FA4 | VA: 0x103E67A4 | - [TimeStamp] 0x5AD972EA -> Fri 20th Apr 2018 04:56:10 (GMT) | DebugDirectory | - | Offset: 0x00398AD4 | VA: 0x1039A2D4 | - [!] Executable uses TLS callbacks (1 total... 0 invalid addresses) [LoadConfig] Struct determined as v8 (Expected size 140 | Actual size 64) [!] Executable uses SEH Tables (/SAFESEH) (1803 calculated 1803 recorded... 0 invalid addresses) [LoadConfig] CodeIntegrity -> Flags 0x0 | Catalog 0x0 (0) | Catalog Offset 0x0 | Reserved 0x0 [LoadConfig] GuardAddressTakenIatEntryTable 0x0 | Count 0x0 (0) [LoadConfig] GuardLongJumpTargetTable 0x0 | Count 0x0 (0) [LoadConfig] HybridMetadataPointer 0x0 | DynamicValueRelocTable 0x0 [LoadConfig] FailFastIndirectProc 0x0 | FailFastPointer 0x0 [LoadConfig] UnknownZero1 0x0 [File Heuristics] -> Flag #1 : 00000100000001001101000100000000 (0x0404D100) [Entrypoint Section Entropy] : 6.58 (section #0) ".text " | Size : 0x33F3D4 (3404756) byte(s) [DllCharacteristics] -> Flag : (0x0140) -> ASLR | DEP [SectionCount] 5 (0x5) | ImageSize 0x4CB000 (5025792) byte(s) [Export] 3% of function(s) (2 of 64) are in file | 0 are forwarded | 2 code | 0 data | 0 uninit data | 0 unknown | [VersionInfo] Company Name : ElDewrito Development Team [VersionInfo] Product Name : ElDewrito [VersionInfo] Product Version : 0.6.0.0 [VersionInfo] File Description : Halo Online extension [VersionInfo] File Version : 0.6.0.0 [VersionInfo] Original FileName : ElDewrito.dll [VersionInfo] Internal Name : ElDewrito.dll [ModuleReport] [IAT] Modules -> KERNEL32.dll | USER32.dll | SHELL32.dll | ADVAPI32.dll | d3dx9_43.dll | WS2_32.dll | PSAPI.DLL | WINMM.dll | libcef.dll | IPHLPAPI.DLL | WINHTTP.dll | MSWSOCK.dll [Debug Info] (record 1 of 1) (file offset 0x398AD0) Characteristics : 0x0 | TimeDateStamp : 0x5AD972EA (Fri 20th Apr 2018 04:56:10 (GMT)) | MajorVer : 0 / MinorVer : 0 -> (0.0) Type : 13 (0xD) -> Undocumented | Size : 0x3BC (956) AddressOfRawData : 0x3A940C | PointerToRawData : 0x3A7C0C [CdKeySerial] found "Test Version" @ VA: 0x0034D489 / Offset: 0x0034BC89 [CdKeySerial] found "SerialNumber" @ VA: 0x0036E8F4 / Offset: 0x0036D0F4 [CdKeySerial] found "SerialNumber" @ VA: 0x0037BE49 / Offset: 0x0037A649 [CdKeySerial] found "SerialNumber" @ VA: 0x0037BEFB / Offset: 0x0037A6FB [!] File appears to have no protection or is using an unknown protection - Scan Took : 0.910 Second(s) [00000038Eh (910) tick(s)] [246 of 580 scan(s) done] --- snip ---
Exports:
--- snip --- ->Export Table Characteristics: 0x00000000 TimeDateStamp: 0xFFFFFFFF MajorVersion: 0x0000 MinorVersion: 0x0000 -> 0.00 Name: 0x003E68D4 ("mtndew.dll") Base: 0x00000001 NumberOfFunctions: 0x00000040 NumberOfNames: 0x00000002 AddressOfFunctions: 0x003E67C8 AddressOfNames: 0x003E68C8 AddressOfNameOrdinals: 0x003E68D0
Ordinal RVA Symbol Name ------- ---------- ---------------------------------- 0x0001 0x000F40C0 "GetEDVersion" 0x0040 0x0027D364 "GetAdaptersInfo" --- snip ---
$ sha1sum ElDewrito\ 0.6.zip bedae9cdc769d15af88524e0afc1e0e17ca1f2e9 ElDewrito 0.6.zip
$ du -sh ElDewrito\ 0.6.zip 2.1G ElDewrito 0.6.zip
$ wine --version wine-5.3
Regards
*** This bug has been marked as a duplicate of bug 27708 ***
https://bugs.winehq.org/show_bug.cgi?id=40583
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Duplicate.