Use asm.var.summary=4 by default ##disasm

This commit is contained in:
pancake 2024-09-30 23:39:02 +02:00 committed by pancake
parent 066fe1cc99
commit 9968329d49
32 changed files with 129 additions and 100 deletions

View File

@ -86,3 +86,4 @@ You can use registers in math expressions. For example: 'wx 1234 @ esp - 2'
For HTTP authentication 'e http.auth = 1', 'e http.authfile = <path>'
Tip: do 'r2pm -i r2premium; echo "e cfg.fortunes.type = nsfw" >> ~/.radare2rc' for a premium r2 experience
Use the `:` command To run the io plugin cmd callback, many io plugins provide useful features, find them out!
Change asm.var.summary variable to 0 to display all local variables and argument types and names

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2022-2023 - pancake, condret */
/* radare - LGPL - Copyright 2022-2024 - pancake, condret */
#include <r_arch.h>
#include <config.h>

View File

@ -3781,7 +3781,7 @@ R_API int r_core_config_init(RCore *core) {
SETBPREF ("asm.var", "true", "show local function variables in disassembly");
SETBPREF ("asm.var.access", "false", "show accesses of local variables");
SETBPREF ("asm.sub.var", "true", "substitute variables in disassembly");
SETICB ("asm.var.summary", 0, &cb_asm_var_summary, "show variables summary instead of full list in disasm (0, 1, 2)");
SETICB ("asm.var.summary", 4, &cb_asm_var_summary, "show variables summary instead of full list in disasm (0, 1, 2, 3, 4)");
SETBPREF ("asm.sub.varonly", "true", "substitute the entire variable expression with the local variable name (e.g. [local10h] instead of [ebp+local10h])");
SETBPREF ("asm.sub.reg", "false", "substitute register names with their associated role name (drp~=)");
SETBPREF ("asm.sub.rel", "true", "substitute pc relative expressions in disasm");

View File

@ -1931,11 +1931,14 @@ static void print_var_summary(RDisasmState *ds, RList *list) {
if (sp_args) { sp_args_color = numColor; }
if (rg_args) { rg_args_color = numColor; }
if (ds->show_varsum == 4) {
ds_begin_line (ds);
ds_print_pre (ds, true);
int total_args = bp_args + sp_args + rg_args;
int total_vars = bp_vars + sp_vars + rg_vars;
if (total_args > 0 || total_vars > 0) {
ds_begin_line (ds);
ds_print_pre (ds, true);
}
if (total_args > 0) {
r_cons_printf ("afv: args(");
r_cons_printf ("`- args(");
const char *comma = "";
int minsprange = ST32_MAX;
int maxsprange = 0;
@ -1958,9 +1961,12 @@ static void print_var_summary(RDisasmState *ds, RList *list) {
if (maxsprange > 0) {
r_cons_printf ("%ssp[0x%x..0x%x]", comma, minsprange, maxsprange);
}
r_cons_printf (") ");
if (total_vars > 0) {
r_cons_printf (") ");
} else {
r_cons_printf (")");
}
}
int total_vars = bp_vars + sp_vars + rg_vars;
if (total_vars > 0) {
if (total_args < 1) {
r_cons_printf ("afv: ");
@ -1986,11 +1992,13 @@ static void print_var_summary(RDisasmState *ds, RList *list) {
}
}
if (maxsprange > 0) {
r_cons_printf ("%ssp[0x%x..0x%x]", comma, minsprange, maxsprange);
r_cons_printf ("%s%d:sp[0x%x..0x%x]", comma, total_vars, minsprange, maxsprange);
}
r_cons_printf (")");
}
ds_newline (ds);
if (total_args > 0 || total_vars > 0) {
ds_newline (ds);
}
return;
}
if (ds->show_varsum == 3) {
@ -3572,7 +3580,7 @@ static bool ds_print_data_type(RDisasmState *ds, const ut8 *obuf, int ib, int si
if (size == 4 || size == 8) {
if (r_str_startswith (r_config_get (core->config, "asm.arch"), "arm")) {
ut64 bits = r_config_get_i (core->config, "asm.bits");
//adjust address for arm/thumb address
// adjust address for arm/thumb address
if ((bits < 64) && (n & 1)) {
n--;
}

View File

@ -90,7 +90,9 @@ static bool r2qjs_arch_init(RArchSession *s) {
}
static bool r2qjs_arch_fini(RArchSession *s) {
R_RETURN_VAL_IF_FAIL (s, false);
if (s == NULL) {
return false;
}
RCore *core = s->user;
QjsPluginManager *pm = R_UNWRAP4 (core, lang, session, plugin_data);

View File

@ -320,7 +320,7 @@ EOF
EXPECT=<<EOF
/ (fcn) fcn.00000000 16
// void fcn.00000000 (int32_t arg2);
| ; arg int32_t arg2 @ r1
| `- args(r1)
| 0x00000000 021081e0 add r1, r1, r2 ; arg2
| 0x00000004 1eff2f01 bxeq lr
| 0x00000008 0020a0e3 mov r2, 0
@ -666,6 +666,11 @@ NAME=ELF ARM: function arg
FILE=bins/elf/analysis/armcall
CMDS=<<EOF
e asm.cmt.calls=false
e asm.var.summary=0
afr@main
afva@sym.call
pdf@sym.call
e asm.var.summary=4
afr@main
afva@sym.call
pdf@sym.call
@ -685,6 +690,20 @@ EXPECT=<<EOF
| 0x0001043c 0030a0e3 mov r3, 0
| 0x00010440 0300a0e1 mov r0, r3
| 0x00010444 04d04be2 sub sp, fp, 4
\ 0x00010448 0088bde8 pop {fp, pc}
; CALL XREF from main @ 0x10468(x)
/ (fcn) sym.call 44
| `- args(r0) vars(1:sp[0xc..0xc])
| 0x00010420 00482de9 push {fp, lr}
| 0x00010424 04b08de2 add fp, sp, 4
| 0x00010428 08d04de2 sub sp, sp, 8
| 0x0001042c 08000be5 str r0, [var_8h] ; 8 ; arg1
| 0x00010430 14009fe5 ldr r0, [0x0001044c] ; [0x1044c:4]=0x104f0 "%d"
| 0x00010434 08101be5 ldr r1, [var_8h] ; 8
| 0x00010438 a2ffffeb bl sym.imp.printf
| 0x0001043c 0030a0e3 mov r3, 0
| 0x00010440 0300a0e1 mov r0, r3
| 0x00010444 04d04be2 sub sp, fp, 4
\ 0x00010448 0088bde8 pop {fp, pc}
EOF
RUN
@ -692,6 +711,7 @@ RUN
NAME=ELF ARM: function args
FILE=bins/elf/analysis/armcall
CMDS=<<EOF
e asm.var.summary=0
e asm.cmt.calls=false
af@main
afva@main
@ -782,6 +802,7 @@ NAME=ELF ARM: vars
FILE=bins/elf/analysis/arm-ls
CMDS=<<EOF
e asm.cmt.calls=false
e asm.var.summary=0
s main
af
pd 1~var?
@ -1174,6 +1195,7 @@ RUN
NAME=load code refs
FILE=bins/elf/blah.bin
CMDS=<<EOF
e asm.var.summary=0
af
pdf
s main

View File

@ -7,7 +7,7 @@ f hit.key.lastQword 1 0x1000100e0
f sym.generatePrivateKey 720 0x1000086dc
f sym.calledFromGeneratePrivKey 64 0x100008ab8
e emu.str=true
e asm.var.summary=true
e asm.var.summary=1
Cd 4[16] @ hit.key.base
CCu base64:WzI0XSAtcnctIHNlY3Rpb24gc2l6ZSAyNzIgbmFtZWQgMjQuX19EQVRBLl9fYnNz @ 0x100010300
s 0x100008710

View File

@ -2,6 +2,7 @@ NAME=aac on non executable sections
# BROKEN=1
FILE=bins/elf/analysis/calls_x64
CMDS=<<EOF
e asm.var.summary=0
af
e anal.in=bin.sections.x
aac
@ -30,6 +31,7 @@ RUN
NAME=aac on non executable sections (defaults)
FILE=bins/elf/analysis/calls_x64
CMDS=<<EOF
e asm.var.summary=0
af
aac
pdf
@ -57,6 +59,7 @@ RUN
NAME=aac on non executable sections (bug)
FILE=bins/elf/analysis/calls_x64
CMDS=<<EOF
e asm.var.summary=0
e anal.in=io.maps.x
af
aac

View File

@ -54,6 +54,7 @@ NAME=emu paths
FILE=bins/mach0/ret0ret1restr
ARGS=-2
CMDS=<<EOF
e asm.var.summary=0
aeim
?e ret paths
s sym._retbool
@ -170,6 +171,7 @@ FILE=bins/mach0/infloop
CMDS=<<EOF
af
aeim
e asm.var.summary=0
e dbg.trace=true
e asm.trace=true
e asm.comments=false

View File

@ -10,19 +10,7 @@ EXPECT=<<EOF
;-- section.0.__TEXT.__text:
; DATA XREF from sym.func.100004000 @ 0x100004040(r)
276: sym.func.100004000 (int64_t arg1, int64_t arg2, int64_t arg4, int64_t arg5, int64_t arg6, int64_t arg7, int64_t arg_80h);
; arg int64_t arg1 @ x0
; arg int64_t arg2 @ x1
; arg int64_t arg4 @ x3
; arg int64_t arg5 @ x4
; arg int64_t arg6 @ x5
; arg int64_t arg7 @ x6
; arg int64_t arg_80h @ sp+0x100
; var int64_t var_20h @ sp+0x20
; var int64_t var_30h @ sp+0x30
; var int64_t var_40h @ sp+0x40
; var int64_t var_50h @ sp+0x50
; var int64_t var_60h @ sp+0x60
; var int64_t var_70h @ sp+0x70
`- args(x0, x1, x3, x4, x5, x6, sp[0x80..0x80]) vars(6:sp[0x10..0x60])
0x100004000 sub sp, sp, 0x80 ; [00] -r-x section size 13240 named 0.__TEXT.__text
0x100004004 str x28, [var_20h]
0x100004008 stp x27, x26, [var_30h]
@ -152,34 +140,7 @@ pdr
EOF
EXPECT=<<EOF
904: sym.func.100004124 (int64_t arg1, int64_t arg2, int64_t arg_140h);
; arg int64_t arg1 @ x0
; arg int64_t arg2 @ x1
; arg int64_t arg_140h @ sp+0x280
; var int64_t var_0h @ sp+0x0
; var int64_t var_8h @ sp+0x8
; var int64_t var_10h @ sp+0x10
; var int64_t var_18h @ sp+0x18
; var int64_t var_20h @ sp+0x20
; var int64_t var_28h @ sp+0x28
; var int64_t var_30h @ sp+0x30
; var int64_t var_38h @ sp+0x38
; var int64_t var_40h @ sp+0x40
; var int64_t var_48h @ sp+0x48
; var int64_t var_50h @ sp+0x50
; var int64_t var_58h @ sp+0x58
; var int64_t var_60h @ sp+0x60
; var int64_t var_68h @ sp+0x68
; var int64_t var_70h @ sp+0x70
; var int64_t var_78h @ sp+0x78
; var int64_t var_80h @ sp+0x80
; var int64_t var_88h @ sp+0x88
; var int64_t var_90h @ sp+0x90
; var int64_t var_e0h @ sp+0xe0
; var int64_t var_f0h @ sp+0xf0
; var int64_t var_100h @ sp+0x100
; var int64_t var_110h @ sp+0x110
; var int64_t var_120h @ sp+0x120
; var int64_t var_130h @ sp+0x130
`- args(x0, x1, sp[0x140..0x140]) vars(25:sp[0x10..0x140])
0x100004124 sub sp, sp, 0x140
0x100004128 str x28, [var_e0h]
0x10000412c stp x27, x26, [var_f0h]

View File

@ -51,6 +51,7 @@ NAME=analysis macho test
FILE=bins/mach0/ls-m1
ARGS=-a arm -b 64
CMDS=<<EOF
e asm.var.summary=0
aa
pd 4
EOF

View File

@ -456,8 +456,7 @@ EXPECT=<<EOF
0x8060b4f8 00000000 nop
0x8060b4fc 00000000 nop
(fcn) fcn.8060b500 80
; arg int32_t arg1 @ a0
; arg int32_t arg2 @ a1
`- args(a0, a1)
0x8060b500 002e0500 sll a1, a1, 0x18
0x8060b504 032e0500 sra a1, a1, 0x18
0x8060b508 0f008010 beqz a0, 0x8060b548
@ -479,8 +478,7 @@ EXPECT=<<EOF
0x8060b548 0800e003 jr ra
0x8060b54c 00000000 nop
(fcn) fcn.8060b550 36
; arg int32_t arg1 @ a0
; arg int32_t arg2 @ a1
`- args(a0, a1)
0x8060b550 0000a290 lbu v0, (a1)
0x8060b554 05004010 beqz v0, 0x8060b56c
0x8060b558 0100a524 addiu a1, a1, 1
@ -492,8 +490,7 @@ EXPECT=<<EOF
0x8060b570 000080a0 sb zero, (a0)
0x8060b574 00000000 nop
(fcn) fcn.8060b578 20
; arg int32_t arg1 @ a0
; arg int32_t arg2 @ a1
`- args(a0, a1)
0x8060b578 e0ffbd27 addiu sp, sp, -0x20
0x8060b57c 542d180c jal fcn.8060b550
0x8060b580 00000000 nop
@ -593,8 +590,7 @@ EXPECT=<<EOF
0x8060b4f8 00000000 nop
0x8060b4fc 00000000 nop
(fcn) fcn.8060b500 80
; arg int32_t arg1 @ a0
; arg int32_t arg2 @ a1
`- args(a0, a1)
0x8060b500 002e0500 sll a1, a1, 0x18
0x8060b504 032e0500 sra a1, a1, 0x18
0x8060b508 0f008010 beqz a0, 0x8060b548
@ -616,8 +612,7 @@ EXPECT=<<EOF
0x8060b548 0800e003 jr ra
0x8060b54c 00000000 nop
(fcn) fcn.8060b550 36
; arg int32_t arg1 @ a0
; arg int32_t arg2 @ a1
`- args(a0, a1)
0x8060b550 0000a290 lbu v0, (a1)
0x8060b554 05004010 beqz v0, 0x8060b56c
0x8060b558 0100a524 addiu a1, a1, 1
@ -629,8 +624,7 @@ EXPECT=<<EOF
0x8060b570 000080a0 sb zero, (a0)
0x8060b574 00000000 nop
(fcn) fcn.8060b578 20
; arg int32_t arg1 @ a0
; arg int32_t arg2 @ a1
`- args(a0, a1)
0x8060b578 e0ffbd27 addiu sp, sp, -0x20
0x8060b57c 542d180c jal fcn.8060b550
0x8060b580 00000000 nop
@ -665,8 +659,7 @@ EXPECT=<<EOF
0x8060b4f8 00000000 nop
0x8060b4fc 00000000 nop
/ (fcn) fcn.8060b500 80
| ; arg int32_t arg1 @ a0
| ; arg int32_t arg2 @ a1
| `- args(a0, a1)
| 0x8060b500 002e0500 sll a1, a1, 0x18
| 0x8060b504 032e0500 sra a1, a1, 0x18
| 0x8060b508 0f008010 beqz a0, 0x8060b548
@ -688,8 +681,7 @@ EXPECT=<<EOF
| 0x8060b548 0800e003 jr ra
\ 0x8060b54c 00000000 nop
/ (fcn) fcn.8060b550 36
| ; arg int32_t arg1 @ a0
| ; arg int32_t arg2 @ a1
| `- args(a0, a1)
| 0x8060b550 0000a290 lbu v0, (a1)
| 0x8060b554 05004010 beqz v0, 0x8060b56c
| 0x8060b558 0100a524 addiu a1, a1, 1
@ -701,8 +693,7 @@ EXPECT=<<EOF
\ 0x8060b570 000080a0 sb zero, (a0)
0x8060b574 00000000 nop
/ (fcn) fcn.8060b578 20
| ; arg int32_t arg1 @ a0
| ; arg int32_t arg2 @ a1
| `- args(a0, a1)
| 0x8060b578 e0ffbd27 addiu sp, sp, -0x20
| 0x8060b57c 542d180c jal fcn.8060b550
| 0x8060b580 00000000 nop

View File

@ -67,6 +67,7 @@ RUN
NAME=afb sparc
FILE=bins/elf/elf-Linux-SparcV8-bash
CMDS=<<EOF
e asm.var.summary=0
s sym.zwrite
af
afb

View File

@ -2,6 +2,7 @@ NAME=simple type propagation
FILE=bins/mach0/simple-retype
CMDS=<<EOF
af
e asm.var.summary=0
aaft
afv
?e ---

View File

@ -146,6 +146,7 @@ RUN
NAME=pdf
FILE=bins/elf/test_o
CMDS=<<EOF
e asm.var.summary=0
af
pdf
afv
@ -332,9 +333,7 @@ pd 13
EOF
EXPECT=<<EOF
/ 22: fcn.00000000 (int64_t arg1, int64_t arg2, int64_t arg3);
| ; arg int64_t arg1 @ rcx
| ; arg int64_t arg2 @ rdx
| ; arg int64_t arg3 @ r8
| `- args(rcx, rdx, r8)
| 0x00000000 4053 push rbx
| 0x00000002 4883ec20 sub rsp, 0x20
| 0x00000006 418bd8 mov ebx, r8d ; arg3
@ -347,8 +346,7 @@ EXPECT=<<EOF
0x00000017 cc int3
; CALL XREF from fcn.00000000 @ 0x9(x)
/ 5: fcn.00000018 (int64_t arg1, int64_t arg2);
| ; arg int64_t arg1 @ rcx
| ; arg int64_t arg2 @ rdx
| `- args(rcx, rdx)
| 0x00000018 2bca sub ecx, edx ; arg2
| 0x0000001a 8bc1 mov eax, ecx ; arg1
\ 0x0000001c c3 ret
@ -448,6 +446,7 @@ NAME=Variable access with misc registers (ARM)
FILE=-
ARGS=-a arm -b 16
CMDS=<<EOF
e asm.var.summary=0
e asm.flags=false
e asm.comments=false
e anal.vars.stackname = true
@ -549,6 +548,7 @@ NAME=Stack Variables
FILE=-
ARGS=-a arm -b 16
CMDS=<<EOF
e asm.var.summary=0
e anal.vars.newstack=true
wx 2de9f04fadf54e4da5b088460df1900a0021aaf18007802281463846fff7e0ee4bf2640400214ff448420df5d260fff7d8eec0f2000400214ff48062a4a8fff7
af
@ -574,6 +574,7 @@ RUN
NAME=arm64 stack variables
FILE=bins/mach0/arm_snippet_1
CMDS=<<EOF
e asm.var.summary=0
e asm.sub.var=true
af
pdf

View File

@ -127,8 +127,7 @@ pdf
EOF:
EXPECT=<<EOF
/ 11: fcn.00000000 (int16_t arg_6h, int16_t arg_ah);
| ; arg int16_t arg_6h @ bp+0x6
| ; arg int16_t arg_ah @ bp+0xa
| `- args(sp[0x4..0x8])
| 0000:0000 55 push bp
| 0000:0001 8bec mov bp, sp
| 0000:0003 c57606 lds si, [arg_6h]

View File

@ -250,7 +250,10 @@ RUN
NAME=x86: fastcall argument analysis
FILE=bins/elf/analysis/fast
CMDS=aa ; s sym.fastcaslled ; afc fastcall ; afva ; pdf~arg,var
CMDS=<<EOF
e asm.var.summary=0
aa ; s sym.fastcaslled ; afc fastcall ; afva ; pdf~arg,var
EOF
EXPECT=<<EOF
/ 59: sym.fastcaslled (int32_t arg1, int32_t arg2, int32_t arg_8h, int32_t arg_ch);
| ; arg int32_t arg1 @ ecx
@ -3223,6 +3226,7 @@ NAME=reflines offset
FILE=malloc://1023
CMDS=<<EOF
e asm.cmt.calls=false
e asm.var.summary=0
e asm.bits=32
e asm.cpu=x86
e asm.arch=x86
@ -3287,6 +3291,7 @@ NAME=reflines offset (ascii)
FILE=malloc://1023
CMDS=<<EOF
e asm.cmt.calls=false
e asm.var.summary=0
e asm.bits=32
e asm.cpu=x86
e anal.cpu=x86
@ -3366,6 +3371,7 @@ NAME=afva for esp based vars
FILE=malloc://1024
CMDS=<<EOF
e asm.bits=32
e asm.var.summary=0
e asm.arch = x86
e anal.arch = x86
e anal.vars.stackname=true

View File

@ -1479,9 +1479,7 @@ pdf
EOF
EXPECT=<<EOF
/ 76: fcn.00012740 (int64_t arg1, int64_t arg2);
| ; arg int64_t arg1 @ rdi
| ; arg int64_t arg2 @ rsi
| ; var int64_t var_8h @ rbp-0x8
| `- args(rdi, rsi) vars(1:sp[0x10..0x10])
| 0x00012740 push rbp
| 0x00012741 mov rbp, rsp
| 0x00012744 sub rsp, 0x1030
@ -1876,7 +1874,10 @@ s sym.fastcaslled
afc fastcall
afc
afva
e asm.var.summary=0
pdf
e asm.var.summary=4
pd 1
EOF
EXPECT=<<EOF
fastcall
@ -1911,12 +1912,17 @@ fastcall
| 0x08048451 90 nop
| 0x08048452 c9 leave
\ 0x08048453 c20800 ret 8
; CALL XREF from main @ 0x80484c7(x)
/ 59: sym.fastcaslled (int32_t arg1, int32_t arg2, int32_t arg_8h, int32_t arg_ch);
| `- args(ecx, edx, sp[0x4..0x8]) vars(4:sp[0x10..0x24])
| 0x0804841b 55 push ebp
EOF
RUN
NAME=afva for cdecl/stdcall with no esp vars
FILE=bins/elf/analysis/fast
CMDS=<<EOF
e asm.var.summary=0
e asm.cmt.calls=false
aa
s sym.nonfastcaslled
@ -1971,6 +1977,7 @@ RUN
NAME=anal vars crash 2
FILE=-
CMDS=<<EOF
e asm.var.summary=0
e asm.bits=64
e asm.arch = x86
e anal.arch = x86
@ -3755,6 +3762,7 @@ RUN
NAME=Microsoft x64 CC Args/Vars
FILE=bins/pe/testx64.exe
CMDS=<<EOF
e asm.var.summary=0
e asm.comments=0
e anal.vars.stackname=true
s 0x140001080
@ -3849,6 +3857,7 @@ RUN
NAME=lea pseudo improvements (pseudo disabled)
FILE=-
CMDS=<<EOF
e asm.var.summary=0
e asm.arch=x86
e asm.bits=64
e asm.comments=false
@ -3890,6 +3899,7 @@ RUN
NAME=lea pseudo improvements (pseudo enabled)
FILE=-
CMDS=<<EOF
e asm.var.summary=0
e asm.arch=x86
e asm.bits=64
e asm.comments=false

View File

@ -454,14 +454,7 @@ EXPECT=<<EOF
0x1000047a8
;-- func.1000047a8:
/ 688: sym.il.piltrafilla (int64_t arg1, int64_t arg2, int64_t arg3);
| ; arg int64_t arg1 @ x0
| ; arg int64_t arg2 @ x1
| ; arg int64_t arg3 @ x2
| ; var int64_t var_10h @ sp+0x10
| ; var int64_t var_20h @ sp+0x20
| ; var int64_t var_30h @ sp+0x30
| ; var int64_t var_40h @ sp+0x40
| ; var int64_t var_50h @ sp+0x50
| `- args(x0, x1, x2) vars(5:sp[0x10..0x50])
| 0x1000047a8 7f2303d5 pacibsp
| 0x1000047ac fc6fbaa9 stp x28, x27, [sp, -0x60]!
EOF

View File

@ -406,6 +406,7 @@ NAME=lowaddr lights
FILE=bins/elf/elf_one_symbol_shdr
ARGS=-n
CMDS=<<EOF
e asm.var.summary=0
e asm.arch=x86
e asm.bits=64
s 0x44b

View File

@ -26,6 +26,7 @@ FILE=malloc://1024
CMDS=<<EOF
e asm.arch=x86
e asm.bits=64
e asm.var.summary=0
s 0x10
af
@ -64,7 +65,6 @@ pd1~comment
Cvr- var_rax
pd1~comment
?e --
EOF
EXPECT=<<EOF
| ; arg uint64_t var_rax @ rax ; comment for var_rax

View File

@ -592,9 +592,9 @@ pd 1 @ 0~var
pd 1 @ 7
EOF
EXPECT=<<EOF
; var int64_t var_28h @ rsp+0x40
afv: vars(1:sp[0x28..0x28])
mov rax, qword [var_28h]
; var int64_t var_28h @ rsp+0x40
afv: vars(1:sp[0x28..0x28])
mov rax, qword [rsp + var_28h]
EOF
RUN
@ -2090,10 +2090,12 @@ FILE=bins/elf/ls
CMDS=<<EOF
aa
pdf
e asm.var.summary=0
pd 2
EOF
EXPECT=<<EOF
/ 46: entry0 (int64_t arg3);
| ; arg int64_t arg3 @ rdx
| `- args(rdx)
| 0x00005ae0 f30f1efa endbr64
| 0x00005ae4 31ed xor ebp, ebp
| 0x00005ae6 4989d1 mov r9, rdx ; arg3
@ -2106,6 +2108,10 @@ EXPECT=<<EOF
| 0x00005afa 488d0def0b.. lea rcx, [0x000166f0]
| 0x00005b01 488d3d68e5.. lea rdi, [main] ; 0x4070 ; "AWAVAUATU\x89\xfdSH\x89\xf3H\x83\xecXH\x8b>dH\x8b\x04%("
\ 0x00005b08 ff150ac30100 call qword [reloc.__libc_start_main] ; [0x21e18:8]=0
/ 46: entry0 (int64_t arg3);
| ; arg int64_t arg3 @ rdx
| 0x00005ae0 f30f1efa endbr64
| 0x00005ae4 31ed xor ebp, ebp
EOF
RUN

View File

@ -156,6 +156,7 @@ NAME=realign after sparse (#11810)
FILE=bins/pe/cmd_adf_sample0.exe
CMDS=<<EOF
e anal.vars.stackname=true
e asm.var.summary=0
e asm.bytes=false
e asm.comments=false
s 0x560e67
@ -349,6 +350,7 @@ NAME=esil func cmts
FILE=bins/elf/arm1.bin
CMDS=<<EOF
tn- __libc_start_main
e asm.var.summary=0
e asm.emu=true
e emu.write=true
s 0x8174

View File

@ -34,6 +34,7 @@ NAME=pd+reloff+colors
FILE=bins/elf/analysis/ls-alxchk
CMDS=<<EOF
af
e asm.var.summary=0
e asm.offset.relto=func
pd 10
e scr.color=1

View File

@ -396,7 +396,7 @@ EXPECT=<<EOF
0x00005b00 0048 8d3d 68e5 ffff ff15 0ac3 0100 f490 .H.=h...........
0x00005b10 488d 3d51 c701 0048 8d05 4ac7 0100 4839 H.=Q...H..J...H9
/ 46: entry0 (int64_t arg3);
| ; arg int64_t arg3 @ rdx
| `- args(rdx)
| 0x00005ae0 f30f1efa endbr64
| 0x00005ae4 31ed xor ebp, ebp
| 0x00005ae6 4989d1 mov r9, rdx ; arg3

View File

@ -2,6 +2,7 @@ NAME=asm.trace
FILE=bins/mach0/main-loop
CMDS=<<EOF
af
e asm.var.summary=0
e asm.flags.inline=true
e asm.comments=false
e asm.trace=1

View File

@ -139,7 +139,7 @@ EOF
EXPECT=<<EOF
; DATA XREF from entry0 @ 0x40045d(r)
/ 44: int main (int argc, char **argv, char **envp);
| ; var int64_t var_4h @ rbp-0x4
| afv: vars(1:sp[0xc..0xc])
| 0x0040052d 55 push rbp ; dwarftest.c:4
EOF
RUN
@ -171,6 +171,7 @@ NAME="function info integration c++"
FILE=bins/elf/dwarf3_many_comp_units.elf
CMDS=<<EOF
e asm.dwarf=false
e asm.var.summary=0
aaa
pd 13 @ main
EOF
@ -202,6 +203,7 @@ NAME="function info integration 1 rust"
FILE=bins/elf/dwarf_rust_bubble
CMDS=<<EOF
e asm.dwarf=false
e asm.var.summary=0
aaa
pd 75 @ dbg.main
EOF
@ -347,6 +349,7 @@ NAME="function info integration 2 rust"
FILE=bins/elf/dwarf_rust_bubble
CMDS=<<EOF
e asm.dwarf=false
e asm.var.summary=0
aaa
pd 40 @ dbg.bubble_sort_i32_
EOF
@ -431,6 +434,7 @@ NAME="big endian variable info"
FILE=bins/elf/ppc64_sudoku_dwarf
CMDS=<<EOF
e asm.dwarf=false
e asm.var.summary=0
aaa
pdf @ dbg.init
EOF
@ -465,6 +469,7 @@ NAME="function info integration ada"
FILE=bins/elf/ada_test_dwarf
CMDS=<<EOF
e asm.dwarf=false
e asm.var.summary=0
aaa
pdf @ dbg.main
EOF
@ -510,6 +515,7 @@ RUN
NAME="function info integration freepascal"
FILE=bins/efi/freepascal_test_dwarf
CMDS=<<EOF
e asm.var.summary=0
e asm.dwarf=false
aaa
pd 20 @ dbg.palya

View File

@ -94,7 +94,7 @@ EOF
EXPECT=<<EOF
; DATA XREF from entry0 @ 0x40048d(r)
/ 41: int main (int argc, char **argv, char **envp);
| ; var int64_t var_4h @ rbp-0x4
| afv: vars(1:sp[0xc..0xc])
| 0x00400566 55 push rbp
| 0x00400567 4889e5 mov rbp, rsp
| 0x0040056a 4883ec10 sub rsp, 0x10

View File

@ -129,6 +129,7 @@ CMDS=<<EOF
e anal.vars.stackname=true
e asm.lines.bb = false
e asm.lines.jmp = false
e asm.var.summary=0
e io.cache=false
e io.cache.read=false
wc-*
@ -825,6 +826,7 @@ RUN
NAME=Comments and var in struct offset propagation
FILE=bins/elf/struct_sample
CMDS=<<EOF
e asm.var.summary=0
aa
s main
"td struct Books {char title[50];char author[50]; char subject[100];};"
@ -1175,6 +1177,7 @@ RUN
NAME=Caller to callee propgation (64 bits)
FILE=bins/elf/arg_down_prop
CMDS=<<EOF
e asm.var.summary=0
e asm.lines = false
e asm.xrefs = false
aa
@ -1195,6 +1198,7 @@ RUN
NAME=Caller to caller propgation (32 bits)
FILE=bins/elf/arg_down_32
CMDS=<<EOF
e asm.var.summary=0
e asm.lines = false
e asm.xrefs = false
aa
@ -1443,6 +1447,7 @@ NAME=constrained type
FILE=bins/elf/constr_type
CMDS=<<EOF
e anal.types.constraint = true
e asm.var.summary=0
aaa
s sym.single_cond
pd 1~4h

View File

@ -344,7 +344,7 @@ EXPECT=<<EOF
0x00007524 45ca8ce2 add ip, ip, 0x45000
0x00007528 f0f5bce5 ldr pc, [ip, 0x5f0]!
/ 552: sym.Curl_close (int32_t arg1);
| ; arg int32_t arg1 @ r0
| `- args(r0)
| 0x0001de5c 70402de9 push {r4, r5, r6, lr}
| 0x0001de60 0010a0e3 mov r1, 0
| 0x0001de64 086090e5 ldr r6, [r0, 8] ; arg1
@ -530,7 +530,7 @@ EXPECT=<<EOF
0x00017524 45ca8ce2 add ip, ip, 0x45000
0x00017528 f0f5bce5 ldr pc, [ip, 0x5f0]!
/ 552: sym.Curl_close (int32_t arg1);
| ; arg int32_t arg1 @ r0
| `- args(r0)
| 0x0002de5c 70402de9 push {r4, r5, r6, lr}
| 0x0002de60 0010a0e3 mov r1, 0
| 0x0002de64 086090e5 ldr r6, [r0, 8] ; arg1

View File

@ -2,6 +2,7 @@ NAME=random39855 relocs
FILE=bins/elf/random_39855/random_39855.oo
CMDS=<<EOF
s sym.func_9
e asm.var.summary=0
e emu.str=true
af
pd 20
@ -80,6 +81,7 @@ RUN
NAME=random39855 relocs bin
FILE=bins/elf/random_39855/random_39855
CMDS=<<EOF
e asm.var.summary=0
e emu.str=true
s sym.func_9
af

View File

@ -476,6 +476,7 @@ RUN
NAME=ELF: riscv64: main analysis (1)
FILE=bins/elf/analysis/guess-number-riscv64
CMDS=<<EOF
e asm.var.summary=0
e anal.vars.stackname=true
e asm.cmt.calls=false
s sym.main
@ -536,6 +537,7 @@ RUN
NAME=ELF: riscv64: main analysis (2)
FILE=bins/elf/analysis/guess-number-riscv64
CMDS=<<EOF
e asm.var.summary=0
s sym.main
af
pdf
@ -657,6 +659,7 @@ NAME=ELF: riscv64: full analysis
FILE=bins/elf/analysis/guess-number-riscv64
ARGS=-e asm.cmt.calls=false -b64
CMDS=<<EOF
e asm.var.summary=0
aeim
e asm.bits=64
e asm.arch=riscv