Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing "Publisher" information for a ".exe" file

Tags:

HOW I CAME ACROSS THIS

I wrote code for a simple stopwatch which can also double up as a Rubik's cube timer. The source code and the executable are here:

Cube timer

Anyway my doubt is not regarding this code(It works fine).

I downloaded the executable that I had uploaded to check if it worked fine and at that time I was greeted with this screen:

Open file - security warning

And under this dialogue box there was a field that said:

Publisher : Unknown Publisher

SCREEN SHOT:

screenshot

DOUBT

Is there some way programatically or otherwise by which I can change the publisher field?

SPECS

I have compiled the code with Microsoft Visual C++ 2010 Express.

like image 620
IcyFlame Avatar asked Mar 12 '13 10:03

IcyFlame


People also ask

Can I modify an EXE file?

Executables are files, you can modify them as you would any other file (though, depending on OS, not while they're running, you'd have to work on a copy).

Can you get the source code from a .EXE file?

You can't get the C++ source from an exe, and you can only get some version of the C# source via reflection.


1 Answers

You can easily change the publisher, either when linking/compiling by setting the appropriate resources for your project (e.g. CompanyName), or modifying the resources with a resource editor.

Your problem is really that there is no signature, so even if a publisher field is present it cannot be trusted.

You can find an example resource rc file near the end of http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx.

To add resources to your VC project check:

  • How do I embed version information into a windows binary?
  • VC++ 2012: How to include version info from version.inc (maintained separately) into the .rc file

The .rc file(s) will be compiled to binary (.res) and linked into your final executable.

To add or modify an existing executable, you should be able to use this tool (login required, this will cause the signature to be invalid in an already signed binary of course).

The Microsoft Authenticode documentation includes tutorials.

CAcert.org will sign a certificate you can use, and have instructions for getting started with Authenticode.

(Sorry I can't be more helpful with VC, I don't use it, I usually using mingw and make.)

like image 67
mr.spuratic Avatar answered Oct 09 '22 12:10

mr.spuratic