uroboros-diversification/src/disasm/arm_process.py
def tb_process(offsize, pc, buf, filehandle):
    """
    Manage tb[hb] jumptable
    :param offsize: jump table entry size
    :param pc: current program counter
    :param buf: raw data containing jump offsets
    :param filehandle: file handle for code dump
    """
    i = 0
    unpacker = '<H' if offsize == 2 else '<B'
    datatype = ('.short' if offsize == 2 else '.byte').ljust(7)
    while i < len(buf):
        val = unpack(unpacker, buf[i:i+offsize])[0] << 1
        filehandle.write(('%x' % (pc+i)).rjust(8) + ':\t' + datatype + ' (S_0x%X-S_0x%X)/2\n' % ((pc + val) & 0xFFFFFFFF, pc))
        i += offsize

    Manage tb[hb] jumptable
    :param offsize: jump table entry size
    :param pc: current program counter
    :param buf: raw data containing jump offsets
    :param filehandle: file handle for code dump
    
Manage tb[hb] jumptable
Manage tb [ hb ] jumptable
def tb_process(offsize, pc, buf, filehandle):
    i = 0
    unpacker = '<H' if offsize == 2 else '<B'
    datatype = ('.short' if offsize == 2 else '.byte').ljust(7)
    while i < len(buf):
        val = unpack(unpacker, buf[i:i+offsize])[0] << 1
        filehandle.write(('%x' % (pc+i)).rjust(8) + ':\t' + datatype + ' (S_0x%X-S_0x%X)/2\n' % ((pc + val) & 0xFFFFFFFF, pc))
        i += offsize
def tb_process ( offsize , pc , buf , filehandle ) : i = 0 unpacker = '<H' if offsize == 2 else '<B' datatype = ( '.short' if offsize == 2 else '.byte' ) . ljust ( 7 ) while i < len ( buf ) : val = unpack ( unpacker , buf [ i : i + offsize ] ) [ 0 ] << 1 filehandle . write ( ( '%x' % ( pc + i ) ) . rjust ( 8 ) + ':\t' + datatype + ' (S_0x%X-S_0x%X)/2\n' % ( ( pc + val ) & 0xFFFFFFFF , pc ) ) i += offsize
Manage tb[hb] jumptable
Manage tb [ hb ] jumptable
"""
    Manage tb[hb] jumptable
    :param offsize: jump table entry size
    :param pc: current program counter
    :param buf: raw data containing jump offsets
    :param filehandle: file handle for code dump
    """
offsize
jump table entry size
jump table entry size
pc
current program counter
current program counter
buf
raw data containing jump offsets
raw data containing jump offsets
filehandle
file handle for code dump
file handle for code dump