comparison test/test_aslr.py @ 1874:1c9215154d4a

Handle /proc/.../maps being reordered We now search for the first r-xp line in the file
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Feb 2022 22:13:06 +0800
parents d940f8007a45
children
comparison
equal deleted inserted replaced
1873:2c9d635a1c04 1874:1c9215154d4a
26 print(map1) 26 print(map1)
27 print(map2) 27 print(map2)
28 # expect something like 28 # expect something like
29 # "563174d59000-563174d5d000 r--p 00000000 00:29 4242372 /home/matt/src/dropbear/build/dropbear" 29 # "563174d59000-563174d5d000 r--p 00000000 00:29 4242372 /home/matt/src/dropbear/build/dropbear"
30 assert map1.endswith('/dropbear') or map1.endswith('/dropbearmulti') 30 assert map1.endswith('/dropbear') or map1.endswith('/dropbearmulti')
31 assert ' r--p ' in map1
32 a1 = map1.split()[0] 31 a1 = map1.split()[0]
33 a2 = map2.split()[0] 32 a2 = map2.split()[0]
34 print(a1) 33 print(a1)
35 print(a2) 34 print(a2)
36 # relocation addresses should differ 35 # relocation addresses should differ