radareorg/radare2

Support bitfields in `pf` and `t` commands

Open

#12,555 opened on Dec 24, 2018

View on GitHub
 (9 comments) (0 reactions) (0 assignees)C (3,229 forks)batch import
commandenhancementgood first issueinputpftypes

Repository metrics

Stars
 (23,826 stars)
PR merge metrics
 (Avg merge 16h 24m) (99 merged PRs in 30d)

Description

See http://mjfrazer.org/mjfrazer/bitfields on how to unpack on different endians.

[0x000068c0]> "td struct qwe { int a:4; int b:16; int c:3; };"
[0x000068c0]> ts
qwe
[0x000068c0]> ts qwe
pf ddd a b c
[0x000068c0]> px 4
- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
0x000068c0  f30f 1efa                                ....
[0x000068c0]> tp qwe
 a : 0x000068c0 = 4196274163
 b : 0x000068c4 = 2303323441
 c : 0x000068c8 = 2303221457

Contributor guide