Commit graph

26810 commits

Author SHA1 Message Date
Riccardo Schirone
86f6fec835
Add rzshell_which script to look for the handler of a rzshell cmd (#1839)
* remove isort linter on CI
2021-10-19 15:43:11 +02:00
Riccardo Schirone
a3ccc64912
Add files required to build packages for OBS (#1853)
* Add SPEC/Deb files to create packages for OBS
* Add INSTALL.md instructions
2021-10-19 15:42:29 +02:00
Dhruv Maroo
6da244eca7 Update db commands according to the new syntax after newshell port 2021-10-19 14:20:29 +08:00
Anton Kochkov
09cbd2648d Move visual modes to librz/core/tui/ 2021-10-18 22:28:19 +08:00
Khairul Azhar Kasmiran
e595da9cd3
Add comment to RZ_(BIN_)STRING_ENC_8BIT (#1851) 2021-10-18 18:26:34 +08:00
Anton Kochkov
036f1490d0 Move command handlers to librz/core/cmd 2021-10-18 18:00:17 +08:00
Riccardo Schirone
1172c4085c Re-design the way ? and ?? are used in rzshell
* `<cmd>?` allows to list the sub-commands of <cmd>. If <cmd> has no
  sub-commands, the full help of <cmd> is printed instead.
* `<cmd>??` allows to always list the full help of <cmd>. Useful when
  <cmd> is both the name of a group and a command itself.
* output modes are only listed as part of the full help and not
  considered as sub-commands.
* fix a bug where `<cmd><mode>?` was just printing the list of
  sub-commands of <cmd> instead of the full help of <cmd><mode>.
2021-10-18 11:57:17 +02:00
chinggg
42b7525f5c Fix invalid v command resulting in black screen 2021-10-18 10:26:56 +02:00
Khairul Azhar Kasmiran
637c192145
bin.str.enc: Rename latin1 to the more generic 8bit (#1847)
* Rename `rz_str_escape_latin1()` to `rz_str_escape_8bit()`
* test_serialize_analysis.c: Change string from "latin1" to "8bit"
* `bin.str.enc`: Rename `latin1` to the more generic `8bit`
2021-10-18 12:07:52 +08:00
Dhruv Maroo
897c5bf641
Retain prompt when exiting using ^D (#1846) 2021-10-16 15:25:42 +02:00
Khairul Azhar Kasmiran
cb46249098
Rename Csa to Csb (#1844) 2021-10-16 15:50:59 +08:00
Anton Kochkov
9ac3e8f263 Add Csp command to add Pascal strings 2021-10-16 11:33:48 +08:00
Anton Kochkov
e835652470 Rename RZ_STRING_TYPE_* to RZ_BIN_STRING_ENC_* 2021-10-16 11:33:48 +08:00
Anton Kochkov
022c606372 Rename RzStrEncOptions to RzStrEscOptions 2021-10-16 11:33:48 +08:00
Riccardo Schirone
ed9dbd3ef0
RzCmd: colorize arguments mentioned in summary/descriptions (#1842) 2021-10-15 17:38:05 +02:00
Anton Kochkov
39613b5c16
Port C (metainformation) commands to the rzshell (#1752)
* Do not escape strings during the search
* Port `C` (metainformation) commands to the rzshell
* Improve string autodetection
* Remove `Cr` and RZ_META_TYPE_RUN
* Escape `\x1b` as `\e` character in strings
* Move string encoding options to `RzStrEncOptions` struct
* Add `esc_double_quotes` option to `RzStrEncOptions`
* Do not filter out unprintable characters for uppercase check
* Use `esc_double_quotes` when printing the string between '"' in disasm
* Use signed chars on all platforms/architectures

Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
2021-10-15 16:48:18 +08:00
Giovanni
92c4ec0141
Adding timeouts to long tests (#1822)
* Update sections
* Update mdmp
2021-10-14 09:19:56 +00:00
Giovanni
215113b49e
Fixed build warning (#1832) 2021-10-13 17:38:08 +02:00
Theofilos Pechlivanis
2f181b9053
Fix #469 by checking the value of analysis.jmp.cref (#1594) 2021-10-13 14:32:47 +02:00
Anton Kochkov
af1d7ecb78
Minor code style updates in RzCons (#1825)
* Minor code style updates in RzCons
* Remove `e graph.bubble` config and "bubble" ASCII graph
2021-10-13 12:38:05 +08:00
Khairul Azhar Kasmiran
581e84a756 Revert "Revert OpenBSD buildtype back to debugoptimized and remove its MALLOC_OPTIONS=S (#1827)"
This reverts commit ef92170c16.
2021-10-12 23:23:56 +08:00
Khairul Azhar Kasmiran
ef92170c16
Revert OpenBSD buildtype back to debugoptimized and remove its MALLOC_OPTIONS=S (#1827) 2021-10-12 22:41:26 +08:00
Anton Kochkov
7bbb2d9283
Update GitHub labeler settings (#1823) 2021-10-12 12:07:23 +02:00
Anton Kochkov
9661c81a6a
Fix RzILOpNot name for use in bindings (#1820) 2021-10-12 10:44:10 +02:00
David CARLIER
f4311e3fcb
librz: build warning fix (#1821) 2021-10-11 22:30:24 +02:00
Giovanni
69b509a157
Fix RzIL headers (#1819)
* Fixed RzIL headers and il
* Added c++ guards
2021-10-11 17:53:23 +02:00
Giovanni
75aa120c90
Added -e option to rz-diff (#1817) 2021-10-11 17:52:59 +02:00
Khairul Azhar Kasmiran
f98680aab4
Fix -Warray-bounds warnings in gcc-11 build (#1818) 2021-10-11 22:33:48 +08:00
Riccardo Schirone
dd04668233
Update dev version to v0.4.0-git (#1813) 2021-10-11 11:06:33 +02:00
Khairul Azhar Kasmiran
b80cadf756
Switch to ubuntu:hirsute for gcc-11 build (#1811) 2021-10-10 18:41:05 +02:00
Heersin
e0d3d6bc66
New RZIL integration (#1663)
The new intermediate language is based on the BAP (Binary Analysis Platform) Core Theory.
It operates on SMT-like bitvectors and their arrays to represent values and memory.
Apart from that, it has also representation for the data and code side effects.
2021-10-09 18:14:44 +08: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
Dhruv Maroo
afd1bab3c0
Port db commands to newshell (#1777)
* Add `db` commands in `cmd_debug.yaml`

* Use bool instead of int as return value

* Port `db` commands to newshell

* Fix integration tests. Use `db- <addr>`, instead of `db-<addr>`

* Fix `dbW` handler and update `rz_w32_add_winmsg_breakpoint`

* Remove checks for `argc` in `cmd_debug.c` (from review)

* Fix failing Windows tests

* Change control flow in conditional expressions

* Use `RzCmdStateOutput` in handler for `dbt` to print backtrace in various formats

* Use forward slash (/) instead of pipe (|) for command descriptions

* Use output modes for printing breakpoints in `db` handler

* Remove extra newline while printing breakpoints in JSON format

* Change description for `dbc` command

* Update descriptions and handlers; Remove <addr> argument wherever necessary

* Use `RZ_CMD_ARG_TYPE_CHOICES` for perm in `dbw`

* Add details for `dbC` and `dbw`

* Add quiet printing mode for breakpoints

* Remove unnecessary <addr> argument for `db` commands

 * Also add a quiet output mode for `dbl` and `dbt`

* Return if no breakpoint found in function `add_breakpoint`

* Update tests for new `db` commands

* Update `db` command descriptions

 * Remove `dbi.` redundant command
 * Add details for iterating through the list of breakpoints

* Extract `rz_debug_bp_add_noreturn_func` into `debug.c` as RZ_API

* Fix `dbil` handler and `dbg_bps` test

* Shift the noreturn function breakpoint to `cdebug.c`

* Format according to clang-format

* Fix failing integration tests

 * TODO: Find why `db- @@c:dblq` is failing, and fix the bug

* Update `db` commands

* Use `db- @@c:dblq` instead of `db-*`

 * This will also work as a test for command edits (see https://github.com/rizinorg/rizin/pull/1806)
2021-10-08 21:40:51 +05:30
Riccardo Schirone
64be19f082 Move TSLanguage initialization into new rz_core_cmd_new API 2021-10-08 15:38:16 +02:00
Riccardo Schirone
5330777882
Use a stack to store the trees/input while applying command edits (#1806)
* Use a stack to store the trees/input while applying command edits

Command edits are performed when there is a need to rewrite part of the
user input, in order to support things like command substitution and
also rewriting one command in terms of another (e.g. @@c: is rewritten
in terms of @@=).

It can happen that multiple nested edits are necessary in execute a
script, thus it is necessary to maintain a stack of saved things,
instead of just one element.
2021-10-08 19:25:46 +08:00
Riccardo Schirone
291c6e9e9a
Add RzBinResource type and use it to print resources (#1804) 2021-10-08 16:47:04 +08:00
Khairul Azhar Kasmiran
4995a22228
Add gcc-11 build to CI (#1802) 2021-10-07 17:07:06 +08:00
Dhruv Maroo
23e264c10d
Fix function return type for rz_debug_.*_wait functions (#1766)
* Fix function return type for `rz_debug_.*_wait` functions

* Use preprocessor condition to use `RzDebugReasonType` only for Windows

* Return `RzDebugReasonType` instead of `int` for `.*_wait` functions

* Use correct return values for wait functions in debug
2021-10-06 16:04:30 +05:30
Khairul Azhar Kasmiran
db0fdffc4e
archos/: Support <os>-any test categories (#1795) 2021-10-05 17:33:42 +08:00
Giovanni
e874fa2fb8
[dex] remove bottleneck on rz_list_get_n() (#1798)
* Converted RzList to RzPVector
* Optimized library parsing on dex
2021-10-05 15:21:24 +08:00
Dhruv Maroo
d6ac6b93ef
Fix changing rflags register using dr (#1794)
* Use the numerical value string as parameter of `rz_core_debug_reg_set()`
* Add test for changing rflags using dr
* Add test for changing rflags using ar
2021-10-04 17:51:38 +08:00
Anton Kochkov
e75fbc5551
Use RzOutputMode for rz_core_file_print() (o cmd) (#1769) 2021-10-04 16:27:02 +08:00
Giovanni
5b7b0944aa
Fix potential buffer overflow in rc2 (#1792) 2021-10-03 16:52:19 +02:00
Khairul Azhar Kasmiran
bf847a5db1
Add pt-boundaries test (#1791) 2021-10-03 17:31:35 +08:00
Giovanni
93927e219b
Fix nullptr due missing small_block method when openssl is used. (#1790) 2021-10-03 10:17:05 +08:00
Riccardo Schirone
af65352aa1
Move files to generate windows installer under dist/windows (#1765) 2021-10-02 13:53:13 +02:00
Khairul Azhar Kasmiran
ddee12ccdc
pj_(k)r: Use ut8 instead of unsigned char (#1788) 2021-10-02 10:51:24 +02:00
David CARLIER
3f468275ee
remaining warning build fixes (#1787) 2021-10-02 10:50:03 +02:00
Dhruv Maroo
4f8100cd97
Extend the pretty printing API for base types and other printers (#1781)
* Replace `rz_type_db_base_type_as_string` with `rz_type_db_base_type_as_pretty_string`

 * Use the new type pretty printing API to pretty print base types

* Add option to return newline terminated string by pretty printing API

 * Add `RZ_TYPE_PRINT_END_NEWLINE` option to RzTypePrintOpts

* Improve printing in cases of empty structs/unions/enums

 * Initially, the separator was printed between the curly breaces
   irrespective of whether the struct/union/enum is empty. Now the
   separator is not printed if the given type is empty

* Add pretty printing support for typedefs

 * Also, add another type printing option to show typedefs. To be used in
   `rz_cores_types_typedef_as_c`

* Refactor `.*_as_c` functions to use the new type pretty printing API

* Add tests for typedef and `unknown_t` for pretty printing API

* Add `rz_type_db_base_type_as_string` back. Update tests.

 * Use ternary operator to make expression more concise

* Add doxygen documentation for `rz_type_db_base_type_as_string`

* Use `rz_vector_len` to determine if empty, instead of convoluted logic

* Remove redundant `RZ_NONNULL` for RzTypeDB

* Fix integration tests for type printing

* Update Doxygen documentation

* Fix failint enum printing itegration tests

* Fix according to clang-format
2021-10-02 13:51:01 +05:30
Anton Kochkov
458095d7a0
Fix afvd command for compound types (#1786) 2021-10-02 11:00:14 +08:00