def __init__(self, fd, inmem=False):

        # Grab a 32bit header to use to check for other
        # machine types...
        e = vs_elf.Elf32()
        fd.seek(0)
        bytes = fd.read(len(e))
        e.vsParse(bytes)
        if e.e_machine in e_machine_32:
            vs_elf.Elf32.__init__(self)
            self.bits = 32
            self.psize = 4
        elif e.e_machine in e_machine_64:
            vs_elf.Elf64.__init__(self)
            self.bits = 64
            self.psize = 8
        else:
            raise Exception(e.e_machine % 'Unrecognized e_machine: %d')

        self.fd = fd

        bytes = self.readAtOffset(0, len(self))
        self.vsParse(bytes)

        if self.e_machine == EM_386:
            self.r_types = r_types_386
        elif self.e_machine == EM_X86_64:
            self.r_types = r_types_amd64
        else:
            self.r_types = {}

        self.pheaders = []
        self.sections = []
        self.secnames = {}
        self.symbols  = []
        self.relocs   = []
        self.symbols_by_name = {}
        self.symbols_by_addr = {}
        self.dynamics = []
        self.dynamic_symbols = []

        self._parsePheaders()
        self._parseSections()
        self._parseSymbols()
        self._parseDynamic()
        self._parseRelocs()
dataset/ETHPy150Open columbia/libtrack/libtrack/elfmod/Elf/__init__.py/Elf.__init__/swapped operands of `%`