[Bug 33745] SimCity Societies launcher (.NET app) crashes on startup (incorrect canonicalization of URL containing trade mark sign character U+2122)

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Jan 14 18:48:42 CST 2014


http://bugs.winehq.org/show_bug.cgi?id=33745

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |dotnet
             Status|UNCONFIRMED                 |NEW
                 CC|                            |focht at gmx.net
          Component|-unknown                    |shlwapi
            Summary|SimCity Societies segfaults |SimCity Societies launcher
                   |                            |(.NET app) crashes on
                   |                            |startup (incorrect
                   |                            |canonicalization of URL
                   |                            |containing trade mark sign
                   |                            |character U+2122)
     Ever confirmed|0                           |1

--- Comment #15 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

confirming.

The problem is the trade mark sign character U+2122 '™' within a folder name.

--- snip ---
$ pwd
/home/focht/.wine/drive_c/Program Files/Electronic Arts/SimCity™ Societies
--- snip ---

The .NET runtime (loader) tries to resolve the launcher assembly config file
and fails.
This is expected because the .NET app doesn't have a .config file.

What is unexpected is the last error code 0x0000007b (should have been
0x00000002).
This is the result of an incorrect intermediate path conversion.

Relevant part of trace log:

--- snip ---
$ WINEDEBUG=+tid,+seh,+relay wine ./SCSocietiesLauncher.exe >>log.txt 2>&1
...
002b:Call shlwapi.UrlIsW(0033ebe0 L"C:\\Program Files\\Electronic
Arts\\SimCity\2122 Societies\\Launcher\\",00000003) ret=79ebe6cb
...
002b:Ret  shlwapi.UrlIsW() retval=00000000 ret=79ebe6cb 
002b:Call shlwapi.PathIsURLW(0033ebe0 L"C:\\Program Files\\Electronic
Arts\\SimCity\2122 Societies\\Launcher\\") ret=79ebe6d6
002b:Ret  shlwapi.PathIsURLW() retval=00000000 ret=79ebe6d6
002b:Call shlwapi.UrlCanonicalizeW(0033ebe0 L"C:\\Program Files\\Electronic
Arts\\SimCity\2122 Societies\\Launcher\\",0033db24,0033db20,00000000)
ret=79ebe700 
...
002b:Ret  shlwapi.UrlCanonicalizeW() retval=00000000 ret=79ebe700
002b:Call shlwapi.UrlUnescapeW(0033db24
L"file:///C:/Program%20Files/Electronic%20Arts/SimCity%22%20Societies/Launcher/",0015c000,0033eb98,00000000)
ret=79ebe715
002b:Ret  shlwapi.UrlUnescapeW() retval=00000000 ret=79ebe715
...
002b:Call shlwapi.PathCreateFromUrlW(0033e0e8
L"file:///C:/Program%20Files/Electronic%20Arts/SimCity%22%20Societies/Launcher/SCSocietiesLauncher.exe.config",0033f17c,0033f170,00000000)
ret=79ec1350
002b:Call KERNEL32.CompareStringW(0000007f,00000001,0033e0e8
L"file:///C:/Program%20Files/Electronic%20Arts/SimCity%22%20Societies/Launcher/SCSocietiesLauncher.exe.config",00000005,7ed66e0a
L"file:",00000005) ret=7ed474a1
002b:Ret  KERNEL32.CompareStringW() retval=00000002 ret=7ed474a1
002b:Ret  shlwapi.PathCreateFromUrlW() retval=00000000 ret=79ec1350 
...
002b:Call KERNEL32.GetFileAttributesW(0033f17c L"C:\\Program Files\\Electronic
Arts\\SimCity\" Societies\\Launcher\\SCSocietiesLauncher.exe.config")
ret=79eb7b18
002b:Ret  KERNEL32.GetFileAttributesW() retval=ffffffff ret=79eb7b18
002b:Call KERNEL32.GetLastError() ret=79eb7b29
002b:Ret  KERNEL32.GetLastError() retval=0000007b ret=79eb7b29
...
002b:trace:seh:raise_exception code=e06d7363 flags=1 addr=0x7b83a913
ip=7b83a913 tid=002b
002b:trace:seh:raise_exception  info[0]=19930520
002b:trace:seh:raise_exception  info[1]=0033f63c
002b:trace:seh:raise_exception  info[2]=7a34f188
002b:trace:seh:raise_exception  eax=7b826989 ebx=7b8ba000 ecx=7a34f188
edx=0033f330 esi=0033f3d0 edi=0033f390
002b:trace:seh:raise_exception  ebp=0033f368 esp=0033f304 cs=0023 ds=002b
es=002b fs=0063 gs=006b
--- snip ---

Wine shlwapi.UrlCanonicalizeW() encodes the trade mark sign character U+2122 as
"%22%20" which is wrong, resulting in invalid path later, containing reserved
'"' character.
The trade mark sign character must not be percent-encoded.

Hex dump for illustration, how it should look like:

--- snip ---
0033DB24  66 00 69 00 6C 00 65 00 3A 00 2F 00 2F 00 2F 00  file:///
0033DB34  43 00 3A 00 2F 00 50 00 72 00 6F 00 67 00 72 00  C:/Progr
0033DB44  61 00 6D 00 25 00 32 00 30 00 46 00 69 00 6C 00  am%20Fil
0033DB54  65 00 73 00 2F 00 45 00 6C 00 65 00 63 00 74 00  es/Elect
0033DB64  72 00 6F 00 6E 00 69 00 63 00 25 00 32 00 30 00  ronic%20
0033DB74  41 00 72 00 74 00 73 00 2F 00 53 00 69 00 6D 00  Arts/Sim
0033DB84  43 00 69 00 74 00 79 00 22 21 25 00 32 00 30 00  City™%20
0033DB94  53 00 6F 00 63 00 69 00 65 00 74 00 69 00 65 00  Societie
0033DBA4  73 00 2F 00 4C 00 61 00 75 00 6E 00 63 00 68 00  s/Launch
0033DBB4  65 00 72 00 2F 00 00 00 00 00 00 00 00 00 00 00  er/.....
--- snip ---

You can work around by renaming the folder to not contain the trade mark sign
character or by using an Asian locale like ja-JP or zh-CN.

Tidbit: The game is protected with SecuROM DRM scheme which works fine:

--- snip ---
Scanning -> Z:\home\focht\.wine\drive_c\Program Files\Electronic Arts\SimCity™
Societies\SimCitySocieties.exe
File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 12017664 (0B76000h)
Byte(s)
[File Heuristics] -> Flag : 00000100000000000000000000000001 (0x04000001)
[Entrypoint Section Entropy] : 6.64
[Debug Info]
Characteristics : 0x0 | TimeDateStamp : 0x4716AA5F | MajorVer : 0 / MinorVer :
0 -> (0.0)
Type : 2 -> CodeView | Size : 0x5C (92)
AddressOfRawData : 0xF3401C | PointerToRawData : 0xA7701C
CvSig : 0x53445352 | SigGuid B295E72B-6C40-4D50-893CC3FC32535D4B
Age : 0x1 | Pdb : c:\SC5EngineWork\Source\bin\Games\Gold
Release\SimCitySocieties.pdb

[!] SecuROM Detected - Version 07.33.0017
[CompilerDetect] -> Visual C++ 8.0 (Visual Studio 2005)
- Scan Took : 0.868 Second(s) [000000364h tick(s)] [533 scan(s) done]
--- snip ---

$ wine --version
wine-1.7.10-428-g444c2b2

Regards

-- 
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