SlideShare uma empresa Scribd logo
1 de 19
Breakpoints
The secrets behind them
A breakpoint makes your program stop whenever a certain point in the program is
reached
What’s a breakpoint?
How are they implemented?
Using the following steps...
What’s a debugger?
A debugger or debugging tool is a computer program that is used to test and debug
other programs (the "target" program).
Before that….
A basic debugger
Fork the debugee process in run_child function by calling “exec”
Now the debugger is the parent process and the debugee the child
Step - 1
Identify the memory address you want to set a breakpoint at.
Access that memory address
Set the instruction “int 3” at the first byte of that memory address
Ooh! What do they even mean?
Identify the memory address you want to set a breakpoint at
Identify the memory address
Here’s a sample program I want to debug -
Identify the memory address
And here’s the objdump result -
And what about?
Access the memory address
Access the memory address
Using ptrace calls
The ptrace() system call provides a means by which one process (the "tracer") may
observe and control the execution of another process (the "tracee"), and examine and
change the tracee's memory and registers. It is primarily used to implement breakpoint
debugging and system call tracing.
I don’t even...
Set the instruction “int 3” at the first byte of the memory address
int 3
Assembly language instruction for generating software interrupt
int 3 is used by the debuggers
The opcode for int 3 is - 0xCC
Set the “int 3” at the first byte
What happens now?
The child process is modified and is now being executed.
The instruction pointer loads the memory address at 0x80483e9
And it gets an interrupt
And the parent process (which is the debugger) gets an interrupt.
What does the parent process do?
Handle the breakpoint
Step 2
Revert the value that we modified at the first byte of the address on which the
breakpoint is set
Back the instruction pointer one address up
Revert the value
Remember we had put “int 3” opcode at the first byte of the address 0x80483e9
Let’s change it back to original instructions
Back the IP one step up
We haven’t actually executed the original instruction at the address 0x80483e9
Let’s execute it by setting the EIP/RIP register to the memory address
Step 3
Let the user do what she wants to do once the breakpoint has been hit

Mais conteúdo relacionado

Mais procurados

Heading for a Record: Chromium, the 5th Check
Heading for a Record: Chromium, the 5th CheckHeading for a Record: Chromium, the 5th Check
Heading for a Record: Chromium, the 5th CheckPVS-Studio
 
PVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernelPVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernelPVS-Studio
 
computer notes - Inter process communication
computer notes - Inter process communicationcomputer notes - Inter process communication
computer notes - Inter process communicationecomputernotes
 
Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Andrey Karpov
 
Intel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correctionIntel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correctionPVS-Studio
 
Intel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correctionIntel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correctionAndrey Karpov
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsqlafa reg
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsJames Brotsos
 

Mais procurados (20)

Heading for a Record: Chromium, the 5th Check
Heading for a Record: Chromium, the 5th CheckHeading for a Record: Chromium, the 5th Check
Heading for a Record: Chromium, the 5th Check
 
Java ppt
Java pptJava ppt
Java ppt
 
Computer Science Assignment Help
Computer Science Assignment HelpComputer Science Assignment Help
Computer Science Assignment Help
 
Python Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging modulePython Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging module
 
PVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernelPVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernel
 
Operating System Engineering Quiz
Operating System Engineering QuizOperating System Engineering Quiz
Operating System Engineering Quiz
 
computer notes - Inter process communication
computer notes - Inter process communicationcomputer notes - Inter process communication
computer notes - Inter process communication
 
Computer Science Homework Help
Computer Science Homework HelpComputer Science Homework Help
Computer Science Homework Help
 
CPP10 - Debugging
CPP10 - DebuggingCPP10 - Debugging
CPP10 - Debugging
 
Java memory model
Java memory modelJava memory model
Java memory model
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
 
Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
Miranda NG Project to Get the "Wild Pointers" Award (Part 1)
 
Operating System Assignment Help
Operating System Assignment HelpOperating System Assignment Help
Operating System Assignment Help
 
Intel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correctionIntel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correction
 
Intel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correctionIntel IPP Samples for Windows - error correction
Intel IPP Samples for Windows - error correction
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsql
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loops
 
Dynamic Binary Instrumentation
Dynamic Binary Instrumentation	Dynamic Binary Instrumentation
Dynamic Binary Instrumentation
 
Anti Debugging
Anti DebuggingAnti Debugging
Anti Debugging
 
0903 1
0903 10903 1
0903 1
 

Destaque

排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...
排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...
排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...婉萍 蔡
 
調試器原理與架構
調試器原理與架構調試器原理與架構
調試器原理與架構hackstuff
 
SITCON2016, 防毒擋不住?勒索軟體猖獗與實作
SITCON2016, 防毒擋不住?勒索軟體猖獗與實作SITCON2016, 防毒擋不住?勒索軟體猖獗與實作
SITCON2016, 防毒擋不住?勒索軟體猖獗與實作Sheng-Hao Ma
 
UCCU 朕不給的你不能看
UCCU 朕不給的你不能看UCCU 朕不給的你不能看
UCCU 朕不給的你不能看SHANG-DE JIANG
 
第一次使用Shodan.io就上手
第一次使用Shodan.io就上手第一次使用Shodan.io就上手
第一次使用Shodan.io就上手Ting-En Lin
 
HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)
HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)
HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)HITCON GIRLS
 
HITCON GIRLS: CTF 介紹 (小魚&念奇)
HITCON GIRLS: CTF 介紹 (小魚&念奇)HITCON GIRLS: CTF 介紹 (小魚&念奇)
HITCON GIRLS: CTF 介紹 (小魚&念奇)HITCON GIRLS
 
HITCON CTF 2016導覽
HITCON CTF 2016導覽HITCON CTF 2016導覽
HITCON CTF 2016導覽HITCON GIRLS
 
Web2.0 attack and defence
Web2.0 attack and defenceWeb2.0 attack and defence
Web2.0 attack and defencehackstuff
 
第一次做光劍就上手
第一次做光劍就上手第一次做光劍就上手
第一次做光劍就上手杰 杜
 
Algo/Crypto about CTF
Algo/Crypto about CTFAlgo/Crypto about CTF
Algo/Crypto about CTFhackstuff
 
HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS 成大講座 密碼學(阿毛)HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS 成大講座 密碼學(阿毛)HITCON GIRLS
 
Dvwa low level
Dvwa low levelDvwa low level
Dvwa low levelhackstuff
 
HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS 成大講座 惡意程式分析(Turkey)HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS 成大講座 惡意程式分析(Turkey)HITCON GIRLS
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Developmenthackstuff
 
新手無痛入門Apk逆向
新手無痛入門Apk逆向新手無痛入門Apk逆向
新手無痛入門Apk逆向hackstuff
 
Python 網頁爬蟲由淺入淺
Python 網頁爬蟲由淺入淺Python 網頁爬蟲由淺入淺
Python 網頁爬蟲由淺入淺hackstuff
 
防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作Sheng-Hao Ma
 

Destaque (20)

排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...
排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...
排隊理論_An Exploration of The Optimization of Executive Scheduling in The Cloud ...
 
調試器原理與架構
調試器原理與架構調試器原理與架構
調試器原理與架構
 
SITCON2016, 防毒擋不住?勒索軟體猖獗與實作
SITCON2016, 防毒擋不住?勒索軟體猖獗與實作SITCON2016, 防毒擋不住?勒索軟體猖獗與實作
SITCON2016, 防毒擋不住?勒索軟體猖獗與實作
 
UCCU 朕不給的你不能看
UCCU 朕不給的你不能看UCCU 朕不給的你不能看
UCCU 朕不給的你不能看
 
第一次使用Shodan.io就上手
第一次使用Shodan.io就上手第一次使用Shodan.io就上手
第一次使用Shodan.io就上手
 
HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)
HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)
HITCON GIRLS: Android 滲透測試介紹 (Elven Liu)
 
HITCON GIRLS: CTF 介紹 (小魚&念奇)
HITCON GIRLS: CTF 介紹 (小魚&念奇)HITCON GIRLS: CTF 介紹 (小魚&念奇)
HITCON GIRLS: CTF 介紹 (小魚&念奇)
 
HITCON CTF 2016導覽
HITCON CTF 2016導覽HITCON CTF 2016導覽
HITCON CTF 2016導覽
 
Rootkit 101
Rootkit 101Rootkit 101
Rootkit 101
 
Web2.0 attack and defence
Web2.0 attack and defenceWeb2.0 attack and defence
Web2.0 attack and defence
 
CTF 經驗分享
CTF 經驗分享CTF 經驗分享
CTF 經驗分享
 
第一次做光劍就上手
第一次做光劍就上手第一次做光劍就上手
第一次做光劍就上手
 
Algo/Crypto about CTF
Algo/Crypto about CTFAlgo/Crypto about CTF
Algo/Crypto about CTF
 
HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS 成大講座 密碼學(阿毛)HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS 成大講座 密碼學(阿毛)
 
Dvwa low level
Dvwa low levelDvwa low level
Dvwa low level
 
HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS 成大講座 惡意程式分析(Turkey)HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS 成大講座 惡意程式分析(Turkey)
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Development
 
新手無痛入門Apk逆向
新手無痛入門Apk逆向新手無痛入門Apk逆向
新手無痛入門Apk逆向
 
Python 網頁爬蟲由淺入淺
Python 網頁爬蟲由淺入淺Python 網頁爬蟲由淺入淺
Python 網頁爬蟲由淺入淺
 
防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作
 

Semelhante a Breakpoints

8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijayVijay Kumar
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kVijay Kumar
 
Let's write a Debugger!
Let's write a Debugger!Let's write a Debugger!
Let's write a Debugger!Levente Kurusa
 
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docxNIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docxcurwenmichaela
 
Penetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityPenetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityIOSR Journals
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazyMichael Boman
 
44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - IntroductionTo Sum It Up
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming Max Kleiner
 
advanced Operating system
advanced Operating systemadvanced Operating system
advanced Operating systemLakshmiakshiva
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3aRuth Marvin
 
Central Processing Unit
Central Processing UnitCentral Processing Unit
Central Processing UnitBrenda Debra
 
5_2017_03_10!11_43_44_AM.pptx
5_2017_03_10!11_43_44_AM.pptx5_2017_03_10!11_43_44_AM.pptx
5_2017_03_10!11_43_44_AM.pptxSaziaSharmin2
 

Semelhante a Breakpoints (20)

8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.k
 
Let's write a Debugger!
Let's write a Debugger!Let's write a Debugger!
Let's write a Debugger!
 
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docxNIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
 
Penetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityPenetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utility
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazy
 
44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy
 
Microprocessor systems (4)
Microprocessor systems (4)Microprocessor systems (4)
Microprocessor systems (4)
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming
 
Al2ed chapter14
Al2ed chapter14Al2ed chapter14
Al2ed chapter14
 
advanced Operating system
advanced Operating systemadvanced Operating system
advanced Operating system
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3a
 
Central Processing Unit
Central Processing UnitCentral Processing Unit
Central Processing Unit
 
Presentation1
Presentation1Presentation1
Presentation1
 
computing networks and operating system
computing networks and operating system computing networks and operating system
computing networks and operating system
 
5_2017_03_10!11_43_44_AM.pptx
5_2017_03_10!11_43_44_AM.pptx5_2017_03_10!11_43_44_AM.pptx
5_2017_03_10!11_43_44_AM.pptx
 
Lecture 2 - Introductory Concepts
Lecture 2 - Introductory ConceptsLecture 2 - Introductory Concepts
Lecture 2 - Introductory Concepts
 
Program execution
Program executionProgram execution
Program execution
 

Último

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 

Último (20)

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 

Breakpoints

  • 2. A breakpoint makes your program stop whenever a certain point in the program is reached What’s a breakpoint?
  • 3. How are they implemented? Using the following steps...
  • 4. What’s a debugger? A debugger or debugging tool is a computer program that is used to test and debug other programs (the "target" program). Before that….
  • 5. A basic debugger Fork the debugee process in run_child function by calling “exec” Now the debugger is the parent process and the debugee the child
  • 6. Step - 1 Identify the memory address you want to set a breakpoint at. Access that memory address Set the instruction “int 3” at the first byte of that memory address
  • 7. Ooh! What do they even mean? Identify the memory address you want to set a breakpoint at
  • 8. Identify the memory address Here’s a sample program I want to debug -
  • 9. Identify the memory address And here’s the objdump result -
  • 10. And what about? Access the memory address
  • 11. Access the memory address Using ptrace calls The ptrace() system call provides a means by which one process (the "tracer") may observe and control the execution of another process (the "tracee"), and examine and change the tracee's memory and registers. It is primarily used to implement breakpoint debugging and system call tracing.
  • 12. I don’t even... Set the instruction “int 3” at the first byte of the memory address
  • 13. int 3 Assembly language instruction for generating software interrupt int 3 is used by the debuggers The opcode for int 3 is - 0xCC
  • 14. Set the “int 3” at the first byte
  • 15. What happens now? The child process is modified and is now being executed. The instruction pointer loads the memory address at 0x80483e9 And it gets an interrupt And the parent process (which is the debugger) gets an interrupt. What does the parent process do? Handle the breakpoint
  • 16. Step 2 Revert the value that we modified at the first byte of the address on which the breakpoint is set Back the instruction pointer one address up
  • 17. Revert the value Remember we had put “int 3” opcode at the first byte of the address 0x80483e9 Let’s change it back to original instructions
  • 18. Back the IP one step up We haven’t actually executed the original instruction at the address 0x80483e9 Let’s execute it by setting the EIP/RIP register to the memory address
  • 19. Step 3 Let the user do what she wants to do once the breakpoint has been hit

Notas do Editor

  1. I am fascinated by the debuggers. They saved me countless number of times from killing myself or somebody who is readily accessible. I love them so much that I wrote a small, very debugger as one of my projects during the first half of RC. Today I am going to talk about how do the debuggers set breakpoints