uroboros-diversification/src/instrumentation/gfree/inlining.py
def bswapsub(reg, loc):
        """
        Replace target register in bswap containing ret encoding bytes
        :param reg: bswapped register
        :param loc: instuction location
        :return: instruction list with replaced bswap
        """
        sub = Types.RegClass('edi' if reg[0].lower() == 'e' else 'rdi')
        substack = Types.RegClass('edi' if ELF_utils.elf_32() else 'rdi')
        return set_inlineblocklocation(loc, [
            Types.DoubleInstr(('push', substack, None, False)),
            Types.TripleInstr(('mov', sub, reg, None, False)),
            Types.DoubleInstr(('bswap', sub, None, False)),
            Types.TripleInstr(('mov', reg, sub, None, False)),
            Types.DoubleInstr(('pop', substack, None, False)),
        ])

        Replace target register in bswap containing ret encoding bytes
        :param reg: bswapped register
        :param loc: instuction location
        :return: instruction list with replaced bswap
        
Replace target register in bswap containing ret encoding bytes
Replace target register in bswap containing ret encoding bytes
def bswapsub(reg, loc):
        sub = Types.RegClass('edi' if reg[0].lower() == 'e' else 'rdi')
        substack = Types.RegClass('edi' if ELF_utils.elf_32() else 'rdi')
        return set_inlineblocklocation(loc, [
            Types.DoubleInstr(('push', substack, None, False)),
            Types.TripleInstr(('mov', sub, reg, None, False)),
            Types.DoubleInstr(('bswap', sub, None, False)),
            Types.TripleInstr(('mov', reg, sub, None, False)),
            Types.DoubleInstr(('pop', substack, None, False)),
        ])
def bswapsub ( reg , loc ) : sub = Types . RegClass ( 'edi' if reg [ 0 ] . lower ( ) == 'e' else 'rdi' ) substack = Types . RegClass ( 'edi' if ELF_utils . elf_32 ( ) else 'rdi' ) return set_inlineblocklocation ( loc , [ Types . DoubleInstr ( ( 'push' , substack , None , False ) ) , Types . TripleInstr ( ( 'mov' , sub , reg , None , False ) ) , Types . DoubleInstr ( ( 'bswap' , sub , None , False ) ) , Types . TripleInstr ( ( 'mov' , reg , sub , None , False ) ) , Types . DoubleInstr ( ( 'pop' , substack , None , False ) ) , ] )
Replace target register in bswap containing ret encoding bytes
Replace target register in bswap containing ret encoding bytes
"""
        Replace target register in bswap containing ret encoding bytes
        :param reg: bswapped register
        :param loc: instuction location
        :return: instruction list with replaced bswap
        """
instruction list with replaced bswap
instruction list with replaced bswap
reg
None
loc
None