rmusser01 / pefile

Automatically exported from code.google.com/p/pefile
Other
0 stars 1 forks source link

Changes to pe.FileInfo dictionaries are not persisted via pe.write() #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Parse a pe file
   pe = pefile.PE(path)
2. Edit a version string value:
   pe.FileInfo[0].StringTable[0].entries['FileVersion'] = '2, 0, 0, 0'
3. Write out a file:
   pe.write(filename='temp.exe')

What is the expected output? What do you see instead?

Looking at the properties of the exe in Windows Explorer, I see that the
FileVersion is unchanged.  I believe this is because the write() method
just serializes structures and the FileInfo dictionary is parsed out of
structures.

What version of the product are you using? On what operating system?

pefile 1.2.8 under Python 2.5 on Windows XP SP2

Please provide any additional information below.

In general, a pe.setVersion('w.x.y.z') method would be very useful.  I've
implemented the VS_FIXEDFILEINFO part of it, but am stuck on the FileInfo
part.  I could of course edit the StringFileInfo structures directly, but
that would require a lot of code duplication from parse_version_information()

My goal is to replace http://www.elphin.com/products/stampver.html with a
simpler tool that supports 64-bit PE

Original issue reported on code.google.com by cjdo...@gmail.com on 20 Dec 2007 at 3:29

GoogleCodeExporter commented 9 years ago
Great suggestion. I'll look into it for the next version. It would be a very 
useful feature

Original comment by ero.carr...@gmail.com on 22 Dec 2007 at 1:58

GoogleCodeExporter commented 9 years ago

Original comment by ero.carr...@gmail.com on 26 Feb 2008 at 5:23

GoogleCodeExporter commented 9 years ago
I've implemented the functionality and will be available with pefile 1.2.9

Original comment by ero.carr...@gmail.com on 28 Feb 2008 at 9:40