Skip to content

Commit

Permalink
Injection stuck bug after making injection unsafe again
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaork committed Jan 6, 2023
1 parent 7d2fe20 commit f20c11a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 3 additions & 2 deletions madbg/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ def __del__(self):
self.pty.close()

def attach(self):

def set():
f = currentframe().f_back.f_back
f = currentframe().f_back.f_back.f_back
f.f_globals[self._DEBUGGING_GLOBAL] = True
self.check_debugging_global = True
self.set_trace(f)
# If this gets stuck, it's probably because the debugger kicks in before the injection finishes.
# The debugging global must be pushed to the right frame to prevent that.
run_in_thread(self.thread, set)

def notify_client_connect(self, tty_config: TTYConfig):
Expand Down
9 changes: 3 additions & 6 deletions madbg/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,9 @@ def make_sure_listening_at(cls, addr: Addr):


"""
app - show periodically updated stack traces
deadlock detection support
Next steps:
- revert safe injection diff in hypno
- sqlite errors
- when writing ? in the terminal, "Object `` not found." is printed to stdout
- no \r printed...
- continue raises exceptions
- run in thread using ptrace - better than signal??
signal: interfering with signal handlers
ptrace: invoke subprocess, load dll
Expand All @@ -183,6 +178,8 @@ def make_sure_listening_at(cls, addr: Addr):
the app could be configured with the first user's terminal, and connected through a raw pty to each
user's pty
so each thread has a pty, and each user has a pty
- app - show periodically updated stack traces
- deadlock detection support
- pyinjector issues:
- getting the python error back to us or at least know that it failed
- threads
Expand Down

0 comments on commit f20c11a

Please sign in to comment.