views:

1392

answers:

1

My installer build "signs" a DLL using a Code Signing certificate during the build process.

I've noticed that if I try to build twice in succession, the second build fails because the DLL is already signed so signcode chokes. Obviously I can fix this by signing a copy of the DLL in the build, but the problem intrigued me:

Is it possible to "unsign" a DLL, and if not, why not...?

+2  A: 

Sure it's possible, but not trivial.

Although it would be easier to save a copy of the presigned DLL.

This digital signature is little more that an extra section appended to the end of a PE file. You could write a program that deleted the signature, if you want.

It's not quite as simple as trunctating the file; you have to remove references to the signature in the file header. It could get compilicated if the DLL has multiple signatures and you just want to remove one.

The format of a PE file is publicly documented here

Die in Sente
Thanks. Not *quite* the answer I hoped for (eg "just run UNSIGNTOOL"), but I'm mich better informed now!
Roddy