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))
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))
def test_asm_weird_section(self): self.assertTrue( dis_reasm_test(asm_dir / 'ex_weird_sections', 'ex', c_compilers=['gcc'], cxx_compilers=['g++'], optimizations=['']))
def test_asm_pointerReatribution3_clang(self): self.assertTrue( dis_reasm_test(asm_dir / 'ex_pointerReatribution3_clang', 'ex', c_compilers=['gcc'], cxx_compilers=['g++'], optimizations=['']))
def test_memberPointer(self): self.assertTrue( dis_reasm_test( ex_dir / "ex_memberPointer", "ex", reassembly_compiler="g++", strip=True, ))
def test_exceptions3(self): self.assertTrue( dis_reasm_test( ex_dir / "ex_exceptions3", "ex", reassembly_compiler="g++", strip=True, ))
def test_threads(self): self.assertTrue( dis_reasm_test( ex_dir / "ex_threads", "ex", reassembly_compiler="g++", reassemble_function=skip_reassemble, ))
def test_virtualDispatch(self): self.assertTrue( dis_reasm_test( ex_dir / "ex_virtualDispatch", "ex", reassembly_compiler="g++", strip=True, ))
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']))
def test_asm_weird_section(self): self.assertTrue( dis_reasm_test( asm_dir / "ex_weird_sections", "ex", c_compilers=["gcc"], cxx_compilers=["g++"], optimizations=[""], ))
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=[""], ))
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=[""], ))
def test_loop_instructions(self): self.assertTrue( dis_reasm_test( asm_dir / "ex_loop_instructions", "ex", c_compilers=["gcc"], cxx_compilers=["g++"], optimizations=[""], ))
def test_asm_pointerReatribution3_clang(self): self.assertTrue( dis_reasm_test( asm_dir / "ex_pointerReatribution3_clang", "ex", c_compilers=["gcc"], cxx_compilers=["g++"], optimizations=[""], ))
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", ) )
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, ))
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=[""], ))
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"], ))
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')
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")
def test_pointerReatribution2(self): self.assertTrue( dis_reasm_test(ex_dir / "ex_pointerReatribution2", "ex"))
def test_noreturn(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_noreturn", "ex"))
def test_getoptlong(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_getoptlong", "ex"))
def test_fprintf(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_fprintf", "ex"))
def test_float(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_float", "ex"))
def test_false_pointer_array(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_false_pointer_array", "ex"))
def test_exceptions2(self): self.assertTrue( dis_reasm_test(ex_dir / "ex_exceptions2", "ex", reassembly_compiler="g++"))
def test_struct(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_struct", "ex", strip=True))
def test_switch(self): self.assertTrue(dis_reasm_test(ex_dir / "ex_switch", "ex", strip=True))
def test_uninitialized_data(self): self.assertTrue( dis_reasm_test(ex_dir / "ex_uninitialized_data", "ex", strip=True))