diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/arch/mep/asm/test_asm.py | 4 | ||||
| -rw-r--r-- | test/arch/mep/asm/test_major_opcode_4.py | 2 | ||||
| -rw-r--r-- | test/arch/x86/arch.py | 20 | ||||
| -rw-r--r-- | test/expression/simplifications.py | 5 | ||||
| -rwxr-xr-x | test/test_all.py | 12 |
5 files changed, 40 insertions, 3 deletions
diff --git a/test/arch/mep/asm/test_asm.py b/test/arch/mep/asm/test_asm.py index 7762669a..e8b8afb9 100644 --- a/test/arch/mep/asm/test_asm.py +++ b/test/arch/mep/asm/test_asm.py @@ -22,12 +22,12 @@ class TestMisc(object): for mn_str, mn_hex in unit_tests: print("-" * 49) # Tests separation - # Dissassemble + # Disassemble mn_bin = decode_hex(mn_hex) mn = mn_mep.dis(mn_bin, "b") print("dis: %s -> %s" % (mn_hex.rjust(20), str(mn).rjust(20))) - assert(str(mn) == mn_str) # dissassemble assertion + assert(str(mn) == mn_str) # disassemble assertion # Assemble and return all possible candidates instr = mn_mep.fromstring(str(mn), "b") diff --git a/test/arch/mep/asm/test_major_opcode_4.py b/test/arch/mep/asm/test_major_opcode_4.py index a6f57ac2..fd466b62 100644 --- a/test/arch/mep/asm/test_major_opcode_4.py +++ b/test/arch/mep/asm/test_major_opcode_4.py @@ -107,7 +107,7 @@ class TestMajor4(object): check_instruction("LBU $4, 0x22($TP)", "4ca2", multi=2) # Note: the following instruction can not be easily manipulated due to # expressions simplifications performed by miasm at assembly and - # dissassembly, i.e. ExprMem($TP + 0) is simplified into ExprMem($TP) + # disassembly, i.e. ExprMem($TP + 0) is simplified into ExprMem($TP) #check_instruction("LBU $6, 0x0($TP)", "4e80", multi=2) check_instruction("LBU $7, 0x3C($TP)", "4fbc", multi=2) check_instruction("LBU $2, 0x4($TP)", "4a84", multi=2) diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py index 202ecac5..68a14036 100644 --- a/test/arch/x86/arch.py +++ b/test/arch/x86/arch.py @@ -3097,6 +3097,26 @@ reg_tests = [ (m32, "00000000 EMMS", "0f77"), + (m64, "00000000 INCSSP RAX", + "f3480faee8"), + (m64, "00000000 INCSSP EAX", + "f30faee8"), + (m64, "00000000 RDSSP EAX", + "f30f1ec8"), + (m64, "00000000 RDSSP RAX", + "f3480f1ec8"), + (m64, "00000000 SAVEPREVSSP", + "f30f01ea"), + (m64, "00000000 RSTORSSP XMMWORD PTR [RAX]", + "f30f0128"), + (m64, "00000000 WRSS QWORD PTR [0x1234], RDX", + "480f38f6142534120000"), + (m64, "00000000 WRUSS DWORD PTR [EAX], EAX", + "67660f38f500"), + (m64, "00000000 SETSSBSY", + "f30f01e8"), + (m64, "00000000 CLRSSBSY XMMWORD PTR [RAX]", + "f30fae30"), (m64, "00000000 ENDBR64", "f30f1efa"), (m32, "00000000 ENDBR32", diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py index 1a22c43d..e0b666da 100644 --- a/test/expression/simplifications.py +++ b/test/expression/simplifications.py @@ -192,6 +192,11 @@ to_test = [(ExprInt(1, 32) - ExprInt(1, 32), ExprInt(0, 32)), ExprOp('&', a, ExprInt(0x0FFFFFFF, 32))), (ExprOp('<<', ExprOp('>>', a, ExprInt(0x4, 32)), ExprInt(0x4, 32)), ExprOp('&', a, ExprInt(0xFFFFFFF0, 32))), + + (ExprCompose(ExprId("a", 8), ExprId("b", 24)) & ExprInt(0xFF, 32), ExprCompose(ExprId("a", 8), ExprInt(0x0, 24))), + (ExprCompose(ExprId("a", 8), ExprInt(0x12, 8), ExprId("b", 16)) & ExprInt(0xFFFF, 32), ExprCompose(ExprId("a", 8), ExprInt(0x12, 24))), + (ExprCompose(ExprId("a", 8), ExprInt(0x1234, 16), ExprId("b", 8)) & ExprInt(0xFFFF, 32), ExprCompose(ExprId("a", 8), ExprInt(0x34, 24))), + (a[:32], a), (a[:8][:8], a[:8]), (a[:16][:8], a[:8]), diff --git a/test/test_all.py b/test/test_all.py index 6d4ee0a5..ce223211 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -697,6 +697,18 @@ for script in [["basic_op.py"], ]: testset += ExampleExpression(script) +## Loader +class ExampleLoader(Example): + """Loader examples specificities: + - script path begins with "loader/" + """ + example_dir = "loader" + + +testset += ExampleLoader(["build_pe.py"], products=["fresh_pe.exe"]) +# A sample is required, so "minidump_to_pe.py" is disabled for now + + ## Symbolic Execution class ExampleSymbolExec(Example): """Symbol Exec examples specificities: |