コード例 #1
0
ファイル: runtests.py プロジェクト: Grazfather/gef
 def test_cmd_patch_qword(self):
     before = gdb_start_silent_cmd_last_line("display/8bx $pc")
     after = gdb_start_silent_cmd_last_line("patch qword $pc 0x4242424242424242", after=["display/8bx $pc",])
     self.assertNoException(after)
     r = difflib.SequenceMatcher(None, before, after).ratio()
     self.assertTrue( r > 0.50 )
     return
コード例 #2
0
ファイル: runtests.py プロジェクト: DanNixon/dotfiles
 def test_cmd_patch_qword(self):
     before = gdb_start_silent_cmd_last_line("display/8bx $pc")
     after = gdb_start_silent_cmd_last_line("patch qword $pc 0x4242424242424242", after=["display/8bx $pc",])
     self.assertNoException(after)
     r = difflib.SequenceMatcher(None, before, after).ratio()
     self.assertTrue( r > 0.50 )
     return
コード例 #3
0
ファイル: runtests.py プロジェクト: zkx06111/gef-legacy
 def test_cmd_edit_flags(self):
     # force enable flag
     res = gdb_start_silent_cmd_last_line("edit-flags +carry")
     self.assertNoException(res)
     self.assertIn("CARRY ", res)
     # force disable flag
     res = gdb_start_silent_cmd_last_line("edit-flags -carry")
     self.assertNoException(res)
     self.assertIn("carry ", res)
     # toggle flag
     res = gdb_start_silent_cmd_last_line("edit-flags ~carry")
     self.assertNoException(res)
     self.assertIn("CARRY ", res)
     return
コード例 #4
0
ファイル: runtests.py プロジェクト: zkx06111/gef-legacy
 def test_cmd_patch_qword(self):
     res = gdb_start_silent_cmd_last_line(
         "patch qword $pc 0xcccccccccccccccc", after=[
             "display/8bx $pc",
         ])
     self.assertNoException(res)
     self.assertRegex(res, r"(0xcc\s*)(\1\1\1\1\1\1)0xcc")
     return
コード例 #5
0
ファイル: runtests.py プロジェクト: zkx06111/gef-legacy
 def test_cmd_patch_byte(self):
     res = gdb_start_silent_cmd_last_line("patch byte $pc 0xcc",
                                          after=[
                                              "display/8bx $pc",
                                          ])
     self.assertNoException(res)
     self.assertRegex(res, r"0xcc\s*0x[^c]{2}")
     return
コード例 #6
0
ファイル: runtests.py プロジェクト: Grazfather/gef
 def test_cmd_edit_flags(self):
     # force enable flag
     res = gdb_start_silent_cmd_last_line("edit-flags +carry")
     self.assertNoException(res)
     self.assertIn(b"CARRY ", res)
     # force disable flag
     res = gdb_start_silent_cmd_last_line("edit-flags -carry")
     self.assertNoException(res)
     self.assertIn(b"carry ", res)
     # toggle flag
     before = gdb_start_silent_cmd_last_line("edit-flags")
     self.assertNoException(before)
     after = gdb_start_silent_cmd_last_line("edit-flags ~carry")
     self.assertNoException(after)
     s = difflib.SequenceMatcher(None, before, after)
     self.assertTrue(s.ratio() > 0.90)
     return
コード例 #7
0
ファイル: runtests.py プロジェクト: DanNixon/dotfiles
 def test_cmd_edit_flags(self):
     # force enable flag
     res = gdb_start_silent_cmd_last_line("edit-flags +carry")
     self.assertNoException(res)
     self.assertIn("CARRY ", res)
     # force disable flag
     res = gdb_start_silent_cmd_last_line("edit-flags -carry")
     self.assertNoException(res)
     self.assertIn("carry ", res)
     # toggle flag
     before = gdb_start_silent_cmd_last_line("edit-flags")
     self.assertNoException(before)
     after = gdb_start_silent_cmd_last_line("edit-flags ~carry")
     self.assertNoException(after)
     s = difflib.SequenceMatcher(None, before, after)
     self.assertTrue(s.ratio() > 0.90)
     return
コード例 #8
0
ファイル: runtests.py プロジェクト: zkx06111/gef-legacy
 def test_cmd_patch_string(self):
     res = gdb_start_silent_cmd_last_line(
         "patch string $sp \"Gef!Gef!Gef!Gef!\"",
         after=[
             "grep Gef!Gef!Gef!Gef!",
         ])
     self.assertNoException(res)
     self.assertIn("Gef!Gef!Gef!Gef!", res)
     return
コード例 #9
0
ファイル: runtests.py プロジェクト: DanNixon/dotfiles
 def test_cmd_patch_string(self):
     res = gdb_start_silent_cmd_last_line("patch string $sp \"Gef!Gef!Gef!Gef!\"", after=["grep Gef!Gef!Gef!Gef!",])
     self.assertNoException(res)
     self.assertIn("Gef!Gef!Gef!Gef!", res)
     return