'Returns an OrderedDict of addresses/values which will set the specified
register context.
Arguments:
registers(dict): Dictionary of ``{register name: value}``
Returns:
An OrderedDict of ``{register: sequence of gadgets, values, etc.}``.'

def setRegisters(self, registers):

    reg_order = collections.OrderedDict()
    for (reg, value) in registers.items():
        gadget = self.find_gadget([('pop    ' + reg), 'ret'])
        if (not gadget):
            log.error(("can't    set    %r" % reg))
        reg_order[reg] = [gadget, value]
    return reg_order
