diff --git a/.gitignore b/.gitignore index 6ad846b..79a8109 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ __pycache__ *.pyc *.egg-info/ -build/ dist/ diff --git a/README.md b/README.md index 53789b7..792300c 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ pip3 install git+https://mpxd.net/code/jan/mem_edit.git@release Most functions and classes are documented inline. To read the inline help, -```python3 +```python import mem_edit help(mem_edit.Process) ``` @@ -46,7 +46,7 @@ help(mem_edit.Process) ## Examples Increment a magic number (unsigned long 1234567890) found in 'magic.exe': -```python3 +```python import ctypes from mem_edit import Process @@ -67,7 +67,7 @@ Increment a magic number (unsigned long 1234567890) found in 'magic.exe': ``` Narrow down a search after a value changes: -```python3 +```python import ctypes from mem_edit import Process @@ -88,7 +88,7 @@ Narrow down a search after a value changes: ``` Read and alter a structure: -```python3 +```python import ctypes from mem_edit import Process diff --git a/mem_edit/linux.py b/mem_edit/linux.py index ae8404d..4dafd1c 100644 --- a/mem_edit/linux.py +++ b/mem_edit/linux.py @@ -40,7 +40,7 @@ def ptrace(command: int, pid: int = 0, arg1: int = 0, arg2: int = 0) -> int: """ Call ptrace() with the provided pid and arguments. See the ```man ptrace```. """ - logger.debug('ptrace({}, {}, {}, {})'.format(command, pid, arg1, arg2)) + logger.debug('ptrace({}, {}, {}, {})'.format(command, pid, arg1, arg2)) result = _ptrace(command, pid, arg1, arg2) if result == -1: err_no = ctypes.get_errno() @@ -58,7 +58,7 @@ class Process(AbstractProcess): self.pid = process_id def close(self): - os.kill(self.pid, signal.SIGSTOP) + os.kill(self.pid, signal.SIGSTOP) ptrace(ptrace_commands['PTRACE_DETACH'], self.pid, 0, 0) self.pid = None @@ -78,7 +78,7 @@ class Process(AbstractProcess): with open('/proc/{}/cmdline', 'rb') as f: return f.read().decode().split('\x00')[0] except FileNotFoundError: - return '' + return '' @staticmethod def list_available_pids() -> List[int]: