rizin/test/prj/v9-stackptr.rzdb
Florian Märkl 13cd3942d1
Rewrite stack pointer tracking and storage (#3207)
The stack pointer was previously already tracked during analysis for
variables and their accesses, but not stored in any sensible form for
further use. RzAnalysisBlock.stackptr and parent_stackptr were used in
some places, but they had no evident meaning.
Now we store the sp at the entry of a basic block and the difference
from that for every instruction inside the block to allow for efficient
querying of the sp value at arbitrary analyzed addresses.
RzAnalysisFunction.stackptr is now deprecated as its previous use was
primarily as a temporary accumulator, which is now handled locally, but
full removal of it would go beyond the scope here.

asm.stackptr visualizes both the absolute sp value and the delta of each
instruction in disassembly.

Changes in librz/analysis/p fix some test cases with the new tracking.

Introduces project version v10 with sp_entry/sp_delta instead of
stackptr/parent_stackptr.
2022-12-23 15:01:15 +01:00

90 lines
3.1 KiB
Text

/
type=rizin rz-db project
version=9
/core
blocksize=0x100
offset=0x8048484
/core/analysis
/core/analysis/blocks
0x8048394={"size":6,"ninstr":1,"parent_stackptr":0}
0x80483a4={"size":6,"ninstr":1,"parent_stackptr":0}
0x80483b4={"size":6,"ninstr":1,"parent_stackptr":0}
0x8048484={"size":66,"ninstr":18,"op_pos":[1,3,6,9,13,21,24,27,32,35,38,40,41,42,49,54,61],"stackptr":28,"parent_stackptr":0}
0x80484c8={"size":20,"jump":134513884,"ninstr":5,"op_pos":[1,3,6,13],"stackptr":44,"parent_stackptr":0}
0x80484dc={"size":16,"jump":134513958,"ninstr":5,"op_pos":[3,6,11,14],"parent_stackptr":44}
0x8048526={"size":12,"jump":134513884,"ninstr":4,"op_pos":[5,8,10],"stackptr":44,"parent_stackptr":44}
/core/analysis/callables
/core/analysis/cc
/core/analysis/classes
/core/analysis/classes/attrs
/core/analysis/functions
0x8048394={"name":"sym.imp.printf","bits":32,"type":1,"cc":"cdecl","stack":0,"maxstack":0,"ninstr":1,"bp_frame":true,"bbs":[134513556]}
0x80483a4={"name":"sym.imp.sscanf","bits":32,"type":1,"cc":"cdecl","stack":0,"maxstack":0,"ninstr":1,"bp_frame":true,"bbs":[134513572]}
0x80483b4={"name":"sym.imp.exit","bits":32,"type":1,"cc":"cdecl","stack":0,"maxstack":0,"ninstr":1,"bp_frame":true,"bbs":[134513588]}
0x8048484={"name":"sym.parell","bits":32,"type":1,"cc":"cdecl","stack":28,"maxstack":28,"ninstr":18,"bp_frame":true,"bp_off":4,"bbs":[134513796],"vars":[{"name":"var_4h","type":"int32_t","kind":"b","delta":-8,"accs":[{"off":6,"type":"r","sp":18446744073709551612,"reg":"ebp"},{"off":32,"type":"r","sp":18446744073709551612,"reg":"ebp"}]},{"name":"var_8h","type":"int32_t","kind":"s","delta":-20,"accs":[{"off":9,"type":"w","sp":8,"reg":"esp"}]},{"name":"var_sp_4h","type":"int32_t","kind":"s","delta":-24,"accs":[{"off":13,"type":"w","sp":4,"reg":"esp"}]},{"name":"arg_8h","type":"int32_t","kind":"b","delta":4,"arg":true,"accs":[{"off":21,"type":"r","sp":8,"reg":"ebp"}]}]}
0x80484c8={"name":"sym.check","bits":32,"type":1,"cc":"cdecl","stack":44,"maxstack":44,"ninstr":14,"bp_frame":true,"bp_off":4,"bbs":[134513864,134513958,134513884],"vars":[{"name":"var_8h","type":"int32_t","kind":"b","delta":-12,"accs":[{"off":6,"type":"w","sp":18446744073709551608,"reg":"ebp"}]},{"name":"var_ch","type":"int32_t","kind":"b","delta":-16,"accs":[{"off":13,"type":"w","sp":18446744073709551604,"reg":"ebp"},{"off":31,"type":"r","sp":18446744073709551604,"reg":"ebp"},{"off":99,"type":"r","sp":18446744073709551604,"reg":"ebp"}]},{"name":"arg_8h","type":"int32_t","kind":"b","delta":4,"arg":true,"accs":[{"off":20,"type":"r","sp":8,"reg":"ebp"}]}]}
/core/analysis/hints
/core/analysis/imports
/core/analysis/meta
/core/analysis/meta/spaces
name=CS
spacestack=["*"]
/core/analysis/meta/spaces/spaces
bin=s
/core/analysis/noreturn
/core/analysis/typelinks
/core/analysis/types
/core/analysis/vars
/core/analysis/xrefs
/core/config
/core/debug
/core/debug/breakpoints
/core/file
relative=../bins/elf/crackme0x05
/core/flags
base=0
realnames=0
/core/flags/flags
/core/flags/spaces
name=fs
spacestack=["*"]
/core/flags/spaces/spaces
classes=s
functions=s
imports=s
relocs=s
sections=s
segments=s
strings=s
symbols=s
symbols.sections=s
/core/flags/tags
/core/flags/zones