ADXPATCH prevents signtool from signing ADXLOADER.DLL

Add-in Express™ Support Service
That's what is more important than anything else

ADXPATCH prevents signtool from signing ADXLOADER.DLL
Suddendly, the ADXPATCH tool has started blocking signtool from signing the ADXLOADER.DLL file. 
Michael Hutchinson


Guest


We have been using adxpatch.exe to customize the version number and signtool.exe sign the adxloader.dll for some time now. All has been well then all of a sudden it has just stopped working. The signtool reports error code 0x800700C1 "not a valid Win32 application". We are using the 9.2.6124 version.


Execute signtool.exe
Done Adding Additional Store
SignTool Error: ISignedCode::Sign returned error: 0x800700C1
        An unknown error has occured. Please contact your vendor for assistance.

SignTool Error: An error occurred while attempting to sign: adxloader.dll


Anybody else see this issue?

Regards,
Michael
Posted 17 Apr, 2015 16:23:22 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Michael,

Please read the following article: https://markcz.wordpress.com/2013/01/26/signtool-exe-returned-error-0x800700c1/
Probably it will help you to resolve the issue.
Posted 20 Apr, 2015 05:06:13 Top
Michael Hutchinson


Guest


Sergey,

Thanks for the reference, it did indeed resolve my problem.

FYI the tool told me what the problem was...

First sign works:

Execute signtool.exe
Done Adding Additional Store
Successfully signed and timestamped: adxloader.dll


then the patch:

adxpatch.exe adxloader.dll /productversion="1.0.0.0"
Change file version action: The version of file is set to '1.0.0.0'.


Second sign now fails:

Execute signtool.exe
Done Adding Additional Store
SignTool Error: ISignedCode::Sign returned error: 0x800700C1
        An unknown error has occured. Please contact your vendor for assistance.
SignTool Error: An error occurred while attempting to sign: adxloader.dll


Use the tool to "patch" the patched version:

delcert.exe adxloader.dll

Target file(s): adxloader.dll

Stripping file: adxloader.dll.
ImageRemoveCertificate failed with error 0x00000057
This happens when there's a listing in IMAGE_DIRECTORY_SECURITY
in the PE's header, but the actual Authenticode signature has been stripped.
Let's fix that ...
certificates->Size == 0x00001920
certificates->VA == 0x0008da00
Setting both fields to zero ...
Succeeded.


Third sign works again:

Execute signtool.exe
Done Adding Additional Store
Successfully signed and timestamped: adxloader.dll


So it seems that the adxpatch.exe is not fixing the IMAGE_DIRECTORY_SECURITY header in the PE.

Could you adapt the adxpatch.exe tool, for your next release, to include the same functionality that delcert.exe provides using the sources provided from the link?

Regards,
Michael
Posted 20 Apr, 2015 11:33:02 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Michael,

Thank you for the bug report. We will fix it in subsequent builds of the product.
Posted 22 Apr, 2015 04:54:52 Top