- Introduce the following new methods: * `rz_analysis_similarity_basic_block()` * `rz_analysis_similarity_function()` * `rz_analysis_similarity_basic_block_2()` * `rz_analysis_similarity_function_2()` * `rz_analysis_match_basic_blocks()` * `rz_analysis_match_functions()` * `rz_analysis_match_basic_blocks_2()` * `rz_analysis_match_functions_2()` - Remove `RzAnalysisDiff` and its usages - Remove `librz/analysis/diff.c` entirely to and adds `librz/analysis/similarity.c` - Remove a lot of unused structures and simplified the code by a lot - Fix typo in levenshtein - Remove `librz/core/gdiff.c` and `gdiff` functions since they were unused or only used in rz-diff - Remove `difftype` (or "color") from `RzANode` which lead to dead code - Decrease serialized data in projects. - Add `RzAnalysisVarKind` and `RzAnalysisVarType` and replaces all the hardcoded values - Remove command `agd` - Remove all `rz_core_gdiff` usages from `rz_core.h` - Refactor `rz_analysis_var_list` and `rz_analysis_var_count` due unused argument (`RzAnalysis` was not used) - Add new method `rz_analysis_var_count_total` to simplify some usages - Remove `rz_core_graph_diff` - Add `typedef RzAnalysisFcnType` on `enum``used for function types - Remove unused `RZ_ANALYSIS_FCN_VARKIND_LOCAL` - Remove from `RzAnalysisFunction` the following variables: * `fingerprint` * `fingerprint_size` * `diff` * `diff_ops` * `diff_thbb` * `diff_thfcn` - Remove from `RzAnalysisBlock` the following variables: * `fingerprint` * `diff` - Remove `RZ_ANALYSIS_THRESHOLDBB` and `RZ_ANALYSIS_THRESHOLDFCN` - Remove the following callbacks from `RzAnalysisPlugin` * `RzAnalysisDiffBBCallback` * `RzAnalysisDiffFcnCallback` * `RzAnalysisDiffEvalCallback` - Fix fancy table columns/rows when a color string is in a cell - Bumped project version to 9
270 lines
4.3 KiB
Text
270 lines
4.3 KiB
Text
NAME=p-h out of bounds
|
|
FILE=bins/mach0/mach0-x86-64
|
|
CMDS=<<EOF
|
|
aaa
|
|
p-h @ 0x100001010 @e:search.in=bin.section
|
|
EOF
|
|
EXPECT=<<EOF
|
|
|
|
.-------------------------------------------------.
|
|
| offset | flags | funcs | cmts | syms | str |
|
|
)-------------------------------------------------(
|
|
| 0x100001000 | 3 | 0 | 1 | 0 | 0 |
|
|
| 0x100001010 | 2 | 0 | 1 | 0 | 0 |
|
|
)-------------------------------------------------(
|
|
| | 5 | 0 | 2 | 0 | 0 |
|
|
`-------------------------------------------------'
|
|
|
|
EOF
|
|
RUN
|
|
|
|
NAME=p-
|
|
FILE=bins/elf/analysis/x86-helloworld-gcc
|
|
CMDS=<<EOF
|
|
s 0x8048000
|
|
e search.in=io.map
|
|
p-
|
|
e search.in=io.maps
|
|
p-
|
|
EOF
|
|
EXPECT=<<EOF
|
|
0x08048000 [^._______ssss_s__ssssss_ss_ss_ss__sz_s____s] 0x0804859c
|
|
0x08048000 [^_sssssszss_____________________________s_s] 0x080496d0
|
|
EOF
|
|
RUN
|
|
|
|
NAME=p- without any file
|
|
FILE=--
|
|
CMDS=p-
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=p- with malloc://512
|
|
FILE=malloc://512
|
|
CMDS=p-
|
|
EXPECT=<<EOF
|
|
0x00000000 [^__________________________________________] 0x00000200
|
|
EOF
|
|
RUN
|
|
|
|
NAME=p- bounds
|
|
FILE=malloc://0x1000
|
|
CMDS=<<EOF
|
|
e hex.cols=0
|
|
f test @ 0x1000
|
|
p- 0x40 # 0x1000 % 0x40 = 0
|
|
p- 0xa # 0x1000 % 0xa != 0
|
|
f- test
|
|
f test @ 0xfff
|
|
p- 0x40 # 0x1000 % 0x40 = 0
|
|
p- 0xa # 0x1000 % 0xa != 0
|
|
EOF
|
|
EXPECT=<<EOF
|
|
0x00000000 [^_______________________________________________________________] 0x00001000
|
|
0x00000000 [^_________] 0x00001000
|
|
0x00000000 [^______________________________________________________________.] 0x00001000
|
|
0x00000000 [^________.] 0x00001000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=p-j
|
|
FILE=malloc://0x1000
|
|
CMDS=<<EOF
|
|
e hex.cols=0
|
|
f test @ 0x1000
|
|
p-j 0x4~{} # 0x1000 % 0x4 = 0
|
|
?e -------
|
|
p-j 0xa~{} # 0x1000 % 0xa != 0
|
|
?e -------
|
|
f- test
|
|
f test @ 0xfff
|
|
af+ hello @ 0x3ff
|
|
afb+ 0x3ff 0x3ff 0x10
|
|
p-j 0x4~{} # 0x1000 % 0x40 = 0
|
|
?e -------
|
|
p-j 0xa~{} # 0x1000 % 0xa != 0
|
|
EOF
|
|
EXPECT=<<EOF
|
|
{
|
|
"from": 0,
|
|
"to": 4096,
|
|
"blocksize": 1024,
|
|
"blocks": [
|
|
{
|
|
"offset": 0,
|
|
"size": 1024,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 1024,
|
|
"size": 1024,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2048,
|
|
"size": 1024,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 3072,
|
|
"size": 1024,
|
|
"perm": "rwx"
|
|
}
|
|
]
|
|
}
|
|
-------
|
|
{
|
|
"from": 0,
|
|
"to": 4096,
|
|
"blocksize": 410,
|
|
"blocks": [
|
|
{
|
|
"offset": 0,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 410,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 820,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 1230,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 1640,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2050,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2460,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2870,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 3280,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 3690,
|
|
"size": 406,
|
|
"perm": "rwx"
|
|
}
|
|
]
|
|
}
|
|
-------
|
|
{
|
|
"from": 0,
|
|
"to": 4096,
|
|
"blocksize": 1024,
|
|
"blocks": [
|
|
{
|
|
"offset": 0,
|
|
"size": 1024,
|
|
"flags": 1,
|
|
"functions": 1,
|
|
"in_functions": 1,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 1024,
|
|
"size": 1024,
|
|
"in_functions": 1,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2048,
|
|
"size": 1024,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 3072,
|
|
"size": 1024,
|
|
"flags": 1,
|
|
"perm": "rwx"
|
|
}
|
|
]
|
|
}
|
|
-------
|
|
{
|
|
"from": 0,
|
|
"to": 4096,
|
|
"blocksize": 410,
|
|
"blocks": [
|
|
{
|
|
"offset": 0,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 410,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 820,
|
|
"size": 410,
|
|
"flags": 1,
|
|
"functions": 1,
|
|
"in_functions": 1,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 1230,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 1640,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2050,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2460,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 2870,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 3280,
|
|
"size": 410,
|
|
"perm": "rwx"
|
|
},
|
|
{
|
|
"offset": 3690,
|
|
"size": 406,
|
|
"flags": 1,
|
|
"perm": "rwx"
|
|
}
|
|
]
|
|
}
|
|
EOF
|
|
RUN
|