Esempio n. 1
0
 def test_asm_pointerReatribution3_pie(self):
     self.assertTrue(dis_reasm_test(asm_dir/'ex_pointerReatribution3_pie','ex',
         extra_compile_flags=['-pie'],
         c_compilers=['gcc'],
         cxx_compilers=['g++'],
         optimizations=[''],
         strip=True))
Esempio n. 2
0
    def test_virtualDispatch(self): self.assertTrue(dis_reasm_test(ex_dir/'ex_virtualDispatch','ex',reassembly_compiler='g++'))


    # Examples that fail to reassemble

    #thread local storage
    def test_threads(self): self.assertTrue(dis_reasm_test(ex_dir/'ex_threads','ex',reassembly_compiler='g++',skip_reassemble=True))
Esempio n. 3
0
 def test_asm_weird_section(self):
     self.assertTrue(
         dis_reasm_test(asm_dir / 'ex_weird_sections',
                        'ex',
                        c_compilers=['gcc'],
                        cxx_compilers=['g++'],
                        optimizations=['']))
Esempio n. 4
0
 def test_asm_pointerReatribution3_clang(self):
     self.assertTrue(
         dis_reasm_test(asm_dir / 'ex_pointerReatribution3_clang',
                        'ex',
                        c_compilers=['gcc'],
                        cxx_compilers=['g++'],
                        optimizations=['']))
Esempio n. 5
0
 def test_memberPointer(self):
     self.assertTrue(
         dis_reasm_test(
             ex_dir / "ex_memberPointer",
             "ex",
             reassembly_compiler="g++",
             strip=True,
         ))
Esempio n. 6
0
 def test_exceptions3(self):
     self.assertTrue(
         dis_reasm_test(
             ex_dir / "ex_exceptions3",
             "ex",
             reassembly_compiler="g++",
             strip=True,
         ))
Esempio n. 7
0
 def test_threads(self):
     self.assertTrue(
         dis_reasm_test(
             ex_dir / "ex_threads",
             "ex",
             reassembly_compiler="g++",
             reassemble_function=skip_reassemble,
         ))
Esempio n. 8
0
 def test_virtualDispatch(self):
     self.assertTrue(
         dis_reasm_test(
             ex_dir / "ex_virtualDispatch",
             "ex",
             reassembly_compiler="g++",
             strip=True,
         ))
Esempio n. 9
0
 def test_ex1_static(self):
     self.assertTrue(
         dis_reasm_test(ex_dir / 'ex1',
                        'ex',
                        skip_reassemble=True,
                        extra_compile_flags=['-static'],
                        c_compilers=['gcc'],
                        cxx_compilers=['g++'],
                        optimizations=['-O0']))
Esempio n. 10
0
 def test_asm_weird_section(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_weird_sections",
             "ex",
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
         ))
Esempio n. 11
0
 def test_asm_relative_switch_sizes(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_relative_switch_sizes",
             "ex",
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
         ))
Esempio n. 12
0
 def test_asm_switch_in_code(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_switch_in_code",
             "ex",
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
         ))
Esempio n. 13
0
 def test_loop_instructions(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_loop_instructions",
             "ex",
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
         ))
Esempio n. 14
0
 def test_asm_pointerReatribution3_clang(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_pointerReatribution3_clang",
             "ex",
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
         ))
Esempio n. 15
0
 def test_arm64_binrats_hello(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "hello",
             "hello",
             c_compilers=["aarch64-linux-gnu-gcc"],
             cxx_compilers=["aarch64-linux-gnu-g++"],
             reassembly_compiler="aarch64-linux-gnu-gcc",
         )
     )
Esempio n. 16
0
 def test_asm_relative_switch_through_stack(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_relative_switch_through_stack",
             "ex",
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
             strip=True,
         ))
Esempio n. 17
0
 def test_asm_pointerReatribution3_pie(self):
     self.assertTrue(
         dis_reasm_test(
             asm_dir / "ex_pointerReatribution3_pie",
             "ex",
             extra_compile_flags=["-pie"],
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=[""],
         ))
Esempio n. 18
0
 def test_ex1_static(self):
     self.assertTrue(
         dis_reasm_test(
             ex_dir / "ex1",
             "ex",
             reassemble_function=skip_reassemble,
             extra_compile_flags=["-static"],
             c_compilers=["gcc"],
             cxx_compilers=["g++"],
             optimizations=["-O0"],
         ))
Esempio n. 19
0
 def test_fcf_protection(self):
     # check if the -fcf-protection is supported by the compiler (only newer versions support it)
     current_dir=os.getcwd()
     with cd(ex_dir/'ex1'):
         flag_supported=compile('gcc','g++','',['-fcf-protection'])
     if flag_supported:
         self.assertTrue(dis_reasm_test(ex_dir/'ex1','ex',
             c_compilers=['gcc'],cxx_compilers=['g++'],
             optimizations=[''],
             extra_compile_flags=['-fcf-protection']))
     else:
         print('Flag -fcf-protection not supported')
Esempio n. 20
0
 def test_fcf_protection(self):
     # check if the -fcf-protection is supported by the compiler
     # (only newer versions support it)
     with cd(ex_dir / "ex1"):
         flag_supported = compile("gcc", "g++", "", ["-fcf-protection"])
     if flag_supported:
         self.assertTrue(
             dis_reasm_test(
                 ex_dir / "ex1",
                 "ex",
                 c_compilers=["gcc"],
                 cxx_compilers=["g++"],
                 optimizations=[""],
                 extra_compile_flags=["-fcf-protection"],
             ))
     else:
         print("Flag -fcf-protection not supported")
Esempio n. 21
0
 def test_pointerReatribution2(self):
     self.assertTrue(
         dis_reasm_test(ex_dir / "ex_pointerReatribution2", "ex"))
Esempio n. 22
0
 def test_noreturn(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_noreturn", "ex"))
Esempio n. 23
0
 def test_getoptlong(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_getoptlong", "ex"))
Esempio n. 24
0
 def test_fprintf(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_fprintf", "ex"))
Esempio n. 25
0
 def test_float(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_float", "ex"))
Esempio n. 26
0
 def test_false_pointer_array(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_false_pointer_array",
                                    "ex"))
Esempio n. 27
0
 def test_exceptions2(self):
     self.assertTrue(
         dis_reasm_test(ex_dir / "ex_exceptions2",
                        "ex",
                        reassembly_compiler="g++"))
Esempio n. 28
0
 def test_struct(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_struct", "ex", strip=True))
Esempio n. 29
0
 def test_switch(self):
     self.assertTrue(dis_reasm_test(ex_dir / "ex_switch", "ex", strip=True))
Esempio n. 30
0
 def test_uninitialized_data(self):
     self.assertTrue(
         dis_reasm_test(ex_dir / "ex_uninitialized_data", "ex", strip=True))