(load_stmt, cfg, addr)
return None
Resolve cases where only a single constant load is required to resolve the indirect jump. Strictly speaking, it
        is not a jump table, but we resolve it here anyway.

        :param load_stmt:   The pyvex.IRStmt.Load statement that loads an address.
        :param cfg:         The CFG instance.
        :param int addr:    Address of the jump table block.
        :return:            A jump target, or None if it cannot be resolved.
        :rtype:             int or None
Resolve cases where only a single constant load is required to resolve the indirect jump. Strictly speaking, it
        is not a jump table, but we resolve it here anyway.
Resolve cases where only a single constant load is required to resolve the indirect jump . Strictly speaking it is not a jump table but we resolve it here anyway .
def _try_resolve_single_constant_loads(load_stmt, cfg, addr):
        """
        Resolve cases where only a single constant load is required to resolve the indirect jump. Strictly speaking, it
        is not a jump table, but we resolve it here anyway.

        :param load_stmt:   The pyvex.IRStmt.Load statement that loads an address.
        :param cfg:         The CFG instance.
        :param int addr:    Address of the jump table block.
        :return:            A jump target, or None if it cannot be resolved.
        :rtype:             int or None
        """

        # If we're just reading a constant, don't bother with the rest of this mess!
        if isinstance(load_stmt, pyvex.IRStmt.WrTmp):
            if type(load_stmt.data.addr) is pyvex.IRExpr.Const:
                # It's directly loading from a constant address
                # e.g.,
                #  ldr r0, =main+1
                #  blx r0
                # It's not a jump table, but we resolve it anyway
                jump_target_addr = load_stmt.data.addr.con.value
                jump_target = cfg._fast_memory_load_pointer(jump_target_addr)
                if jump_target is None:
                    l.info("Constant indirect jump %#x points outside of loaded memory to %#08x", addr,
                           jump_target_addr)
                    raise NotAJumpTableNotification()

                l.info("Resolved constant indirect jump from %#08x to %#08x", addr, jump_target_addr)
                return jump_target

        elif isinstance(load_stmt, pyvex.IRStmt.LoadG):
            if type(load_stmt.addr) is pyvex.IRExpr.Const:
                # It's directly loading from a constant address
                # e.g.,
                #  4352c     SUB     R1, R11, #0x1000
                #  43530     LDRHI   R3, =loc_45450
                #  ...
                #  43540     MOV     PC, R3
                #
                # It's not a jump table, but we resolve it anyway
                # Note that this block has two branches: One goes to 45450, the other one goes to whatever the original
                # value of R3 is. Some intensive data-flow analysis is required in this case.
                jump_target_addr = load_stmt.addr.con.value
                jump_target = cfg._fast_memory_load_pointer(jump_target_addr)
                l.info("Resolved constant indirect jump from %#08x to %#08x", addr, jump_target_addr)
                return jump_target

        return None
def _try_resolve_single_constant_loads ( load_stmt , cfg , addr ) : # If we're just reading a constant, don't bother with the rest of this mess! if isinstance ( load_stmt , pyvex . IRStmt . WrTmp ) : if type ( load_stmt . data . addr ) is pyvex . IRExpr . Const : # It's directly loading from a constant address # e.g., #  ldr r0, =main+1 #  blx r0 # It's not a jump table, but we resolve it anyway jump_target_addr = load_stmt . data . addr . con . value jump_target = cfg . _fast_memory_load_pointer ( jump_target_addr ) if jump_target is None : l . info ( "Constant indirect jump %#x points outside of loaded memory to %#08x" , addr , jump_target_addr ) raise NotAJumpTableNotification ( ) l . info ( "Resolved constant indirect jump from %#08x to %#08x" , addr , jump_target_addr ) return jump_target elif isinstance ( load_stmt , pyvex . IRStmt . LoadG ) : if type ( load_stmt . addr ) is pyvex . IRExpr . Const : # It's directly loading from a constant address # e.g., #  4352c     SUB     R1, R11, #0x1000 #  43530     LDRHI   R3, =loc_45450 #  ... #  43540     MOV     PC, R3 # # It's not a jump table, but we resolve it anyway # Note that this block has two branches: One goes to 45450, the other one goes to whatever the original # value of R3 is. Some intensive data-flow analysis is required in this case. jump_target_addr = load_stmt . addr . con . value jump_target = cfg . _fast_memory_load_pointer ( jump_target_addr ) l . info ( "Resolved constant indirect jump from %#08x to %#08x" , addr , jump_target_addr ) return jump_target return None