From 898c4eba78bfd125f96ef593842d1ecea0e03076 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 27 Oct 2019 13:03:59 -0700 Subject: [PATCH 1/3] readme change? --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 From 4deaa41d7e8a48a15da53d2f363e00da6db91d8b Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 27 Oct 2019 13:05:27 -0700 Subject: [PATCH 2/3] whitespace fixes --- mem_edit/linux.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mem_edit/linux.py b/mem_edit/linux.py index 4dafd1c..ae8404d 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]: From 260d67bf815796371d63e87cdd791c98f765d71b Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 27 Oct 2019 13:54:43 -0700 Subject: [PATCH 3/3] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 79a8109..6ad846b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ __pycache__ *.pyc *.egg-info/ +build/ dist/