1

I am trying to debug of an OSX desktop application (Mac os catalina 10.15.3) via LLDB.

lldb path/to/Electron.app
>>> Current executable set to 'path/to/Electron.app' (x86_64).

After that I can successfully add breakpoints to the debugger, but when I try to run application with run or process launch it always gives me:

error: process exited with status -1 (Error 1)

Also another issue with attaching to the pid. It gives me an error and can not attach to the process.

lldb -p 41324
>>> error: attach failed: Error 1

Why I can't disassemble the program inside debugger ?

Ozan Honamlioglu
  • 765
  • 1
  • 8
  • 20

2 Answers2

3

On macOS debuggers can only attach to a process if that process has marked itself - with the proper entitlement - as willing to be debugged. Xcode generally builds Debug builds with this entitlement, and Release builds without it. When lldb tries to attach to a process that doesn't want to be debugged, this is the error you see. It's a low-information error because the agent that denies the attach is walled off from lldb, and doesn't have a way to give us any more information.

Note, however, that you don't need to run a program to disassemble it. The disassemble command works when you've loaded a binary as well when you are debugging one.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63
  • I understand. Actually I want to watch how the program uses RAM layouts, so I want to crack the program. Do you have any idea to share with me for cracking in OSX... Also I will be in searching for that, thanks – Ozan Honamlioglu Apr 23 '20 at 18:54
0

I just find the way to debug and do not restrict any root accessibility... It is about the Apple's system integrity protection https://support.apple.com/en-us/HT204899

and if you are willing to disable system integrity protection, just be careful and know what you are doing.

Here is the article that how you can disable system integrity protection https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d

Ozan Honamlioglu
  • 765
  • 1
  • 8
  • 20