diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 10:38:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 10:38:37 -0300 |
| commit | 6a7a87b8ecb7902de5640cad00028997825024d2 (patch) | |
| tree | 9e76e47c769d62f0a1affa563b9fba9849e2ab5d /src/cli/disasm.c | |
| parent | 390872b7bb9cdcf3e8095442af88af0dfcb40602 (diff) | |
| download | computeranim-6a7a87b8ecb7902de5640cad00028997825024d2.tar.gz computeranim-6a7a87b8ecb7902de5640cad00028997825024d2.zip | |
trace: a function's basic blocks; ASan's shadow memory
For a graph of a function's blocks: at the first stop inside it a
function's blocks are recorded once (bounds, how each ends, where its
edges go), with every instruction's text up to 2048 of them;
telescope.blocks reads them, and a branch event ties a run to the edge
it took. Stripped libraries get blocks from their unwind bounds.
For a plain build seen against an ASan one: record --asan keeps the
shadow of every region it records, the offset found from the process;
telescope.shadow gives an address's shadow byte. The report functions
are named and the chain holds from inside the report to main. Tested on
an overflowing target built plain, with gcc's ASan and with clang's.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'src/cli/disasm.c')
| -rw-r--r-- | src/cli/disasm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cli/disasm.c b/src/cli/disasm.c index 9b15e0c..6f2ffa4 100644 --- a/src/cli/disasm.c +++ b/src/cli/disasm.c @@ -21,6 +21,8 @@ struct zt_branch { // A conditional jump whose condition does not hold is not taken. uint8_t taken; uint8_t indirect; + // A jump on a condition. + uint8_t conditional; }; // Whether the flags (and rcx) make a conditional jump go. @@ -96,6 +98,7 @@ size_t zt_disasm(const uint8_t *code, size_t len, uint64_t addr, char *text, siz branch->taken = regs ? holds(insn->id, regs[18], regs[11]) : 1; branch->indirect = 0; branch->target = 0; + branch->conditional = branch->kind == 2 && insn->id != X86_INS_JMP && insn->id != X86_INS_LJMP; if (branch->kind == 1 || branch->kind == 2) { const cs_x86_op *op = &x->operands[0]; if (x->op_count < 1) branch->kind = 0; |
