Closed GoogleCodeExporter closed 9 years ago
pefile will not rearrange any structures/headers if data of different lengths
is written. It does allow to overwrite the values, which often comes handy.
Currently there are have no plans of having pefile regenerate the PE to account
for changes in field/structure sizes.
Original comment by ero.carr...@gmail.com
on 26 Jun 2012 at 7:46
no that's not what I meant, what I meant is exactly what you said, pefile isn't
doing what you said, if a different string length is put in this will corrupt
the pe, only when the strings are too long not if they are too short, this is a
bug in the code
there should be checks preventing this from happening
try my example out
Original comment by simonz...@gmail.com
on 27 Jun 2012 at 2:43
Thanks for bringing this up. I see how that might be a problem.
The correct behavior would be to rearrange the file so it all fits when adding
both, longer and shorter data. Given that pefile doesn't attempt to produce
correct PEs I don't see checks as the ones you proposed to provide much value.
I don't want people to start relying on pefile to compose PEs ;-) . It's
complex enough to parse all its idiosyncrasies that I don't want to have to
deal with composition of correct PEs.
Actually, I've personally found useful having no such checks when I've needed
to modify the PE without adhering to structure/header boundaries.
Nonetheless, if you still feel this is a serious problem for your use-case, I
will take a look at patches.
Original comment by ero.carr...@gmail.com
on 27 Jun 2012 at 8:37
Original issue reported on code.google.com by
simonz...@gmail.com
on 25 Jun 2012 at 7:54