This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pefile | |
filename = '/home/martin/some_binary.dll' | |
base = os.path.basename(filename) | |
pe = pefile.PE(filename) | |
#Remove is_dll flag | |
pe.FILE_HEADER.Characteristics = pe.FILE_HEADER.Characteristics - 0x2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime as dt | |
from textwrap import wrap | |
def convert_sep_time(timestamp): | |
year, month, day, hours, minutes, seconds = wrap(timestamp, 2) | |
return dt.datetime(year=int(year, 16) + 1970, month=int(month, 16) + 1, day=int(day, 16), hour=int(hours, 16), | |
minute=int(minutes, 16), | |
second=int(seconds, 16)) |