Evil_TTL> show | s

Modify First Bytes in a Binary File with Python

Category:Automation -> Python

This code will replace first 2 bytes in a file with 0.

with open("filename.ext""r+b") as f:
    
f.seek(0)
    
f.write(b'\x00')
    
f.seek(1)
    
f.write(b'\x00'
By privilege15