[Bug 44213] ShareHolder Finder 0.9.3.0 fails to generate unique hardware id, reports 'Error: The requested action with this object has failed.' (several ' Win32_ComputerSystemProduct' WMI class properties missing)

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Feb 3 20:52:23 CST 2018


https://bugs.winehq.org/show_bug.cgi?id=44213

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net
           Severity|major                       |normal
            Summary|Failure to run application: |ShareHolder Finder 0.9.3.0
                   |CoGetInstanceFromFile       |fails to generate unique
                   |failed to get CLSID from a  |hardware id, reports
                   |file                        |'Error: The requested
                   |                            |action with this object has
                   |                            |failed.' (several
                   |                            |'Win32_ComputerSystemProduc
                   |                            |t' WMI class properties
                   |                            |missing)
          Component|ole32                       |wmi&wbemprox

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

the application uses WMI to query for various information to generate a unique
hardware id. Unfortunately Wine lacks several properties in some WMI classes
hence the application is failing. 

This bug report is about 'Win32_ComputerSystemProduct' WMI class properties
only.

--- snip ---
$ WINEDEBUG=+seh,+relay,+wbemprox,+ole,+variant wine ./ShareHolderFinder.exe
>>log.txt 2>&1
...
0055:trace:wbemprox:wbem_services_ExecQuery 0x1759638, L"WQL", L"SELECT * FROM
Win32_ComputerSystemProduct", 0x00000010, (nil), 0x90e6f8 
...
0055:trace:wbemprox:enum_class_object_Clone 0x176d548, 0x90ec10
0055:trace:wbemprox:EnumWbemClassObject_create 0x90ec10
...
0055:trace:wbemprox:EnumWbemClassObject_create returning iface 0x176d450
...
0055:trace:ole:DispCallFunc retval: 0x90eda0 {VT_ERROR: 00000000}
0055:trace:ole:ITypeInfo_fnInvoke [retval] value: 0x176d400
{VT_UNKNOWN|VT_BYREF 0x90ed90}
0055:trace:variant:VariantInit (0x90f0f8)
0055:trace:variant:VariantCopyInd (0x90f0f8 {VT_EMPTY},0x176d400
{VT_UNKNOWN|VT_BYREF 0x90ed90})
0055:trace:variant:VariantClear (0x90f0f8 {VT_EMPTY})
0055:trace:variant:VariantCopyInd returning 0x00000000, 0x90f0f8 {VT_UNKNOWN:
0x176d578}
0055:trace:variant:VARIANT_ClearInd (0x176d400 {VT_UNKNOWN|VT_BYREF 0x90ed90})
0055:trace:variant:VariantClear (0x176d410 {VT_EMPTY})
...
0055:trace:wbemprox:enum_class_object_Reset 0x176d450 
...
0055:trace:wbemprox:class_object_GetNames 0x176d400, (null), 00000000, (null),
0x90eafc 
...
0055:trace:wbemprox:class_object_Get 0x176d400, L"IdentifyingNumber", 00000000,
0x90ec90, (nil), (nil) 
...
0055:Call oleaut32.VariantClear(0090ec90) ret=00479fc6
0055:trace:variant:VariantClear (0x90ec90 {VT_BSTR: L"0"})
...
0055:trace:variant:VariantClear (0x176d6e4 {VT_EMPTY})
0055:Ret  oleaut32.VariantClear() retval=00000000 ret=00456e96 
...
0055:trace:ole:ITypeInfo_fnAddRef (0x1761ce0)->ref is 2
0055:trace:ole:ITypeInfo_fnGetIDsOfNames (0x1761ce0) Name L"Name" cNames 1 
...
0055:Call user32.MessageBoxW(00030080,0176d988 L"Line 16964  (File
\"Z:\\home\\focht\\Downloads\\ShareHolderFinder.exe\"):\n\n\nError: The
requested action with this object has failed.",0176d6f0 L"AutoIt
Error",00011010) ret=0046a0a4 
...
--- snip ---

The application is actually an AutoIT Script encrypted and compiled to PE.

One can decompile/decrypt it using 'myAut2Exe - The Open Source AutoIT Script
Decompiler'.

https://github.com/dzzie/myaut_contrib

The relevant part of decompiled script:

--- snip ---
FUNC _WINAPI_UNIQUEHARDWAREID($IFLAGS=0)
LOCAL $OSERVICE=OBJGET("winmgmts:\\.\root\cimv2")
IF NOT ISOBJ($OSERVICE)THEN RETURN SETERROR(1,0,"")
LOCAL $OITEMS=$OSERVICE.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct")
IF NOT ISOBJ($OITEMS)THEN RETURN SETERROR(2,0,"")
LOCAL $SHW="",$IEXTENDED=0
FOR $OPROPERTY IN $OITEMS
$SHW&=$OPROPERTY.IdentifyingNumber
$SHW&=$OPROPERTY.Name
$SHW&=$OPROPERTY.SKUNumber
$SHW&=$OPROPERTY.UUID
$SHW&=$OPROPERTY.Vendor
$SHW&=$OPROPERTY.Version
NEXT
$SHW=STRINGSTRIPWS($SHW,$STR_STRIPALL)
IF NOT $SHW THEN RETURN SETERROR(3,0,"")
LOCAL $STEXT
IF BITAND($IFLAGS,1)THEN
$OITEMS=$OSERVICE.ExecQuery("SELECT * FROM Win32_BIOS")
IF NOT ISOBJ($OITEMS)THEN RETURN SETERROR(3,0,"")
$STEXT=""
FOR $OPROPERTY IN $OITEMS
$STEXT&=$OPROPERTY.IdentificationCode
$STEXT&=$OPROPERTY.Manufacturer
$STEXT&=$OPROPERTY.Name
$STEXT&=$OPROPERTY.SerialNumber
$STEXT&=$OPROPERTY.SMBIOSMajorVersion
$STEXT&=$OPROPERTY.SMBIOSMinorVersion
NEXT
$STEXT=STRINGSTRIPWS($STEXT,$STR_STRIPALL)
IF $STEXT THEN
$IEXTENDED+=1
$SHW&=$STEXT
ENDIF
ENDIF
IF BITAND($IFLAGS,2)THEN
$OITEMS=$OSERVICE.ExecQuery("SELECT * FROM Win32_Processor")
IF NOT ISOBJ($OITEMS)THEN RETURN SETERROR(4,0,"")
$STEXT=""
FOR $OPROPERTY IN $OITEMS
$STEXT&=$OPROPERTY.Architecture
$STEXT&=$OPROPERTY.Family
$STEXT&=$OPROPERTY.Level
$STEXT&=$OPROPERTY.Manufacturer
$STEXT&=$OPROPERTY.Name
$STEXT&=$OPROPERTY.ProcessorId
$STEXT&=$OPROPERTY.Revision
$STEXT&=$OPROPERTY.Version
NEXT
$STEXT=STRINGSTRIPWS($STEXT,$STR_STRIPALL)
IF $STEXT THEN
$IEXTENDED+=2
$SHW&=$STEXT
ENDIF
ENDIF
IF BITAND($IFLAGS,4)THEN
$OITEMS=$OSERVICE.ExecQuery("SELECT * FROM Win32_PhysicalMedia")
IF NOT ISOBJ($OITEMS)THEN RETURN SETERROR(5,0,"")
$STEXT=""
FOR $OPROPERTY IN $OITEMS
SWITCH _WINAPI_GETDRIVEBUSTYPE($OPROPERTY.Tag)
CASE 3,11
$STEXT&=$OPROPERTY.SerialNumber
CASE ELSE
ENDSWITCH
NEXT
$STEXT=STRINGSTRIPWS($STEXT,$STR_STRIPALL)
IF $STEXT THEN
$IEXTENDED+=4
$SHW&=$STEXT
ENDIF
ENDIF
LOCAL $SHASH=__MD5($SHW)
IF NOT $SHASH THEN RETURN SETERROR(6,0,"")
RETURN
SETEXTENDED($IEXTENDED,"{"&STRINGMID($SHASH,1,8)&"-"&STRINGMID($SHASH,9,4)&"-"&STRINGMID($SHASH,13,4)&"-"&STRINGMID($SHASH,17,4)&"-"&STRINGMID($SHASH,21,12)&"}")
ENDFUNC
--- snip ---

It expects several properties present in 'Win32_ComputerSystemProduct' WMI
class:

* IdentifyingNumber
* Name
* SKUNumber
* UUID
* Vendor
* Version

Source:

https://source.winehq.org/git/wine.git/blob/f9181daa1ddc2c10d3b6ddd4610bc1421cfd0f42:/dlls/wbemprox/builtin.c#l440

--- snip ---
 440 static const struct column col_compsysproduct[] =
 441 {
 442     { prop_identifyingnumberW,  CIM_STRING|COL_FLAG_KEY },
 443     { prop_uuidW,               CIM_STRING|COL_FLAG_DYNAMIC }
 444 };
...
1410 static enum fill_status fill_compsysproduct( struct table *table, const
struct expr *cond )
1411 {
1412     struct record_computersystemproduct *rec;
1413     enum fill_status status = FILL_STATUS_UNFILTERED;
1414     UINT row = 0;
1415 
1416     if (!resize_table( table, 1, sizeof(*rec) )) return
FILL_STATUS_FAILED;
1417 
1418     rec = (struct record_computersystemproduct *)table->data;
1419     rec->identifyingnumber = compsysproduct_identifyingnumberW;
1420     rec->uuid              = get_compsysproduct_uuid();
1421     if (!match_row( table, row, cond, &status )) free_row_values( table,
row );
1422     else row++;
1423 
1424     TRACE("created %u rows\n", row);
1425     table->num_rows = row;
1426     return status;
1427 }
...
--- snip ---

$ du -sh ShareHolderFinder.exe
1.2M    ShareHolderFinder.exe

$ sha1sum ShareHolderFinder.exe
062235dda76f1aa1b5b41bf9b9d0f29aeca75174  ShareHolderFinder.exe

$ wine --version
wine-3.1

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