'This function is for checking if the current exe/dll is
supported by this program. Returns false if not supported,
returns flItms if it is.'

def support_check(self):

    print '[*]    Checking    if    binary    is    supported'
    self.flItms['supported'] = False
    with open(self.FILE, 'r+b') as self.binary:
        if (self.binary.read(2) != 'MZ'):
            print ('%s    not    a    PE    File' % self.FILE)
            return False
        if ((self.gather_file_info_win() is False) and (self.PATCH_METHOD != 'onionduke')):
            print '[!]    Failure    during    gathering    file    info.'
            return False
        if (self.flItms is False):
            return False
        if (MachineTypes[hex(self.flItms['MachineType'])] not in supported_types):
            for item in self.flItms:
                print (item + ':'), self.flItms[item]
            print ('This    program    does    not    support    this    format:    %s' % MachineTypes[hex(self.flItms['MachineType'])])
        else:
            self.flItms['supported'] = True
        targetFile = intelCore(self.flItms, self.binary, self.VERBOSE)
        if ((((self.flItms['Characteristics'] % 16384) - 8192) > 0) and (self.flItms['DllCharacteristics'] > 0) and (self.PATCH_DLL is False)):
            print '[!]    DLL    patching    not    enabled'
            return False
        if ((self.flItms['Magic'] == int('20B', 16)) and ((self.IMAGE_TYPE == 'ALL') or (self.IMAGE_TYPE == 'x64'))):
            targetFile.pe64_entry_instr()
        elif ((self.flItms['Magic'] == int('10b', 16)) and ((self.IMAGE_TYPE == 'ALL') or (self.IMAGE_TYPE == 'x86'))):
            targetFile.pe32_entry_instr()
        else:
            self.flItms['supported'] = False
        if (self.flItms['BoundImportSize'] != 0):
            print '[!]    No    support    for    Bound    Imports    at    this    time'
            return False
        if ((self.RUNAS_ADMIN is True) and (self.SUPPORT_CHECK is True)):
            self.parse_rsrc()
            if ('manifestLOC' in self.flItms):
                self.flItms['runas_admin'] = self.runas_admin()
            else:
                print '[!]    No    manifest    in    rsrc'
        if (self.VERBOSE is True):
            self.print_flItms(self.flItms)
        if (self.flItms['supported'] is False):
            return False
