Support stack pointer-based variables
XVilka opened this issue · comments
[i] ℤ rizin /bin/ls 19:53:52
-- Use 'e asm.offset=true' to show offsets in 16bit segment addressing mode.
[0x00006b10]> aaa
[x] Analyze all flags starting with sym. and entry0 (aa)
[x] Analyze function calls (aac)
[x] Analyze len bytes of instructions for references (aar)
[x] Check for classes
[x] Type matching analysis for all functions (aaft)
[x] Propagate noreturn information
[x] Use -AA or aaaa to perform additional experimental analysis.
[0x00006b10]> s main
[0x00004d80]> pdg
// WARNING: Could not reconcile some variable overlaps
// WARNING: [rz-ghidra] Var arg_508h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_117h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var format is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_fdh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_feh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var s is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var s2 is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_b0h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_80h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_90h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_a0h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_78h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_c0h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_84h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_e0h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_c4h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_6eh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_d0h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_88h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_6fh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_94h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_d4h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_c8h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_8ch is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_cch is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_68h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_568h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_ffh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_f8h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_fch is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Detected overlap for variable var_2b8h
// WARNING: [rz-ghidra] Detected overlap for variable var_2f5h
// WARNING: [rz-ghidra] Var arg_4h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_ch is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_bh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_10h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_8h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_18h is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_6ffh is stack pointer based, which is not supported for decompilation.
// WARNING: [rz-ghidra] Var arg_190h is stack pointer based, which is not supported for decompilation.
undefined4 main(int argc, char **argv)
Not much that can be done on rz-ghidra side because sp-based is conceptually wrong for variables in the general case. They should be removed from rizin and stack variables should always be relative to the bottom of the stack frame, regardless of what base pointer and stack pointer contain.
Yes, also related: rizinorg/rizin#1260 (comment)