File tree 6 files changed +13
-7
lines changed
6 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 9
9
from tests .base import RemoteGefUnitTestGeneric
10
10
11
11
from tests .utils import (
12
+ ARCH ,
12
13
debug_target ,
13
14
gdbserver_session ,
14
15
qemuuser_session ,
@@ -135,6 +136,7 @@ def test_func_parse_maps_remote_gdbserver(self):
135
136
sections = gef .memory .maps
136
137
assert len (sections ) > 0
137
138
139
+ @pytest .mark .skipif (ARCH not in ("x86_64" ,), reason = f"Skipped for { ARCH } " )
138
140
def test_func_parse_maps_remote_qemu (self ):
139
141
gdb , gef = self ._gdb , self ._gef
140
142
# When in a gef-remote qemu-user session `parse_gdb_info_proc_maps`
Original file line number Diff line number Diff line change 6
6
import pathlib
7
7
import random
8
8
import re
9
+ import pytest
9
10
10
11
from tests .base import RemoteGefUnitTestGeneric
11
12
12
13
from tests .utils import (
14
+ ARCH ,
13
15
debug_target ,
14
16
gdbserver_session ,
15
17
qemuuser_session ,
@@ -72,6 +74,7 @@ def test_root_dir_remote(self):
72
74
expected .st_ino == result .st_ino
73
75
)
74
76
77
+ @pytest .mark .skipif (ARCH not in ("x86_64" ,), reason = f"Skipped for { ARCH } " )
75
78
def test_root_dir_qemu (self ):
76
79
gdb , gef = self ._gdb , self ._gef
77
80
Original file line number Diff line number Diff line change @@ -13,22 +13,21 @@ def setUp(self) -> None:
13
13
self ._target = debug_target ("canary" )
14
14
return super ().setUp ()
15
15
16
-
17
16
def test_cmd_canary (self ):
18
17
assert ERROR_INACTIVE_SESSION_MESSAGE == self ._gdb .execute ("canary" , to_string = True )
19
18
self ._gdb .execute ("start" )
20
19
res = self ._gdb .execute ("canary" , to_string = True )
21
20
assert "The canary of process" in res
22
21
assert self ._gef .session .canary [0 ] == self ._gef .session .original_canary [0 ]
23
22
24
-
25
23
def test_overwrite_canary (self ):
26
24
gdb , gef = self ._gdb , self ._gef
27
25
28
26
gdb .execute ("start" )
27
+ _ , canary_address = gef .session .canary
29
28
if is_64b ():
30
- gef .memory .write (gef . arch . canary_address () , p64 (0xdeadbeef ))
29
+ gef .memory .write (canary_address , p64 (0xDEADBEEF ))
31
30
else :
32
- gef .memory .write (gef . arch . canary_address () , p32 (0xdeadbeef ))
33
- res = u32 (gef .memory .read (gef . arch . canary_address () , gef .arch .ptrsize ))
31
+ gef .memory .write (canary_address , p32 (0xDEADBEEF ))
32
+ res = u32 (gef .memory .read (canary_address , gef .arch .ptrsize ))
34
33
assert 0xdeadbeef == res
Original file line number Diff line number Diff line change 8
8
9
9
from tests .base import RemoteGefUnitTestGeneric
10
10
from tests .utils import (
11
+ ARCH ,
11
12
debug_target ,
12
13
gdbserver_session ,
13
14
qemuuser_session ,
@@ -39,6 +40,7 @@ def test_cmd_gef_remote_gdbserver(self):
39
40
assert res .endswith (f"pid={ gef .session .pid } , mode={ gdbserver_mode } )" )
40
41
41
42
@pytest .mark .slow
43
+ @pytest .mark .skipif (ARCH not in ("x86_64" ,), reason = f"Skipped for { ARCH } " )
42
44
def test_cmd_gef_remote_qemu_user (self ):
43
45
gdb = self ._gdb
44
46
gef = self ._gef
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class ScanCommand(RemoteGefUnitTestGeneric):
11
11
"""`scan` command test module"""
12
12
13
13
def setUp (self ) -> None :
14
- self ._target = debug_target ("checksec-no-pie " )
14
+ self ._target = debug_target ("default " )
15
15
return super ().setUp ()
16
16
17
17
def test_cmd_scan (self ):
Original file line number Diff line number Diff line change @@ -22,5 +22,5 @@ def test_cmd_vmmap(self):
22
22
res = gdb .execute ("vmmap stack" , to_string = True )
23
23
self .assertGreater (len (res .splitlines ()), 1 )
24
24
25
- res = gdb .execute ("vmmap $rip " , to_string = True )
25
+ res = gdb .execute ("vmmap $pc " , to_string = True )
26
26
self .assertEqual (len (res .splitlines ()), 2 )
You can’t perform that action at this time.
0 commit comments