Beispiel #1
0
def test_asm(test_target, syntax, source, result, target):
    try:
        output = pwny.asm(source, syntax=syntax, target=test_target)
    except RuntimeError:
        # Toolchain wasn't found. Unfortunate, but unavoidable on travis-ci atm.
        pytest.skip('No suitable binutils was found for %s' % target)
    assert output == result, 'Got %r, expected %r' % (output, result)
Beispiel #2
0
def test_asm(test_target, syntax, source, result, target):
    try:
        output = pwny.asm(source, syntax=syntax, target=test_target)
    except RuntimeError:
        # Toolchain wasn't found. Unfortunate, but unavoidable on travis-ci atm.
        pytest.skip('No suitable binutils was found for %s' % target)
    assert output == result, 'Got %r, expected %r' % (output, result)
Beispiel #3
0
def test_asm_nasm_unsupported_arch():
    pwny.asm('mov al, [0xced]', syntax=pwny.AsmSyntax.nasm, target=target_arm_64_le)
Beispiel #4
0
def test_asm_unsupported_target():
    pwny.asm('mov al, [0xced]', target=target_unknown_32)
Beispiel #5
0
def test_asm_syntax_error():
    pwny.asm('mov ced, 3')
Beispiel #6
0
def test_asm_unsupported_target():
    pwny.asm('mov al, [0xced]', target=target_unknown_32)
Beispiel #7
0
def test_asm_syntax_error():
    pwny.asm('mov ced, 3', target=target_x86_32)
Beispiel #8
0
def test_asm_unsupported_target():
    pwny.asm(SOURCE_ASM, target=target_arm_32)
Beispiel #9
0
def test_asm_with_target_x86_64():
    assert pwny.asm(SOURCE_ASM, target=target_x86_64) == RESULT_BIN_64
Beispiel #10
0
def test_asm_syntax_error():
    pwny.asm('mov ced, 3')
Beispiel #11
0
def test_asm_with_default_target():
    # Note: set up sets default arch to x86 32bit
    assert pwny.asm(SOURCE_ASM) == RESULT_BIN_32
Beispiel #12
0
def test_asm_unsupported_target():
    pwny.asm(SOURCE_ASM, target=target_arm_32)
Beispiel #13
0
def test_asm_with_target_x86_64():
    assert pwny.asm(SOURCE_ASM, target=target_x86_64) == RESULT_BIN_64
Beispiel #14
0
def test_asm_with_default_target():
    # Note: set up sets default arch to x86 32bit
    assert pwny.asm(SOURCE_ASM) == RESULT_BIN_32
Beispiel #15
0
def test_asm_nasm_unsupported_arch():
    pwny.asm('mov al, [0xced]',
             syntax=pwny.AsmSyntax.nasm,
             target=target_arm_64_le)