Skip to content

ptrace internals How it prevents debugger attachment - #2933

Merged
carlospolop merged 2 commits into
masterfrom
update_ptrace_internals_How_it_prevents_debugger_attach_1373161ffc0cf365
Oct 12, 2026
Merged

carlospolop merged 2 commits into
masterfrom
update_ptrace_internals_How_it_prevents_debugger_attach_1373161ffc0cf365

Conversation

@carlospolop

@carlospolop carlospolop commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Blog URL

https://blog.reversesociety.co/blog/2024/anti-debugging-using-ptrace

Blog Title

ptrace internals: How it prevents debugger attachment

Blog high summary

ptrace(PT_DENY_ATTACH) is a macOS anti-debugging control. LLDB uses PT_ATTACHEXC, causing XNU to set P_LTRACED; the target then exits with ENOTSUP/45. If the target sets P_LNOATTACH first, a later attach sends SIGSEGV to the attaching parent and LLDB loses its connection. Hopper bypasses the control by changing ARM64 movz w0, #0x1f to movz w0, #0x0 (PT_TRACE_ME).

PR changes

Errors

mdbook build unavailable

@carlospolop

Copy link
Copy Markdown
Collaborator Author

merge

@carlospolop

Copy link
Copy Markdown
Collaborator Author

Conflict repair: resolved
Head: a94c5a4cefefd58a2d393a7b10e36752215de8cf

Resolved the macOS anti-debugging documentation conflict.

  • Restored the PR’s missing ARM64 identification text verbatim while retaining the default branch’s _sysctl detail.
  • Verified that examples from both conflict sides remain present and the edited file has no conflict markers or whitespace errors.

@carlospolop
carlospolop merged commit 2490e76 into master Oct 12, 2026
2 checks passed
@carlospolop
carlospolop deleted the update_ptrace_internals_How_it_prevents_debugger_attach_1373161ffc0cf365 branch October 12, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants