#!/usr/bin/env python3 from modules.logger import logger import struct # Declare a class that can automatically convert virtual executable addresses # to file addresses class Bin: file = None def __init__(self, filename): logger.debug('Parsing headers of "%s"... ', filename) self.file = open(filename, 'rb') #HACK: Strictly, we should be parsing the header, but we know where # everything is in these two files so we just jump straight there # Read ImageBase self.file.seek(0xB4) self.imagebase, = struct.unpack('