Discussion:
[PATCH] unshield 0.6.0 crashes on abit WLP-01 driver
Pavel Roskin
2009-07-16 21:44:21 UTC
Permalink
Hello!

I was trying to unpack the driver for abit WLP-01 downloaded from
http://file.abit.com.tw/pub/download/driver2/airpace/wifi_U1011_20070511.zip

I tries unshield 0.5.1 first, then version 0.6. Both dumped core.
Debugging showed that header->major_version was determined as 0, which
lead to self->file_group_count being read from a wrong location.
self->file_group_count was more than MAX_FILE_GROUP_COUNT, which lead to
unshield_component_new() calling abort().

This is what the debugging output shows:

$ unshield -D3 x data1.cab
[unshield_read_headers:226] Reading header from .hdr file 1.
[unshield_read_headers:281] Version 0x020004b0 handled as major version 0
[unshield_get_cab_descriptor:81] Cabinet descriptor: 00003162 0000146f 0000146f 0000000c
[unshield_get_cab_descriptor:83] Directory count: 3
[unshield_get_cab_descriptor:84] File count: 53
Aborted (core dumped)

The major version is read from this digit:

0x020004b0
^

If I change the sources to assume version 9, I can successfully unpack
the archive.

It looks like the actual version of the software is 12 (the version of
the archive format may be different)

$ strings setup.exe |grep -i shield
http://www.installshield.com/isetup/ProErrorCentral.asp?ErrorCode=%d : 0x%x&ErrorInfo=%s
InstallShield.OCISetupPlayer12.12
InstallShield.OCISetupPlayer12
InstallShield
InstallShield Silent
InstallShield\ISEngine12.0
SOFTWARE\InstallShield\Cryptography\Trust
(c) Copyright 2004 InstallShield Software Corporation (All Rights Reserved)
InstallShieldPendingOperation
InstallShield Setup Player
name="InstallShield.Setup"
<description>InstallShield.Setup</description>

I suggest applying this patch as a workaround.

--- lib/libunshield.c
+++ lib/libunshield.c
@@ -271,6 +271,9 @@ static bool unshield_read_headers(Unshie

header->major_version = (header->common.version >> 12) & 0xf;

+ if (header->common.version == 0x020004b0)
+ header->major_version = 9;
+
#if 0
if (header->major_version < 5)
header->major_version = 5;
--
Regards,
Pavel Roskin
David Eriksson
2009-07-18 19:42:13 UTC
Permalink
Hi,

Thanks for the great bug report! If you have the time, please report it
in the SourceForge tracker:

http://sourceforge.net/tracker/?limit=10&func=&group_id=30550&atid=399601&assignee=&status=&category=&artgroup=&keyword=&submitter=&artifact_id=&assignee=&status=&category=667878&artgroup=&submitter=&keyword=&artifact_id=&submit=Filter

I have applied the patch, thanks!

I'm thinking of moving version identification and affected offsets to
various data structures to a configuration file to avoid recompiling for
things like this. ..


Best regards,

David Eriksson, http://www.divideandconquer.se/
Post by Pavel Roskin
Hello!
I was trying to unpack the driver for abit WLP-01 downloaded from
http://file.abit.com.tw/pub/download/driver2/airpace/wifi_U1011_20070511.zip
I tries unshield 0.5.1 first, then version 0.6. Both dumped core.
Debugging showed that header->major_version was determined as 0, which
lead to self->file_group_count being read from a wrong location.
self->file_group_count was more than MAX_FILE_GROUP_COUNT, which lead to
unshield_component_new() calling abort().
$ unshield -D3 x data1.cab
[unshield_read_headers:226] Reading header from .hdr file 1.
[unshield_read_headers:281] Version 0x020004b0 handled as major version 0
[unshield_get_cab_descriptor:81] Cabinet descriptor: 00003162 0000146f 0000146f 0000000c
[unshield_get_cab_descriptor:83] Directory count: 3
[unshield_get_cab_descriptor:84] File count: 53
Aborted (core dumped)
0x020004b0
^
If I change the sources to assume version 9, I can successfully unpack
the archive.
It looks like the actual version of the software is 12 (the version of
the archive format may be different)
$ strings setup.exe |grep -i shield
http://www.installshield.com/isetup/ProErrorCentral.asp?ErrorCode=%d : 0x%x&ErrorInfo=%s
InstallShield.OCISetupPlayer12.12
InstallShield.OCISetupPlayer12
InstallShield
InstallShield Silent
InstallShield\ISEngine12.0
SOFTWARE\InstallShield\Cryptography\Trust
(c) Copyright 2004 InstallShield Software Corporation (All Rights Reserved)
InstallShieldPendingOperation
InstallShield Setup Player
name="InstallShield.Setup"
<description>InstallShield.Setup</description>
I suggest applying this patch as a workaround.
--- lib/libunshield.c
+++ lib/libunshield.c
@@ -271,6 +271,9 @@ static bool unshield_read_headers(Unshie
header->major_version = (header->common.version >> 12) & 0xf;
+ if (header->common.version == 0x020004b0)
+ header->major_version = 9;
+
#if 0
if (header->major_version < 5)
header->major_version = 5;
--
Pavel Roskin
2009-07-18 20:58:21 UTC
Permalink
Post by David Eriksson
Hi,
Thanks for the great bug report! If you have the time, please report it
http://sourceforge.net/tracker/?limit=10&func=&group_id=30550&atid=399601&assignee=&status=&category=&artgroup=&keyword=&submitter=&artifact_id=&assignee=&status=&category=667878&artgroup=&submitter=&keyword=&artifact_id=&submit=Filter
Sorry, I have no idea why I should file a bug for a resolved issue.
Post by David Eriksson
I have applied the patch, thanks!
I'm thinking of moving version identification and affected offsets to
various data structures to a configuration file to avoid recompiling for
things like this. ..
I would do following:

If the version cannot be determined, print the whole 32-bit version
field and ask the user to report it.

Add an option to force unshield use specific version of the format.

Stop using abort(). Instead, print a unique message (so that the
condition can be identified) and exit with a non-zero error code.


Thank you for maintaining unshield! Being a wireless developer, I often
need unshield to unpack wireless drivers. This helps me determine the
chipset of the hardware without buying it. Also, some drivers can be
used with ndiswrapper.
--
Regards,
Pavel Roskin
Loading...