Being a Better Reverse Engineer
With Pictures
by Kyle Martin
whoami
A Computer Engineer at NYU
A Reverse Engineer at Large
An Intern at Trail of Bits and Vector35
The Vice President and Head of Research at the OSIRIS Lab
Cyber Security Researcher
CTF Challenge Writer
Insane
And more
And more
And more….
Let’s Start
What is this?
Let’s Get Some Hints
Hint One
Does this help? (Usage?)
Hint Two
Let’s look inside….
(How it works?)
Hint Three
What does it do?
(What it’s called?)
Hint Four
Where does it belong?
What is this?
Here It Is
What Worked Best?
What’s The End Goal?
Understand:
But to these ends, we need to know as much as possible about it.
How Do Learn About
It
Quickly?
Build Some Tooling For It.
Runbooks/Guides (Crime scenes, disaster recovery, forensics)
Policy (What to/not to do; Criminal investigation, penetration testing)
Analysis Tools (Crime - DNA, data matching, categorization, last week’s talk)
Something Else
Applying This To
The It
We Care About Here
x86
Reduced Instruction Set Computing
Turing Complete
A system that can be used to solve any computation problem
Simple Turing Completeness?
Break into fundamental operations:
Math : Add
Control-Flow : Jump if ____?
Ultimate Reduced Instruction Set Computing
One instruction:
Subtract and branch if less than or equal to zero
jmp c:
subleq Z, Z, c
Ultimate Reduced Instruction Set Computing
One instruction:
Subtract and branch if less than or equal to zero (src, dest)
mov a, b:
The Most Ultimate Reduced Instruction Set Computing
And because x86 is bad and Intel/AMD are monsters:
The ZERO-INSTRUCTION turing complete compiler.
But is any of this clear?
No.
No It’s Not.
What’s the problem?
1Sn’7 iT 3Asy???
How do we fix this?
Less Ultimate-RISC
More instructions that perform simple tasks
New Language
14 Operations:
Did this help?
14 instructions:
add, sub, mul, div, xor, or, and, not, jl, jg, je, jmp, mov, int; (src, dest)
jmp c:
jmp c
mov a, b:
mov a, b
Back to x86
Over 1700 different instructions
Over 7400 total different forms those instructions can take
Much undocumented behavior
Intermediate Representations
A Turing Complete system can be used to solve any computation problem
Example: Jump if greater or equal
Reinventing The Wheel
Tons of Intermediate Representations (IRs) already Exist:
What have we done?
Become faster learners:
Obtained the facts
What Do We Do With The Facts?
Remember, What Is The End Goal?
Understand:
And now we are equipped with the fundamental facts about it (the local ‘what’).
What Is Important?
Generally, in software:
Work To Be Done
You, the reverse engineer, need to
Additional Resources/Bibliography
Being a Better Reverse Engineer
by Kyle Martin
elyk@nyu.edu
GitHub.com/KyleMiles
KyleMiles.me
@ElykDeer
@Elyk