Skip to content

Commit 73fb3f0

Browse files
committed
docs: sbpfv2+ note in immediate doc
1 parent 4b06d65 commit 73fb3f0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/src/reverse/immediates.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,22 @@ Even if the length for key #1 is unclear (or too long), sol-azy will **truncate
160160

161161
This avoids having `"You win!" + "You lose!"` accidentally merged into one blob, since both of them will be used independently by separate `LD_DW_IMM` instructions.
162162

163-
---
163+
> Support for sBPF v2+: Address Construction via `mov32` + `hor64`
164+
> In sBPF version 2 and above, the use of `lddw` for loading 64-bit constants is forbidden. Instead, addresses are **manually constructed** using:
165+
>
166+
> ```text
167+
> mov32 r1, 0x3000 ; load lower 32 bits
168+
> hor64 r1, 0x10000000 ; set upper 32 bits → r1 = 0x1000000000003000
169+
> ```
170+
>
171+
> sol-azy handles this by:
172+
>
173+
> 1. **Tracking register values** using a `RegisterTracker`
174+
> 2. **Do an "emulation"** of `mov` and `hor64`
175+
> 3. **Resolving loads like** `ldxdw r2, [dst + off]` where `dst + off` points into `.rodata`
176+
> 4. **Extracting and decoding the pointed memory**, same as for `lddw`
177+
>
178+
> This lets the disassembler annotate pointer-based loads even when addresses are assembled dynamically.
164179
165180
## Internal Implementation
166181

0 commit comments

Comments
 (0)