Commit graph

28596 commits

Author SHA1 Message Date
Anton Kochkov
7f6f9049a2
Bump version to v0.6.0 (#3369) 2023-02-16 09:30:58 +08:00
Heersin
2b748567fa
Add fbasic theory to rzil using rz_util/float (#3184)
* Fbasic dev build test

* Add fbasic structure and enums

* Add fbasic op new

* Add fbasic op dup

* Add fbasic op free

* Add partial theory of float

* Add fbasic handlers to pure table default

* Add fbasic stringfy

* Add temporary float functions

* Add rz-float value and evaluation

* Add float json dump functions, todo add mode info in il_opdmp_* functions and compelete il_resolve_pure

* Complete fbasic il in il_export

* Fix detected error in compilation

* Add doxygen for il/definition/float

* Pack float_round function

* Add new version of rounding

* Add cast and convert, todo add 'float_get_sign' and 'float_get_no_bias_exp'

* Add comments and fix new version rounding

* Add util float functions

* Implement theory fbasic : cast, convert and round

* Remove bv_one warning

* Move basic functions into rz_util from definition/float

* Add two basic test cmp and extra format test

* Add test to fsucc, fpred and fneg

* Add round significant test case 1 and fix bug to pass it

* Test round significant and bug fixes

* Add 6 types test cases to round_and_pack function

* Finish round significant and round_pack test with bug fixes and signature changes

* Leave fround as unimplement now

* Pass all test to cast and convert

* Add SPDX header

* Add SPDX header

* Add round to integral float with test and bug fixes

* Add more tests to cast_sint and bug fixes

* Fix mem leak in cast_sfloat

* Replace the deprecated rounding method, fix bugs and pass tests

* Resolve some reviewed issues

* Fix most memleak and bug found

* Remove deprecated round_bv

* Remove unused functions to eliminate warnings

* Fix typo in comments

* Uncommented implmented operations

* Add test cases and bug fixes for fbasic theory in rzil

* Fix ret type of new_bitv_from_* from Bool to BitVector

* Add new float op from f32 and f64
2023-02-15 18:18:40 +08:00
Riccardo Schirone
c9d6ad9ee6
io: return error when reading/writing to unmapped memory (#3323)
* core: 'wow' command was replaced with 'wb'

* io: on_map_skyline returns false when nothing was done

Before this patch on_map_skyline returned true even when the callback
was not called on any part of the skyline. In other words,
reading/writing to an unmapped memory returned true.

This commit changes the behaviour to return false in those cases.

* analysis/esil: mem_read/mem_write were alway returning true

* use o malloc instead of oC

* librz: deal with seek errors
2023-02-11 11:36:27 +01:00
Anton Kochkov
b770693575 Fix crash in iA commands for undefined arch 2023-02-10 22:38:35 +08:00
Anton Kochkov
c379ec0658
Fix memory leak in RzParse ARM and MIPS (#3364) 2023-02-09 17:58:58 +01:00
Riccardo Schirone
505bc3da7e tests/db: fix wrong tests using nonexisting eval/cmd 2023-02-09 08:44:53 +08:00
Riccardo Schirone
59fb1c0f85 core/cmd: return CMD_STATUS_OK even when env var is not found 2023-02-09 08:44:53 +08:00
Riccardo Schirone
8d6b3b04e0 core/cmd: handle properly errors while executing commands substitution
Before this patch, while executing a command with a command
substitution, if the command substitution failed the outer command was
executed anyway, giving wrong results in some cases.

This commit makes sure that errors in command substitutions are
propagated to the outer command.
2023-02-09 08:44:53 +08:00
Florian Märkl
2221ab27af
Fix filling RzAnalysisDisasmText.arrow when asm.lines=false (#3361)
The arrow info is needed to print custom reflines, for example in
Cutter. In such a case, asm.lines will generally be false to not have
the lines also printed inside the text.
2023-02-09 08:00:52 +08:00
Riccardo Schirone
497c2b2e05
Remove old bash-based rz-pm (#3360) 2023-02-07 18:26:38 +08:00
Peiwei Hu
a0e9750913
Mute the mouse in the HUD mode (#3355) 2023-02-07 17:07:35 +08:00
Peiwei Hu
6bf0f4b3d2
Enable scroll in non-default printCmds in Vv mode (#3352)
* Enable scroll by j and k in the right view of the Vv mode
* Cache the result of printCmds to avoid duplicated analysis
* Fix the unreasonable change of the right view while pressing tab
2023-02-07 09:13:43 +08:00
Riccardo Schirone
c61dd6f7c6
CI: env vars on windows work differently (#3354) 2023-02-06 13:19:54 +08:00
Peiwei Hu
eacd8d1755
Small typo in DEVELOPERS.md (#3353) 2023-02-06 12:36:23 +08:00
Anton Kochkov
62e1c42bdc
Linux heap - skip invalid addresses in main arena (#3344) 2023-02-05 22:55:28 +08:00
Anton Kochkov
438b56e166
Remove use of deprecated set-output in GHA (#3346) 2023-02-05 18:06:53 +08:00
Anton Kochkov
1558f586ac
Fix big memory leak in graph rendering (#3342) 2023-02-05 16:57:31 +08:00
Anton Kochkov
d3239f6ac1
Coverity fixes - memory leaks (#3348)
* Fix CID 396249 - memory leak

* Fix CID 396058 - memory leak

* Fix CID 395932 - memory leak

* Fix CID 395762 - memory leak

* Fix CID 393103 - memory leak

* Fix CID 393102 - memory leak

* Fix CID 316891 - memory leak

* Update librz/core/cautocmpl.c

Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>

---------

Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
2023-02-05 15:22:28 +08:00
Anton Kochkov
5d7335c8b6
Add some missing Windows types (#3347) 2023-02-05 14:27:43 +08:00
Giovanni
8d46a25203
Updated libmspack to latest commit (#3349)
Fixed url for lz4 dep
2023-02-05 13:23:02 +08:00
Anton Kochkov
00958561e9
Coverity fixes - memory leaks, integer overflows (#3343)
* Fix CID 396030 - wrong assert use

* Fix CID 396032 - wrong assert use

* Fix CID 316792 - memory leak

* Fix CID 316334 - memory leak

* Fix CID 316667 - integer overflow

* Fix CID 316931 - bad shift

* Fix CID 317014 - NULL dereference

* Fix CID 404022 - memory leak

* Fix CID 401066 - memory leak

* Fix CID 398794 - memory leak

* Fix CID 352582 - negative size
2023-02-05 11:27:45 +08:00
Anton Kochkov
bb8872798e
Use theme color for pxa header (#3341) 2023-02-04 21:00:46 +08:00
Anton Kochkov
a9096718e9
Coverity fixes - memory leaks, NULL dereferences (#3339)
* Fix CID 398788 - memory leak

* Fix CID 397077 - remove useless comparison

* Fix CID 397076 - remove useless comparison

* Fix CID 397074 - remove useless comparison

* Fix CID 396207 - memory leak

* Fix CID 392014 - bad shift

* Fix CID 391965 - NULL dereference

* Fix CID 390010 - wrong assert use

* Fix CID 378899 - unitialized variable

* Fix CID 378859 - integer overflow

* Fix CID 366898 - remove useless comparison

* Fix CID 364035 - NULL dereference

* Fix CID 317001 - closing "-1" file descriptor

* Fix CID 316991 - lseek() to negative position

* Fix CID 316172 - mmap() with negative size

* Fix CID 401510 - double free

* Fix CID 395360 - remove useless comparison

* Fix CID 352574 - negative loop bound

* Fix CID 316187 - memory leak

* Fix CID 395425 - memory leak

* Fix CID 316975 - buffer overrun

* Fix CID 316947 - memory leak

* Fix CID 398474 - integer overflow
2023-02-04 20:01:42 +08:00
Anton Kochkov
66e4f71dfa
Fix big memory leak in parsing x86 disasm (#3340) 2023-02-04 12:34:12 +01:00
Anton Kochkov
6414f1a418
Fix variable declaration in Vv mode (#3338)
Since the change of function variable storage it wasn't working
2023-02-03 13:09:02 +01:00
Anton Kochkov
a3ef563473 Fix CodeQL warnings 1657 and 1658 2023-02-02 20:23:08 +08:00
Anton Kochkov
8bd0d3356d Update xz (liblzma) to 5.4.1 2023-02-02 13:50:52 +08:00
Anton Kochkov
d765127a33 Update liblz4 to 1.9.4 2023-02-02 13:50:52 +08:00
Anton Kochkov
a68be33f38 Update zlib to 1.2.13 2023-02-02 13:50:52 +08:00
Anton Kochkov
c2ecb289ef
Coverity fixes - memory leaks, UAFs (#3335)
* Fix CID 404596 - memory leak

* Fix CID 404594 - memory leak

* Fix CID 404595 - memory leak

* Fix CID 404593 - memory leak

* Fix CID 404592 - memory leak

* Fix CID 404349 - memory leak

* Fix CID 404021 - memory leak

* Fix CID 403816 - memory leak

* Fix CID 403733 - memory leak

* Fix CID 403587 - use after free

* Fix CID 403585 - memory leak

* Fix CID 402981 - memory leak

* Fix CID 402915 - memory leak

* Fix CID 402914 - memory leak

* Fix CID 402911 - memory leak

* Fix CID 402910 - memory leak

* Fix CID 401662 - memory leak

* Fix CID 401542 - resource leak

* Fix CID 400949 - memory leak

* Fix CID 400948 - memory leak
2023-02-02 08:59:07 +08:00
Anton Kochkov
fd64b7ee25 Convert pr commands to the rzshell 2023-02-02 08:21:09 +08:00
Anton Kochkov
0ffa5e3233 Update tree-sitter to 0.20.7 2023-01-31 19:06:55 +08:00
Giovanni
53776b129b
Small refactoring of rtr_http.c code (#3329)
* Remove unused http.maxport
* Rename http.dietime to http.stop.after
* Extract rtr_http code to simplify it
* Enforce utf8 charset in headers for browsers.
2023-01-31 10:02:54 +08:00
Anton Kochkov
5082c1f0e8 Convert p= commands to rzshell 2023-01-31 08:27:30 +08:00
Anton Kochkov
969ce2e570 Add an example of vertical histogram in comment 2023-01-31 08:27:30 +08:00
Gyanendra Banjare
8bdbd28741
Fix #3280 - Restores color on returning from Rh. (#3306) 2023-01-30 21:38:36 +08:00
Giovanni
c3f9d4c1d3
Fix #2859 - Use minstring in all bin plugins (#3328)
* Do not hardcode min string size for bins using `rz_bin_file_strings()`
* Fix rz-bin to set properly `bin.[min|max]str`
* Add and fix tests
2023-01-30 18:38:08 +08:00
Giovanni
21333133d9
Fix bx after add lr, pc, 0 in arm32 (#3326)
Co-authored-by: pancake <pancake@nopcode.org>
2023-01-28 15:10:14 +08:00
Florian Märkl
b740cba35d Fix alignment issues in sha2
Reading ut32 from the data array directly crashes on sparc when the
array is not 4-byte aligned. This fixes both the regular and the
unrolled variant of the code, even though we do not use the unrolled
one.
Relevant tests are in test/db/cmd/hash.
2023-01-26 20:39:24 +01:00
Florian Märkl
62c0a6b880 Raise timeout for 6502 rzil test
On some platforms, the rizin startup itself takes multiple seconds,
which can make these tests timeout even if they would otherwise work.
2023-01-26 20:39:24 +01:00
Riccardo Schirone
d6c586bc3b
core: replace 'it' with 'iT' (#3320)
`it` is the table mode of the `i` command, thus leave it available and
use `iT` instead.
2023-01-26 16:01:06 +08:00
Florian Märkl
77a334a2af
Refactor srec reading to not use sscanf (#3321)
Parsing with sscanf turned out to cause an extreme slowdown. As only hex
values are being read, this can be done with RzUtil-provided
functionality. Relevant test cases exist in test/db/io/srec.
2023-01-25 16:42:46 +01:00
rizan21
f5668b2359 Changes in .clang-format
* requires clasue will now format in a single line
2023-01-25 22:02:26 +08:00
rizan21
cc18d675e6 Use clang-format 15 instead of 14 2023-01-25 22:02:26 +08:00
Riccardo Schirone
a0b7b48b53
core: implement simple 'help' command (#3319)
'help' command provide very basic guidelines on how to use Rizin.
2023-01-24 11:24:47 +08:00
Riccardo Schirone
e933003b5b
librz: do not duplicate plugins (#3313)
* librz: do not duplicate plugins

Plugins structures are statically defined at the file scope and not
dynamically allocated. Plugins should not allocate them either as
RzLibPlugin keeps a reference to them anyway.
2023-01-23 12:51:09 +00:00
Anton Kochkov
c362b28254
Fix integer shift UB in ARM ESIL uplifting (#3317)
Fixes the following UBSAN error:
arm_esil64.c:947:26: runtime error: left shift of 65535 by 48 places
cannot be represented in type 'long long int'
2023-01-23 18:25:26 +08:00
Anton Kochkov
38a909738c
Convert pC commands to rzshell (#3213) 2023-01-23 17:54:52 +08:00
Anton Kochkov
a3885e8f99
Remove legacy unit tests (#3088) 2023-01-23 17:46:21 +08:00
Florian Märkl
ead601655c
Make bp usage check not depend on opex string (#3315)
In all instructions in all existing tests, the result of can_affect_bp()
is equal to what the opex check would determine, so we can avoid the
overhead of opex here.
2023-01-22 19:05:20 +01:00