SlideShare a Scribd company logo
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

More Related Content

What's hot

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
PVS-Studio
 
Java ppt
Java pptJava ppt
Java ppt
Rohan Gajre
 
Computer Science Assignment Help
Computer Science Assignment HelpComputer Science Assignment Help
Computer Science Assignment Help
Programming Homework Help
 
Python Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging modulePython Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging module
P3 InfoTech Solutions Pvt. Ltd.
 
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
PVS-Studio
 
Operating System Engineering Quiz
Operating System Engineering QuizOperating System Engineering Quiz
Operating System Engineering Quiz
Programming Homework Help
 
computer notes - Inter process communication
computer notes - Inter process communicationcomputer notes - Inter process communication
computer notes - Inter process communication
ecomputernotes
 
Computer Science Homework Help
Computer Science Homework HelpComputer Science Homework Help
Computer Science Homework Help
Programming Homework Help
 
CPP10 - Debugging
CPP10 - DebuggingCPP10 - Debugging
CPP10 - Debugging
Michael Heron
 
Java memory model
Java memory modelJava memory model
Java memory model
Michał Warecki
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
Programming Homework 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)
Andrey Karpov
 
Operating System Assignment Help
Operating System Assignment HelpOperating System Assignment Help
Operating System Assignment Help
Programming Homework 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
PVS-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 correction
Andrey Karpov
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsql
afa reg
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loops
James Brotsos
 
Dynamic Binary Instrumentation
Dynamic Binary Instrumentation	Dynamic Binary Instrumentation
Dynamic Binary Instrumentation
Cysinfo Cyber Security Community
 
Anti Debugging
Anti DebuggingAnti Debugging
0903 1
0903 10903 1
0903 1
petrcoy
 

What's hot (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
 

Viewers also liked

排隊理論_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
 
Rootkit 101
Rootkit 101Rootkit 101
Rootkit 101
hackstuff
 
Web2.0 attack and defence
Web2.0 attack and defenceWeb2.0 attack and defence
Web2.0 attack and defence
hackstuff
 
CTF 經驗分享
CTF 經驗分享CTF 經驗分享
CTF 經驗分享
Hacks in Taiwan (HITCON)
 
第一次做光劍就上手
第一次做光劍就上手第一次做光劍就上手
第一次做光劍就上手
杰 杜
 
Algo/Crypto about CTF
Algo/Crypto about CTFAlgo/Crypto about CTF
Algo/Crypto about CTF
hackstuff
 
HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS 成大講座 密碼學(阿毛)HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS 成大講座 密碼學(阿毛)
HITCON GIRLS
 
Dvwa low level
Dvwa low levelDvwa low level
Dvwa low level
hackstuff
 
HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS 成大講座 惡意程式分析(Turkey)HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS 成大講座 惡意程式分析(Turkey)
HITCON GIRLS
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Development
hackstuff
 
新手無痛入門Apk逆向
新手無痛入門Apk逆向新手無痛入門Apk逆向
新手無痛入門Apk逆向
hackstuff
 
Python 網頁爬蟲由淺入淺
Python 網頁爬蟲由淺入淺Python 網頁爬蟲由淺入淺
Python 網頁爬蟲由淺入淺
hackstuff
 
防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作
Sheng-Hao Ma
 

Viewers also liked (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 網頁爬蟲由淺入淺
 
防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作防毒擋不住?勒索病毒猖獗與實作
防毒擋不住?勒索病毒猖獗與實作
 

Similar to 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 vijay
Vijay 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.k
Vijay 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.docx
curwenmichaela
 
Penetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityPenetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utility
IOSR 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 crazy
Michael 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 crazy
44CON
 
Microprocessor systems (4)
Microprocessor systems (4)Microprocessor systems (4)
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
To Sum It Up
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
ssusera8c91a
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming
Max Kleiner
 
Al2ed chapter14
Al2ed chapter14Al2ed chapter14
Al2ed chapter14
Abdullelah Al-Fahad
 
advanced Operating system
advanced Operating systemadvanced Operating system
advanced Operating system
Lakshmiakshiva
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3a
Ruth Marvin
 
Central Processing Unit
Central Processing UnitCentral Processing Unit
Central Processing Unit
Brenda Debra
 
computing networks and operating system
computing networks and operating system computing networks and operating system
computing networks and operating system
porfinencuentrounodisponible
 
Presentation1
Presentation1Presentation1
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
SaziaSharmin2
 
Lecture 2 - Introductory Concepts
Lecture 2 - Introductory ConceptsLecture 2 - Introductory Concepts
Lecture 2 - Introductory Concepts
Md. Imran Hossain Showrov
 
Program execution
Program executionProgram execution
Program execution
peoplesmagnet
 

Similar to 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
 
computing networks and operating system
computing networks and operating system computing networks and operating system
computing networks and operating system
 
Presentation1
Presentation1Presentation1
Presentation1
 
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
 

Recently uploaded

Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
Addu25809
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
Madan Karki
 

Recently uploaded (20)

Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
 

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

Editor's Notes

  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