mirror of
https://github.com/rizinorg/rizin
synced 2026-08-22 20:26:16 -04:00
This rewrites the look of the interactive horizontal histogram in Rizin - the output of `p==v`, `p==ev`, `p==mv`, `p==0v`, `p==fv`, `p==pv`, `p==zv`, `p==Sv` and the analysis-based interactive variants. It closes #6365 and #4431 in full, and now sits on top of the recently merged static-histogram PR (#6427) so it reuses the new RzHistogramOptions struct and its helpers. Five sub-tasks from #6365: - Context-aware vertical ruler with up to 5 anchor labels (top, bottom, quarter, half, three-quarter) honouring opts->value_min..value_max, value_precision, value_scale and value_unit. Reuses the static helpers compute_ruler_gutter, render_ruler_gutter, label_value_at and select_ruler_label_rows so visual and static stay consistent. - X-axis byte-offset ruler at the bottom: `^` ticks every (addr_w + 3) cols followed by absolute byte offsets computed from opts->offpos + realj * blocksize. - Cursor offset + percentage shown right-aligned on the status line, with "Index N data V" on the left. - Top minimap: Unicode block characters (▁▂▃▄▅▆▇█) for the density of each slice of the whole data, plus a ┏━━━┓ window indicator showing the visible slice. Always rendered when the new `scr.hist.minimap` config is true. When the terminal is wide (hist->w > 200) the minimap shrinks by 43 columns to make room for a two-line `px 0x20`-style hex preview panel on the right showing the 32 bytes at the cursor's file offset. Each byte is wrapped in its px-style colour code (b0x00 / b0x7f / b0xff / btext / other) when opts->color is set, matching rz_print's rz_print_byte_color exactly. A trailing safety pad keeps the canvas from clipping the last byte of the first hex row. - Missing-half bug on `p==v` when the cursor is at offset 0 fixed by clamping `adder` to [0, histogramwidth - span]. The old expression `barnumber + 1 - histogramwidth/(zoom*2)` was always negative for the default barnumber=0, causing the rendering loop to read `data[-N]` (segfault on large files, missing left half on small ones). Cursor visibility: - The cursor column is drawn as a CONTINUOUS vertical line connecting two plain markers at the top and bottom, ALWAYS exactly one character wide. The line itself uses the dedicated `wordhl` palette colour (default red background, configurable via `ec wordhl ...`), drawn on every chart row so the cursor is always a full-height vertical strip. The markers (`▼` at the top and `▲` at the bottom, or ASCII `v` / `^` when scr.utf8=false) are intentionally left un-highlighted so they read as a clean pair of arrows pointing at the cursor column. - The cursor screen column is computed up-front (j_cursor) by inverting the data-to-column map (rel * zoom * width / histogramwidth). Two distinct widening bugs are avoided this way: 1. sizeofonebar > 1 (high zoom) - each data index spans several screen columns; only j == j_cursor && kbar == 0 renders as the cursor, the remaining kbar columns fall through to the gradient. 2. histogramwidth < width (chart much wider than data) - several adjacent screen columns map to the same data index via integer truncation; only the j_cursor column may render as the cursor. Interactive keybindings & live config: - The `:` hotkey drops into rz_core_visual_prompt_input, matching the rest of Rizin's visual modes. Lets the user run arbitrary rizin commands without leaving the histogram. - The `?` help text now uses the same colour-coded format as the visual / visual-bit-editor modes (rz_core_visual_append_help with pal.args for keys and pal.help for descriptions), shown via rz_cons_less_str. - The config-driven opts (scr.hist.minimap, scr.hist.block, scr.utf8, scr.color, hex.offset) are re-read on every redraw via refresh_visual_opts_from_config, so `:` `e scr.hist.minimap=true` <Enter> takes effect immediately without having to quit and re-enter. The canvas's `color` field is refreshed alongside so `scr.color` changes take effect on the same redraw. Hex preview panel: - When the terminal is wide (hist->w > 200) and the minimap is enabled, the visual mode shows a two-line hex preview on the right of the minimap rows: 32 bytes at the cursor's file offset, formatted as 8 pairs of 2 bytes separated by spaces (`abcd ef00 1234 5678 ...`), matching `px 0x20` minus the header / offsets / ASCII column. The bytes are fetched live via rz_io_read_at_mapped each redraw, so moving the cursor (`h` / `l`) updates the preview. - Each byte gets its px-style colour code: green for 0x00, red for 0xff, yellow for 0x7f, btext (white) for printable ASCII, "other" (magenta) for non-printable. Mirrors rz_print_byte_color so the histogram preview reads consistently with `px`. - A trailing safety pad keeps the canvas from clipping the last hex byte of the first row (a side effect of UTF-8 minimap glyphs interacting with the canvas's width tracking when the row fills the canvas exactly). - Implemented via two new fields on RzHistogramInteractive (`cursor_bytes`, `cursor_bytes_len`) that the caller fills in just before the render call and clears right after. The minimap helper grows two extra parameters that the visual function passes through; when the panel is disabled (narrow terminal, no cursor_bytes, or shrinking the minimap would leave it < 40 cols) the helper falls back to the previous full-width minimap. Closes #4431 in full: - The negative-offset crash above is the immediate segfault from the bug report. - `print_histogram_bytes` now samples one byte per block instead of reading nblocks contiguous bytes from core->offset. For an 8 GB file shown across 80 bars the original code rendered the first 80 bytes of the file; the new code samples at offsets brange->from + i * blocksize so the chart represents the full span. - The inner `int i` in the column-aggregation loop is renamed to `k` to drop the shadow over the outer `size_t i`. Refactor on the cmd_print.c side: - New default_visual_opts(core, offset) returns an RZ_OWN RzHistogramOptions* pre-populated for the visual commands (ruler=true, minimap from scr.hist.minimap, offpos from caller, palette and screen-mode toggles from config via refresh_visual_opts_from_config). The nine print_visual_bytes call sites now build opts via this helper, then pass it to print_visual_bytes which takes ownership. Entropy sets value_max=8 / value_precision=1 / data_f=fdata so the visual histogram shows the Shannon range matching the static side. - `print_visual_bytes(core, opts, data, brange)` now propagates opts cleanup along every error path; rz_histogram_interactive_new no longer leaves a heap-allocated opts pointer dangling. The redraw loop fetches 32 cursor bytes via rz_io_read_at_mapped, points hist->cursor_bytes at a stack buffer for the call, then NULLs it back so the next iteration's fetch is independent. - RzHistogramInteractive gains `blocksize`, `cursor_bytes` and `cursor_bytes_len` fields. New config option: - `scr.hist.minimap` (bool, default true) controls whether the top minimap is shown for p==v / p==ev. Surfaces as `opts->minimap` and is honoured by `rz_histogram_interactive_horizontal`. When true, the minimap is ALWAYS rendered (provided there's room) - even when the chart already shows the full data, in which case the window indicator spans the whole map. Changes via `:` `e scr.hist.minimap=...` <Enter> are picked up on the very next redraw. Tests (33 total, 10 new for the visual side): - test_histogram_interactive_horizontal_basic - smoke test with barnumber=0 (pins the #4431 crash regression). - test_histogram_interactive_horizontal_ruler_percent - fractional labels with value_max=100 / value_scale=0.01 / unit="%". - test_histogram_interactive_horizontal_ruler_default - the legacy 0..255 byte ruler. - test_histogram_interactive_horizontal_no_negative_adder - covers `p==v` at offset 0 on a small data set. - test_histogram_interactive_horizontal_percent - status-line percent indicator present. - test_histogram_interactive_horizontal_cursor_markers - the ▼/▲ cursor markers (and ASCII v/^ fallback) appear on the cursor column, left un-highlighted. - test_histogram_interactive_horizontal_cursor_full_line - the cursor bar is rendered on every chart row between the markers regardless of the data threshold (continuous vertical line). - test_histogram_interactive_horizontal_cursor_width - pins single- char width across BOTH cursor-widening bugs: high zoom (sizeofonebar > 1) AND chart wider than data (histogramwidth < width). - test_histogram_interactive_horizontal_minimap_toggle - pins the scr.hist.minimap gating across {zoomed, not zoomed} when opts->minimap=true / =false. - test_histogram_interactive_horizontal_hex_preview - 4 cases: wide terminal + cursor_bytes shows the hex panel; narrow terminal suppresses it; missing cursor_bytes suppresses it; colour mode emits ANSI escape sequences for the bytes. Both p== integration tests in test/db/cmd/cmd_print pass with their regenerated EXPECT blocks (the per-block sampling change moves the visible bars for small buffers). Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
995 lines
43 KiB
Text
995 lines
43 KiB
Text
NAME=p2 hello-linux-x86_64
|
||
FILE=bins/elf/analysis/hello-linux-x86_64
|
||
CMDS=p2 16
|
||
EXPECT=<<EOF
|
||
----..==----##..
|
||
--==####..####..
|
||
==..##..------==
|
||
--==####..####--
|
||
==..==##--##==##
|
||
..----####--====
|
||
==..==..########
|
||
##..##==--==##--
|
||
EOF
|
||
RUN
|
||
|
||
NAME=p= various tests with malloc://
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e zoom.in=block
|
||
p=p" 1 " 1 EN
|
||
echo -------
|
||
b 2
|
||
wx 0xff
|
||
e zoom.in=block
|
||
p= 2 2@ 0
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x00000000 000 0000 |#
|
||
-------
|
||
0x00000000 000 00ff |###################################################
|
||
0x00000001 001 0000 |#
|
||
EOF
|
||
RUN
|
||
|
||
NAME=p=e 5
|
||
FILE=bins/elf/arm1.bin
|
||
CMDS=p=e 5@ 0
|
||
EXPECT=<<EOF
|
||
0x00000000 000 009f |########
|
||
0x0001bec1 001 00c3 |#
|
||
0x00037d82 002 00c3 |#
|
||
0x00053c43 003 00c3 |#######################################
|
||
0x0006fb04 004 0051 |################
|
||
EOF
|
||
RUN
|
||
|
||
NAME=p= tests
|
||
FILE=bins/elf/arm1.bin
|
||
ARGS=-n
|
||
CMDS=<<EOF
|
||
p=d @!10 @ 0
|
||
echo -------
|
||
p=r
|
||
echo -------
|
||
p=r 0.73 0.06
|
||
echo -------
|
||
p=rj 0.73 0.06
|
||
echo -------
|
||
p=rq 0.73 0.06
|
||
echo -------
|
||
p=rl 0.73 0.06
|
||
echo -------
|
||
p=rt 0.73 0.06
|
||
echo -------
|
||
p=p 5@ 0
|
||
echo -------
|
||
e zoom.in=block
|
||
p=e 5 0x100
|
||
echo -------
|
||
e zoom.in=block
|
||
p=e 5 0x100 1
|
||
echo -------
|
||
e zoom.in=block
|
||
p=p 5 0x100
|
||
echo -------
|
||
e zoom.in=block
|
||
p=p 5 0x100 1
|
||
EOF
|
||
EXPECT=<<EOF
|
||
min: 0 0x0
|
||
max: 127 0x7f
|
||
unique (count): 6 0x6
|
||
range (max-min): 127 0x7f
|
||
size (of block): 10 0xa
|
||
-------
|
||
0x00000000 Falling entropy edge
|
||
-------
|
||
0x00010a00 Rising entropy edge
|
||
0x00017200 Rising entropy edge
|
||
0x00017f00 Rising entropy edge
|
||
0x0004a800 Rising entropy edge
|
||
0x0005f000 Rising entropy edge
|
||
0x00063d00 Falling entropy edge
|
||
0x00064000 Falling entropy edge
|
||
0x0006cd00 Falling entropy edge
|
||
0x00070200 Rising entropy edge
|
||
0x00073200 Falling entropy edge
|
||
0x00074300 Falling entropy edge
|
||
-------
|
||
[{"addr":68096,"index":266,"edge_type":"rising entropy edge","entropy_value":0.730819},{"addr":94720,"index":370,"edge_type":"rising entropy edge","entropy_value":0.730736},{"addr":98048,"index":383,"edge_type":"rising entropy edge","entropy_value":0.733761},{"addr":305152,"index":1192,"edge_type":"rising entropy edge","entropy_value":0.730632},{"addr":389120,"index":1520,"edge_type":"rising entropy edge","entropy_value":0.757028},{"addr":408832,"index":1597,"edge_type":"falling entropy edge","entropy_value":0.042506},{"addr":409600,"index":1600,"edge_type":"falling entropy edge","entropy_value":0.000000},{"addr":445696,"index":1741,"edge_type":"falling entropy edge","entropy_value":0.058047},{"addr":459264,"index":1794,"edge_type":"rising entropy edge","entropy_value":0.760109},{"addr":471552,"index":1842,"edge_type":"falling entropy edge","entropy_value":0.000000},{"addr":475904,"index":1859,"edge_type":"falling entropy edge","entropy_value":0.024685}]
|
||
-------
|
||
0x00010a00
|
||
0x00017200
|
||
0x00017f00
|
||
0x0004a800
|
||
0x0005f000
|
||
0x00063d00
|
||
0x00064000
|
||
0x0006cd00
|
||
0x00070200
|
||
0x00073200
|
||
0x00074300
|
||
-------
|
||
0x00010a00 10a Rising entropy edge (0.730819)
|
||
0x00017200 172 Rising entropy edge (0.730736)
|
||
0x00017f00 17f Rising entropy edge (0.733761)
|
||
0x0004a800 4a8 Rising entropy edge (0.730632)
|
||
0x0005f000 5f0 Rising entropy edge (0.757028)
|
||
0x00063d00 63d Falling entropy edge (0.042506)
|
||
0x00064000 640 Falling entropy edge (0.000000)
|
||
0x0006cd00 6cd Falling entropy edge (0.058047)
|
||
0x00070200 702 Rising entropy edge (0.760109)
|
||
0x00073200 732 Falling entropy edge (0.000000)
|
||
0x00074300 743 Falling entropy edge (0.024685)
|
||
-------
|
||
addr index edge_type entropy_value
|
||
-------------------------------------------------
|
||
0x10a00 266 rising entropy edge 0.730819
|
||
0x17200 370 rising entropy edge 0.730736
|
||
0x17f00 383 rising entropy edge 0.733761
|
||
0x4a800 1192 rising entropy edge 0.730632
|
||
0x5f000 1520 rising entropy edge 0.757028
|
||
0x63d00 1597 falling entropy edge 0.042506
|
||
0x64000 1600 falling entropy edge 0.000000
|
||
0x6cd00 1741 falling entropy edge 0.058047
|
||
0x70200 1794 rising entropy edge 0.760109
|
||
0x73200 1842 falling entropy edge 0.000000
|
||
0x74300 1859 falling entropy edge 0.024685
|
||
-------
|
||
0x00000000 000 0032 |##########
|
||
0x0001bec1 001 0031 |#
|
||
0x00037d82 002 0035 |###
|
||
0x00053c43 003 0040 |###########
|
||
0x0006fb04 004 0076 |########################
|
||
-------
|
||
0x00000000 000 005a |##################
|
||
0x00000033 001 004c |###
|
||
0x00000066 002 0057 |#################
|
||
0x00000099 003 004b |###############
|
||
0x000000cc 004 0043 |##############
|
||
-------
|
||
0x00000000 000 004c |###
|
||
0x00000033 001 0057 |#################
|
||
0x00000066 002 004b |###############
|
||
0x00000099 003 0043 |#############
|
||
0x000000cc 004 003f |#############
|
||
-------
|
||
0x00000000 000 0032 |#########
|
||
0x00000033 001 0019 |#
|
||
0x00000066 002 001e |#
|
||
0x00000099 003 001e |##
|
||
0x000000cc 004 0028 |########
|
||
-------
|
||
0x00000000 000 0019 |#
|
||
0x00000033 001 001e |#
|
||
0x00000066 002 001e |##
|
||
0x00000099 003 0028 |#######
|
||
0x000000cc 004 001e |######
|
||
EOF
|
||
RUN
|
||
|
||
NAME=ppd/ endianness
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e asm.arch=arm
|
||
e cfg.bigendian=false
|
||
ppd/ 0x41574141
|
||
e cfg.bigendian=true
|
||
ppd/ 0x41574141
|
||
EOF
|
||
EXPECT=<<EOF
|
||
64
|
||
65
|
||
EOF
|
||
RUN
|
||
|
||
NAME=p8 10
|
||
FILE=malloc://1024
|
||
CMDS=wx 90909090909090909090 ; p8 10
|
||
EXPECT=<<EOF
|
||
90909090909090909090
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi 3
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f
|
||
pi 3
|
||
EOF
|
||
EXPECT=<<EOF
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0xa
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pia output
|
||
FILE=bins/elf/analysis/hello-linux-x86_64
|
||
CMDS=<<EOF
|
||
pia 10
|
||
EOF
|
||
EXPECT=<<EOF
|
||
xor ebp, ebp
|
||
in eax, dx
|
||
mov r9, rdx
|
||
mov ecx, edx
|
||
rcr dword [rsi+0x48], 0x01
|
||
pop rsi
|
||
mov rdx, rsp
|
||
mov edx, esp
|
||
loop 0x400462
|
||
invalid
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pdj 3
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f
|
||
pdj 3
|
||
EOF
|
||
EXPECT=<<EOF
|
||
[{"offset":0,"val":1,"esil":"1,rax,=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":5,"opcode":"mov eax, 0x01","disasm":"mov eax, 0x01","bytes":"b801000000","family":"cpu","type":"mov","reloc":false,"type_num":9,"type2_num":0},{"offset":5,"esil":"rcx,rdx,==,$z,zf,:=,64,$b,cf,:=,$p,pf,:=,63,$s,sf,:=,rcx,0x8000000000000000,-,!,63,$o,^,of,:=,3,$b,af,:=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":3,"opcode":"cmp rdx, rcx","disasm":"cmp rdx, rcx","bytes":"4839ca","family":"cpu","type":"cmp","reloc":false,"type_num":15,"type2_num":0},{"offset":8,"esil":"sf,of,!,^,zf,!,&,?{,10,rip,=,}","refptr":false,"fcn_addr":0,"fcn_last":0,"size":2,"opcode":"jnle 0xa","disasm":"jnle 0xa","bytes":"7f00","family":"cpu","type":"cjmp","reloc":false,"type_num":2147483649,"type2_num":0,"jump":10,"fail":10}]
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi 6
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f00b8010000004839ca7f00
|
||
pi 6
|
||
EOF
|
||
EXPECT=<<EOF
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0xa
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0x14
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi -5 @ 0x0040050f
|
||
FILE=bins/elf/analysis/main
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
pi -5 @ 0x0040050f
|
||
echo -------
|
||
pdj -3 @ 0x0040050f
|
||
echo -------
|
||
s 0x0040050f
|
||
pi -5
|
||
echo -------
|
||
aaa
|
||
pi -5 @ 0x0040050f
|
||
EOF
|
||
EXPECT=<<EOF
|
||
pop rbp
|
||
jmp sym.register_tm_clones
|
||
push rbp
|
||
mov rbp, rsp
|
||
mov edi, str.Hello_World
|
||
-------
|
||
[{"offset":4195590,"esil":"rbp,8,rsp,-,=[8],8,rsp,-=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":1,"opcode":"push rbp","disasm":"push rbp","bytes":"55","family":"cpu","type":"rpush","reloc":false,"type_num":268435468,"type2_num":0,"flags":["main","sym.main"]},{"offset":4195591,"esil":"rsp,rbp,=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":3,"opcode":"mov rbp, rsp","disasm":"mov rbp, rsp","bytes":"4889e5","family":"cpu","type":"mov","reloc":false,"type_num":9,"type2_num":0},{"offset":4195594,"ptr":4195780,"val":4195780,"esil":"4195780,rdi,=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":5,"opcode":"mov edi, 0x4005c4","disasm":"mov edi, str.Hello_World","bytes":"bfc4054000","family":"cpu","type":"mov","reloc":false,"type_num":9,"type2_num":0}]
|
||
-------
|
||
pop rbp
|
||
jmp sym.register_tm_clones
|
||
push rbp
|
||
mov rbp, rsp
|
||
mov edi, str.Hello_World
|
||
-------
|
||
pop rbp
|
||
jmp sym.register_tm_clones
|
||
push rbp
|
||
mov rbp, rsp
|
||
mov edi, str.Hello_World
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pif bsz
|
||
FILE=malloc://1024
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx 5b415c415d415e415f5dc3
|
||
af
|
||
b 2
|
||
pif
|
||
EOF
|
||
EXPECT=<<EOF
|
||
pop rbx
|
||
pop r12
|
||
pop r13
|
||
pop r14
|
||
pop r15
|
||
pop rbp
|
||
ret
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi~?
|
||
FILE=malloc://1024
|
||
CMDS=<<EOF
|
||
pi 200~?
|
||
pi 200~?
|
||
pd 200~?
|
||
EOF
|
||
EXPECT=<<EOF
|
||
200
|
||
200
|
||
200
|
||
EOF
|
||
RUN
|
||
|
||
NAME=tmpbits
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
p8 1 @b:32
|
||
e asm.bits
|
||
EOF
|
||
EXPECT=<<EOF
|
||
00
|
||
64
|
||
EOF
|
||
RUN
|
||
|
||
NAME=tmpbits
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=32
|
||
p8 1 @b:64
|
||
e asm.bits
|
||
EOF
|
||
EXPECT=<<EOF
|
||
00
|
||
32
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi 3
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f
|
||
pi 3
|
||
EOF
|
||
EXPECT=<<EOF
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0xa
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pdj 3 (2)
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f
|
||
pdj 3
|
||
EOF
|
||
EXPECT=<<EOF
|
||
[{"offset":0,"val":1,"esil":"1,rax,=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":5,"opcode":"mov eax, 0x01","disasm":"mov eax, 0x01","bytes":"b801000000","family":"cpu","type":"mov","reloc":false,"type_num":9,"type2_num":0},{"offset":5,"esil":"rcx,rdx,==,$z,zf,:=,64,$b,cf,:=,$p,pf,:=,63,$s,sf,:=,rcx,0x8000000000000000,-,!,63,$o,^,of,:=,3,$b,af,:=","refptr":false,"fcn_addr":0,"fcn_last":0,"size":3,"opcode":"cmp rdx, rcx","disasm":"cmp rdx, rcx","bytes":"4839ca","family":"cpu","type":"cmp","reloc":false,"type_num":15,"type2_num":0},{"offset":8,"esil":"sf,of,!,^,zf,!,&,?{,10,rip,=,}","refptr":false,"fcn_addr":0,"fcn_last":0,"size":2,"opcode":"jnle 0xa","disasm":"jnle 0xa","bytes":"7f00","family":"cpu","type":"cjmp","reloc":false,"type_num":2147483649,"type2_num":0,"jump":10,"fail":10}]
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi 6
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f00b8010000004839ca7f00
|
||
pi 6
|
||
EOF
|
||
EXPECT=<<EOF
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0xa
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0x14
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi -3 @ 10
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f00
|
||
pi -3 @ 10
|
||
EOF
|
||
EXPECT=<<EOF
|
||
mov eax, 0x01
|
||
cmp rdx, rcx
|
||
jnle 0xa
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pdj -3 @ 10
|
||
FILE=malloc://512
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx b8010000004839ca7f00
|
||
pdj -3 @ 10~{}
|
||
EOF
|
||
EXPECT=<<EOF
|
||
[
|
||
{
|
||
"offset": 0,
|
||
"val": 1,
|
||
"esil": "1,rax,=",
|
||
"refptr": false,
|
||
"fcn_addr": 0,
|
||
"fcn_last": 0,
|
||
"size": 5,
|
||
"opcode": "mov eax, 0x01",
|
||
"disasm": "mov eax, 0x01",
|
||
"bytes": "b801000000",
|
||
"family": "cpu",
|
||
"type": "mov",
|
||
"reloc": false,
|
||
"type_num": 9,
|
||
"type2_num": 0
|
||
},
|
||
{
|
||
"offset": 5,
|
||
"esil": "rcx,rdx,==,$z,zf,:=,64,$b,cf,:=,$p,pf,:=,63,$s,sf,:=,rcx,0x8000000000000000,-,!,63,$o,^,of,:=,3,$b,af,:=",
|
||
"refptr": false,
|
||
"fcn_addr": 0,
|
||
"fcn_last": 0,
|
||
"size": 3,
|
||
"opcode": "cmp rdx, rcx",
|
||
"disasm": "cmp rdx, rcx",
|
||
"bytes": "4839ca",
|
||
"family": "cpu",
|
||
"type": "cmp",
|
||
"reloc": false,
|
||
"type_num": 15,
|
||
"type2_num": 0
|
||
},
|
||
{
|
||
"offset": 8,
|
||
"esil": "sf,of,!,^,zf,!,&,?{,10,rip,=,}",
|
||
"refptr": false,
|
||
"fcn_addr": 0,
|
||
"fcn_last": 0,
|
||
"size": 2,
|
||
"opcode": "jnle 0xa",
|
||
"disasm": "jnle 0xa",
|
||
"bytes": "7f00",
|
||
"family": "cpu",
|
||
"type": "cjmp",
|
||
"reloc": false,
|
||
"type_num": 2147483649,
|
||
"type2_num": 0,
|
||
"jump": 10,
|
||
"fail": 10
|
||
}
|
||
]
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi -10
|
||
FILE=malloc://1024
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx 90909090909090909090 ; s 10 ; pi -10
|
||
EOF
|
||
EXPECT=<<EOF
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pif bsz
|
||
FILE=malloc://1024
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx 5b415c415d415e415f5dc3
|
||
af
|
||
b 2
|
||
pif
|
||
EOF
|
||
EXPECT=<<EOF
|
||
pop rbx
|
||
pop r12
|
||
pop r13
|
||
pop r14
|
||
pop r15
|
||
pop rbp
|
||
ret
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pi~?
|
||
FILE=malloc://1024
|
||
CMDS=<<EOF
|
||
pi 200~?
|
||
pi 200~?
|
||
pd 200~?
|
||
EOF
|
||
EXPECT=<<EOF
|
||
200
|
||
200
|
||
200
|
||
EOF
|
||
RUN
|
||
|
||
NAME=tmpbits
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
p8 1 @b:32
|
||
e asm.bits
|
||
e asm.bits=32
|
||
p8 1 @b:64
|
||
e asm.bits
|
||
EOF
|
||
EXPECT=<<EOF
|
||
00
|
||
64
|
||
00
|
||
32
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm olf
|
||
FILE=bins/elf/ioli/crackme0x00
|
||
ARGS=-n
|
||
CMDS=pm bins/src/olf.magic
|
||
EXPECT=<<EOF
|
||
0x00000000 OLF 32-bit LSB
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm lzma
|
||
FILE=bins/other/hello-world.lzma
|
||
CMDS=<<EOF
|
||
pm
|
||
pmj
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x00000000 LZMA BE compressed data dictionary size: 32768 bytes,
|
||
[{"address":0,"magic":"LZMA BE compressed data dictionary size: 32768 bytes,"}]
|
||
EOF
|
||
EXPECT_ERR=
|
||
RUN
|
||
|
||
NAME=pm hello.c
|
||
FILE=bins/src/hello.c
|
||
CMDS=pm
|
||
EXPECT=<<EOF
|
||
0x00000000 C source code
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm elf/main
|
||
FILE=bins/elf/analysis/main
|
||
ARGS=-n
|
||
CMDS=<<EOF
|
||
pm
|
||
pmj
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x00000000 ELF 64-bit LSB executable, x86-64, version 1
|
||
[{"address":0,"magic":"ELF 64-bit LSB executable, x86-64, version 1"}]
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm mach0/fatmach0-3true
|
||
FILE=bins/mach0/fatmach0-3true
|
||
ARGS=-n
|
||
CMDS=pm
|
||
EXPECT=<<EOF
|
||
0x00000000 Fat-Mach-O version 3.0 Mach-O fat file with 3 architectures
|
||
0x00001000 Mach-O
|
||
0x00003140 MacOS Deteched Code Signature
|
||
0x00005000 Mach-O
|
||
0x00007120 MacOS Deteched Code Signature
|
||
0x00009000 Mach-O
|
||
0x0000b060 MacOS Deteched Code Signature
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm perl/exam.pm
|
||
FILE=bins/perl/exam.pm
|
||
ARGS=-n
|
||
CMDS=pm
|
||
EXPECT=<<EOF
|
||
0x00000000 Perl5 module source text
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm perl/exam.pl
|
||
FILE=bins/perl/exam.pl
|
||
ARGS=-n
|
||
CMDS=pm
|
||
EXPECT=<<EOF
|
||
0x00000000 Perl script text executable
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm java/Hello.class
|
||
FILE=bins/java/Hello.class
|
||
ARGS=-n
|
||
CMDS=pm
|
||
EXPECT=<<EOF
|
||
0x00000000 Java CLASS
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pm pe/a.exe
|
||
FILE=bins/pe/a.exe
|
||
ARGS=-n
|
||
CMDS=pm
|
||
EXPECT=<<EOF
|
||
0x00000000 PE for MS Windows (console) Intel 80386 32-bit
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pib from beginning of bb & inside bb
|
||
FILE=bins/elf/analysis/x64-loop
|
||
CMDS=<<EOF
|
||
s main
|
||
af
|
||
pib
|
||
echo -------
|
||
so 2
|
||
pib
|
||
EOF
|
||
EXPECT=<<EOF
|
||
push rbp
|
||
mov rbp, rsp
|
||
sub rsp, 0x20
|
||
mov dword [var_1ch], edi
|
||
mov qword [var_28h], rsi
|
||
mov dword [var_ch], 0x00
|
||
jmp 0x400523
|
||
-------
|
||
sub rsp, 0x20
|
||
mov dword [var_1ch], edi
|
||
mov qword [var_28h], rsi
|
||
mov dword [var_ch], 0x00
|
||
jmp 0x400523
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pI size > bocksize
|
||
FILE=malloc://1024
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
wx 90909090909090909090
|
||
b 1
|
||
pI 10
|
||
EOF
|
||
EXPECT=<<EOF
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
nop
|
||
EOF
|
||
RUN
|
||
|
||
NAME=psW 32 utf32le & psM 32 utf32be
|
||
FILE=bins/elf/crackme0x00b
|
||
CMDS=<<EOF
|
||
psW @ obj.pass.1964
|
||
echo --------
|
||
psM @ 0x0804a03d
|
||
EOF
|
||
EXPECT=<<EOF
|
||
w0wgreat
|
||
--------
|
||
w0wgreat
|
||
EOF
|
||
RUN
|
||
|
||
NAME=io.unalloc, io.unalloc.ch and prc
|
||
FILE=bins/elf/analysis/tiny.elf
|
||
CMDS=<<EOF
|
||
. scripts/palette.rz
|
||
(print; prc 0x00010032-0x0000fffa @ 0x0000fffa)
|
||
e io.unalloc=true
|
||
e scr.color=0
|
||
.(print)
|
||
echo
|
||
e io.unalloc.ch=-
|
||
.(print)
|
||
echo
|
||
e scr.color=3
|
||
e io.unalloc.ch=
|
||
.(print)
|
||
echo
|
||
e io.unalloc.ch=?
|
||
.(print)
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x0000fffa ????????????se,,,,,,
|
||
0x0001000a .. ..
|
||
0x0001001a en....OO,,OO;; ..
|
||
0x0001002a .. ##########
|
||
|
||
0x0000fffa ------------se,,,,,,
|
||
0x0001000a .. ..
|
||
0x0001001a en....OO,,OO;; ..
|
||
0x0001002a .. ##########
|
||
|
||
[38;2;19;161;14m0x0000fffa[0m [0m..[0m..[0m..[0m..[0m..[0m..[38;2;0;0;0m[48;2;149;254;184m[38;2;0;0;0mse[38;2;0;0;0m[48;2;103;155;0m[38;2;0;0;0m [38;2;0;0;0m[48;2;192;255;67m[38;2;0;0;0m [38;2;0;0;0m[48;2;117;176;0m[38;2;0;0;0m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [0m
|
||
[38;2;19;161;14m0x0001000a[0m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;100;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;117;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [0m
|
||
[38;2;19;161;14m0x0001001a[0m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;135;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;29;117m[38;2;240;240;240men[38;2;0;0;0m[48;2;255;195;15m[38;2;0;0;0m [38;2;240;240;240m[48;2;86;86;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;25;0;76m[38;2;240;240;240m [38;2;240;240;240m[48;2;50;76;0m[38;2;240;240;240m [38;2;0;0;0m[48;2;147;94;255m[38;2;0;0;0m [38;2;240;240;240m[48;2;0;76;76m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;0;0;0m[48;2;135;135;0m[38;2;0;0;0m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [0m
|
||
[38;2;19;161;14m0x0001002a[0m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [0m
|
||
|
||
[38;2;19;161;14m0x0000fffa[0m [0m??[0m??[0m??[0m??[0m??[0m??[38;2;0;0;0m[48;2;149;254;184m[38;2;0;0;0mse[38;2;0;0;0m[48;2;103;155;0m[38;2;0;0;0m [38;2;0;0;0m[48;2;192;255;67m[38;2;0;0;0m [38;2;0;0;0m[48;2;117;176;0m[38;2;0;0;0m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [0m
|
||
[38;2;19;161;14m0x0001000a[0m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;100;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;117;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [0m
|
||
[38;2;19;161;14m0x0001001a[0m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;135;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;29;117m[38;2;240;240;240men[38;2;0;0;0m[48;2;255;195;15m[38;2;0;0;0m [38;2;240;240;240m[48;2;86;86;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;25;0;76m[38;2;240;240;240m [38;2;240;240;240m[48;2;50;76;0m[38;2;240;240;240m [38;2;0;0;0m[48;2;147;94;255m[38;2;0;0;0m [38;2;240;240;240m[48;2;0;76;76m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;0;0;0m[48;2;135;135;0m[38;2;0;0;0m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [0m
|
||
[38;2;19;161;14m0x0001002a[0m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m [38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0m [0m
|
||
EOF
|
||
RUN
|
||
|
||
NAME=prc text color
|
||
FILE==
|
||
CMDS=<<EOF
|
||
. scripts/palette.rz
|
||
woe 0 0xff 1
|
||
(test_flag; f `p8 1`)
|
||
.(test_flag) @@s:0 0x100 1
|
||
e scr.color=3
|
||
prc 256
|
||
EOF
|
||
EXPECT=<<EOF
|
||
[38;2;19;161;14m0x00000000[0m [38;2;240;240;240m[48;2;0;0;0m[38;2;240;240;240m00[38;2;240;240;240m[48;2;86;0;0m[38;2;240;240;240m01[38;2;240;240;240m[48;2;100;0;0m[38;2;240;240;240m02[38;2;240;240;240m[48;2;117;0;0m[38;2;240;240;240m03[38;2;240;240;240m[48;2;135;0;0m[38;2;240;240;240m04[38;2;240;240;240m[48;2;155;0;0m[38;2;240;240;240m05[38;2;240;240;240m[48;2;176;0;0m[38;2;240;240;240m06[38;2;240;240;240m[48;2;198;0;0m[38;2;240;240;240m07[38;2;240;240;240m[48;2;221;0;0m[38;2;240;240;240m08[38;2;240;240;240m[48;2;245;0;0m[38;2;240;240;240m09[38;2;240;240;240m[48;2;255;15;15m[38;2;240;240;240m0a[38;2;240;240;240m[48;2;255;40;40m[38;2;240;240;240m0b[38;2;0;0;0m[48;2;255;67;67m[38;2;0;0;0m0c[38;2;0;0;0m[48;2;255;94;94m[38;2;0;0;0m0d[38;2;0;0;0m[48;2;255;121;121m[38;2;0;0;0m0e[38;2;0;0;0m[48;2;254;149;149m[38;2;0;0;0m0f[0m
|
||
[38;2;19;161;14m0x00000010[0m [38;2;240;240;240m[48;2;76;22;0m[38;2;240;240;240m10[38;2;240;240;240m[48;2;86;25;0m[38;2;240;240;240m11[38;2;240;240;240m[48;2;100;30;0m[38;2;240;240;240m12[38;2;240;240;240m[48;2;117;35;0m[38;2;240;240;240m13[38;2;240;240;240m[48;2;135;40;0m[38;2;240;240;240m14[38;2;240;240;240m[48;2;155;46;0m[38;2;240;240;240m15[38;2;240;240;240m[48;2;176;52;0m[38;2;240;240;240m16[38;2;240;240;240m[48;2;198;59;0m[38;2;240;240;240m17[38;2;240;240;240m[48;2;221;66;0m[38;2;240;240;240m18[38;2;0;0;0m[48;2;245;73;0m[38;2;0;0;0m19[38;2;0;0;0m[48;2;255;87;15m[38;2;0;0;0m1a[38;2;0;0;0m[48;2;255;105;40m[38;2;0;0;0m1b[38;2;0;0;0m[48;2;255;123;67m[38;2;0;0;0m1c[38;2;0;0;0m[48;2;255;142;94m[38;2;0;0;0m1d[38;2;0;0;0m[48;2;255;161;121m[38;2;0;0;0m1e[38;2;0;0;0m[48;2;254;181;149m[38;2;0;0;0m1f[0m
|
||
[38;2;19;161;14m0x00000020[0m [38;2;240;240;240m[48;2;76;57;0m[38;2;240;240;240m20[38;2;240;240;240m[48;2;86;64;0m[38;2;240;240;240m21[38;2;240;240;240m[48;2;100;75;0m[38;2;240;240;240m22[38;2;240;240;240m[48;2;117;87;0m[38;2;240;240;240m23[38;2;240;240;240m[48;2;135;101;0m[38;2;240;240;240m24[38;2;0;0;0m[48;2;155;116;0m[38;2;0;0;0m25[38;2;0;0;0m[48;2;176;132;0m[38;2;0;0;0m26[38;2;0;0;0m[48;2;198;148;0m[38;2;0;0;0m27[38;2;0;0;0m[48;2;221;166;0m[38;2;0;0;0m28[38;2;0;0;0m[48;2;245;184;0m[38;2;0;0;0m29[38;2;0;0;0m[48;2;255;195;15m[38;2;0;0;0m2a[38;2;0;0;0m[48;2;255;201;40m[38;2;0;0;0m2b[38;2;0;0;0m[48;2;255;208;67m[38;2;0;0;0m2c[38;2;0;0;0m[48;2;255;214;94m[38;2;0;0;0m2d[38;2;0;0;0m[48;2;255;221;121m[38;2;0;0;0m2e[38;2;0;0;0m[48;2;254;228;149m[38;2;0;0;0m2f[0m
|
||
[38;2;19;161;14m0x00000030[0m [38;2;240;240;240m[48;2;76;76;0m[38;2;240;240;240m30[38;2;240;240;240m[48;2;86;86;0m[38;2;240;240;240m31[38;2;240;240;240m[48;2;100;100;0m[38;2;240;240;240m32[38;2;240;240;240m[48;2;117;117;0m[38;2;240;240;240m33[38;2;0;0;0m[48;2;135;135;0m[38;2;0;0;0m34[38;2;0;0;0m[48;2;155;155;0m[38;2;0;0;0m35[38;2;0;0;0m[48;2;176;176;0m[38;2;0;0;0m36[38;2;0;0;0m[48;2;198;198;0m[38;2;0;0;0m37[38;2;0;0;0m[48;2;221;221;0m[38;2;0;0;0m38[38;2;0;0;0m[48;2;245;245;0m[38;2;0;0;0m39[38;2;0;0;0m[48;2;255;255;15m[38;2;0;0;0m3a[38;2;0;0;0m[48;2;255;255;40m[38;2;0;0;0m3b[38;2;0;0;0m[48;2;255;255;67m[38;2;0;0;0m3c[38;2;0;0;0m[48;2;255;255;94m[38;2;0;0;0m3d[38;2;0;0;0m[48;2;255;255;121m[38;2;0;0;0m3e[38;2;0;0;0m[48;2;255;254;149m[38;2;0;0;0m3f[0m
|
||
[38;2;19;161;14m0x00000040[0m [38;2;240;240;240m[48;2;50;76;0m[38;2;240;240;240m40[38;2;240;240;240m[48;2;57;86;0m[38;2;240;240;240m41[38;2;240;240;240m[48;2;66;100;0m[38;2;240;240;240m42[38;2;240;240;240m[48;2;78;117;0m[38;2;240;240;240m43[38;2;240;240;240m[48;2;90;135;0m[38;2;240;240;240m44[38;2;0;0;0m[48;2;103;155;0m[38;2;0;0;0m45[38;2;0;0;0m[48;2;117;176;0m[38;2;0;0;0m46[38;2;0;0;0m[48;2;132;198;0m[38;2;0;0;0m47[38;2;0;0;0m[48;2;147;221;0m[38;2;0;0;0m48[38;2;0;0;0m[48;2;163;245;0m[38;2;0;0;0m49[38;2;0;0;0m[48;2;175;255;15m[38;2;0;0;0m4a[38;2;0;0;0m[48;2;183;255;40m[38;2;0;0;0m4b[38;2;0;0;0m[48;2;192;255;67m[38;2;0;0;0m4c[38;2;0;0;0m[48;2;201;255;94m[38;2;0;0;0m4d[38;2;0;0;0m[48;2;210;255;121m[38;2;0;0;0m4e[38;2;0;0;0m[48;2;219;254;149m[38;2;0;0;0m4f[0m
|
||
[38;2;19;161;14m0x00000050[0m [38;2;240;240;240m[48;2;31;76;0m[38;2;240;240;240m50[38;2;240;240;240m[48;2;35;86;0m[38;2;240;240;240m51[38;2;240;240;240m[48;2;41;100;0m[38;2;240;240;240m52[38;2;240;240;240m[48;2;48;117;0m[38;2;240;240;240m53[38;2;240;240;240m[48;2;56;135;0m[38;2;240;240;240m54[38;2;240;240;240m[48;2;64;155;0m[38;2;240;240;240m55[38;2;0;0;0m[48;2;73;176;0m[38;2;0;0;0m56[38;2;0;0;0m[48;2;82;198;0m[38;2;0;0;0m57[38;2;0;0;0m[48;2;92;221;0m[38;2;0;0;0m58[38;2;0;0;0m[48;2;102;245;0m[38;2;0;0;0m59[38;2;0;0;0m[48;2;115;255;15m[38;2;0;0;0m5a[38;2;0;0;0m[48;2;130;255;40m[38;2;0;0;0m5b[38;2;0;0;0m[48;2;145;255;67m[38;2;0;0;0m5c[38;2;0;0;0m[48;2;161;255;94m[38;2;0;0;0m5d[38;2;0;0;0m[48;2;177;255;121m[38;2;0;0;0m5e[38;2;0;0;0m[48;2;193;254;149m[38;2;0;0;0m5f[0m
|
||
[38;2;19;161;14m0x00000060[0m [38;2;240;240;240m[48;2;0;76;0m[38;2;240;240;240m60[38;2;240;240;240m[48;2;0;86;0m[38;2;240;240;240m61[38;2;240;240;240m[48;2;0;100;0m[38;2;240;240;240m62[38;2;240;240;240m[48;2;0;117;0m[38;2;240;240;240m63[38;2;240;240;240m[48;2;0;135;0m[38;2;240;240;240m64[38;2;240;240;240m[48;2;0;155;0m[38;2;240;240;240m65[38;2;240;240;240m[48;2;0;176;0m[38;2;240;240;240m66[38;2;0;0;0m[48;2;0;198;0m[38;2;0;0;0m67[38;2;0;0;0m[48;2;0;221;0m[38;2;0;0;0m68[38;2;0;0;0m[48;2;0;245;0m[38;2;0;0;0m69[38;2;0;0;0m[48;2;15;255;15m[38;2;0;0;0m6a[38;2;0;0;0m[48;2;40;255;40m[38;2;0;0;0m6b[38;2;0;0;0m[48;2;67;255;67m[38;2;0;0;0m6c[38;2;0;0;0m[48;2;94;255;94m[38;2;0;0;0m6d[38;2;0;0;0m[48;2;121;255;121m[38;2;0;0;0m6e[38;2;0;0;0m[48;2;149;254;149m[38;2;0;0;0m6f[0m
|
||
[38;2;19;161;14m0x00000070[0m [38;2;240;240;240m[48;2;0;76;25m[38;2;240;240;240m70[38;2;240;240;240m[48;2;0;86;28m[38;2;240;240;240m71[38;2;240;240;240m[48;2;0;100;33m[38;2;240;240;240m72[38;2;240;240;240m[48;2;0;117;39m[38;2;240;240;240m73[38;2;240;240;240m[48;2;0;135;45m[38;2;240;240;240m74[38;2;240;240;240m[48;2;0;155;51m[38;2;240;240;240m75[38;2;240;240;240m[48;2;0;176;58m[38;2;240;240;240m76[38;2;0;0;0m[48;2;0;198;66m[38;2;0;0;0m77[38;2;0;0;0m[48;2;0;221;73m[38;2;0;0;0m78[38;2;0;0;0m[48;2;0;245;81m[38;2;0;0;0m79[38;2;0;0;0m[48;2;15;255;95m[38;2;0;0;0m7a[38;2;0;0;0m[48;2;40;255;112m[38;2;0;0;0m7b[38;2;0;0;0m[48;2;67;255;129m[38;2;0;0;0m7c[38;2;0;0;0m[48;2;94;255;147m[38;2;0;0;0m7d[38;2;0;0;0m[48;2;121;255;166m[38;2;0;0;0m7e[38;2;0;0;0m[48;2;149;254;184m[38;2;0;0;0m7f[0m
|
||
[38;2;19;161;14m0x00000080[0m [38;2;240;240;240m[48;2;0;76;76m[38;2;240;240;240m80[38;2;240;240;240m[48;2;0;86;86m[38;2;240;240;240m81[38;2;240;240;240m[48;2;0;100;100m[38;2;240;240;240m82[38;2;240;240;240m[48;2;0;117;117m[38;2;240;240;240m83[38;2;240;240;240m[48;2;0;135;135m[38;2;240;240;240m84[38;2;240;240;240m[48;2;0;155;155m[38;2;240;240;240m85[38;2;0;0;0m[48;2;0;176;176m[38;2;0;0;0m86[38;2;0;0;0m[48;2;0;198;198m[38;2;0;0;0m87[38;2;0;0;0m[48;2;0;221;221m[38;2;0;0;0m88[38;2;0;0;0m[48;2;0;245;245m[38;2;0;0;0m89[38;2;0;0;0m[48;2;15;255;254m[38;2;0;0;0m8a[38;2;0;0;0m[48;2;40;255;254m[38;2;0;0;0m8b[38;2;0;0;0m[48;2;67;255;254m[38;2;0;0;0m8c[38;2;0;0;0m[48;2;94;255;254m[38;2;0;0;0m8d[38;2;0;0;0m[48;2;121;255;255m[38;2;0;0;0m8e[38;2;0;0;0m[48;2;149;255;254m[38;2;0;0;0m8f[0m
|
||
[38;2;19;161;14m0x00000090[0m [38;2;240;240;240m[48;2;0;57;76m[38;2;240;240;240m90[38;2;240;240;240m[48;2;0;64;86m[38;2;240;240;240m91[38;2;240;240;240m[48;2;0;75;100m[38;2;240;240;240m92[38;2;240;240;240m[48;2;0;87;117m[38;2;240;240;240m93[38;2;240;240;240m[48;2;0;101;135m[38;2;240;240;240m94[38;2;240;240;240m[48;2;0;116;155m[38;2;240;240;240m95[38;2;240;240;240m[48;2;0;132;176m[38;2;240;240;240m96[38;2;240;240;240m[48;2;0;148;198m[38;2;240;240;240m97[38;2;0;0;0m[48;2;0;166;221m[38;2;0;0;0m98[38;2;0;0;0m[48;2;0;184;245m[38;2;0;0;0m99[38;2;0;0;0m[48;2;15;195;255m[38;2;0;0;0m9a[38;2;0;0;0m[48;2;40;201;255m[38;2;0;0;0m9b[38;2;0;0;0m[48;2;67;208;255m[38;2;0;0;0m9c[38;2;0;0;0m[48;2;94;214;255m[38;2;0;0;0m9d[38;2;0;0;0m[48;2;121;221;255m[38;2;0;0;0m9e[38;2;0;0;0m[48;2;149;228;254m[38;2;0;0;0m9f[0m
|
||
[38;2;19;161;14m0x000000a0[0m [38;2;240;240;240m[48;2;0;38;76m[38;2;240;240;240ma0[38;2;240;240;240m[48;2;0;43;86m[38;2;240;240;240ma1[38;2;240;240;240m[48;2;0;50;100m[38;2;240;240;240ma2[38;2;240;240;240m[48;2;0;58;117m[38;2;240;240;240ma3[38;2;240;240;240m[48;2;0;67;135m[38;2;240;240;240ma4[38;2;240;240;240m[48;2;0;77;155m[38;2;240;240;240ma5[38;2;240;240;240m[48;2;0;88;176m[38;2;240;240;240ma6[38;2;240;240;240m[48;2;0;99;198m[38;2;240;240;240ma7[38;2;240;240;240m[48;2;0;110;221m[38;2;240;240;240ma8[38;2;240;240;240m[48;2;0;122;245m[38;2;240;240;240ma9[38;2;240;240;240m[48;2;15;135;255m[38;2;240;240;240maa[38;2;0;0;0m[48;2;40;147;255m[38;2;0;0;0mab[38;2;0;0;0m[48;2;67;161;255m[38;2;0;0;0mac[38;2;0;0;0m[48;2;94;174;255m[38;2;0;0;0mad[38;2;0;0;0m[48;2;121;188;255m[38;2;0;0;0mae[38;2;0;0;0m[48;2;149;202;254m[38;2;0;0;0maf[0m
|
||
[38;2;19;161;14m0x000000b0[0m [38;2;240;240;240m[48;2;0;19;76m[38;2;240;240;240mb0[38;2;240;240;240m[48;2;0;21;86m[38;2;240;240;240mb1[38;2;240;240;240m[48;2;0;25;100m[38;2;240;240;240mb2[38;2;240;240;240m[48;2;0;29;117m[38;2;240;240;240mb3[38;2;240;240;240m[48;2;0;33;135m[38;2;240;240;240mb4[38;2;240;240;240m[48;2;0;38;155m[38;2;240;240;240mb5[38;2;240;240;240m[48;2;0;44;176m[38;2;240;240;240mb6[38;2;240;240;240m[48;2;0;49;198m[38;2;240;240;240mb7[38;2;240;240;240m[48;2;0;55;221m[38;2;240;240;240mb8[38;2;240;240;240m[48;2;0;61;245m[38;2;240;240;240mb9[38;2;240;240;240m[48;2;15;75;255m[38;2;240;240;240mba[38;2;240;240;240m[48;2;40;94;255m[38;2;240;240;240mbb[38;2;240;240;240m[48;2;67;114;255m[38;2;240;240;240mbc[38;2;0;0;0m[48;2;94;134;255m[38;2;0;0;0mbd[38;2;0;0;0m[48;2;121;154;255m[38;2;0;0;0mbe[38;2;0;0;0m[48;2;149;176;254m[38;2;0;0;0mbf[0m
|
||
[38;2;19;161;14m0x000000c0[0m [38;2;240;240;240m[48;2;25;0;76m[38;2;240;240;240mc0[38;2;240;240;240m[48;2;28;0;86m[38;2;240;240;240mc1[38;2;240;240;240m[48;2;33;0;100m[38;2;240;240;240mc2[38;2;240;240;240m[48;2;39;0;117m[38;2;240;240;240mc3[38;2;240;240;240m[48;2;45;0;135m[38;2;240;240;240mc4[38;2;240;240;240m[48;2;51;0;155m[38;2;240;240;240mc5[38;2;240;240;240m[48;2;58;0;176m[38;2;240;240;240mc6[38;2;240;240;240m[48;2;66;0;198m[38;2;240;240;240mc7[38;2;240;240;240m[48;2;73;0;221m[38;2;240;240;240mc8[38;2;240;240;240m[48;2;81;0;245m[38;2;240;240;240mc9[38;2;240;240;240m[48;2;95;15;255m[38;2;240;240;240mca[38;2;240;240;240m[48;2;112;40;255m[38;2;240;240;240mcb[38;2;240;240;240m[48;2;129;67;255m[38;2;240;240;240mcc[38;2;0;0;0m[48;2;147;94;255m[38;2;0;0;0mcd[38;2;0;0;0m[48;2;166;121;255m[38;2;0;0;0mce[38;2;0;0;0m[48;2;184;149;254m[38;2;0;0;0mcf[0m
|
||
[38;2;19;161;14m0x000000d0[0m [38;2;240;240;240m[48;2;51;0;76m[38;2;240;240;240md0[38;2;240;240;240m[48;2;57;0;86m[38;2;240;240;240md1[38;2;240;240;240m[48;2;66;0;100m[38;2;240;240;240md2[38;2;240;240;240m[48;2;78;0;117m[38;2;240;240;240md3[38;2;240;240;240m[48;2;90;0;135m[38;2;240;240;240md4[38;2;240;240;240m[48;2;103;0;155m[38;2;240;240;240md5[38;2;240;240;240m[48;2;117;0;176m[38;2;240;240;240md6[38;2;240;240;240m[48;2;132;0;198m[38;2;240;240;240md7[38;2;240;240;240m[48;2;147;0;221m[38;2;240;240;240md8[38;2;240;240;240m[48;2;163;0;245m[38;2;240;240;240md9[38;2;240;240;240m[48;2;175;15;255m[38;2;240;240;240mda[38;2;240;240;240m[48;2;183;40;255m[38;2;240;240;240mdb[38;2;0;0;0m[48;2;192;67;255m[38;2;0;0;0mdc[38;2;0;0;0m[48;2;201;94;255m[38;2;0;0;0mdd[38;2;0;0;0m[48;2;210;121;255m[38;2;0;0;0mde[38;2;0;0;0m[48;2;219;149;254m[38;2;0;0;0mdf[0m
|
||
[38;2;19;161;14m0x000000e0[0m [38;2;240;240;240m[48;2;76;0;76m[38;2;240;240;240me0[38;2;240;240;240m[48;2;86;0;86m[38;2;240;240;240me1[38;2;240;240;240m[48;2;100;0;100m[38;2;240;240;240me2[38;2;240;240;240m[48;2;117;0;117m[38;2;240;240;240me3[38;2;240;240;240m[48;2;135;0;135m[38;2;240;240;240me4[38;2;240;240;240m[48;2;155;0;155m[38;2;240;240;240me5[38;2;240;240;240m[48;2;176;0;176m[38;2;240;240;240me6[38;2;240;240;240m[48;2;198;0;198m[38;2;240;240;240me7[38;2;240;240;240m[48;2;221;0;221m[38;2;240;240;240me8[38;2;240;240;240m[48;2;245;0;245m[38;2;240;240;240me9[38;2;240;240;240m[48;2;254;15;255m[38;2;240;240;240mea[38;2;0;0;0m[48;2;254;40;255m[38;2;0;0;0meb[38;2;0;0;0m[48;2;254;67;255m[38;2;0;0;0mec[38;2;0;0;0m[48;2;254;94;255m[38;2;0;0;0med[38;2;0;0;0m[48;2;254;121;255m[38;2;0;0;0mee[38;2;0;0;0m[48;2;254;149;254m[38;2;0;0;0mef[0m
|
||
[38;2;19;161;14m0x000000f0[0m [38;2;240;240;240m[48;2;76;0;50m[38;2;240;240;240mf0[38;2;240;240;240m[48;2;86;0;57m[38;2;240;240;240mf1[38;2;240;240;240m[48;2;100;0;66m[38;2;240;240;240mf2[38;2;240;240;240m[48;2;117;0;78m[38;2;240;240;240mf3[38;2;240;240;240m[48;2;135;0;90m[38;2;240;240;240mf4[38;2;240;240;240m[48;2;155;0;103m[38;2;240;240;240mf5[38;2;240;240;240m[48;2;176;0;117m[38;2;240;240;240mf6[38;2;240;240;240m[48;2;198;0;132m[38;2;240;240;240mf7[38;2;240;240;240m[48;2;221;0;147m[38;2;240;240;240mf8[38;2;240;240;240m[48;2;245;0;163m[38;2;240;240;240mf9[38;2;240;240;240m[48;2;255;15;175m[38;2;240;240;240mfa[38;2;0;0;0m[48;2;255;40;183m[38;2;0;0;0mfb[38;2;0;0;0m[48;2;255;67;192m[38;2;0;0;0mfc[38;2;0;0;0m[48;2;255;94;201m[38;2;0;0;0mfd[38;2;0;0;0m[48;2;255;121;210m[38;2;0;0;0mfe[38;2;0;0;0m[48;2;255;255;255m[38;2;0;0;0mff[0m
|
||
EOF
|
||
RUN
|
||
|
||
NAME=prc single-char-flag fix
|
||
FILE==
|
||
CMDS=<<EOF
|
||
woe 0 0xff 1
|
||
f s @ 0x77
|
||
prc 256
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x00000000
|
||
0x00000010
|
||
0x00000020 ................................
|
||
0x00000030 ................................
|
||
0x00000040 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||
0x00000050 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||
0x00000060 ::::::::::::::::::::::::::::::::
|
||
0x00000070 :::::::::::::: s::::::::::::::::
|
||
0x00000080 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
0x00000090 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
0x000000a0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||
0x000000b0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||
0x000000c0 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
|
||
0x000000d0 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
|
||
0x000000e0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
0x000000f0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##
|
||
EOF
|
||
RUN
|
||
|
||
NAME=prc hex.offset=0
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e hex.offset=0
|
||
woe 0 0xff 1
|
||
f s @ 0x77
|
||
prc 256
|
||
EOF
|
||
EXPECT=<<EOF
|
||
|
||
|
||
................................
|
||
................................
|
||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||
::::::::::::::::::::::::::::::::
|
||
:::::::::::::: s::::::::::::::::
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
|
||
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##
|
||
EOF
|
||
RUN
|
||
|
||
NAME=p=e hex.offset=0
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e hex.offset=0
|
||
e scr.color=0
|
||
woe 0 0xff 1
|
||
p=e 10
|
||
EOF
|
||
EXPECT=<<EOF
|
||
000 00b4 |#
|
||
001 00b4 |#
|
||
002 00b4 |#
|
||
003 00b4 |#
|
||
004 00b4 |###################################
|
||
005 0004 |
|
||
006 0000 |#
|
||
007 0000 |#
|
||
008 0000 |#
|
||
009 0000 |#
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pxA hex.offset=0
|
||
FILE==
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
e hex.offset=0
|
||
e scr.color=0
|
||
woe 0 0xff 1
|
||
pxA 10
|
||
EOF
|
||
EXPECT=<<EOF
|
||
++++++ _| 10
|
||
EOF
|
||
RUN
|
||
|
||
NAME=pxf
|
||
FILE=bins/elf/analysis/main
|
||
CMDS=<<EOF
|
||
e asm.arch=x86
|
||
e asm.bits=64
|
||
aaa
|
||
pxf
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x00400410 31ed 4989 d15e 4889 e248 83e4 f050 5449 1.I..^H..H...PTI
|
||
0x00400420 c7c0 b005 4000 48c7 c120 0540 0048 c7c7 ....@.H.. .@.H..
|
||
EOF
|
||
RUN
|
||
|
||
|
||
NAME=p== horizontal histogram ruler
|
||
FILE=malloc://8
|
||
CMDS=<<EOF
|
||
wx ff00ff00ff00ff00
|
||
e scr.color=0
|
||
e scr.hist.ruler=true
|
||
e scr.utf8=false
|
||
p== 8
|
||
echo ---
|
||
e scr.utf8=true
|
||
p== 8
|
||
EOF
|
||
EXPECT=<<EOF
|
||
255|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
197|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
138|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
79|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
|########## ########## ########## ##########
|
||
0|##########__________##########_________##########__________##########_________
|
||
^ ^ ^
|
||
0x0 0x3 0x7
|
||
---
|
||
255│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
197│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
138│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
79│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
│██████████ ██████████ ██████████ ██████████
|
||
0│██████████__________██████████_________██████████__________██████████_________
|
||
^ ^ ^
|
||
0x0 0x3 0x7
|
||
EOF
|
||
RUN
|
||
|
||
NAME=p== horizontal histogram ruler complex
|
||
FILE=malloc://182
|
||
CMDS=<<EOF
|
||
wx 31ed4989d15e4889e24883e4f050544531c031c9488d3d85e4ffffff1517080200f4662e0f1f8400000000000f1f4000488d3de90a0200488d05e20a02004839f87415488b05f60702004885c07409ffe00f1f8000000000c30f1f8000000000488d3db90a0200488d35b20a02004829fe4889f048c1ee3f48c1f8034801c648d1fe7414488b05f50702004885c07408ffe0660f1f440000c30f1f8000000000f30f1efa803dbd0a020000752b5548833dd2070200004889e5740c488b3de6070200e801dfffffe864ffffffc605950a0200015dc30f1f00c30f1f8000000000f30f1efae977ffffff662e0f1f840000000000662e0f1f840000000000662e0f
|
||
e scr.color=0
|
||
e scr.hist.ruler=true
|
||
e scr.utf8=false
|
||
p== 80
|
||
echo ---
|
||
e scr.utf8=true
|
||
p== 80
|
||
EOF
|
||
EXPECT=<<EOF
|
||
255| # #
|
||
| # # # # # # # #
|
||
| # # ## # # # # # # # #
|
||
197| # # # ## # # # # # # # # #
|
||
| # # # ## # # # ## # # # # ## # #
|
||
| # # # ## # # # ## # # # # # ## # #
|
||
138| # # # ## # # # ## # # # # # ## # #
|
||
| # ### ## # ## # ## ## # ## ## # # ## # # #
|
||
| # ### ## # ## # ## ## # ## ## # # ### ### #
|
||
79| # ### ## # # ## # ## ## # ## ## # # ### #### #
|
||
| ## #### ## # # ## # ## ## # ## ## # # ### #### #
|
||
| ####### #### # # ### ## ## ## ### # ## ## ############ #### #
|
||
|############## # # ### ## ## ## ### # ## ## ############ #### #
|
||
0|###############__#_#___###__##_#####_####__##__##__##_############___#####_##_
|
||
^ ^ ^
|
||
0x0 0x4e 0x9e
|
||
---
|
||
255│ █ █
|
||
│ █ █ █ █ █ █ █ █
|
||
│ █ █ ██ █ █ █ █ █ █ █ █
|
||
197│ █ █ █ ██ █ █ █ █ █ █ █ █ █
|
||
│ █ █ █ ██ █ █ █ ██ █ █ █ █ ██ █ █
|
||
│ █ █ █ ██ █ █ █ ██ █ █ █ █ █ ██ █ █
|
||
138│ █ █ █ ██ █ █ █ ██ █ █ █ █ █ ██ █ █
|
||
│ █ ███ ██ █ ██ █ ██ ██ █ ██ ██ █ █ ██ █ █ █
|
||
│ █ ███ ██ █ ██ █ ██ ██ █ ██ ██ █ █ ███ ███ █
|
||
79│ █ ███ ██ █ █ ██ █ ██ ██ █ ██ ██ █ █ ███ ████ █
|
||
│ ██ ████ ██ █ █ ██ █ ██ ██ █ ██ ██ █ █ ███ ████ █
|
||
│ ███████ ████ █ █ ███ ██ ██ ██ ███ █ ██ ██ ████████████ ████ █
|
||
│██████████████ █ █ ███ ██ ██ ██ ███ █ ██ ██ ████████████ ████ █
|
||
0│███████████████__█_█___███__██_█████_████__██__██__██_████████████___█████_██_
|
||
^ ^ ^
|
||
0x0 0x4e 0x9e
|
||
EOF
|
||
RUN
|