text
stringlengths
0
1.99k
| ((((SymVar_49) << 8 | SymVar_48) << 8 | SymVar_47) << 8 | SymVar_46) |
|-------------------------------------------------------------------------|
| > add x0, x22, #8 |
| > results in x0 AST: |
| (((((SymVar_49) << 8 | SymVar_48) << 8 | SymVar_47) << 8 | SymVar_46) |
| + 0x8) & 0xffffffff |
'-------------------------------------------------------------------------'
Emulation only ends once all live symbolic registers are concretized,
at which point the system reverts to native execution with "only" guarded
symbolic memory to catch the next guarded memory access and initiate the
next symbolic emulation session. Where multiple symbolic emulation
sessions separated by native execution gaps will all contribute in
building the input data-flow def-use chains.
As another illustration, consider how a later session incorporates the
full upstream def-use chain. During this run, 379 symbolic emulation
sessions occurred (with native execution in between), and by session #371,
a single guarded load reflects the accumulated expressions along its
def-use chain from the previous 370 sessions. For example:
---------------------------------------------------------------------------
> ldr x8, [x0]
---------------------------------------------------------------------------
This instruction loads from a guarded address, producing an AST that
concatenates bytes defined (and shifted) across multiple earlier
operations in multiple earlier emulation sessions. The resulting AST is:
---------------------------------------------------------------------------
((((((((SymVar_30) << 8 | SymVar_29) << 8 | SymVar_28) << 8 | SymVar_27)
<< 8 | SymVar_26) << 8 | SymVar_25) << 8 | SymVar_24) << 8 |
(((((SymVar_23 << (0x38 & 0x3f)) & 0xffffffffffffffff) |
(((SymVar_22 << (0x30 & 0x3f)) & 0xffffffffffffffff) |
(((SymVar_21 << (0x28 & 0x3f)) & 0xffffffffffffffff) |
(((SymVar_20 << (0x20 & 0x3f)) & 0xffffffffffffffff) |
(((SymVar_19 << (0x18 & 0x3f)) & 0xffffffffffffffff) |
(((SymVar_18 << (0x10 & 0x3f)) & 0xffffffffffffffff) |
(((SymVar_17 << (0x8 & 0x3f)) & 0xffffffffffffffff) |
SymVar_16))))))) >> 56) & 0xff))
---------------------------------------------------------------------------
This mechanism enables efficient, guided symbolic sessions fused
seamlessly with native execution by using memory-access instrumentation as
both the trigger and steering signal for symbolic analysis, bounding each
slice to the scope of live symbolic dependencies. Unlike Concolic-
execution, Selective Symbolic Instrumentation (SSI) avoids needless
emulation of code unaffected by external inputs and preserves near-native
performance across uninstrumented paths.
--[ 7 - Symbolic Definitions
E0 distinguishes between two complementary types of symbolic definitions:
(1) Root Symbolic Definitions anchor def-use chains at their origin,
usually an input buffer. Users explicitly define these through command-
line parameters specifying the buffer location, size, and register details
for tracing:
-module : Name of the module containing the input-handling code
-bp : Breakpoint RVA to intercept and guard the input buffer
-reg : Register holding the pointer to the input
-reg-offset : Optional offset if the input resides inside a structure
-i : Start index of the guarded input region
-n : Length of the guarded region in bytes
For instance, the following command configures E0 to set a breakpoint at
RVA '0x3b40' in the harness module 'ImageIO_test', guarding 200 bytes of
input starting at byte 4 in the buffer pointed to by register 'x0':
./e0 -i 4 -n 200 -module ImageIO_test -bp 0x3b40 -reg 0 ...
(2) Function-Layer Symbolic Definitions (SymDefs) are automatically
captured at runtime as symbolic def-use chain values cross-function
boundaries. These include:
- ARG: symbolic function arguments
- MEM: symbolic memory loads
- RET: symbolic return values
These SymDefs serve two main purposes:
- To support high-resolution data-flow coverage (see next section), and
- To focus LLM analysis on function-level variables derived from
untrusted inputs.
The instrumentation engine logs and stores Function-Layer definitions
(SymDefs) in a local SQLite database, which enables downstream
deduplication, AI inspection, and coverage tracking.
---------------------------------------------------------------------------
SymDef IDs and Invocation IDs
---------------------------------------------------------------------------
Each SymDef ID is a 64-bit identifier encoding the symbolic event's
location and type, allowing easy tracking and reference throughout E0's
analysis workflow. These SymDef IDs appear throughout the runtime logs and
database as ARG, MEM, and RET symbolic definitions. Their format varies
slightly depending on the definition type.
---------------------------------------------------------------------------
Each SymDef ID includes:
---------------------------------------------------------------------------
- Instruction RVA (high SymDef ID 32 bits)