SlideShare a Scribd company logo
Practical Malware Analysis
Ch 6: Recognizing C Constructs in
Assembly
Updated 2-27-17
Function Call
Finding the Code in
IDA Pro
• IDA
shows
only the
entry
point
• Link Ch
6a
Trick: Use Strings, then XREF
Disassembly

in IDA Pro
• 4 arguments
for printf()
function
• Pushed onto
stack
• Reverse
order
• call launches
function
Global vs. Local Variables
• Global variables
– Available to any function in the program
• Local variables
– Defined in a function and only available to
that function
Global vs. Local Variables
Global vs. Local Variables
Local – on stack
Local – on stack
Global – in memory
Arithmetic Operations
Arithmetic Operations
Arithmetic Operations
Branching (if)
Branching (if)
Finding for Loops
• Four components
• Initialization: i starts at 0
• Comparison: is i<100 ?
• Execution: printf
• Increment/decrement: i++
CNIT 126 6: Recognizing C Code Constructs in Assembly
Arrays
CNIT 126 6: Recognizing C Code Constructs in Assembly
Summary
• Finding the Code
– Strings, then XREF
• Function Call
– Arguments pushed onto stack
– Reverse order
– call
• Variables
– Global: in memory, available to all functions
– Local: on stack, only available to one function
Summary
• Arithmetic
– Move variables into registers
– Perform arithmetic (add, sub, idiv, etc.)
– Move results back into variables
• Branching
– Compare (cmp, test, etc.)
– Conditional jump (jz, jnz, etc.)
– Red arrow if false, green arrow if true

More Related Content

What's hot (20)

PDF
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
Sam Bowne
 
PDF
CNIT 126 11. Malware Behavior
Sam Bowne
 
PPTX
Practical Malware Analysis: Ch 4 A Crash Course in x86 Disassembly
Sam Bowne
 
PDF
CNIT 126 9: OllyDbg
Sam Bowne
 
PPTX
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Sam Bowne
 
PDF
Practical Malware Analysis: Ch 9: OllyDbg
Sam Bowne
 
PDF
CNIT 126 12: Covert Malware Launching
Sam Bowne
 
PDF
CNIT 126: Ch 6: Recognizing C Constructs in Assembly
Sam Bowne
 
PPTX
Practical Malware Analysis: Ch 6: Recognizing C Code Constructs in Assembly
Sam Bowne
 
PPTX
Basic Malware Analysis
Albert Hui
 
PDF
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
PPTX
Detecting modern PowerShell attacks with SIEM
Justin Henderson
 
PDF
Black and Blue APIs: Attacker's and Defender's View of API Vulnerabilities
Matt Tesauro
 
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
PDF
CNIT 126: Ch 2 & 3
Sam Bowne
 
PDF
CNIT 126 13: Data Encoding
Sam Bowne
 
PDF
CNIT 126 4: A Crash Course in x86 Disassembly
Sam Bowne
 
PPTX
Introduction to Malware Analysis
Andrew McNicol
 
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
PDF
Practical Malware Analysis Ch13
Sam Bowne
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
Sam Bowne
 
CNIT 126 11. Malware Behavior
Sam Bowne
 
Practical Malware Analysis: Ch 4 A Crash Course in x86 Disassembly
Sam Bowne
 
CNIT 126 9: OllyDbg
Sam Bowne
 
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Sam Bowne
 
Practical Malware Analysis: Ch 9: OllyDbg
Sam Bowne
 
CNIT 126 12: Covert Malware Launching
Sam Bowne
 
CNIT 126: Ch 6: Recognizing C Constructs in Assembly
Sam Bowne
 
Practical Malware Analysis: Ch 6: Recognizing C Code Constructs in Assembly
Sam Bowne
 
Basic Malware Analysis
Albert Hui
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
Detecting modern PowerShell attacks with SIEM
Justin Henderson
 
Black and Blue APIs: Attacker's and Defender's View of API Vulnerabilities
Matt Tesauro
 
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
CNIT 126: Ch 2 & 3
Sam Bowne
 
CNIT 126 13: Data Encoding
Sam Bowne
 
CNIT 126 4: A Crash Course in x86 Disassembly
Sam Bowne
 
Introduction to Malware Analysis
Andrew McNicol
 
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
Practical Malware Analysis Ch13
Sam Bowne
 

Viewers also liked (19)

PDF
CNIT 126 7: Analyzing Malicious Windows Programs
Sam Bowne
 
PDF
CNIT 127 14: Protection Mechanisms
Sam Bowne
 
PDF
Ch 7: Programming for Security Professionals
Sam Bowne
 
PDF
Ch 13: Network Protection Systems
Sam Bowne
 
PDF
'Malware Analysis' by PP Singh
Bipin Upadhyay
 
PPT
Malware Analysis Made Simple
Paul Melson
 
PPTX
Legislacion laboral 1 corte
yujanny1983
 
PPTX
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
grecsl
 
PDF
Iaetsd advanced recycled paper cellulose aerogel synthesis and water
Iaetsd Iaetsd
 
PDF
Open educational practices in language teaching
Shona Whyte
 
PDF
YearUp: Hacking for Jobs
Sam Bowne
 
PDF
Honeypots, Cybercompetitions, and Bug Bounties
Sam Bowne
 
PDF
CNIT 127 Ch 4: Introduction to format string bugs
Sam Bowne
 
PDF
CNIT 127: Ch 8: Windows overflows (Part 2)
Sam Bowne
 
PPTX
PyTriage: A malware analysis framework
Yashin Mehaboobe
 
PDF
CISSP Prep: Ch 5. Communication and Network Security (Part 2)
Sam Bowne
 
PDF
CNIT 140: Perimeter Security
Sam Bowne
 
PDF
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
PDF
CNIT 123: Ch 1 Ethical Hacking Overview
Sam Bowne
 
CNIT 126 7: Analyzing Malicious Windows Programs
Sam Bowne
 
CNIT 127 14: Protection Mechanisms
Sam Bowne
 
Ch 7: Programming for Security Professionals
Sam Bowne
 
Ch 13: Network Protection Systems
Sam Bowne
 
'Malware Analysis' by PP Singh
Bipin Upadhyay
 
Malware Analysis Made Simple
Paul Melson
 
Legislacion laboral 1 corte
yujanny1983
 
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
grecsl
 
Iaetsd advanced recycled paper cellulose aerogel synthesis and water
Iaetsd Iaetsd
 
Open educational practices in language teaching
Shona Whyte
 
YearUp: Hacking for Jobs
Sam Bowne
 
Honeypots, Cybercompetitions, and Bug Bounties
Sam Bowne
 
CNIT 127 Ch 4: Introduction to format string bugs
Sam Bowne
 
CNIT 127: Ch 8: Windows overflows (Part 2)
Sam Bowne
 
PyTriage: A malware analysis framework
Yashin Mehaboobe
 
CISSP Prep: Ch 5. Communication and Network Security (Part 2)
Sam Bowne
 
CNIT 140: Perimeter Security
Sam Bowne
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
CNIT 123: Ch 1 Ethical Hacking Overview
Sam Bowne
 
Ad

Similar to CNIT 126 6: Recognizing C Code Constructs in Assembly (20)

PDF
Intro. to static analysis
Chong-Kuan Chen
 
PDF
COMPILER DESIGN Run-Time Environments
Jyothishmathi Institute of Technology and Science Karimnagar
 
PPTX
Functional Programming in Javascript - IL Tech Talks week
yoavrubin
 
PDF
Cs4hs2008 track a-programming
Rashi Agarwal
 
PPTX
Parallel and Async Programming With C#
Rainer Stropek
 
PPTX
Functional programming for the Advanced Beginner
Luis Atencio
 
PDF
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
ESUG
 
PDF
Performance van Java 8 en verder - Jeroen Borgers
NLJUG
 
PDF
Continuous Application with FAIR Scheduler with Robert Xue
Databricks
 
PPTX
OOP-Module-1-Section-4-LectureNo1-5.pptx
sarthakgithub
 
PDF
Introduction to functional programming (In Arabic)
Omar Abdelhafith
 
PDF
08 subprograms
baran19901990
 
PDF
Serving Deep Learning Models At Scale With RedisAI: Luca Antiga
Redis Labs
 
PDF
running stable diffusion on android
Koan-Sin Tan
 
PPTX
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
PDF
The Scheme Language -- Using it on the iPhone
James Long
 
PDF
High-Performance Python
Work-Bench
 
PPTX
Introduction of function in c programming.pptx
abhajgude
 
PDF
lec6_mips-instructions-III.pdf21rewrwaef
TheBreaker8
 
PPT
9781423902096_PPT_ch07.ppt
LokeshK66
 
Intro. to static analysis
Chong-Kuan Chen
 
Functional Programming in Javascript - IL Tech Talks week
yoavrubin
 
Cs4hs2008 track a-programming
Rashi Agarwal
 
Parallel and Async Programming With C#
Rainer Stropek
 
Functional programming for the Advanced Beginner
Luis Atencio
 
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
ESUG
 
Performance van Java 8 en verder - Jeroen Borgers
NLJUG
 
Continuous Application with FAIR Scheduler with Robert Xue
Databricks
 
OOP-Module-1-Section-4-LectureNo1-5.pptx
sarthakgithub
 
Introduction to functional programming (In Arabic)
Omar Abdelhafith
 
08 subprograms
baran19901990
 
Serving Deep Learning Models At Scale With RedisAI: Luca Antiga
Redis Labs
 
running stable diffusion on android
Koan-Sin Tan
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
The Scheme Language -- Using it on the iPhone
James Long
 
High-Performance Python
Work-Bench
 
Introduction of function in c programming.pptx
abhajgude
 
lec6_mips-instructions-III.pdf21rewrwaef
TheBreaker8
 
9781423902096_PPT_ch07.ppt
LokeshK66
 
Ad

More from Sam Bowne (20)

PDF
Introduction to the Class & CISSP Certification
Sam Bowne
 
PDF
Cyberwar
Sam Bowne
 
PDF
3: DNS vulnerabilities
Sam Bowne
 
PDF
8. Software Development Security
Sam Bowne
 
PDF
4 Mapping the Application
Sam Bowne
 
PDF
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
PDF
12 Elliptic Curves
Sam Bowne
 
PDF
11. Diffie-Hellman
Sam Bowne
 
PDF
2a Analyzing iOS Apps Part 1
Sam Bowne
 
PDF
9 Writing Secure Android Applications
Sam Bowne
 
PDF
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
PDF
10 RSA
Sam Bowne
 
PDF
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
PDF
9. Hard Problems
Sam Bowne
 
PDF
8 Android Implementation Issues (Part 1)
Sam Bowne
 
PDF
11 Analysis Methodology
Sam Bowne
 
PDF
8. Authenticated Encryption
Sam Bowne
 
PDF
7. Attacking Android Applications (Part 2)
Sam Bowne
 
PDF
7. Attacking Android Applications (Part 1)
Sam Bowne
 
PDF
5. Stream Ciphers
Sam Bowne
 
Introduction to the Class & CISSP Certification
Sam Bowne
 
Cyberwar
Sam Bowne
 
3: DNS vulnerabilities
Sam Bowne
 
8. Software Development Security
Sam Bowne
 
4 Mapping the Application
Sam Bowne
 
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
12 Elliptic Curves
Sam Bowne
 
11. Diffie-Hellman
Sam Bowne
 
2a Analyzing iOS Apps Part 1
Sam Bowne
 
9 Writing Secure Android Applications
Sam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
10 RSA
Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
9. Hard Problems
Sam Bowne
 
8 Android Implementation Issues (Part 1)
Sam Bowne
 
11 Analysis Methodology
Sam Bowne
 
8. Authenticated Encryption
Sam Bowne
 
7. Attacking Android Applications (Part 2)
Sam Bowne
 
7. Attacking Android Applications (Part 1)
Sam Bowne
 
5. Stream Ciphers
Sam Bowne
 

Recently uploaded (20)

PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
community health nursing question paper 2.pdf
Prince kumar
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 

CNIT 126 6: Recognizing C Code Constructs in Assembly