clslgrnc / tbrop

Assert statement used outside of tests BAN-B101
Security
Major
10 months ago5 years old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 18    if cs.x86.X86_GRP_BRANCH_RELATIVE in instruction.groups:
 19        assert len(instruction.operands) > 0
 20        destination = instruction.operands[0]
 21        assert destination.type == cs.CS_OP_IMM 22        branch_to = destination.imm  # capstone resolves addresses
 23
 24    return {
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 16    """
 17    branch_to = None
 18    if cs.x86.X86_GRP_BRANCH_RELATIVE in instruction.groups:
 19        assert len(instruction.operands) > 0 20        destination = instruction.operands[0]
 21        assert destination.type == cs.CS_OP_IMM
 22        branch_to = destination.imm  # capstone resolves addresses
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 97        return offsets
 98
 99    # all that remain are call/jmp to imm
100    assert len(instruction.operands) > 0101    destination = instruction.operands[0]
102    assert destination.type == cs.CS_OP_IMM
103
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 99    # all that remain are call/jmp to imm
100    assert len(instruction.operands) > 0
101    destination = instruction.operands[0]
102    assert destination.type == cs.CS_OP_IMM103
104    offsets.append(destination.imm)  # capstone resolves addresses
105
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 18
 19class Arch:
 20    def __init__(self, dependencies):
 21        assert MEM_RESERVED_INDICES > 6 + STACK_PROP 22
 23        self.matrix = dependencies
 24        self.size, _ = dependencies.shape