    def patch_initial_instructions(self):
        """
        This function takes the flItms dict and patches the
        executable entry point to jump to the first code cave.
        """
        print "[*] Patching initial entry instructions"
        self.f.seek(self.flItms['LocOfEntryinCode'], 0)
        #This is the JMP command in the beginning of the
        #code entry point that jumps to the codecave
        self.f.write(struct.pack('=B', int('E9', 16)))
        if self.flItms['JMPtoCodeAddress'] < 0:
            self.f.write(struct.pack('<I', 0xffffffff + self.flItms['JMPtoCodeAddress']))
        else:
            self.f.write(struct.pack('<I', self.flItms['JMPtoCodeAddress']))

        # To make any overwritten instructions dissembler friendly
        if self.flItms['count_bytes'] > 5:
            for i in range(self.flItms['count_bytes'] - 5):
                self.f.write(struct.pack('=B', 0x90))
This function takes the flItms dict and patches the
executable entry point to jump to the first code cave.
intel/intelCore.py