@@ -1196,7 +1196,7 @@ def find_ret_main_addr(lines, calls):
1196
1196
return 0
1197
1197
1198
1198
def search (self , needle , writable = False , executable = False ):
1199
- """search(needle, writable = False, executable = False) -> generator
1199
+ r """search(needle, writable = False, executable = False) -> generator
1200
1200
1201
1201
Search the ELF's virtual address space for the specified string.
1202
1202
@@ -1216,7 +1216,7 @@ def search(self, needle, writable = False, executable = False):
1216
1216
1217
1217
Examples:
1218
1218
1219
- An ELF header starts with the bytes ``\\ x7fELF``, so we
1219
+ An ELF header starts with the bytes ``\x7fELF``, so we
1220
1220
sould be able to find it easily.
1221
1221
1222
1222
>>> bash = ELF('/bin/bash')
@@ -1725,7 +1725,7 @@ def relro(self):
1725
1725
1726
1726
@property
1727
1727
def nx (self ):
1728
- """:class:`bool`: Whether the current binary uses NX protections.
1728
+ r """:class:`bool`: Whether the current binary uses NX protections.
1729
1729
1730
1730
Specifically, we are checking for ``READ_IMPLIES_EXEC`` being set
1731
1731
by the kernel, as a result of honoring ``PT_GNU_STACK`` in the kernel.
@@ -1788,7 +1788,7 @@ def nx(self):
1788
1788
| the rest | [#the_rest]_ | exec / non-exec / missing | | enabled |
1789
1789
+-----------+--------------+---------------------------+------------------------------------------------+----------+
1790
1790
1791
- \\ * Hardware limitations are ignored.
1791
+ \* Hardware limitations are ignored.
1792
1792
1793
1793
If ``READ_IMPLIES_EXEC`` is set, then `all readable pages are executable`__.
1794
1794
.. __: https://github.com/torvalds/linux/blob/v6.3/fs/binfmt_elf.c#L1008-L1009
@@ -1802,15 +1802,15 @@ def nx(self):
1802
1802
1803
1803
.. code-block:: c
1804
1804
1805
- #define elf_read_implies_exec(ex, executable_stack) \\
1805
+ #define elf_read_implies_exec(ex, executable_stack) \
1806
1806
(executable_stack != EXSTACK_DISABLE_X)
1807
1807
1808
1808
.. [#x86_5.8]
1809
1809
`source <https://github.com/torvalds/linux/blob/v5.8/arch/x86/include/asm/elf.h#L305-L306>`__
1810
1810
1811
1811
.. code-block:: c
1812
1812
1813
- #define elf_read_implies_exec(ex, executable_stack) \\
1813
+ #define elf_read_implies_exec(ex, executable_stack) \
1814
1814
(mmap_is_ia32() && executable_stack == EXSTACK_DEFAULT)
1815
1815
1816
1816
`mmap_is_ia32()`__:
@@ -1889,7 +1889,7 @@ def nx(self):
1889
1889
1890
1890
#ifdef __powerpc64__
1891
1891
/* stripped */
1892
- # define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \\
1892
+ # define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \
1893
1893
(exec_stk == EXSTACK_DEFAULT) : 0)
1894
1894
#else
1895
1895
# define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT)
@@ -1900,7 +1900,7 @@ def nx(self):
1900
1900
1901
1901
.. code-block:: c
1902
1902
1903
- #define elf_read_implies_exec(ex, executable_stack) \\
1903
+ #define elf_read_implies_exec(ex, executable_stack) \
1904
1904
((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
1905
1905
1906
1906
EF_IA_64_LINUX_EXECUTABLE_STACK__:
@@ -2153,7 +2153,7 @@ def checksec(self, banner=True, color=True):
2153
2153
for name , message in sorted (values ):
2154
2154
line = '{} = {}' .format (name , red (str (self .config .get (name , None ))))
2155
2155
if message :
2156
- line += ' ({})' . format ( message )
2156
+ line += f ' ({ message } )'
2157
2157
res .append (' ' + line )
2158
2158
2159
2159
# res.extend(sorted(config_opts))
0 commit comments