python - pefile How do I nullify the first 8 bytes of a file? -


how nullify first 8 bytes of file?

this example not work:

import pefile pe = pefile.pe(in) pe.set_dword_at_rva(0,0) pe.set_dword_at_rva(0,4) pe.write(out) pe.close() 

how can rename import functions in file? example not work:

for entry in pe.directory_entry_import:   print entry.dll   imp in entry.imports:      imp.name = 'newimports' pe.write(out) 

sorry english

i'd propose use standard way (i. e. not using pefile) of doing this:

with file('filename.bla', 'wr+') f:   f.write('\0' * 8) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -