layout: post title: "Software Security Notes 6 Disassembly" date: 2021-3-4 07:00:00 +0800
Load a binary
find machine instructions in binary
disassemble into human- or machine readable form
Starts from known entry points
Recursively follows control flow
Used in many reverse-engineering applications
Runtime information can resolve indirect calls, distinguishing data vs code
It allows for execution tracers to dump instructions, memory/register contents
Code coverage problem
Use known test inputs, manually developed, toincrease code coverage.
Trying to cover as much of the program’s functionality as possible.
Ready-made test suites aren’t always available.
Application specific.
Automatically generate inputs
Favoring executing lots of tests to heavy duty analysis
Generation-based fuzzer
Mutation-based fuzzer
Execute not with concrete values but symblic values
One exection path will generate a set of constraints
Path explosion
Compartmentalizing
logically connected codes
function detection
Based on function signatures:
Use $call$ for function so easy to locate.
Indirect and tail-call function
CFG organize the inernals of a function
automated analysis, manual analysis
graphic representation
basic blocks: 1st instruction is the only entry point, last instruction is the only exit point
call edges are not part of CFG
show relationship between call sites and functions rather than basic blocks
indirect call not shown in call graph
direct call: call the specific funtion or address
indirect call: call the address stored in a register.