SlideShare uma empresa Scribd logo
1 de 54
Baixar para ler offline
Macoun
⌘
lldb - Debugger auf Abwegen
Oliver Bayer
inovex GmbH
Disclaimer: Nur weil es technisch
geht, muss es noch lange nicht
sinnvoll sein!
Ablauf
•Breakpoints per CLI
•Metabreakpoints
•Kontrollfluss Manipulation / Demo
Breakpoints
•Software Breakpoint
•Symbolic Breakpoint
•Non-Symbolic Breakpoint
Conditional Breakpoints
foo("")
func foo(_ value: String) {
...
}
foo("bar")
Foo.swift Bar.swift
Conditional Breakpoints
Conditional Breakpoints
Conditional Breakpoints
Non-Symbolic Breakpoint
Conditional Breakpoints
Symbolic Breakpoint
Metabreakpoints
foo("bar")
func foo(_ value: String) {
...
}
foo("bar")
Foo.swift Bar.swift
br s -n foo -N macoun -d
MetabreakpointsMetabreakpoints
foo("bar")
func foo(_ value: String) {
...
}
Bar.swift
br set -n foo -N macoun -d
br s -f Bar.swift -l 42 -C "br en macoun" -G
true
MetabreakpointsMetabreakpoints
foo("bar")
func foo(_ value: String) {
...
}
Bar.swift
Metabreakpoints
func seiteneffekteFuer100() {
print("1")
do()
print("2")
something()
print("3")
forMe()
}
Metabreakpoints
func seiteneffekteFuer100() {
do()
something()
forMe()
}
br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true
br command add -s python
print("Line: {}".format(frame.GetLineEntry().GetLine()))
DONE
Metabreakpoints
func seiteneffekteFuer100() {
do()
something()
forMe()
}
br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true
br command add -s python
print("Line: {}".format(frame.GetLineEntry().GetLine()))
DONE
Metabreakpoints
func seiteneffekteFuer100() {
do()
something()
forMe()
}
br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true
br command add -s python
print("Line: {}".format(frame.GetLineEntry().GetLine()))
DONE
Metabreakpoints
func seiteneffekteFuer100() {
do()
something()
forMe()
}
br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true
br command add -s python
print("Line: {}".format(frame.GetLineEntry().GetLine()))
DONE
Metabreakpoints
func do() {
…
let player = AVPlayer(playerItem: item)
…
player.play()
…
}
Metabreakpoints
func do() {
…
let player = AVPlayer(playerItem: item)
…
}
br s -f Player.swift -l 4 -C "call player.isMuted = false"
-G true
Metabreakpoints
func do() {
…
let player = AVPlayer(playerItem: item)
// Hier der Breakpoint
…
}
br s -f Player.swift -p "// Hier der Breakpoint" -X do
-C "call player.isMuted = true" -G true
Metabreakpoints
•Auf dem Stack1 steht die Rücksprungadresse des Aufrufenden
•Nach dem Rücksprung steht die Adresse der AVPlayer Instanz in
Register rax1
[1] x86 Architekturen
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Metabreakpoints
br s -S "-[AVPlayer init]" -K false
br command add
settings set target.language objc
br s -a `(unsigned long)*(unsigned long *)$rsp` -o true
-C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G
true
settings set target.language swift
continue
Neue Wege gehen mit thread
•Codepfade zur Laufzeit manipulieren
•Methoden kurzschließen
•Rückgabewerte ändern
Demo
Neue Wege gehen mit thread
•Nachteil an thread return et al. → bremst das Ausführen des Codes
aus

•Idee: (Binary) Patch → genauso schnell wie vorher
Binary Patch Breakpoint
private func isExpectedInput(_ value: String) -> Bool {
if value.lowercased() == secret {
return true
} else {
return false
}
}
Binary Patch Breakpoint
private func isExpectedInput(_ value: String) -> Bool {
return true
}
Binary Patch Breakpoint
push rbp

mov rbp, rsp
push 0x1
pop rax
pop rbp
ret
'x55x6ax01x58x5dxc3'
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Binary Patch Breakpoint
br s -n isExpectedInput -o true -K false
br command add -s python
patch = 'x55xB8x01x00x00x00x5dxc3'
addr = bp_loc.GetLoadAddress()
error = lldb.SBError()
proc = frame.GetThread().GetProcess()
result = proc.WriteMemory(addr, patch, error)
proc.Continue()
DONE
Patch Breakpoint
private let secret = "foo" —> "macoun"
Patch Breakpoint
private let secret = "foo" // —> "macoun"
br s -F "Swift.String.init(_builtinStringLiteral:
Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word,
isASCII: Builtin.Int1) -> Swift.String" -c "0 ==
(int)strcmp("foo", (char *)$rdi)" -o true
br command add
exp -- char * $value = (char *)"macoun"
register write $rdi `(unsigned long *)$value`
register write $rsi 6
continue
DONE
Patch Breakpoint
private let secret = "foo" // —> "macoun"
br s -F "Swift.String.init(_builtinStringLiteral:
Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word,
isASCII: Builtin.Int1) -> Swift.String" -c "0 ==
(int)strcmp("foo", (char *)$rdi)" -o true
br command add
exp -- char * $value = (char *)"macoun"
register write $rdi `(unsigned long *)$value`
register write $rsi 6
continue
DONE
Patch Breakpoint
private let secret = "foo" // —> "macoun"
br s -F "Swift.String.init(_builtinStringLiteral:
Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word,
isASCII: Builtin.Int1) -> Swift.String" -c "0 ==
(int)strcmp("foo", (char *)$rdi)" -o true
br command add
exp -- char * $value = (char *)"macoun"
register write $rdi `(unsigned long *)$value`
register write $rsi 6
continue
DONE
Patch Breakpoint
private let secret = "foo" // —> "macoun"
br s -F "Swift.String.init(_builtinStringLiteral:
Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word,
isASCII: Builtin.Int1) -> Swift.String" -c "0 ==
(int)strcmp("foo", (char *)$rdi)" -o true
br command add
exp -- char * $value = (char *)"macoun"
register write $rdi `(unsigned long *)$value`
register write $rsi 6
continue
DONE
Patch Breakpoint
private let secret = "foo" // —> "macoun"
br s -F "Swift.String.init(_builtinStringLiteral:
Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word,
isASCII: Builtin.Int1) -> Swift.String" -c "0 ==
(int)strcmp("foo", (char *)$rdi)" -o true
br command add
exp -- char * $value = (char *)"macoun"
register write $rdi `(unsigned long *)$value`
register write $rsi 6
continue
DONE
Patch Breakpoint
private let secret = "foo" // —> "macoun"
br s -F "Swift.String.init(_builtinStringLiteral:
Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word,
isASCII: Builtin.Int1) -> Swift.String" -c "0 ==
(int)strcmp("foo", (char *)$rdi)" -o true
br command add
exp -- char * $value = (char *)"macoun"
register write $rdi `(unsigned long *)$value`
register write $rsi 6
continue
DONE
Schlussworte
•Automatismen
•https://github.com/obayer/Trampoline
• .lldbinit
• command source <filename>
• für alles andere: lldb help
Fragen?
Vielen Dank
Oliver Bayer
inovex GmbH
Macoun
⌘

Mais conteúdo relacionado

Mais procurados

Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and GoEleanor McHugh
 
typemap in Perl/XS
typemap in Perl/XS  typemap in Perl/XS
typemap in Perl/XS charsbar
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers ToolboxStefan
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Nikita Popov
 
Powered by Python - PyCon Germany 2016
Powered by Python - PyCon Germany 2016Powered by Python - PyCon Germany 2016
Powered by Python - PyCon Germany 2016Steffen Wenz
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick reviewCe.Se.N.A. Security
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years laterclkao
 
Python meetup: coroutines, event loops, and non-blocking I/O
Python meetup: coroutines, event loops, and non-blocking I/OPython meetup: coroutines, event loops, and non-blocking I/O
Python meetup: coroutines, event loops, and non-blocking I/OBuzzcapture
 
Barely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationBarely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationAttila Balazs
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in PerlLaurent Dami
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CSteffen Wenz
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?Nikita Popov
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterakaptur
 
NativeBoost
NativeBoostNativeBoost
NativeBoostESUG
 
C言語静的解析ツールと Ruby 1.9 trunk
C言語静的解析ツールと Ruby 1.9 trunkC言語静的解析ツールと Ruby 1.9 trunk
C言語静的解析ツールと Ruby 1.9 trunkikegami__
 
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureCréer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureAmaury Bouchard
 

Mais procurados (20)

Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 
typemap in Perl/XS
typemap in Perl/XS  typemap in Perl/XS
typemap in Perl/XS
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)
 
Powered by Python - PyCon Germany 2016
Powered by Python - PyCon Germany 2016Powered by Python - PyCon Germany 2016
Powered by Python - PyCon Germany 2016
 
Exploit techniques - a quick review
Exploit techniques - a quick reviewExploit techniques - a quick review
Exploit techniques - a quick review
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years later
 
Go a crash course
Go   a crash courseGo   a crash course
Go a crash course
 
Python meetup: coroutines, event loops, and non-blocking I/O
Python meetup: coroutines, event loops, and non-blocking I/OPython meetup: coroutines, event loops, and non-blocking I/O
Python meetup: coroutines, event loops, and non-blocking I/O
 
Barely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationBarely Legal Xxx Perl Presentation
Barely Legal Xxx Perl Presentation
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
 
NativeBoost
NativeBoostNativeBoost
NativeBoost
 
C言語静的解析ツールと Ruby 1.9 trunk
C言語静的解析ツールと Ruby 1.9 trunkC言語静的解析ツールと Ruby 1.9 trunk
C言語静的解析ツールと Ruby 1.9 trunk
 
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureCréer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heure
 
Python
PythonPython
Python
 

Semelhante a lldb – Debugger auf Abwegen

Debug Information And Where They Come From
Debug Information And Where They Come FromDebug Information And Where They Come From
Debug Information And Where They Come FromMin-Yih Hsu
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...DevGAMM Conference
 
Best Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesBest Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesAndrey Karpov
 
A Self Replicating Serverless Function
A Self Replicating Serverless FunctionA Self Replicating Serverless Function
A Self Replicating Serverless FunctionMichael Adda
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 
Perl training-in-navi mumbai
Perl training-in-navi mumbaiPerl training-in-navi mumbai
Perl training-in-navi mumbaivibrantuser
 
Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Workhorse Computing
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyYasuharu Nakano
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...akaptur
 
我在豆瓣使用Emacs
我在豆瓣使用Emacs我在豆瓣使用Emacs
我在豆瓣使用Emacs董 伟明
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a bossgsterndale
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire playerMarcin Czarnecki
 
How to not write a boring test in Golang
How to not write a boring test in GolangHow to not write a boring test in Golang
How to not write a boring test in GolangDan Tran
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with itFlavien Raynaud
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1Tom Paulus
 
Concurrent applications with free monads and stm
Concurrent applications with free monads and stmConcurrent applications with free monads and stm
Concurrent applications with free monads and stmAlexander Granin
 

Semelhante a lldb – Debugger auf Abwegen (20)

Debug Information And Where They Come From
Debug Information And Where They Come FromDebug Information And Where They Come From
Debug Information And Where They Come From
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
 
Best Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' MistakesBest Bugs from Games: Fellow Programmers' Mistakes
Best Bugs from Games: Fellow Programmers' Mistakes
 
A Self Replicating Serverless Function
A Self Replicating Serverless FunctionA Self Replicating Serverless Function
A Self Replicating Serverless Function
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
Perl training-in-navi mumbai
Perl training-in-navi mumbaiPerl training-in-navi mumbai
Perl training-in-navi mumbai
 
Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
我在豆瓣使用Emacs
我在豆瓣使用Emacs我在豆瓣使用Emacs
我在豆瓣使用Emacs
 
Ruby 1.9
Ruby 1.9Ruby 1.9
Ruby 1.9
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a boss
 
How to Add Original Library to Android NDK
How to Add Original Library to Android NDKHow to Add Original Library to Android NDK
How to Add Original Library to Android NDK
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire player
 
How to not write a boring test in Golang
How to not write a boring test in GolangHow to not write a boring test in Golang
How to not write a boring test in Golang
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with it
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1
 
Concurrent applications with free monads and stm
Concurrent applications with free monads and stmConcurrent applications with free monads and stm
Concurrent applications with free monads and stm
 
Mpi cheat sheet
Mpi cheat sheetMpi cheat sheet
Mpi cheat sheet
 

Mais de inovex GmbH

Are you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AIAre you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AIinovex GmbH
 
Why natural language is next step in the AI evolution
Why natural language is next step in the AI evolutionWhy natural language is next step in the AI evolution
Why natural language is next step in the AI evolutioninovex GmbH
 
Network Policies
Network PoliciesNetwork Policies
Network Policiesinovex GmbH
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learninginovex GmbH
 
Jenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen UmgebungenJenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen Umgebungeninovex GmbH
 
AI auf Edge-Geraeten
AI auf Edge-GeraetenAI auf Edge-Geraeten
AI auf Edge-Geraeteninovex GmbH
 
Prometheus on Kubernetes
Prometheus on KubernetesPrometheus on Kubernetes
Prometheus on Kubernetesinovex GmbH
 
Deep Learning for Recommender Systems
Deep Learning for Recommender SystemsDeep Learning for Recommender Systems
Deep Learning for Recommender Systemsinovex GmbH
 
Representation Learning von Zeitreihen
Representation Learning von ZeitreihenRepresentation Learning von Zeitreihen
Representation Learning von Zeitreiheninovex GmbH
 
Talk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale AssistentenTalk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale Assistenteninovex GmbH
 
Künstlich intelligent?
Künstlich intelligent?Künstlich intelligent?
Künstlich intelligent?inovex GmbH
 
Das Android Open Source Project
Das Android Open Source ProjectDas Android Open Source Project
Das Android Open Source Projectinovex GmbH
 
Machine Learning Interpretability
Machine Learning InterpretabilityMachine Learning Interpretability
Machine Learning Interpretabilityinovex GmbH
 
Performance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use casePerformance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use caseinovex GmbH
 
People & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madnessPeople & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madnessinovex GmbH
 
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with PulumiInfrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with Pulumiinovex GmbH
 
Remote First – Der Arbeitsplatz in der Cloud
Remote First – Der Arbeitsplatz in der CloudRemote First – Der Arbeitsplatz in der Cloud
Remote First – Der Arbeitsplatz in der Cloudinovex GmbH
 

Mais de inovex GmbH (20)

Are you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AIAre you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AI
 
Why natural language is next step in the AI evolution
Why natural language is next step in the AI evolutionWhy natural language is next step in the AI evolution
Why natural language is next step in the AI evolution
 
WWDC 2019 Recap
WWDC 2019 RecapWWDC 2019 Recap
WWDC 2019 Recap
 
Network Policies
Network PoliciesNetwork Policies
Network Policies
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learning
 
Jenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen UmgebungenJenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen Umgebungen
 
AI auf Edge-Geraeten
AI auf Edge-GeraetenAI auf Edge-Geraeten
AI auf Edge-Geraeten
 
Prometheus on Kubernetes
Prometheus on KubernetesPrometheus on Kubernetes
Prometheus on Kubernetes
 
Deep Learning for Recommender Systems
Deep Learning for Recommender SystemsDeep Learning for Recommender Systems
Deep Learning for Recommender Systems
 
Azure IoT Edge
Azure IoT EdgeAzure IoT Edge
Azure IoT Edge
 
Representation Learning von Zeitreihen
Representation Learning von ZeitreihenRepresentation Learning von Zeitreihen
Representation Learning von Zeitreihen
 
Talk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale AssistentenTalk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale Assistenten
 
Künstlich intelligent?
Künstlich intelligent?Künstlich intelligent?
Künstlich intelligent?
 
Dev + Ops = Go
Dev + Ops = GoDev + Ops = Go
Dev + Ops = Go
 
Das Android Open Source Project
Das Android Open Source ProjectDas Android Open Source Project
Das Android Open Source Project
 
Machine Learning Interpretability
Machine Learning InterpretabilityMachine Learning Interpretability
Machine Learning Interpretability
 
Performance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use casePerformance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use case
 
People & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madnessPeople & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madness
 
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with PulumiInfrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
 
Remote First – Der Arbeitsplatz in der Cloud
Remote First – Der Arbeitsplatz in der CloudRemote First – Der Arbeitsplatz in der Cloud
Remote First – Der Arbeitsplatz in der Cloud
 

Último

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Último (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

lldb – Debugger auf Abwegen

  • 2. lldb - Debugger auf Abwegen Oliver Bayer inovex GmbH
  • 3. Disclaimer: Nur weil es technisch geht, muss es noch lange nicht sinnvoll sein!
  • 6. Conditional Breakpoints foo("") func foo(_ value: String) { ... } foo("bar") Foo.swift Bar.swift
  • 11. Metabreakpoints foo("bar") func foo(_ value: String) { ... } foo("bar") Foo.swift Bar.swift
  • 12. br s -n foo -N macoun -d MetabreakpointsMetabreakpoints foo("bar") func foo(_ value: String) { ... } Bar.swift
  • 13. br set -n foo -N macoun -d br s -f Bar.swift -l 42 -C "br en macoun" -G true MetabreakpointsMetabreakpoints foo("bar") func foo(_ value: String) { ... } Bar.swift
  • 15. Metabreakpoints func seiteneffekteFuer100() { do() something() forMe() } br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true br command add -s python print("Line: {}".format(frame.GetLineEntry().GetLine())) DONE
  • 16. Metabreakpoints func seiteneffekteFuer100() { do() something() forMe() } br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true br command add -s python print("Line: {}".format(frame.GetLineEntry().GetLine())) DONE
  • 17. Metabreakpoints func seiteneffekteFuer100() { do() something() forMe() } br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true br command add -s python print("Line: {}".format(frame.GetLineEntry().GetLine())) DONE
  • 18. Metabreakpoints func seiteneffekteFuer100() { do() something() forMe() } br s -p . -X seiteneffekteFuer100 -f Foo.swift -G true br command add -s python print("Line: {}".format(frame.GetLineEntry().GetLine())) DONE
  • 19. Metabreakpoints func do() { … let player = AVPlayer(playerItem: item) … player.play() … }
  • 20. Metabreakpoints func do() { … let player = AVPlayer(playerItem: item) … } br s -f Player.swift -l 4 -C "call player.isMuted = false" -G true
  • 21. Metabreakpoints func do() { … let player = AVPlayer(playerItem: item) // Hier der Breakpoint … } br s -f Player.swift -p "// Hier der Breakpoint" -X do -C "call player.isMuted = true" -G true
  • 22. Metabreakpoints •Auf dem Stack1 steht die Rücksprungadresse des Aufrufenden •Nach dem Rücksprung steht die Adresse der AVPlayer Instanz in Register rax1 [1] x86 Architekturen
  • 23. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 24. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 25. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 26. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 27. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 28. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 29. Metabreakpoints br s -S "-[AVPlayer init]" -K false br command add settings set target.language objc br s -a `(unsigned long)*(unsigned long *)$rsp` -o true -C "exp -l objc -- [(AVPlayer *)$rax setMuted: @YES]" -G true settings set target.language swift continue
  • 30. Neue Wege gehen mit thread •Codepfade zur Laufzeit manipulieren •Methoden kurzschließen •Rückgabewerte ändern
  • 31. Demo
  • 32. Neue Wege gehen mit thread •Nachteil an thread return et al. → bremst das Ausführen des Codes aus
 •Idee: (Binary) Patch → genauso schnell wie vorher
  • 33. Binary Patch Breakpoint private func isExpectedInput(_ value: String) -> Bool { if value.lowercased() == secret { return true } else { return false } }
  • 34. Binary Patch Breakpoint private func isExpectedInput(_ value: String) -> Bool { return true }
  • 35. Binary Patch Breakpoint push rbp
 mov rbp, rsp push 0x1 pop rax pop rbp ret 'x55x6ax01x58x5dxc3'
  • 36. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 37. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 38. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 39. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 40. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 41. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 42. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 43. Binary Patch Breakpoint br s -n isExpectedInput -o true -K false br command add -s python patch = 'x55xB8x01x00x00x00x5dxc3' addr = bp_loc.GetLoadAddress() error = lldb.SBError() proc = frame.GetThread().GetProcess() result = proc.WriteMemory(addr, patch, error) proc.Continue() DONE
  • 44. Patch Breakpoint private let secret = "foo" —> "macoun"
  • 45. Patch Breakpoint private let secret = "foo" // —> "macoun" br s -F "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String" -c "0 == (int)strcmp("foo", (char *)$rdi)" -o true br command add exp -- char * $value = (char *)"macoun" register write $rdi `(unsigned long *)$value` register write $rsi 6 continue DONE
  • 46. Patch Breakpoint private let secret = "foo" // —> "macoun" br s -F "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String" -c "0 == (int)strcmp("foo", (char *)$rdi)" -o true br command add exp -- char * $value = (char *)"macoun" register write $rdi `(unsigned long *)$value` register write $rsi 6 continue DONE
  • 47. Patch Breakpoint private let secret = "foo" // —> "macoun" br s -F "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String" -c "0 == (int)strcmp("foo", (char *)$rdi)" -o true br command add exp -- char * $value = (char *)"macoun" register write $rdi `(unsigned long *)$value` register write $rsi 6 continue DONE
  • 48. Patch Breakpoint private let secret = "foo" // —> "macoun" br s -F "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String" -c "0 == (int)strcmp("foo", (char *)$rdi)" -o true br command add exp -- char * $value = (char *)"macoun" register write $rdi `(unsigned long *)$value` register write $rsi 6 continue DONE
  • 49. Patch Breakpoint private let secret = "foo" // —> "macoun" br s -F "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String" -c "0 == (int)strcmp("foo", (char *)$rdi)" -o true br command add exp -- char * $value = (char *)"macoun" register write $rdi `(unsigned long *)$value` register write $rsi 6 continue DONE
  • 50. Patch Breakpoint private let secret = "foo" // —> "macoun" br s -F "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String" -c "0 == (int)strcmp("foo", (char *)$rdi)" -o true br command add exp -- char * $value = (char *)"macoun" register write $rdi `(unsigned long *)$value` register write $rsi 6 continue DONE