Commit graph

242 commits

Author SHA1 Message Date
wargio
7685bfe90e remove rz_mem_swaporcopy 2022-10-20 23:12:58 +02:00
Giovanni
e2ee0c3fd6
Rewritten bin_nin3ds.c and add test (#3110) 2022-10-20 19:56:17 +02: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
e68c2cf882 Ownership and doxygen for rz_protobuf_decode 2022-10-09 08:09:00 +08: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
8f40517990 Refactor rz_float_new_from_utXX_as_fXX 2022-09-16 21:55:58 +08:00
wargio
8a4e9ce404 Enums and structs needs to be unique to avoid clashes with common names 2022-09-16 21:55:58 +08:00
Heersin
b13202b934
RzUtil: softfloat support based on bitvector (#2784) 2022-09-14 14:38:22 +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
Khairul Azhar Kasmiran
9b2e6bb2de
Remove multibyte conversion functions (#3000) 2022-09-02 16:51:32 +02:00
Khairul Azhar Kasmiran
da374939eb
Remove rz_str_mb_to_wc_l() (#2998) 2022-09-01 23:27:17 +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
Anton Kochkov
106a1049dc
Make all visual functions private (RZ_IPI) (#2985) 2022-08-27 22:13:12 +08:00
wargio
924cb9ea3a fix #2966 #2967 #2974 - oob read in asn1.c 2022-08-24 08:26:37 +08:00
wargio
0e86b74b1d Fix RzBitmap length type and added ownership and checks. 2022-08-17 21:20:37 +02:00
Khairul Azhar Kasmiran
54508aee39
Rename rz_version.h.in to rz_build_version.h.in (#2914) 2022-08-13 22:20:36 +08:00
karliss
167ef728c3
Avoid warning about unused endian for single byte (#2910) 2022-08-12 13:52:16 +02:00
Heersin
a9c59ce1dd
Add rz_bv_range_set and rz_bv_is_all_one to bitvector lib (#2891) 2022-08-10 08:20:16 +08:00
Khairul Azhar Kasmiran
d1f9006b8f
Add documentation to rz_version_str() (#2893) 2022-08-09 22:11:40 +08:00
billow
215e49253d
Fix windows and cpp compatibility (#2887) 2022-08-08 17:57:30 +02: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
Khairul Azhar Kasmiran
44e94af8a9
Add new API function rz_str_gittip() (#2884) 2022-08-07 13:33:59 +02:00
billow
7bd736d27e fix rz_lang_byte_array.h 2022-08-05 23:40:28 +02:00
Dhruv Maroo
2205f3623f
Use clang-format 14 instead of 13 (#2846) 2022-08-05 23:30:07 +05:30
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
wingdeans
a6a7a5f530 Fix annotation inconsistencies 2022-08-03 00:29:56 -04: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
Dean
f1b2e7bd75
Additional header changes for rz-bindgen (#2852)
* make `rz_bin_section_{new,free}()` symbols public
* add types for rz_analysis, rz_num, rz_flag
2022-07-30 22:33:58 +08:00
billow
10d7c697b4
Remove cb_printf() from RzPrint
* move `rz_print_jsondump()` -> `rz_print_jsondump_str()`
* move `rz_print_hexdiff()` -> `rz_print_hexdiff_str()`
2022-07-29 09:11:55 +08:00
billow
df602944d7
rz_print_hexdump() refactoring (#2841)
* Move `rz_print_hexdump()` -> `rz_print_hexdump_str()`
2022-07-28 00:24:25 +08:00
Rot127
c009f8d7a3
Tokenize and colorize asm strings (#2417)
This introduces the ability to split asm strings into tokens and assign a type to them.

This means:
* Each asm strings is assigned a list of tokens. Each token points to a sub-string.
* A token has a type attached which describes it (e.g. register token, operator token, mnemonic token etc.)
* A generic parsing method is introduced which splits an asm string into tokens. The pattern it parses is `<mnem> <op> <op> ...`.
* Instead of the generic method, plugins can create the token strings on their own.
* An API method was introduced to help plugins implement their own parsing methods via regex patterns.
* Custom token strings are stored in `RzAsmOp.asm_toks`

Additionally the coloring of asm strings is now exclusively done via the token strings.
* For this a function was added to colorize tokenized asm strings according to their token types.
2022-07-27 08:52:01 -04:00
Dean
6b7ea38969
Prepare headers for rz-bindgen (#2786)
* add some missing /*<types>*/ to rz_core, bin, analysis, cons
* add annotation attributes for rz-bindgen
* fix extern "C" in some headers
* rename RzBuffer functions from length to len
* fix rz_core_analysis_name naming conflict
2022-07-22 01:09:19 +08:00
Rot127
ccdd9f2848
Add UTF-8 friendly strchr (#2809)
* Add utility functions to search for UTF-8 chars in strings.

* Break loop if number of read bytes goes beyond str.

* Add doxygen to `rz_mem_cmp`

* Add NULL checks to functions.
2022-07-18 17:53:58 +08:00
Riccardo Schirone
470e030f19
util: provide rz_time_gettimeofday API (#2811) 2022-07-17 09:57:00 +08:00
Anton Kochkov
b2d9429129
Remove sdb json (#1118)
* Drop sdb_json in `librz/cons/grep.c`
* Do not print the JSON key in grep
* Use proper JSON paths in tests
* Use signed number in case of RzJson in tests
* Do not add quotes for sole RZ_JSON_STRING
2022-07-12 22:48:33 +08:00
Riccardo Schirone
2f1e39818e Add liblzma subproject 2022-07-02 10:12:26 +02:00
Khairul Azhar Kasmiran
5f826df878
Remove 1 from some header guards (#2765) 2022-07-01 22:15:12 +08:00
Giovanni
ea02b0d25f
Remove zignatures and move aaF[l] -> F[al] , zf[sdc] -> F[sdc] (#2682) 2022-06-29 07:49:43 +08:00
Giovanni
6567e6ba4e
Multithread string search (#2665) 2022-06-27 23:34:08 +02:00
David Carlier
4ff50c02c2 Update rz_sys_breakpoint proposal.
When available, using `__builtin_debugtrap` which plays better
with debuggers than `__builtin_trap` (SIGTRAP vs SIGILL).
2022-06-25 11:34:36 +02:00
Giovanni
a2d23a8e11
Remove RQueue (#2720) 2022-06-22 22:41:05 +08:00
Dean
e7f85fd409
Clean up headers (#2719)
* Remove duplicate declarations
* Remove undefined functions
2022-06-22 07:30:50 +08:00
Giovanni
4dfad73567
Remove RZ_BIN_STRING_ENC_* in favor of RZ_STRING_ENC_* (#2716) 2022-06-21 18:45:09 +02:00
Giovanni
88d71a6f67
Cleanup of utf8.c and utf16.c files. (#2715) 2022-06-21 12:12:48 +02:00
Rot127
f108873520
Rework register profile parsing
**Register profile parsing**

- Types, sizes, and offsets get now parsed separately in their own functions.
- More logging added.
- The string is first parsed into a list of register definitions and alias (`RzRegProfileDef`, `RzRegProfileAlias`) and afterward applied to `RzReg.regset`.
- Documentation was added on how the register profile needs to be formatted.
- Functions are more consistent with return types (most return `bool` now instead of `Error Msg` + `NULL`).

**New register profile structs**

The register profile of `RzReg` consists of two lists with alias and definitions.
I chose lists over NULL-terminated arrays because they were a little easier to handle during parsing (no memory management).
Please let me know if you would strongly prefer the NULL-terminated version.
2022-06-20 20:54:42 +08:00
GustavoLCR
19546cb498 Print: Memoize number of rows for current print 2022-06-19 17:29:42 +08:00