Commit graph

273 commits

Author SHA1 Message Date
wargio
bbdf3d03bd Fix flirt crc calculation, length and matching 2022-10-26 21:46:22 +02:00
wargio
192f4251fb Fix endianness read&write on cmd_write_bits 2022-10-20 23:12:58 +02:00
Anton Kochkov
3479a9b82a
Convert pv commands to rzshell (#3069) 2022-10-11 23:33:28 +08:00
Anton Kochkov
4a037c2f2a
Convert dk commands to the rzshell (#3078) 2022-10-11 18:02:52 +08:00
Giovanni
171612c5e1
Add ssdeep hash (#3084) 2022-10-10 17:03:26 +02:00
Anton Kochkov
87e369b9a7
Convert de commands to the rzshell (#3083) 2022-10-10 22:10:48 +08:00
Anton Kochkov
24503df48b
Convert pF commands to the rzshell (#3071)
* Convert `pF` commands to the rzshell
* Add json output for PKCS7 and x509 and rename test due FS issues

Co-authored-by: wargio <wargio@libero.it>
2022-10-09 19:18:05 +02:00
wargio
dd92bc3d05 Refactoring and rename RASN1 to RzASN1 2022-10-09 08:09:00 +08:00
wargio
563c70057b Rename RPKCS7/RCMS/Spc to RzPKCS7/RzCMS/RzSpc 2022-10-09 08:09:00 +08:00
wargio
6e5fbe4eef Refactoring names and usages of pkcs7 2022-10-09 08:09:00 +08:00
wargio
a63f07b6c1 Rename RX509* to RzX509* 2022-10-09 08:09:00 +08:00
wargio
4e4565d6aa Refactoring names and usages of x509 2022-10-09 08:09:00 +08: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
Anton Kochkov
7c0bd7cd03 Convert dW command to the rzshell 2022-09-30 15:52:08 +08:00
Anton Kochkov
2a22a1fcc6 Convert dw command to the rzshell 2022-09-30 15:52:08 +08:00
Anton Kochkov
c5e901c332 Convert dg command to the rzshell 2022-09-30 15:52:08 +08:00
Anton Kochkov
4bf6b67212
Convert dd commands to rzshell (#3049)
* Convert `dd` command to rzshell
* Remove unimplemented `dH` command
* Remove `ddt` command
* Move `date` command to the "shell" category
2022-09-29 08:24:50 +08:00
Anton Kochkov
1d7458150e
Convert dx commands to the rzshell (#3043) 2022-09-28 00:49:09 +08:00
Anton Kochkov
d0bd24cf26
Convert dp commands to the rzshell (#3047) 2022-09-27 01:21:25 +08:00
Anton Kochkov
8fd06cd6b7
Convert di commands to the rzshell (#3041) 2022-09-20 20:35:20 +08:00
Anton Kochkov
52260857b5
Convert some of the a commands to the rzshell (#3025)
* Remove `ap` command
* Convert `ad` commands to rzshell
* Convert `aF` command to the rzshell
2022-09-15 21:09:15 +02:00
Dean
59b38e6efa
Add /*<type>*/ comments everywhere (#2986)
Adds /*<type>*/ comments and a linter check from rz-bindgen to enforce
their existence and consistency

Also includes the following fixes made when adding the annotations:
* removed unused intern_table arguments in pyc_dis.c, pyc_dis.h, asm_pyc.c
* removed unused classes argument from place_nodes in agraph.c
* removed unused recurse and recurse_bb functions in canalysis.c
* removed unused vars field from RzPrint struct
* removed unused RzAnalysisType* structs from rz_analysis.h
* removed unused list field from RzEgg struct
* fixed bug in bp_plugin.c where duplication-checking logic iterates over the wrong list
* removed unused q_regs field from RzDebug struct
* removed unused backtrace field from RzDebugPlugin struct
* removed unused classes_list field from RzBinNXOObj struct
* removed unused methods_list and classes_list fields from RzBinZimgObj struct
2022-09-11 13:04:53 +08:00
Anton Kochkov
bdc053097f Move rz_core_project_*() API to the project.c 2022-09-08 07:41:18 +08:00
Anton Kochkov
20792311b4 Move rz_core_file_*() API to the cfile.c 2022-09-08 07:41:18 +08:00
Anton Kochkov
0f352c3ab3 Move RzDebug APIs to the cdebug.c 2022-09-08 07:41:18 +08:00
Anton Kochkov
9b4a1d1be0 Move ESIL and analysis APIs to the corresponding places 2022-09-08 07:41:18 +08:00
billow
46a1929397
Refactor rz_core_analysis_graph*() functions (#2949)
- fix `ags` and `agl` commands
- add more tests for the `ag` commands
- move graph related code to cgraph.c
- remove APIs `rz_core_print_bb_custom` `rz_core_print_bb_gml`
- exports
    - `rz_graph_drawable_to_json_str`
    - `rz_graph_drawable_to_cmd`
    - `rz_graph_drawable_to_gml`
    - `rz_core_graph`
    - `rz_core_graph_diff`
    - `rz_core_graph_format_from_string`
    - `rz_core_graph_type_from_string`
    - `rz_core_graph_write`
    - `create_agraph_from_graph_at`
- add unit/integration tests for the graph API
2022-08-29 22:48:23 +08:00
Giovanni
c89b12a046
Removed plenty of eprintfs in rz_core (#2950) 2022-08-29 00:32:17 +08:00
Anton Kochkov
106a1049dc
Make all visual functions private (RZ_IPI) (#2985) 2022-08-27 22:13:12 +08:00
Riccardo Schirone
9ba89d8116 core/cmd: rewrite rz_cmd_macro API 2022-08-26 07:53:43 +08:00
Riccardo Schirone
544a907443 core/cmd: remove some unnecessary fields for macro handling 2022-08-26 07:53:43 +08:00
Riccardo Schirone
74df176f0f core/cmd: remove brk concept in macros because unused 2022-08-26 07:53:43 +08:00
Riccardo Schirone
cc58442953 core/cmd: remove RZ_API and rz_ pfx from non-exported functions 2022-08-26 07:53:43 +08:00
Riccardo Schirone
02a0b7a1ad core/cmd: just store RzCore reference instead of void *data 2022-08-26 07:53:43 +08:00
wargio
924cb9ea3a fix #2966 #2967 #2974 - oob read in asn1.c 2022-08-24 08:26:37 +08:00
billow
9f4548991d
Expose pda and fix memory leaks (#2943) 2022-08-23 06:56:49 +08:00
billow
4b385978a1
Convert ag to rzshell (#2916)
* `BROKEN=1` for `ag[df]`

Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2022-08-22 08:16:14 +08:00
Florian Märkl
c542bfcb4a Make cb use cfg.bigendian instead of host one
Fixes the remaining test in test/db/cmd/cmd_c on big endian hosts,
tested on OpenBSD/sparc64.
The mask calculation was removed because it was unnecessary (only
comparing selected bytes anyway) and wrong by a factor of 8 (bits vs.
bytes confusion).
2022-08-19 16:10:54 +02:00
Florian Märkl
e4182a6123 Make cu[1248] use cfg.bigendian instead of host one
Fixes the respective test in test/db/cmd/cmd_c on big endian hosts,
tested on OpenBSD/sparc64.
2022-08-19 16:10:54 +02:00
Riccardo Schirone
ac1b0e4d94
core/cmd: fix CHOICES argument selection between choices_cb/choices (#2932) 2022-08-18 20:10:13 +08:00
Riccardo Schirone
56cddfbeb9
core/cmd: print graph when dmhg is executed (#2931) 2022-08-18 18:01:25 +08:00
GustavoLCR
d25dff702a
Fix pg with fewer than 5 arguments (#2921) 2022-08-15 11:23:37 +08:00
wargio
25ff470ecd Removing dead code in esil.
Before this fix, rz_analysis_archinfo(RZ_ANALYSIS_ARCHINFO_DATA_ALIGN) always returned -1
because the RZ_ANALYSIS_ARCHINFO_DATA_ALIGN value was not set in the switch;
when the code was refactored, this broke esil because several checks that were always set
as true, now were actually correctly executed.
To resolve this the dead code has been removed.
2022-08-13 22:52:24 +02:00
billow
2f1fa9e491
Expose rz_core_clippy API (#2909) 2022-08-12 09:26:25 +08:00
billow
eefbbed7d3
Expose pds as an API (#2885)
* expose `rz_core_print_disasm_strings()`
2022-08-09 09:26:28 +08:00
Khairul Azhar Kasmiran
1c9f93f7ef
Move rz_str version funcs into version.c (#2890)
* Move rz_str version funcs into `version.c`
* Move func prototypes into `rz_util/rz_version.h`
* Use `rz_version_` prefix instead of `rz_str_`
2022-08-08 22:30:28 +08:00
billow
1054e6295f
Export pcA as rz_core_print_bytes_with_inst (#2880)
* export `rz_core_print_bytes_with_inst`
* move `pcA` to rzshell
2022-08-07 00:28:01 +08:00
Giovanni
68358b1628
Fix always true if due wrong check in search (#2879) 2022-08-06 10:34:39 +02:00
Riccardo Schirone
4181be2a6f core/cmd: fix afx command JSON output 2022-08-05 15:10:24 +02:00
billow
0908b65bc3
Convert px[ dDhHwWqQol] to rzshell
* `pxd` -> `pxd 4`
* `pxd<N> [len]` -> `pxd <N> [len]`
* expose APIs:
- `rz_core_print_cmp`
- `rz_core_print_dump`
- `rz_core_print_hexdump_`
- `rz_core_print_hexdump_byline`
* test for `pxW` `pxH`
* move `void rz_print_section` -> `const char *rz_print_section`
* `pxd` -> `pxd[ hwq]`
* `pxc`
* `pxAv` -> `pxAl`
* `pxt.` -> removed ?
* `px/` -> keep
* `pxf` -> TODO: not found old code ?
2022-08-04 09:11:22 +08:00