LLDB: Patch your Code with Breakpoints

Last updated: about 1 month ago

LLDB is by far much more capable than just setting a simple breakpoint and stop on it.

This talk will dive into the possibilities that LLDB offers to automatically patch running code by changing values/code in memory using breakpoints, without the need to even touch a single character in your source code.

Some advantages are, that changes will never make their way into your CVS, depending on the kind of patch it can be switched on and off during runtime, and it is not tied to your own source code.

For example these techniques can be used to:

  • Change the expiration time of your OAuth tokens to simulate an expired token, without the need to actually wait or change existing code. Maybe as an help for your code reviewer.
  • Disable SSL pinning of a library you don't have the source code for
  • Temporarily disable some code branches to avoid initialisation of e.g. tracking or crash reporting