Closed rpm5099 closed 10 months ago
pefile
will attempt to use mmap.mmap on the input file, which implements the buffer protocol, as memoryview
does. I have done some experiments with memoryview
but I see not difference in speed or memory consumption. However since the move to Python 3 the b(x)
function is superfluous so I'll do away with it.
I am closing this for the time being but feel free to open if I've misunderstood your suggestion or overlooked something.
In the
PE
class could the__init__
function parameterdata
be changed to support accepting a memoryview? the functiondef b(x):
right now will attempt to runcodecs.encode
on it as if it were a str. In many cases memoryview can be treated just like bytes. If you are working with executables in memoryview format converting them to bytes to analyze with pefile requires them to be copied it memory. Because pefile does not modify data AFAIK, making this change should not be an issue.