http://bugs.winehq.org/show_bug.cgi?id=34558
Bug #: 34558 Summary: Alawar launcher fails to start after game has been registered Product: Wine Version: 1.7.2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: thesource@mail.ru Classification: Unclassified
Created attachment 46008 --> http://bugs.winehq.org/attachment.cgi?id=46008 Alawar launcher wine log
Alawar game launcher starts properly when the game is in trial mode, but after it has been registered, launcher exits showing message box "Error: 198". According to log wine complains it can not create some ole objects. Judging by uuids it's something related to msxml, but winetricking msxml (3, 4, 6) does not help. Attaching log with WINEDEBUG=ole
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #1 from The Source thesource@mail.ru 2013-12-11 06:30:49 CST --- Still true in 1.7.8
http://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #2 from Anastasius Focht focht@gmx.net 2013-12-11 06:40:52 CST --- Hello folks,
is there a download available?
http://www.alawar.com/ -> which game? http://www.alawar.com/item/alawar-game-box -> this one?
WINEDEBUG=ole alone is not useful at all. Attach pure terminal output.
Again: Only attach logs with specific WINEDEBUG channels if actually requested by a developer. Exception: you know the reason/solution and want to pinpoint something.
Regards
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #3 from The Source thesource@mail.ru 2013-12-11 06:49:58 CST --- Direct link to the installer (I could'n find an English version): http://www.alawar.ru/download/MidnightMysteriesHauntedHoudiniCollectorsEditi...
The attached file is a terminal output, I just meant that WINEDEBUG variable was set to ole. Here's terminal output without settings that variable:
fixme:exec:SHELL_execute flags ignored: 0x00000100 fixme:exec:SHELL_execute flags ignored: 0x00004100 [thesource@fedotov ~]$ Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated. fixme:mountmgr:harddisk_ioctl Unsupported ioctl 4d004 (device=4 access=3 func=401 method=0) fixme:mountmgr:harddisk_ioctl Unsupported ioctl 4d004 (device=4 access=3 func=401 method=0) err:ole:CoCreateInstance apartment not initialised err:ole:CoCreateInstance apartment not initialised err:ole:CoCreateInstance apartment not initialised err:ole:CoCreateInstance apartment not initialised fixme:mountmgr:harddisk_ioctl Unsupported ioctl 4d004 (device=4 access=3 func=401 method=0)
http://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.alawar.ru/downlo | |ad/MidnightMysteriesHaunted | |HoudiniCollectorsEditionRus | |.exe
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello,
please generate a trace log as follows:
1) no apps running (wineserver -k) 2) start one Wine builtin app in another terminal (same WINEPREFIX winecfg/notepad...) to avoid tracing of unwanted processes 3) "cd" to the app directory and execute:
WINEDEBUG=+tid,+seh,+relay,+ole,+variant wine ./MidnightMysteries4.exe
log.txt 2>&1
Run the launcher to some point past the error. Ctrl+C or 'wineserver -k' from another terminal.
Attach the file to the bug - do not copy/paste the contents! Compress the trace log if too large for plain text attachment (bzip2).
Regards
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #5 from The Source thesource@mail.ru --- Created attachment 46829 --> http://bugs.winehq.org/attachment.cgi?id=46829&action=edit New debug log
Here's requested log. There's a change in application behavior when it is run in a way you requested: message box with Error 198 is not shown, application just silently (without any gui messages) exits after couple of seconds.
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello,
--- quote --- There's a change in application behavior when it is run in a way you requested: message box with Error 198 is not shown, application just silently (without any gui messages) exits after couple of seconds. --- quote ---
that's because of a software protection scheme which doesn't like relay thunks. I scanned a few executables in install folder:
--- snip --- -=[ ProtectionID v0.6.4.0 JULY]=- (c) 2003-2010 CDKiLLER & TippeX Build 07/08/10-17:57:05 Ready...
Scanning -> Z:\home\focht.wine\drive_c\Program Files\Alawar\non-cyrillic-installfolder\MidnightMysteries4.exe File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 2009024 (01EA7C0h) Byte(s) -> File Appears to be Digitally Signed @ Offset 01E8E00h, size : 019C0h / 06592 byte(s) [File Heuristics] -> Flag : 00000000000001001100000100100110 (0x0004C126) [!] ASProtect v1.40 Build 11.20 detected ! - Scan Took : 0.557 Second(s)
Scanning -> Z:\home\focht.wine\drive_c\Program Files\Alawar\non-cyrillic-installfolder\MidnightMysteries4.wrp.exe File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 9349632 (08EAA00h) Byte(s) [File Heuristics] -> Flag : 00000000000001001100000000000000 (0x0004C000) [!] Possible CD/DVD-Key or Serial Check -> Unregistered [CompilerDetect] -> Visual C++ 10.0 (Visual Studio 2010) [!] File appears to have no protection or is using an unknown protection - Scan Took : 0.389 Second(s) --- snip ---
From your log it seems the app already gathered a certain amount of data to
generate unique license information (NIC mac address, hdd serial which is just "0" because it's the default for each WINEPREFIX).
Can you generate a log file again without relay but more debugging channels (use the same recipe as in my previous comment, just different WINEDEBUG channels):
WINEDEBUG=+tid,+seh,+loaddll,+process,+virtual,+ole,+variant,+msgbox ...
Additionally there should be an application log file named "local.log" in the same folder. Check if there is any suspicious error messages and attach the parts that might be relevant. To have a fresh log created remove it before the run.
Regards
http://bugs.winehq.org/show_bug.cgi?id=34558
The Source thesource@mail.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #46829|0 |1 is obsolete| |
--- Comment #7 from The Source thesource@mail.ru --- Created attachment 46836 --> http://bugs.winehq.org/attachment.cgi?id=46836&action=edit Debug log
With debug options you requested the application thinks that it is unregistered and shows corresponding window (no visible error). Even if correct registration key is entered, application restarts still showing the game unregistered. Attached file is formed with those debug options if you need it nevertheless.
Launching the app without WINEDEBUG recognizes registration and shows Error 198 as before.
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #8 from The Source thesource@mail.ru --- Created attachment 46837 --> http://bugs.winehq.org/attachment.cgi?id=46837&action=edit Launcher log (local.log)
In local.log file there are error messages about failure to load some XML objects.
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #9 from Anastasius Focht focht@gmx.net --- Hello,
--- quote --- In local.log file there are error messages about failure to load some XML objects. --- quote ---
in the initial bug report you said that you've already tried with winetricks msxml recipes. Which 'winetricks' version did you use for installing 'msxml3'?
I ask because I've updated my local version to svn 'trunk' only to find out it's broken (breaks several .NET recipes and probably others silently). That recipe is wrong - just copying native msxml3.dll is not going to work.
Try to install 'msxml3' component manually using 'wine msiexec -i msxml3.msi', set 'msxml3' to native and see if it helps. If not, please check 'local.log' again for changes (if XML errors still present). Make sure you have fresh log created (remove it before the run).
Regards
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #10 from The Source thesource@mail.ru --- Created attachment 46890 --> http://bugs.winehq.org/attachment.cgi?id=46890 wine log (native msxml3)
I did what you suggested. The application now doesn't show any windows and exits silently (doesn't matter with or without WINEDEBUG set). Attaching debug log. As for local.log, it's quite small now:
Start logging 17-12-2013 10:54:50 : debug:core created 17-12-2013 10:54:50 : ERROR:LastErr:Module not found.
http://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #11 from Austin English austinenglish@gmail.com --- (In reply to comment #9)
Hello,
--- quote --- In local.log file there are error messages about failure to load some XML objects. --- quote ---
in the initial bug report you said that you've already tried with winetricks msxml recipes. Which 'winetricks' version did you use for installing 'msxml3'?
I ask because I've updated my local version to svn 'trunk' only to find out it's broken (breaks several .NET recipes and probably others silently). That recipe is wrong - just copying native msxml3.dll is not going to work.
Try to install 'msxml3' component manually using 'wine msiexec -i msxml3.msi', set 'msxml3' to native and see if it helps. If not, please check 'local.log' again for changes (if XML errors still present). Make sure you have fresh log created (remove it before the run).
Regards
The change has been reverted: https://code.google.com/p/winetricks/source/detail?r=1081
and I've put a note in the winetricks' issue tracker about it: https://code.google.com/p/winetricks/issues/detail?id=370#c9
in the future, please report bugs to https://code.google.com/p/winetricks/issues, otherwise it can get lost.
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gaming4jc2@yahoo.com
--- Comment #12 from Anastasius Focht focht@gmx.net --- *** Bug 37587 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #13 from Anastasius Focht focht@gmx.net --- *** Bug 35193 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dan.g.tob@gmail.com
--- Comment #14 from Anastasius Focht focht@gmx.net --- *** Bug 39312 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |obfuscation Status|UNCONFIRMED |NEW Component|-unknown |ntdll Summary|Alawar launcher fails to |Multiple applications and |start after game has been |games wrapped with |registered |ASProtect 1.4 protection | |scheme fail to start after | |registration (Farm Frenzy | |2, Alawar, FL Studio 11.x | |VSTi 'Slayer2' plugin, | |FORScan) Ever confirmed|0 |1
--- Comment #15 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming. I spent a good day on this nasty thing. Debugging thunks/continuations is not really fun.
In essence ASProtect employs some SEH trickery that suffers from different runtime stack usage by Wine's win32 implementation. Bug 28089 (design problem how Wine implements exception handling/signal stack) is potentially also present here but not the real blocker.
The protection sets up various SEH chains at runtime which work fine. Unfortunately there is a case when the protection code sets up an SEH registration record along with additional metadata at ~ 1KB on stack top (ESP - 0x400). After that, a few calls to win32/native API are made until the new SEH record is made active (fs:[0]).
The problem arises with Wine's 'KERNEL32.VirtualAllocEx' (-> 'ntdll.RtlAllocateHeap') which I traced to consume more than 0x400 bytes until all leaf functions have been executed. One of the leaf calls overwrites/corrupts the previously initialized SEH registration record with local variables, leaving a destroyed SEH chain when the new SEH chain head is installed via 'fs:[0]'.
--- snip --- -=[ ProtectionID v0.6.6.7 DECEMBER]=- (c) 2003-2015 CDKiLLER & TippeX Build 24/12/14-22:48:13 Ready... Scanning -> C:\Program Files\FORScan\FORScan.exe File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 980992 (0EF800h) Byte(s) Compilation TimeStamp : 0x55FF57F8 -> Mon 21st Sep 2015 01:06:00 (GMT) [TimeStamp] 0x55FF57F8 -> Mon 21st Sep 2015 01:06:00 (GMT) | PE Header | - | Offset: 0x00000100 | VA: 0x00400100 | - [File Heuristics] -> Flag #1 : 00000000000000001100000000100010 (0x0000C022) [Entrypoint Section Entropy] : 8.00 (section #0) " " | Size : 0x80C00 (527360) byte(s) [DllCharacteristics] -> Flag : (0x0000) -> NONE [SectionCount] 7 (0x7) | ImageSize 0x2A7000 (2781184) byte(s) [!] ASProtect SKE v2.72 or higher detected ! [CompilerDetect] -> Borland Delphi (unknown version) - 20% probability - Scan Took : 0.721 Second(s) [0000002D1h (721) tick(s)] [499 of 573 scan(s) done] --- snip ---
$ sha1sum FORScanSetup2.2.7.beta.exe ddeda5bfed7f6875c90a2dbf1397701e2678ca53 FORScanSetup2.2.7.beta.exe
$ du -sh FORScanSetup2.2.7.beta.exe 15M FORScanSetup2.2.7.beta.exe
$ wine --version wine-1.7.51-202-g14dc7e0
Regards
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Multiple applications and |Multiple applications and |games wrapped with |games wrapped with |ASProtect 1.4 protection |ASProtect 1.x-2.x |scheme fail to start after |protection scheme fail to |registration (Farm Frenzy |start after registration |2, Alawar, FL Studio 11.x |(Farm Frenzy 2, Alawar, FL |VSTi 'Slayer2' plugin, |Studio 11.x VSTi 'Slayer2' |FORScan) |plugin, FORScan)
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |flatdownright@googlemail.co | |m
--- Comment #16 from Anastasius Focht focht@gmx.net --- *** Bug 12279 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |collusion.inc@ntlworld.com
--- Comment #17 from Anastasius Focht focht@gmx.net --- *** Bug 13114 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #18 from Anastasius Focht focht@gmx.net --- Hello folks,
FORScan demo for reproducing:
http://www.forscan.org/download/FORScanSetup2.2.7.beta.exe
Fake key for testing (causing stack overflow):
--- snip --- $ wine reg add "HKCU\SOFTWARE\Astech\FORScan" /v Key /t REG_SZ /d "2222" /f --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #19 from Anastasius Focht focht@gmx.net --- Hello again,
since I wasn't specific about the actual contenders ... the code to make virtual.c critical section uninterruptible by signals is one to look at. The signal set (array) eats 128 bytes stack in NtAllocateVirtualMemory(). Since static storage class is not feasible here, TLS could be an option. This alone saves enough space to let the protection work (already tested). There are multiple other options to reduce stack usage here though.
Anyway, I think the placement of the SEH registration record ~0x400 bytes above stack top is unintended and actually a bug in the protection code that never surfaces on Windows due to different stack usage.
Regards
https://bugs.winehq.org/show_bug.cgi?id=34558
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |michael@fds-team.de, | |sebastian@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/ntdll-Virtual_ | |Memory_Stack
https://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #20 from dan.g.tob@gmail.com --- still seeing stack overflow with wine-staging 1.7.52, are those patches not enough to completely solve this yet?
daniel@Daniel-Laptop:~/.wine/drive_c/Program Files/FORScan$ /opt/wine-staging/bin/wine FORScan.exe fixme:winediag:start_process Wine Staging 1.7.52 is a testing version containing experimental patches. fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org. fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046} Could not load wine-gecko. HTML rendering will be disabled. wine: configuration in '/home/daniel/.wine' has been updated. fixme:mountmgr:harddisk_ioctl Unsupported ioctl 4d004 (device=4 access=3 func=401 method=0) fixme:mountmgr:harddisk_ioctl Unsupported ioctl 4d004 (device=4 access=3 func=401 method=0) err:seh:setup_exception_record stack overflow 816 bytes in thread 0009 eip 7bc5052f esp 00231000 stack 0x230000-0x231000-0x330000
https://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #21 from Sebastian Lackner sebastian@fds-team.de --- (In reply to dan.g.tob from comment #20)
still seeing stack overflow with wine-staging 1.7.52, are those patches not enough to completely solve this yet?
As discussed on wine-devel, the proposed patch doesn't work when compiling with optimization. Most distributed packages are compiled with optimization because this is the default settings on most distributions. The stack layout is completely different then. We are currently looking for a better solution, if you want to get those apps working in the meantime, you have to compile Wine Staging manually with -O0.
https://bugs.winehq.org/show_bug.cgi?id=34558
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=34558
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset|https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/ntdll-Virtual_ | |Memory_Stack | CC| |z.figura12@gmail.com Status|STAGED |NEW
--- Comment #22 from Zebediah Figura z.figura12@gmail.com --- Removing STAGED status as this patch has been disabled since 1.7.54 (October 2015) and removed since 2.7 (April 2017).
https://bugs.winehq.org/show_bug.cgi?id=34558
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #23 from joaopa jeremielapuree@yahoo.fr --- Created attachment 68194 --> https://bugs.winehq.org/attachment.cgi?id=68194 Screenshot with working Forscan
Does the bug still occur with wine-5.17? I tried the forscan demo with the fake key and forscan started.
https://bugs.winehq.org/show_bug.cgi?id=34558
--- Comment #24 from dantob dan.g.tob@gmail.com --- Yes I can confirm, FORScan is working with a real key with wine 5.18. thanks! IDK about the other affected programs, this bug cover a lot.
https://bugs.winehq.org/show_bug.cgi?id=34558
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED URL|http://www.alawar.ru/downlo |https://web.archive.org/web |ad/MidnightMysteriesHaunted |/20170616013244/http://fors |HoudiniCollectorsEditionRus |can.org/download/FORScanSet |.exe |up2.2.7.beta.exe Resolution|--- |FIXED
--- Comment #25 from Anastasius Focht focht@gmx.net --- Hello folks,
resolving 'fixed' here. Somewhere in between Wine 1.7.52 and Wine 2.18.
I'm currently unable to build Wine <= 2.17 modern distros (Freetype 2.8.x build failures/incompatibility) so no exact reverse bisect.
Regards
https://bugs.winehq.org/show_bug.cgi?id=34558
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #26 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.20.