Drop ASL, >>>>, <<<, >>>, SIGN, POPCOUNT and S2D in favor of the r2
names <<, ASR, ROL, ROR, ~, POPCNT and I2D. The ops without an r2
equivalent are kept.
- Take the branch set by SETJT and SETD after its delay slot executes
- Make the delayed branch state conditional under symbolic conditions
so the pc forks after the slot
- Check returns and automerge jumps after their delay slot
- Add a mips test for calls, branches and returns with delay slots
- Add CLZ, POPCNT, ROT, [3], =[3], F!=, F<=, F*+, ~=, SETJT, SETJTS,
SETD, BITS, #! and r=
- Pop two values in TRAP and one in () like r2 does
- Make $jt, $js and $ds push the jump target and delay slot state
- Fix $b checking the wrong bit, $p for concrete values and $s > 63
- Compare signed at the register size in <, >, <= and >=, and set
the flag state like == does
- Set the previous and current values on pokes so flags after memory
ops work, peeks only update the last size
- Push 0 on division and modulo by zero
- Fix sign extension, symbolic POPCNT, ROR/ROL/ASR overflows, D2I range,
half floats in F2D/D2F and NaN handling in the float ops
- Add an esil_ops test with the results of r2 master
- Add shadow stack registers (sf, shadow) for sBPF
- Add signed comparison operations ($<, $<=, $>, $>=)
- Fix unsigned vs signed comparisons for BPF instructions
- Add zero-extension for symbolic values in register operations
- Enhance trap handling for sBPF syscalls with ESIL synchronization
- Add memory access validation for sBPF memory model
- Enable strict mode handling for invalid instructions
- Maintain backward compatibility for non-sBPF architectures
These changes enable radius2 to properly support sBPF (Solana BPF) binaries
while maintaining compatibility with existing architectures.
The example demonstrates how to use libc function emulation, which can
make a huge difference in runtime for a stripped binary that statically
links against glibc. The test binary links against musl for size reasons.
The source code of tests/statically-linked is
int main(int argc, char **argv) {
if (strcmp(argv[1], "s3cret_p4s$w0rd"))
puts("wrong");
}
It was compiled with `musl-gcc -static -Os -s`.