miasm
Reverse engineering framework
test_all Namespace Reference

Classes

class  ArchUnitTest
 ArchUnit regression tests. More...
 
class  Example
 
class  ExampleAssembler
 Assembler. More...
 
class  ExampleDisasmFull
 
class  ExampleDisassembler
 
class  ExampleExpression
 Expression. More...
 
class  ExampleJitter
 Jitter. More...
 
class  ExampleJitterNoPython
 
class  ExampleLoader
 Loader. More...
 
class  ExampleShellcode
 
class  ExampleSymbolExec
 Symbolic Execution. More...
 
class  QEMUTest
 QEMU regression tests. More...
 
class  QEMUTestx86_64
 
class  RegressionTest
 
class  SemanticTestAsm
 Semantic. More...
 
class  SemanticTestExec
 
class  TestDepgraph
 Degraph. More...
 

Variables

string is_win = "Windows"
 
string is_64bit = "64bit"
 
 testset = TestSet("../")
 
dictionary TAGS
 
 base_dir
 Architecture. More...
 
 products
 
dictionary blacklist
 
list tags = [TAGS[jitter]] if jitter in TAGS else []
 
 script
 
 jitter
 
list QEMU_TESTS
 
 test_name
 
list QEMU_TESTS_x86_64
 
 test_x86_64_mul_div = SemanticTestAsm("x86_64", "PE", ["mul_div"])
 
 test_x86_32_bsr_bsf = SemanticTestAsm("x86_32", "PE", ["bsr_bsf"])
 
 depends
 
string input_name = "cst_propag/x86_32_sc_%d" % i
 
string bin_name = "samples/x86_32/%s.bin" % input_name
 
 test_x86_32_cst = SemanticTestAsm("x86_32", None, [input_name])
 
list test_args
 
 test_dg = SemanticTestAsm("x86_32", "PE", ["dg_test_%.2d" % i])
 
dictionary test_box = {}
 
list test_box_names = ["mod", "mod_self", "repmod", "simple", "enc", "pop_esp", "automod"]
 
string sample_base = "x86_32_" + source
 
list args = ["x86_32", sample_base + ".S", sample_base + ".bin", "--PE"]
 
 test_armb = ExampleShellcode(["armb", "arm_simple.S", "demo_arm_b.bin"])
 
 test_arml = ExampleShellcode(["arml", "arm_simple.S", "demo_arm_l.bin"])
 
 test_aarch64b = ExampleShellcode(["aarch64b", "aarch64_simple.S", "demo_aarch64_b.bin"])
 
 test_aarch64l = ExampleShellcode(["aarch64l", "aarch64_simple.S", "demo_aarch64_l.bin"])
 
 test_armb_sc = ExampleShellcode(["armb", "arm_sc.S", "demo_arm2_b.bin"])
 
 test_arml_sc = ExampleShellcode(["arml", "arm_sc.S", "demo_arm2_l.bin"])
 
 test_armtb = ExampleShellcode(["armtb", "armt.S", "demo_armt_b.bin"])
 
 test_armtl = ExampleShellcode(["armtl", "armt.S", "demo_armt_l.bin"])
 
 test_msp430 = ExampleShellcode(["msp430", "msp430.S", "msp430_sc.bin"])
 
 test_mips32b = ExampleShellcode(["mips32b", "mips32.S", "mips32_sc_b.bin"])
 
 test_mips32l = ExampleShellcode(["mips32l", "mips32.S", "mips32_sc_l.bin"])
 
 test_x86_64
 
 test_x86_32_if_reg = ExampleShellcode(['x86_32', 'x86_32_if_reg.S', "x86_32_if_reg.bin"])
 
 test_x86_32_seh
 
 test_x86_32_dead = ExampleShellcode(['x86_32', 'x86_32_dead.S', "x86_32_dead.bin"])
 
 test_x86_32_automod_2
 
 test_x86_32_dis
 
 test_human = ExampleShellcode(["x86_64", "human.S", "human.bin"])
 
 prods
 
 dse_crackme_out = Example.get_sample("dse_crackme")
 
 parser = argparse.ArgumentParser(description="Miasm2 testing tool")
 
 help
 
 action
 
 default
 
bool multiproc = True
 Parse multiproc argument. More...
 
list exclude_tags = []
 Parse omit-tags and only-tags argument. More...
 
list include_tags = []
 
 coveragerc = None
 
string suffix = "_" + str(int(time.time()))
 
 cov_dir = tempfile.mkdtemp(suffix, "m2_coverage_")
 
 coverage = os.path.join(cov_dir, ".coverage")
 
 config = ConfigParser()
 
dictionary d
 
bool llvm = True
 
list test_ko = []
 
list test_ok = []
 
 task_done
 
 task_new
 
 clean
 
string command_line = " ".join(test.command_line)
 

Variable Documentation

◆ action

test_all.action

◆ args

test_all.args = ["x86_32", sample_base + ".S", sample_base + ".bin", "--PE"]

◆ base_dir

test_all.base_dir

Architecture.

Toshiba MeP.

Jitter.

Analysis.

OS_DEP.

IR.

ObjC/CHandler.

Expression.

Core.

◆ bin_name

string test_all.bin_name = "samples/x86_32/%s.bin" % input_name

◆ blacklist

dictionary test_all.blacklist
Initial value:
1 = {
2  "x86/unit/mn_float.py": ["python", "llvm"],
3 }

◆ clean

test_all.clean

◆ command_line

string test_all.command_line = " ".join(test.command_line)

◆ config

test_all.config = ConfigParser()

◆ cov_dir

test_all.cov_dir = tempfile.mkdtemp(suffix, "m2_coverage_")

◆ coverage

test_all.coverage = os.path.join(cov_dir, ".coverage")

◆ coveragerc

test_all.coveragerc = None

◆ d

dictionary test_all.d
Initial value:
1 = {"blue": cosmetics.colors['blue'],
2  "end": cosmetics.colors['end'],
3  "cov_dir": cov_dir}

◆ default

test_all.default

◆ depends

test_all.depends

◆ dse_crackme_out

test_all.dse_crackme_out = Example.get_sample("dse_crackme")

◆ exclude_tags

test_all.exclude_tags = []

Parse omit-tags and only-tags argument.

◆ help

test_all.help

◆ include_tags

test_all.include_tags = []

◆ input_name

string test_all.input_name = "cst_propag/x86_32_sc_%d" % i

◆ is_64bit

string test_all.is_64bit = "64bit"

◆ is_win

string test_all.is_win = "Windows"

◆ jitter

test_all.jitter

◆ llvm

bool test_all.llvm = True

◆ multiproc

bool test_all.multiproc = True

Parse multiproc argument.

◆ parser

test_all.parser = argparse.ArgumentParser(description="Miasm2 testing tool")

◆ prods

test_all.prods

◆ products

test_all.products

◆ QEMU_TESTS

list test_all.QEMU_TESTS

◆ QEMU_TESTS_x86_64

list test_all.QEMU_TESTS_x86_64

◆ sample_base

string test_all.sample_base = "x86_32_" + source

◆ script

test_all.script

◆ suffix

string test_all.suffix = "_" + str(int(time.time()))

◆ TAGS

dictionary test_all.TAGS
Initial value:
1 = {"regression": "REGRESSION", # Regression tests
2  "example": "EXAMPLE", # Examples
3  "long": "LONG", # Very time consumming tests
4  "llvm": "LLVM", # LLVM dependency is required
5  "gcc": "GCC", # GCC based tests
6  "python": "PYTHON", # Python jitted tests
7  "z3": "Z3", # Z3 dependency is needed
8  "qemu": "QEMU", # QEMU tests (several tests)
9  "cparser": "CPARSER", # pycparser is needed
10  "linux": "LINUX", # Test must be run on a Linux
11  }

◆ tags

list test_all.tags = [TAGS[jitter]] if jitter in TAGS else []

◆ task_done

test_all.task_done

◆ task_new

test_all.task_new

◆ test_aarch64b

test_all.test_aarch64b = ExampleShellcode(["aarch64b", "aarch64_simple.S", "demo_aarch64_b.bin"])

◆ test_aarch64l

test_all.test_aarch64l = ExampleShellcode(["aarch64l", "aarch64_simple.S", "demo_aarch64_l.bin"])

◆ test_args

test_all.test_args
Initial value:
1 = [(0x401000, 0x40100d, ["EAX"], 1),
2  (0x401000, 0x401011, ["EAX"], 1),
3  (0x401000, 0x401018, ["EAX"], 2),
4  (0x401000, 0x401011, ["EAX"], 2),
5  (0x401000, 0x401011, ["EAX"], 1),
6  (0x401000, 0x401016, ["EAX"], 1),
7  (0x401000, 0x401017, ["EAX"], 2),
8  (0x401000, 0x401012, ["EAX", "ECX"], 1),
9  (0x401000, 0x401012, ["ECX"], 1),
10  (0x401000, 0x40101f, ["EAX", "EBX"], 2),
11  (0x401000, 0x401025, ["EAX", "EBX"], 4),
12  (0x401000, 0x401007, ["EBX"], 3),
13 ]

◆ test_armb

test_all.test_armb = ExampleShellcode(["armb", "arm_simple.S", "demo_arm_b.bin"])

◆ test_armb_sc

test_all.test_armb_sc = ExampleShellcode(["armb", "arm_sc.S", "demo_arm2_b.bin"])

◆ test_arml

test_all.test_arml = ExampleShellcode(["arml", "arm_simple.S", "demo_arm_l.bin"])

◆ test_arml_sc

test_all.test_arml_sc = ExampleShellcode(["arml", "arm_sc.S", "demo_arm2_l.bin"])

◆ test_armtb

test_all.test_armtb = ExampleShellcode(["armtb", "armt.S", "demo_armt_b.bin"])

◆ test_armtl

test_all.test_armtl = ExampleShellcode(["armtl", "armt.S", "demo_armt_l.bin"])

◆ test_box

dictionary test_all.test_box = {}

◆ test_box_names

list test_all.test_box_names = ["mod", "mod_self", "repmod", "simple", "enc", "pop_esp", "automod"]

◆ test_dg

test_all.test_dg = SemanticTestAsm("x86_32", "PE", ["dg_test_%.2d" % i])

◆ test_human

test_all.test_human = ExampleShellcode(["x86_64", "human.S", "human.bin"])

◆ test_ko

list test_all.test_ko = []

◆ test_mips32b

test_all.test_mips32b = ExampleShellcode(["mips32b", "mips32.S", "mips32_sc_b.bin"])

◆ test_mips32l

test_all.test_mips32l = ExampleShellcode(["mips32l", "mips32.S", "mips32_sc_l.bin"])

◆ test_msp430

test_all.test_msp430 = ExampleShellcode(["msp430", "msp430.S", "msp430_sc.bin"])

◆ test_name

test_all.test_name

◆ test_ok

list test_all.test_ok = []

◆ test_x86_32_automod_2

test_all.test_x86_32_automod_2
Initial value:
1 = ExampleShellcode(
2  [
3  'x86_32', 'x86_32_automod_2.S', "x86_32_automod_2.bin", "--PE"
4  ]
5 )

◆ test_x86_32_bsr_bsf

test_all.test_x86_32_bsr_bsf = SemanticTestAsm("x86_32", "PE", ["bsr_bsf"])

◆ test_x86_32_cst

test_all.test_x86_32_cst = SemanticTestAsm("x86_32", None, [input_name])

◆ test_x86_32_dead

test_all.test_x86_32_dead = ExampleShellcode(['x86_32', 'x86_32_dead.S', "x86_32_dead.bin"])

◆ test_x86_32_dis

test_all.test_x86_32_dis
Initial value:
1 = ExampleShellcode(
2  [
3  "x86_32", "test_x86_32_dis.S", "test_x86_32_dis.bin", "--PE"
4  ]
5 )

◆ test_x86_32_if_reg

test_all.test_x86_32_if_reg = ExampleShellcode(['x86_32', 'x86_32_if_reg.S', "x86_32_if_reg.bin"])

◆ test_x86_32_seh

test_all.test_x86_32_seh
Initial value:
1 = ExampleShellcode(["x86_32", "x86_32_seh.S", "x86_32_seh.bin",
2  "--PE"])

◆ test_x86_64

test_all.test_x86_64
Initial value:
1 = ExampleShellcode(["x86_64", "x86_64.S", "demo_x86_64.bin",
2  "--PE"])

◆ test_x86_64_mul_div

test_all.test_x86_64_mul_div = SemanticTestAsm("x86_64", "PE", ["mul_div"])

◆ testset

test_all.testset = TestSet("../")