Reverse Engineering Machine Code 3
Reverse Engineering Machine Code 3
Visualization
2
Code
Visualization
3
Code
Visualization
4
Code
Visualization
5
Microsoft
Symbols
! Debug
Symbols
" Windows
kernel
symbols
available
! For
most
MS
executables
" Windows
debug
symbols
available
at:
! http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx#f
6
Configuring
OllyDbg
to
Use
Symbols
7
Symbols
in
IDA
8
Windows
Kernel
Debugging
9
Windows
Kernel
Debugging
10
Remote
Debugging
! Remote
Debugging
" Most
good
debuggers
have
a
remote
monitor
that
they
can
connect
to
" Some
virtual
machine
programs
incorporate
remote
debugging
for
kernel
debugging
11
Decoding
Structures
! Structures
" Good
debuggers/disassemblers
will
allow
the
user
to
define
structures
! Structure
decoding
is
implemented
in
OllyDbg
2.0
! Currently,
user-‐defined
structures
are
not
12
Decoding
Structures
13
Decoding
Structures
14
Decoding
Structures
15
IDA
Structures
! Assembler
Structures
" Structures
window
! C
Structures
" Local
types
window
16
Function
Hooking
! Hooking
" Create
user-‐defined
events
upon:
! Function
calls
! System
messages
! IO
events
! …
" SetWindowsHookEx()
! Install
a
hook
" UnhookWindowsHookEx()
! Uninstall
a
hook
! Example:
http://msdn.microsoft.com/en-‐us/library/
windows/desktop/ms632589(v=vs.85).aspx
17
Differential
Reverse
Engineering
! Binary
Diffing
! Code
Coverage
Diffing
! Others
" Memory
diffing
18
Binary
Diffing
! Binary
Diffing
" Compare
two
similar
binary
executables
" Useful
for
reverse
engineering
updates
and
version
changes
" Implemented
in
PaiMei
! PAIMEIdiff
19
Code
Coverage
Diffing
! Demo!
" Let’s
find
the
function
in
Notepad++
that
invokes
the
“About”
information
! 3251
functions
/
28827
basic
blocks
! 1
or
2
functions
are
dedicated
to
the
“About”
window
21
Code
Coverage
Diffing
22
Code
Coverage
Diffing
23
Code
Coverage
Diffing
24
Code
Coverage
Diffing
25
Code
Coverage
Diffing
26
Code
Coverage
Diffing
27
Code
Coverage
Diffing
28
Code
Coverage
Diffing
29
Questions/Comments?
30