Commit graph

138 commits

Author SHA1 Message Date
Giovanni
5789f6557e
Threaded analysis matching (#3090) 2022-10-24 00:40:42 +02:00
Anton Kochkov
9f6e13f364
Remove rz-agent (#3087) 2022-10-12 10:34:46 +02:00
Giovanni
171612c5e1
Add ssdeep hash (#3084) 2022-10-10 17:03:26 +02:00
wargio
fbad0b4859 Remove agd and add rz_analysis_similarity/match + refactoring
- 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
2022-10-04 20:02:35 +02:00
Giovanni
5b1e5e6762
Support blake3 hash algo (#3030) 2022-09-17 18:38:21 +02:00
Giovanni
ade374378e
Add free-pascal demangling support (#3011)
* Add free-pascal demangling support
* Fixed tests
2022-09-06 10:39:58 +08:00
Giovanni
c89b12a046
Removed plenty of eprintfs in rz_core (#2950) 2022-08-29 00:32:17 +08:00
wargio
0eef58115b Rewritten (partially) rz_run_parseline 2022-08-22 13:50:39 +02:00
Dhruv Maroo
d44b5748eb
[RzIL] IL lifting of SuperH ISA (#2518)
* Add an assembler for the SuperH ISA
	* Rewrite GPL GNU disassembler code
2022-08-02 02:37:03 +05:30
GustavoLCR
a6bd48f98b
Fixes for tests (#2818)
* Close files before trying to delete them
* Add `-N` to not load the rizinrc in `read from stdin` test to avoid overwriting the color setting
* Make sure `.tmp` exists for `idpx` test
2022-07-19 18:09:33 +08:00
Khairul Azhar Kasmiran
b79201b49a
Remove RZ_BIRTH (#2803) 2022-07-13 17:01:42 +08:00
billow
40ca22202b
Refactor rz_core_print_disasm_json (#2746)
* Split `rz_core_print_disasm_json` as: `rz_core_print_disasm_json` and `rz_core_disasm`
* Use `rz_str_enc_string_as_type` in `ds_init`
* Refactor `rz_core_print_disasm` and `rz_core_handle_backwards_disasm`
* Add `rz_core_asm_bb_middle`
* Move global `disasm_texts` to `RzDisasmState`
* Rewrite `core_analysis_bytes_standard` with `rz_core_analysis_bytes`
* Add `test_rz_core_print_disasm` and `test_rz_core_analysis_bytes`
* Rewrite `rz_core_print_disasm` with `RzCmdStateOutput`
* `pdi` -> `pdq` in tests
* `pdi` -> `pDq` in tests
* `pid` -> `pdq` in tests
* `pId` -> `pDq` in tests
* `pij` -> `pdj` in tests
* `pIj` -> `pDj` in tests
* `pdeqq` -> `pdeQ` in tests
* Remove `pDJ` from `test/db/json/`
2022-07-09 08:10:06 +08:00
Luca Borzacchiello
2d69ecbb22
Better false-positives detection in rz_scan_strings (#2691)
* Improved false-positive detection in str_search

This commit adds the following features:
- Extend the false-positive check on ASCII frequencies to all UTF strings
- Add a global option to activate/deactivate di check
- Improve the false-positive heuristic by adding a special case for extended-ASCII strings
2022-06-14 22:14:13 +08:00
BraveBoii
782fcd5257 Updated sflib 2022-06-08 20:50:31 +08:00
Riccardo Schirone
e36d66abe7 Remove analysis.endsize config
Commit taken from radare2 project:
03afa631ff37ecb7585d3d4bb052f7208e68c25dA ("Kill anal.endsize ##anal")
2022-05-18 10:25:01 +02:00
Riccardo Schirone
cdc80202dd RzCore: add scr.prompt.flag.only config var 2022-05-16 13:16:28 +02:00
Riccardo Schirone
27e0d7ae82
RzBin: improve handling of addresses in ELF (#2591)
* RzBin/ELF: avoid the creation of useless flags at 0

Use UT64_MAX as an error value for addresses like symbols, imports,
sections, etc., and do not create flags for those because they are not
meaningful. This is useful for imports that do not have an address in
the virtual/file space and for non-alloc sections (e.g. .comment).
2022-05-10 10:17:35 +08:00
Khairul Azhar Kasmiran
ef7b1a0153
rizin.c: Use RZ_LOG_ERROR instead of eprintf for obvious errors (#2553) 2022-04-19 21:26:50 +08:00
Dhruva Gole
e547fe6720
rz-ax: count set bits in number (#2513)
Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
2022-04-12 17:13:34 +02:00
Khairul Azhar Kasmiran
8f320a474f
Support rizin - on Windows (#2482) 2022-04-01 21:47:19 +08:00
Giovanni
f87025d1e8
Remove cb_printf() from RzBin (#2446)
* Remove `cb_printf()` from RzBin
* Removed `bin.rawstr` from `rz-bin`
* Dropping `izzz` since does the same as `izz`
* Fix PE one section executables
* Fix behaviour of BFLT, LE, and SMD bin plugins
2022-03-26 20:30:55 +08:00
wargio
f3ad6c8516 Moved rz_print_randomart under rz_hash and removed it from rz-ax 2022-03-06 16:29:03 +01:00
Khairul Azhar Kasmiran
3125603f89
Complete prompt cycle in prompt tests (#2381) 2022-03-04 20:33:09 +08:00
Khairul Azhar Kasmiran
d525579475
Add tests for Rizin prompt (#2377) 2022-03-03 17:24:22 +01:00
GustavoLCR
ddea0c01e7 PDB: Add/fix tests 2022-02-25 13:17:20 +08:00
Peiwei Hu
9258676789
rz-find: enable search within import and symbol table (#2256)
adds the ability of searching within import and symbol table
command -S has been changed to -w
2022-02-15 13:40:00 +01:00
Florian Märkl
2bdec10f98
Fix cpu in rz-asm -A (#2303)
For analysis info, the cpu also needs to be set on the RzAnalysis, not
only RzAsm.
2022-02-11 22:53:02 +01:00
Riccardo Schirone
2c02457109
Convert o commands to rzshell (#2281) 2022-02-07 18:23:31 +01:00
wargio
8d238ddfc8 Fix asm tests 2022-02-06 15:50:50 +01:00
Anton Kochkov
2f638cad1e Convert f commands to rzshell
* Changed behavior of `f` to only add flag if there is none
* Changed behavior of `f+` to add flag in any case
* Moved listing subcommands from `f` to `fl`
* Moved listing subcommands from `f.` to `f.l`
* Added subcommand `f.l*` to list all local flags in all functions
* Listing flags at the current offset became `fl.`
* Moved `f=` to `fl=`
* Old `fl` (flag length) now became `fL`
* Removed original `fe` commands
* Old `f?` (check if flag exists) now became `fe`
* Removed `fV` commands
* Removed `fn` commands in favor of `fl` and `asm.flags.real=true`
* Removed `fS` commands (`fSo` and `fSn`)
* `fo` became `fortune` and moved from "flags" to "shell" category
* Removed oldshell handlers of the `z` commands
2022-02-03 21:46:42 +08:00
Giovanni
afe1dc3bae
[FLIRT] Add sigdb details and fixed bugs #2223 2022-01-20 17:19:40 +01:00
Florian Märkl
c8a6359d83
Change IL string syntax to s-expressions (#2193)
Before:
	store(key:var(v:ptr), value:add(x:load(key:var(v:ptr), mem:0),
	    y:int(value:1, length:8)), mem:0)
After:
	(store 0 (var ptr) (+ (load 0 (var ptr)) (bv 8 0x1)))

S-Expressions like this are more concise and will be trivial to parse,
in case we want a parser for this later. It is also very similar to what
BAP uses, so it will be easier to compare.
2022-01-11 10:08:41 +01:00
Florian Märkl
cd938d2083 Add -I (IL lifting) option to rz-asm
$? is also set to the return value of a command run by ! for testing
this.
2022-01-10 19:27:09 +01:00
Anton Kochkov
1b2748604e
Fix the RZ_BIN_PREFIX test for Windows (#2189)
* Fix the RZ_BIN_PREFIX test for Windows
* Do not use previous VS2019 image
2022-01-09 13:47:38 +08:00
Giovanni
3e9598d298
RzDiff optimizations and fix #1770 (#2156)
* Added infinite scroll
* Avoid analyzing the whole bin when graph diffing functions
2022-01-03 13:10:44 +01:00
wargio
d92a708541 [FLIRT] add info extraction 2021-12-23 17:06:55 +01:00
Giovanni
d6625126d5
[FLIRT] pac to pat (#2116) 2021-12-19 13:42:00 +01:00
Riccardo Schirone
9465cca0f5 Replace AES code with Nettle one which is LGPLv3
Code taken from https://git.lysator.liu.se/nettle/nettle and placed in
its own subproject.
2021-12-17 09:18:47 +01:00
Riccardo Schirone
27e135b5d5 Replace RSA-MD licenses-code for MD5 with LGPL one
Get the MD5 code from
https://github.com/FreeRADIUS/freeradius-server/blob/v1.1.x/src/lib/md5.c
which is LGPL and it has fewer integration problems with the other
licenses.
2021-12-17 09:18:47 +01:00
Giovanni
57f83bd657
[FLIRT] Create signatures from RzAnalysis data (#2036)
Add pac and sig creation with options & compression via commands and via new rz-sign
Add missing arch (arc, pic, riscv, spc700 xtensa, and more)

Side note:
on other tools public functions and references are generated in a sequential 
way besides the first one which is the first to be assigned.
since we do not search for sequential references, then we can avoid to
add extra public or referenced functions

Extra:
* Refactoring rz_analysis_mask definition
* Add rz_str_startswith_const and rz_list_iter_get_next_data
2021-12-15 19:08:16 +01:00
Anton Kochkov
715dd14811
Remove unused, unupdated and largely untested ARM WineDBG and GNU (Binutils) plugins (#2085)
* Remove WineDBG ARM RzAsm plugin
* Remove unused and untested ARM GNU target
2021-12-10 16:40:58 +01:00
billow
46533d41eb
EBCDIC character support (#1643) 2021-11-22 09:48:57 +08:00
Aswin C
54b6e53feb
Convert ec to the rzshell (#1809)
* Convert `ec` to the rzshell
* Port the `echo` command
* Make the `color` argument optional for `ecHw`
* Remove `rz_core_echo`
* Make `echo` a part of `e` commands
* Add tests for `eco` and `ecHw`
* Move the definition of `bool2status` to `cmd_eval.c`
* Fix `ecHj` and add a test for it
2021-10-22 13:33:35 +08:00
Theofilos Pechlivanis
2f181b9053
Fix #469 by checking the value of analysis.jmp.cref (#1594) 2021-10-13 14:32:47 +02:00
Giovanni
75aa120c90
Added -e option to rz-diff (#1817) 2021-10-11 17:52:59 +02:00
Basstorm
19a6a929f9
Rewrite PDB parser ##bin (#1517)
* Rewrite PDB parser to become endianess-independent
* Use type pretty-printing API
* Use `RzCmdStateOutput` instead of `RzOutputMode` to solve invalid JSON issue
* Move PDB-related print functions to `cpdb.c`
* Use flag API instead of calling commands from the code
* Separate printing from parsing and applying the type information
* Delete useless `main.c`
2021-10-09 16:57:29 +08:00
Giovanni
e224ee7b28
Add demangling as plugins and libdemangle as external dependency (#1656)
* Added demangling as plugins and libdemangle as external dependency
* Added iDl to return the list of demanglers
* moved demangling tests into rz-libdemangle and keep only bin tests
2021-10-01 10:45:38 +00:00
Khairul Azhar Kasmiran
300714c38c
rz_utf8_decode(): Declare overlong encodings as invalid UTF-8 (#1764) 2021-09-29 09:25:03 +08:00
Alexis Ehret
01b6e60775
Refactor elf plugin interface (#1728)
* get_sdb
* check_buffer
* load_buffer
* baddr
* boffset
* binsym
* entries
* headers
* create
* fields
2021-09-28 13:36:46 +08:00
GustavoLCR
fa9146c6c8
Fix rax -t not considering GMT argument 2021-09-24 11:46:12 +08:00