SlideShare a Scribd company logo
Exploring
the Portable Executable
format
London, England
Ange Albertini 2013/09/13
Workshop package
(PoCs+docs)
http://www.xchg.info/corkami/workshop.zip
Recommended PE viewer:
http://icerbero.com/peinsider
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
a handmade PE
simple.exe
a first real example
working minimal
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
detailed
walkthrough
Exploring the Portable Executable format
DOS header
unused in PE mode
Exploring the Portable Executable format
PE header
PE signature
Exploring the Portable Executable format
Optional Header
NOT optional in executables
Exploring the Portable Executable format
DataDirectories
end of OptionalHeader
16 (max) * [RVA, Size]
each entry interpreted differently
Exploring the Portable Executable format
Sections
memory mapping
Exploring the Portable Executable format
Exploring the Portable Executable format
Imports
standard loader mechanism
NOT required
load DLL, locate APIs
Exploring the Portable Executable format
compiled PE
compiled.exe
closer to reality
extra non-critical structure
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
DLL
exports
relocations
Exploring the Portable Executable format
Exploring the Portable Executable format
driver
subsystem, checksum
low alignments mapping
different imports
Exploring the Portable Executable format
resources
structure
version, manifest/icon, APIs
Exploring the Portable Executable format
Exploring the Portable Executable format
Thread Local Storage
callback list
before EntryPoint & after ExitProcess
Exploring the Portable Executable format
.Net
different and integrated binary
2nd loader
Exploring the Portable Executable format
what about 64b?
very few changes
● 2 magic constants
● a few elements become QWord
○ ImageBase, Imports thunks, callbacks
● Exceptions have their own DataDirectory
○ no need for LoadConfig (SafeSEH)
and ARM
● a different magic constant
● still 16b DOS Stub !
● nothing special, PE wise
○ the beauty of ‘Portability’
trivial
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format

More Related Content

PPTX
(Ab)Using GPOs for Active Directory Pwnage
PDF
RAT - Repurposing Adversarial Tradecraft
PDF
Hunting for Credentials Dumping in Windows Environment
PPTX
RACE - Minimal Rights and ACE for Active Directory Dominance
PDF
Privilege escalation from 1 to 0 Workshop
PDF
Derbycon - The Unintended Risks of Trusting Active Directory
PDF
Part 01 Linux Kernel Compilation (Ubuntu)
PPTX
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
(Ab)Using GPOs for Active Directory Pwnage
RAT - Repurposing Adversarial Tradecraft
Hunting for Credentials Dumping in Windows Environment
RACE - Minimal Rights and ACE for Active Directory Dominance
Privilege escalation from 1 to 0 Workshop
Derbycon - The Unintended Risks of Trusting Active Directory
Part 01 Linux Kernel Compilation (Ubuntu)
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...

What's hot (20)

PDF
Valgrind tutorial
PPTX
I Hunt Sys Admins
PPTX
I hunt sys admins 2.0
PPTX
Six Degrees of Domain Admin - BloodHound at DEF CON 24
PDF
How to Hunt for Lateral Movement on Your Network
PDF
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
PPTX
Recon with Nmap
PDF
A Threat Hunter Himself
PPTX
PSConfEU - Offensive Active Directory (With PowerShell!)
PPTX
Bash Shell Scripting
PDF
ReCertifying Active Directory
PPTX
Classification of vulnerabilities
PDF
Open LDAP
PDF
PHDays 2018 Threat Hunting Hands-On Lab
PDF
BloodHound Unleashed.pdf
PDF
FIDO and the Future of User Authentication
PDF
Sniffing via dsniff
PPTX
Presentation on samba server
PPTX
Linux security
PDF
I Have the Power(View)
Valgrind tutorial
I Hunt Sys Admins
I hunt sys admins 2.0
Six Degrees of Domain Admin - BloodHound at DEF CON 24
How to Hunt for Lateral Movement on Your Network
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
Recon with Nmap
A Threat Hunter Himself
PSConfEU - Offensive Active Directory (With PowerShell!)
Bash Shell Scripting
ReCertifying Active Directory
Classification of vulnerabilities
Open LDAP
PHDays 2018 Threat Hunting Hands-On Lab
BloodHound Unleashed.pdf
FIDO and the Future of User Authentication
Sniffing via dsniff
Presentation on samba server
Linux security
I Have the Power(View)
Ad

Viewers also liked (17)

PDF
the PE format 2011/01/17
PPT
Protection
PDF
PE102 - a Windows executable format overview (booklet V1)
PPTX
Pe Format
PPT
PE Packers Used in Malicious Software - Part 1
PDF
PE Trojan Detection Based on the Assessment of Static File Features
PPTX
PE File Format and Packer - Inc0gnito 2016
PDF
TASBot - the perfectionist
PDF
PDF: myths vs facts
PDF
Hacks in video games
PDF
Trusting files (and their formats)
PDF
Connecting communities
PDF
Caring for file formats
PDF
Let's write a PDF file
PDF
Preserving arcade games - 31c3
PDF
Funky file formats - 31c3
the PE format 2011/01/17
Protection
PE102 - a Windows executable format overview (booklet V1)
Pe Format
PE Packers Used in Malicious Software - Part 1
PE Trojan Detection Based on the Assessment of Static File Features
PE File Format and Packer - Inc0gnito 2016
TASBot - the perfectionist
PDF: myths vs facts
Hacks in video games
Trusting files (and their formats)
Connecting communities
Caring for file formats
Let's write a PDF file
Preserving arcade games - 31c3
Funky file formats - 31c3
Ad

Similar to Exploring the Portable Executable format (20)

PDF
Binary art - Byte-ing the PE that fails you (extended offline version)
PPTX
Creating user-mode debuggers for Windows
PPTX
Reversing malware analysis training part3 windows pefile formatbasics
PDF
Reversing & malware analysis training part 3 windows pe file format basics
PDF
A bit more of PE
PPTX
Revers engineering
PPTX
Reversing & malware analysis training part 3 windows pe file format basics
PPT
Intro reverse engineering
PDF
Binary art - Byte-ing the PE that fails you (live version)
ODP
x86 & PE
PDF
Finding Xori: Malware Analysis Triage with Automated Disassembly
PPTX
OS Internals and Portable Executable File Format
PPT
PE Packers Used in Malicious Software - Part 2
PDF
Match Column A with Column B by annotating the letter from Column B i.pdf
PDF
A basic approach to Understanding Win32 Binaries
PDF
Finding Xori: Malware Analysis Triage with Automated Disassembly
PDF
Ch 6: The Wild World of Windows
PDF
CNIT 127 Ch 6: The Wild World of Windows
PDF
Bypassing anti virus scanners
PPTX
Code Injection in Windows
Binary art - Byte-ing the PE that fails you (extended offline version)
Creating user-mode debuggers for Windows
Reversing malware analysis training part3 windows pefile formatbasics
Reversing & malware analysis training part 3 windows pe file format basics
A bit more of PE
Revers engineering
Reversing & malware analysis training part 3 windows pe file format basics
Intro reverse engineering
Binary art - Byte-ing the PE that fails you (live version)
x86 & PE
Finding Xori: Malware Analysis Triage with Automated Disassembly
OS Internals and Portable Executable File Format
PE Packers Used in Malicious Software - Part 2
Match Column A with Column B by annotating the letter from Column B i.pdf
A basic approach to Understanding Win32 Binaries
Finding Xori: Malware Analysis Triage with Automated Disassembly
Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of Windows
Bypassing anti virus scanners
Code Injection in Windows

More from Ange Albertini (20)

PDF
Overview of file type identifiers (HackLu)
PDF
A question of time - Troopers 2024 Keynote
PDF
Technical challenges with file formats
PDF
Relations between archive formats
PDF
Abusing archive file formats
PDF
TimeCryption
PDF
You are *not* an idiot
PDF
Improving file formats
PDF
KILL MD5
PDF
No more dumb hex!
PDF
Beyond your studies
PDF
An introduction to inkscape
PDF
The challenges of file formats
PDF
Exploiting hash collisions
PDF
Infosec & failures
PDF
An overview of potential leaks via PDF
PDF
Advanced Pdf Tricks
PDF
Preserving arcade games
PDF
Let's talk about...
PDF
Hide Android applications in images
Overview of file type identifiers (HackLu)
A question of time - Troopers 2024 Keynote
Technical challenges with file formats
Relations between archive formats
Abusing archive file formats
TimeCryption
You are *not* an idiot
Improving file formats
KILL MD5
No more dumb hex!
Beyond your studies
An introduction to inkscape
The challenges of file formats
Exploiting hash collisions
Infosec & failures
An overview of potential leaks via PDF
Advanced Pdf Tricks
Preserving arcade games
Let's talk about...
Hide Android applications in images

Recently uploaded (20)

PDF
MSPs in 10 Words - Created by US MSP Network
PDF
Unit 1 Cost Accounting - Cost sheet
PDF
Types of control:Qualitative vs Quantitative
PPT
Chapter four Project-Preparation material
PDF
Training And Development of Employee .pdf
PPTX
Lecture (1)-Introduction.pptx business communication
PDF
IFRS Notes in your pocket for study all the time
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PDF
Nidhal Samdaie CV - International Business Consultant
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PDF
COST SHEET- Tender and Quotation unit 2.pdf
PDF
Reconciliation AND MEMORANDUM RECONCILATION
PPTX
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
PDF
Outsourced Audit & Assurance in USA Why Globus Finanza is Your Trusted Choice
PPTX
Probability Distribution, binomial distribution, poisson distribution
PPTX
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
PPTX
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
PDF
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
PDF
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
MSPs in 10 Words - Created by US MSP Network
Unit 1 Cost Accounting - Cost sheet
Types of control:Qualitative vs Quantitative
Chapter four Project-Preparation material
Training And Development of Employee .pdf
Lecture (1)-Introduction.pptx business communication
IFRS Notes in your pocket for study all the time
Roadmap Map-digital Banking feature MB,IB,AB
Nidhal Samdaie CV - International Business Consultant
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
COST SHEET- Tender and Quotation unit 2.pdf
Reconciliation AND MEMORANDUM RECONCILATION
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
Outsourced Audit & Assurance in USA Why Globus Finanza is Your Trusted Choice
Probability Distribution, binomial distribution, poisson distribution
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034

Exploring the Portable Executable format