Click here to Skip to main content
Click here to Skip to main content

Simple Version Resource Tool for Windows

By , 3 Sep 2012
 

Introduction

This article presents a little tool that we made for maintenance of native console applications, DLLs, device drivers and other non-GUI program components.

Developers often have to add a resource script (.rc) to these components, only because of a version info resource. Text strings in the version resource often need to be changed, and the version number has to be kept in sync. All this is boring and error prone - especially these days, when the version info resources are created automatically for Visual C# apps.

This utility allows adding or modifying the version information whenever needed - in the process of building components, or anytime later. The build process can be simplified, because modules that are common to multiple products, OEM versions and are customized only in the version information, can be built only once.

More to this patching of the version information and some other resource data can be done without access to the code and build environment, so this task can be delayed to the post-build release and packaging steps. For example, marketing or field engineering can easily edit information visible in Windows Explorer and certain resources (such as manifests), without requesting help from developers. This saves time and eliminates possible errors.

The example below modifies file version information of foo.dll in one simple command:

verpatch foo.dll "1.2.3.4 my special build"

A sample scripts included in the source show how to set version information on many files at once, and how to specify all version info elements.

Since the tool is provided in source form, you can easily tweak it to the specific requirements of your products and build procedures.

The code also demonstrates use of Win32 API for native resources and PE image manipulations.

VerPatch/ver-winxp.png

VerPatch/ver-vista.png

Background

The Version Information resource contains the information visible in the Windows Explorer when you view properties of program files.

As shown on the pictures above, Explorer of WinXP displays all strings in the version info; in newer Windows versions, only few elements are displayed for the same file. However, all the data in the version resource still can be accessed via the Win32 API (GetFileVersionInfo, GetFileVersionInfoEx, VerQueryValue).

The traditional way of providing this data for native modules is adding a native resource script (.rc file) to the project, adding a VS_VERSION_INFO resource to the .rc file, compiling it with the Resource Compiler and linking to the binary. This method requires providing all the details of the version info: the file version number, the final name of the file, product name and version, etc. - which may not be known at the build time yet. A .RC file often requires complicated C macros and additional include files.

Anyway, writing version resources by hand is not the best way to spend developer's time, and can be avoided.

The version resource data consists of a "binary" data structure, and array of text string pairs (key and value). In other words, it is kind of a manifest from a pre-.NET, pre-XML era.

Executables produced by some .NET compilers have a version info attribute AssemblyVersion. This is a 4-part number, like File Version and Product Version, but it is not duplicated in the binary part of the version resource, and can differ from the actual assembly version, as .NET tools see it.

We could not find a formal schema for string attributes data in the version resource, however. Some of the elements are "well known" (such as created by Visual Studio and recognized by Windows Explorer).

One notorious thing about the version info resource is that two string attributes, FileVersion and ProductVersion, should be text representation of same fields in the binary part. In reality, they may differ, causing confusion.

In Vista and Windows 7, Windows Explorer displays only few of these attributes; others are not visible to end user. The displayed file version number is taken from the binary part of version structure. Comments, Private Build, Special Build attributes, created by Visual Studio are not displayed. If information in these strings should be visible to the end user, consider moving it to elements that remain visible (File description, Product name).

You can modify this tool to automatically reformat version information on your program files, without rebuilding them, so that the version information appears in the best way on the latest Windows OS.

The version info can possibly depend on contents of the file itself, or various manifests attached to the file, or it's debug information (the .pdb file) - but we'll leave this as an exercise for the reader. 

Some installers, self-extracting archives and other applications are known to append extra data to executable files. Such data is not a resource, but simply appended to the PE file, for example as by command copy /b file.exe + data file2.exe.
The program detects such extra data, saves it and appends again after modifying resources. However, the way the data is restored may be not compatible with all these applications. Please, verify that executable files that contain extra data work correctly after modification.

The code to save the extra data (pExtras.c,h) has been contributed by reader Rob from UK, for executables created with BBC Basic (BB4W).

Note that any modification of a PE file breaks its checksum or other integrity envelope, such as digital signature. The tool will automatically fix the checksum (which is required for kernel drivers and protected DLLs), but will not repair signatures. It should be used as the last touch before signing the application files and building packages for deployment.

Using the Code

The code is provided as a Visual C++ 2008 (or Express) project.

We don't provide a precompiled executable, because it can be easily built from the source. You can just compile the utility and run - it is quite useful, even with the limitations mentioned below.
The command line options and usage instructions are described in the readme.txt file with the sources.

The tool "as is" supports two main usage scenarios:

  • A file does not have a version resource at all; a new version resource is created.
  • A file already has a version resource; only certain parts of it are modified, the rest is preserved.

In the first case, all version info details can be provided as command line arguments, and the missing details will be filled by defaults.

In the second case, the version resource is attached to the binary at build time. Some version info details (file version, special build description) are set later, using this tool.

Since the command line for a complete version info may be too long, it is better to run verpatch from a batch file, or your favorite script language. The script can contain all the version details, or get them from somewhere else, for example, as described here.

rem Example 2: run verpatch to create version info for foodll.dll  

set VERSION="1.2.3.4 (%date%)"
set FILEDESCR=/s desc "sample foodll description"
set BUILDINFO=/s pb "Built by %USERNAME%"
set COMPINFO=/s company "sample company" /s (c) "(c) Sample copyleft 2009"
set PRODINFO=/s product "sample product" /pv "1.0.22.33"

verpatch /va foodll.dll %VERSION% %FILEDESCR% %COMPINFO% %PRODINFO% %BUILDINFO%

Of course, using a script, you can update many files at once.

Below is the "classic" RC source of version resource created by verpatch with options above (to produce this output, run verpatch on the sample DLL file again, with switches /vo /xi ). It even can be compiled with RC.

1       VERSIONINFO
FILEVERSION     1,2,3,4
PRODUCTVERSION  1,0,22,33
FILEFLAGSMASK   0X3FL
FILEFLAGS       0L
FILEOS          0X40004L
FILETYPE        0X2
FILESUBTYPE     0
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904B0"
        BEGIN
            VALUE "FileVersion", "1.2.3.4 (10-Jun-2009)"
            VALUE "ProductVersion", "1.0.22.33"
            VALUE "OriginalFilename", "foodll.dll"
            VALUE "InternalName", "foodll.dll"
            VALUE "FileDescription", "sample foodll description"
            VALUE "CompanyName", "sample company"
            VALUE "LegalCopyright", "(c) Sample copyleft 2009"
            VALUE "ProductName", "sample product"
            VALUE "PrivateBuild", "Built by username"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
            VALUE "Translation", 0x0409, 0x04B0
    END
END

The program is written in very simple C++. It can be compiled with Visual C++ 2005 or 2008 Express, does not depend on MFC, ATL or anything else.

Points of Interest

The UpdateResource API allows adding or replacing native resources of a program file, without recompiling or re-linking. This is what we use to accomplish the task. Since the format of VS_VERSION structure is not likely to change, and is documented in MSDN, we do our own parsing of this structure and do not depend on the Resource compiler.

The program ensures that the file and product version numbers are identical in the binary part of the version structure and in the strings. You only need to specify the numbers once.

Other capabilities, besides of import and export of version resources, that are worth mentioning:

  • Adding resource files to executable. This can be useful in many ways: to add or replace XML manifests, or to use application specific raw binary resources. The help text of this program, for example, is such a custom resource, and users can update it using the program itself.
  • Use of Win32 imagehlp API to repair the file checksum
  • Option to remove the .pdb path from the debug information in the file. We've seen requests from people that consider this path sensitive information and want to remove it. Wink | <img src= " src="http://www.codeproject.com/script/Forums/Images/smiley_wink.gif" complete="true" />

Compatibility with the Semantic Versioning specification

Some adjustments in this utlity have been made to support the Semantic Versioning (http://semver.org), just because it seems interesting. According to this spec, a version number has three parts (not four) and optional string suffix separated by  '-' or '+' character (a space is not a valid separator). Example:  1.2.3-some.thing.1234

Verpatch accepts file and product version in this format, if a new swith /high is specified. Then, the three parts of the version number are interpreted properly, and the version string is preserved in the string part of the version resource (however, users will not see this text in the Windows Explorer, as explained above). If /high not specified, verpatch behaves as before v.1.0.9, for compatibility. Please see the readme file for syntax details.

Limitations of This Version

The most serious limitation is the lack of support for languages in the version parsing and generating code, but this should be easy to fix. I have not done this, because this was not needed for my kind of projects.

Old (non-Unicode) or strange formats of version resources are not handled properly and will probably break the parser.

Please note that cool C++ coding style, strings or memory management are not subjects of this article.
We'd like to port this utility to C# for easier integration for modern .NET build tools, Powershell and so on.

History

  • Rev. 10 (1.0.10): August 2012
  • Rev 9 (1.0.9): November 2011
  • Rev. 6: Extra data appended to executable file is detected and saved (code provided by a reader)
  • Rev. 3: Code fixed to handle LN version resources, .NET executables; article text edited
  • Rev. 2: Some improvements in the code, added example scripts, text edited
  • The first version of the article and published code: May 2009

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

ddbug
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
SuggestionThis project is now on Codeplex [modified]memberddbug18 Jan '13 - 14:23 
Binary updates and source repository of verpatch are now on Codeplex:
 
http://ddverpatch.codeplex.com
 
It can be compiled using VC++ 2008 or 2010 (fetch the code using the built-in TFS client).
 
Enjoy!
 
/* This is not because I am not happy with CodeProject - it is a great resource for articles and news - but ongoing development of a program is better on a specialized service */
 
-- dd

-- modified 18 Jan '13 - 20:36.
QuestionParseBinaryVersionRessource and Embarcadero C++buildermemberm_ehrhart9 Nov '12 - 4:45 
Hi,
Thanks for this usefull tool.
 
When I use it (with switch /vo) on executable built with C++builder XE, I notice an exception (block "StringFileInfo").
I'm sorry, I have not debugged it more precisely.
Does someone attempt to use on such binaries ?
I can apply it with success on binaries built by ms compiler.
 
Sincerely.
AnswerRe: ParseBinaryVersionRessource and Embarcadero C++buildermemberddbug9 Nov '12 - 6:55 
If you can send me an example executable I'll look at it.
Thanks,
dd.
AnswerRe: ParseBinaryVersionRessource and Embarcadero C++buildermemberddbug17 Nov '12 - 13:07 
Thanks for the sample. Will add support for C++B in the next update.
 
-- dd
SuggestionCode hostingmemberpzycho2 Oct '12 - 9:23 
Thanks for this nice little tool, does exactly what I want it to do.
 
Any chance that you might put the code on some code hosting platform like github for example?
This would be alot easier to get notice of code changes and for others to contribute.
 
-- pzy
GeneralRe: Code hostingmemberddbug2 Oct '12 - 11:04 
Thanks for your interest. The code is hosted on Unfuddle. Unfortunately they do not seem to support public collaborators. Also, Github naturally supports only git, but I still use svn. Perhaps I should consider Bitbucket (and mercurial).
 
-- dd
GeneralRe: Code hostingmemberpzycho2 Oct '12 - 12:56 
Hmmm, never heard of Unfuddle. Github was just an example, but I really came to love it recently. Coming from svn myself, it sure took me a while to grasp. With all the options nowadays (e.g. SourceForge, Google Code, CodePlex, ...) go with what suits your needs.
 
-- pzy
GeneralRe: Code hostingmemberddbug18 Jan '13 - 14:40 
Ok so it is now on Codeplex: http://ddverpatch.codeplex.com. If I understand correctly, patches can be posted via their web interface, even without commit access to the repo.
 
-- dd
Questionis it possible to set only the last value of the revision number?memberMember 94074426 Sep '12 - 22:06 
My exe already has a version info created by a resource, say 1.2.3.0
 
I want to modify only the last version number (to some source control revision) so I have 1.2.3.4444
 
when I use:
"verpatch.exe my.exe 4444 /va"
 
the version number becomes 0.0.0.4444
 
however I can do it with:
"verpatch.exe my.exe 3.4444 /va"
to get the correct version number of 1.2.3.4444
 
is this a bug?
 
Thanks
AnswerRe: is it possible to set only the last value of the revision number?memberAngryWill6 Sep '12 - 23:42 
ok my bad - removing the /va (add/overwrite option) stops this behaviour
 
great utility - thanks for sharing
GeneralMy vote of 5memberaByteArray4 Sep '12 - 5:55 
really useful tool, thanks for sharing the source as well!
BugVersion string length fixmembervzeissler22 Aug '12 - 2:04 
Could you please consider to apply the following patch which fixes the problem with a broken string size field (computed in bytes, but shall be in chars -- at least VS does it so):
 
Index: vs_version.h
===================================================================
@@ -75,12 +75,11 @@
     //   WORD   Value[];
     //};
          WORD wValueLength = val ? (WORD)wcslen(val) : 0;
-          if (wValueLength)
-               wValueLength = (wValueLength + 1) * sizeof(WCHAR);
+          WORD wValueSize = (wValueLength) ? (wValueLength + 1) * sizeof(WCHAR) : 0;
          WORD wNameLength = (WORD)((wcslen(name) + 1 ) * sizeof(WCHAR));
          ASSERT(wNameLength > sizeof(WCHAR));

-          checkspace( wValueLength + wNameLength + 5*sizeof(WORD));
+          checkspace( wValueSize + wNameLength + 5*sizeof(WORD));

          PUCHAR porig = m_curptr;
          pushw(-1); //length, patch
GeneralRe: Version string length fixmemberddbug22 Aug '12 - 6:59 
Thanks for looking at my messy code...
But I don't understand what your patch changes besides of perhaps improving readability.
You've added a variable wValueSize which receives the same value as wValueLength, and use it instead of wValueLength.
 
-- dd
GeneralRe: Version string length fixmembervzeissler30 Aug '12 - 3:02 
wValueLength is written to the data block instead of wValueSize.
wValueSize is used solely to check the available space.
AnswerRe: Version string length fix [modified]memberddbug30 Aug '12 - 7:14 
Will add this patch. Thank you.
- dd

modified 2 Sep '12 - 12:07.

GeneralMy vote of 5membergndnet9 Aug '12 - 2:07 
cool
GeneralThank you.memberpraveenkoru12 Jun '12 - 5:10 
It is doing what exactly I am looking for. Thank you very much. If I found some problem I will let you know, Smile | :) Smile | :) Smile | :)
GeneralMy vote of 5memberMihai MOGA15 Apr '12 - 18:18 
This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information. Keep it up once again.
Questionexcellent work + very minor annoyance (removing the tail of the version)memberoren.shnitzer10 Apr '12 - 8:33 
Thanks for this tool. It really helps!
I just encountered a very small annoyance bug: if the version number includes a tail part - let's say the original version was "1.2.3.4 - tail" and we are trying to set it to "1.2.3.5", I think that it would be better to overwrite the exiting tail with nothing.
I found out (by debugging) that I needed to specify "1.2.3.5 " to overwrite the tail. While this is a valid workaround (I don't think anyone will care about the extra space in the version), it would be great if you can update the code to overwrite the tail part by NULL if no tail was specified. I think this is what most users would expect.
 
I apologize for nitpicking. I usually don't do that. I just want to save other users the time it takes to figure this out.
AnswerRe: excellent work + very minor annoyance (removing the tail of the version)memberddbug13 Apr '12 - 23:59 
Thanks, it is a good idea. However I don't update code here often, because it needs to pass thru the editors. Will do with a next major revision.
 
- dd
GeneralMy vote of 5memberoren.shnitzer10 Apr '12 - 4:32 
Does what it says
QuestionFile Version errormemberpradeepgoudR8 Mar '12 - 1:11 
When I tried to change the version info of a executable file with this command
 
verpatch d:\test.exe /va 1.2.3.4 /s desc "my program"
 
I am getting the following error.
 
err GetShortPathName, gle=2
err opening file for rechecksum (unicode path)
err open file for reading extra data 2
Failed to read extra data
 
Any help on this is highly appreciated.
 
Thanks
AnswerRe: File Version errormemberddbug9 Mar '12 - 2:56 
This means "file not found". Sorry, the error message needs improvement. Will fix later.
 
dd.
GeneralRe: File Version errormemberpradeepgoudR15 Mar '12 - 4:18 
Thanks.....It worked for me....Great tool....... Smile | :)
QuestionBug? Build file problems?memberDavid Pallett23 Feb '12 - 2:37 
A very useful piece of code!!
I download your code and the binaries - the binaries went bang on usage so I built it in VS 2010 allowing it to do a conversion to the new format.
I ran the debug version in a BAT file and got the following:
verpatch GDS_Agilent.dll "33.44 special release" /pv 1.2.3.4
Exception in ParseBinaryVersionResource
Error in ParseBinaryVersionResource
error parsing version info from the file
Some of actions failed, exiting
 
I have run StampVer (another similar exe) against it and it works - any ideas?
best regards
AnswerRe: Bug? Build file problems?memberddbug9 Mar '12 - 3:10 
Yes, my parser does not cover all possible formats. Can you send me this dll?
 
dd
GeneralMy vote of 5memberDonJAtTelestream9 Feb '12 - 11:43 
Very useful little program. Thanks.
QuestionSimple Version Resource Tool help neededmemberpradeepgoudR5 Feb '12 - 22:19 
I have downloaded the source code and executables of the simple version resource tool from this forum.
 
I need to change the file version information of the installer(.exe) in WINDOWS Operating System.
 
I tried douvle clicking on the verpatch(application) in the executables I have downloaded but it is not showing up anything.
 
Please guide me to change the file version information of the installer(.exe).
 
Any help on this is higly appreciated.
 
Thanks
QuestionthanksmemberMember 840958025 Jan '12 - 23:59 
for 2 months I was searching for this kind of code thank youThumbs Up | :thumbsup: Thumbs Up | :thumbsup: Thumbs Up | :thumbsup: Thumbs Up | :thumbsup: Rose | [Rose] Rose | [Rose] Rose | [Rose] Big Grin | :-D Big Grin | :-D Big Grin | :-D Smile | :)
QuestionFailed to read extra data returns 0 as ERRORLEVEL in a batch file. return value should be 2 right?memberjanettria17 Jan '12 - 19:47 
it always returns 0 as the errorlevel even if errors occured.
 
I'm trying to use the return value of this resource tool in a batch file... but the error values are always the same with or without errors...
AnswerRe: Failed to read extra data returns 0 as ERRORLEVEL in a batch file. return value should be 2 right?memberddbug26 Jan '12 - 0:53 
The "extra data" still is experimental. Need to revise it. Sigh | :sigh:
 
Thanks,
dd
BugUAC break outmemberddbug11 Jan '12 - 8:20 
After a recent Windows update, Windows wants to elevate any program that has "dirty words" in file name or decription, and has no requestedExecutionLevel element in the manifest.
The verpatch.exe binary posted with this article is affected because it has been built with VC++ 2005 and its name contains "patch". But it never needs to be elevated. If you use Win7 and verpatch.exe causes UAC popups, do not run it elevated, neither try any compatibility modes.
Rebuilding verpatch with VC2008 or 2010 should fix this (just check in project properties that requestedExecutionLevel is "asInvoker"). To use the existing binary, please disable UAC temporarily.
In the next release I'll fix the binary.
 
Ah, by the way, some of "dirty words" that trigger UAC are: patch, update, setup.
 
dd.
Suggestion.NET assembly version to file version [modified]memberddbug29 Nov '11 - 2:25 
Users asked how to sync the .net assembly version with the file version visible in Explorer.
One solution is to extract the assembly version from the file, then run verpatch to set it as the file version resource. All this can be done in a post-build step in Visual Studio. Of course, this must be done before digital signing.
 
Now, how to extract the assembly version?
You can write a small program that prints assembly version to stdout. From there you can pick it and pass to verpatch.
 
With powershell:
 
$filename = "c:\path\my-dotnet.dll"
$Myasm = [System.Reflection.Assembly]::Loadfile($filename)
$Aname = $Myasm.GetName()
$Aver =  $Aname.version
# Display result:
"Assembly name: {0} Assembly version: {1}" -f $Aname.name, $aver
 

Same, in C++/CLI:
 
using namespace System;
using namespace System::IO;
using namespace System::Reflection;
 
int main(array<System::String ^> ^args)
{
  if(args->Length <= 0)
      return 1;
 
  String^ filename = Path::GetFullPath(args[0]);
  Assembly^ a = Assembly::LoadFile(filename);
  AssemblyName^ aname = a->GetName();
  Console::WriteLine(aname->Version->ToString());
  return 0;
}
 
(thinking of a new utility to get specified properties from PE files, such as version number, assembly version, VC++ runtime/.NET runtime version required, interesting details from the manifest, signatures, etc.)
 
Regards,
dd.

modified 11 Jan '12 - 13:58.

NewsUpdate: alternate format of version numbers, support for intl. language codes [modified]memberddbug29 Nov '11 - 1:54 
I've added two features since ver. 6:
- version numbers (file version, product version) now accept dash separator from the optional suffix string (to comply with the http://semver.org/[^] format.
However, the version numbers still will have 4 components rather than 3.
I'll add new switch "/3" to format string versions with only 3 components.
 
- Language code of existing version resource will be preserved and not replaced to LN or ENU.
- New switch /lang added to specify language code for newly created version resource
 

The update has been sent to the editors. Zip names to download begin with verpatch-1.0.9.
 
Thanks,
dd.

modified 1 Dec '11 - 6:29.

QuestionHow can I replace a VERSIONINFO with language code set to 1024?memberskyhighsmile19 Nov '11 - 19:33 
Hi,
 
Verpatch is great - I was trying to use ResHacker to do the same thing, and had alot of challenges with it.
 
I'm having a problem with one thing though.   I have a dll where the language code for the version info block is 1024.   When I use verpatch to update it, instead of changing the existing block, it creates a new version info block with language code 1033 (U.S. English).
 
Is there any way to tell verpatch which language code to use, so it will overwrite the original block instead of creating a new one?
 
Alternatively, is there any way to have verpatch just remove the old one, so that when I create a new one there's only 1 version info block?   (I tried using the /va switch, but that actually created a new version info block with language code 0, without deleting the original one that has language code 1024).
 
Thanks!
AnswerRe: How can I replace a VERSIONINFO with language code set to 1024?memberddbug20 Nov '11 - 1:51 
1024 (0x400) is not a real language code, it stands for Process default language. See http://msdn.microsoft.com/en-us/library/aa912040.aspx[^]
 
I've thought about enumerating and deleting all existing version resources for /va, but have not done it yet.
 
Thanks,
dd
NewsSemantic versioning [modified]memberddbug11 Nov '11 - 19:37 
There is an article on semantics of version numbers:
 
Semantic versioning[^]
 
and interesting discussion here.[^]
 
One point to take from this proposal is that it explains the use of additional string after the numeric version (p.3). This may justify duplication of the version number in binary and strings parts.
 
It also specifies the syntax: there should be a dash between the last digit and the extra string ("1.2.3.4-extra" rather than "1.2.3.4 extra").
 
I'll fix the code to allow this syntax (currently it requires the space before extra string).
 
-- dd

modified 29 Nov '11 - 7:58.

BugSigned BinariesmemberBill Tutt4 Nov '11 - 3:00 
The extra data calculation doesn't include PE Authenticode Certificate data in the endOfImage calculation in peExtras.cpp:getFileExtraData.
 
// Add in CERTIFICATE data if it exists. 
// It comes at the end of the file if there isn't a .debug section.
if (im.FileHeader->OptionalHeader.NumberOfRvaAndSizes > 5)
{
	PIMAGE_OPTIONAL_HEADER pOptionalHeader = &im.FileHeader->OptionalHeader;
	if (pOptionalHeader->NumberOfRvaAndSizes > 5
		&& endOfImage < pOptionalHeader->DataDirectory[4].VirtualAddress + pOptionalHeader->DataDirectory[4].Size)
	{
		// TODO: Warn about invalidating CERTIFICATE data if we're updating the file
		endOfImage = pOptionalHeader->DataDirectory[4].VirtualAddress + pOptionalHeader->DataDirectory[4].Size;
	}
}
 
Next steps would be:
* Use the knowledge of the CERTIFICATE table to optionally remove the data since it is no longer useful with any added/changed resources.
* Warn about the fact that you're ruining a signed binary.
 
Bill
GeneralRe: Signed Binariesmemberddbug4 Nov '11 - 6:26 
Thank you. I wanted to check for signed binaries, but delayed it as low priority.
What is the file has both .debug section and certificate?
 
- dd
GeneralRe: Signed BinariesmemberShada224 Nov '11 - 7:55 
It isn't an issue. Debug data comes after the certificate information.
 
From v8 of the PE COFF spec Section 4 introduction(available from msdn.microsoft.com):
 
<quot> Another exception is that attribute certificate and debug information must be placed at the very end of an image file, with the attribute certificate table immediately preceding the debug section, because the loader does not map these into memory.</quot>
 
You can get the spec from: http://msdn.microsoft.com/en-us/windows/hardware/gg463125[^]
 
Fyi,
Bill
QuestionCrash dumps and WinDBGmemberRolf Kristensen1 Aug '11 - 23:07 
Just curious whether the PDB file will continue to work in WinDBG, when having modified the EXE/DLL file after the initial linking ?
AnswerRe: Crash dumps and WinDBGmemberddbug2 Aug '11 - 0:56 
Yes, should work.
GeneralMy vote of 5memberronhash28 Jul '11 - 0:35 
Useful tool for version release - we're going to use it as part of our products
GeneralSmall bugmembercjones28524 Apr '11 - 10:44 
In file relstamp.cpp, at around line 210, the file type is set incorrectly.
		if ( _tcsicmp( pdot_ext, _T(".exe") ))
			fvd->dwFileType = VFT_APP;
		if ( _tcsicmp( pdot_ext, _T(".sys") ))
			fvd->dwFileType = VFT_DRV;
		if ( _tcsicmp( pdot_ext, _T(".dll") ))
			fvd->dwFileType = VFT_DLL;
 
The fix is to replace the above code with this:
		if ( 0 == _tcsicmp( pdot_ext, _T(".exe") ))
			fvd->dwFileType = VFT_APP;
		if ( 0 == _tcsicmp( pdot_ext, _T(".sys") ))
			fvd->dwFileType = VFT_DRV;
		if ( 0 == _tcsicmp( pdot_ext, _T(".dll") ))
			fvd->dwFileType = VFT_DLL;

GeneralRe: Small bugmemberddbug11 Jan '12 - 8:02 
Fixed, thanks.
Generalrunning verpatch under winememberSheldonRiddell21 Apr '11 - 2:56 
Ive been using this tool and have had a lot of success running from DOS.
I need to however now run on linux x86 gc22. Im using wine and always come up with the following error: "Some of actions failed, exiting"
Setting a new version number did not work.
Using the /vo option displayed the data but printed the error above on completion.
Is there anything that I need to specifically set up under wine to get this running succesfully.
GeneralRe: running verpatch under winememberddbug21 Apr '11 - 8:20 
Thanks for letting know. Looks like Wine does not implement some imagehlp API. If time allows will test this.
 
--dd
GeneralRe: running verpatch under winememberSheldonRiddell1 May '11 - 21:47 
Extra information
version of wine is wine-1.0.1
GeneralVery Very Useful!! Thanks!!!!memberKellyHong2 Mar '11 - 18:26 
.
GeneralMy vote of 5memberSteveWilkinson16 Aug '10 - 3:09 
Very handy utility - many thanks.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 3 Sep 2012
Article Copyright 2009 by ddbug
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid