Commit graph

28277 commits

Author SHA1 Message Date
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
Rizan
bbc5457b7a
Use compiler intrinsics for rz_swap_* functions (#3300)
* Using `__builtin_swap*()` whenever available instead of `rz_swap*()`
* Moved `test_endian()` from test_utils.c to test_endian.h
* Added test cases
2023-01-22 21:30:21 +08:00
Florian Märkl
9703de3099
Set up srht builds to trigger through hottub (#3312)
hottub_trigger is a key added in our hottub fork.
2023-01-21 19:25:33 +01:00
Florian Märkl
b1277a7dc8 Reduce requested op info in go analysis
BASIC supplies all needed info in these cases and is slightly less
expensive than DISASM.
2023-01-21 18:26:11 +01:00
Florian Märkl
b6c9b6ad01 Skip filling IL in x86 if not requested
If not requested, building the IL is an unnecessary overhead.
2023-01-21 18:26:11 +01:00
Florian Märkl
3f4570cd7a
Fix string flag sizes after aar (Fix #3305) (#3307)
Regression from 7af1353166, but most
likely already broken before and only made visible by it: String flags
set from bin had their size set to how many bytes the string takes, but
were overwritten to a size of 1 after running aar.
2023-01-21 15:28:05 +01:00
Giovanni
7af1353166
Use proper methods to detect strings in analysis loop. (#3284) 2023-01-20 12:02:10 +08:00
Giovanni
a13a724550
Fix #3128 - Add overflow checks on dyldcache bin values. (#3303) 2023-01-20 12:01:34 +08:00
Giovanni
907e0981c5
Fix English in docs files and updated/removed some tips (#3299) 2023-01-17 19:49:38 +01:00
Florian Märkl
8f1fdc91d6
Limit op cache in type matching (#3297)
Reduces the peak memory usage of the corkami virtgap.exe test from
1.177GB to 241.9MB (measured with massif).
2023-01-17 15:54:37 +08:00
Riccardo Schirone
30f4d77088
ci: add CI for rz-bindgen (#3285) 2023-01-17 07:02:15 +08:00
Riccardo Schirone
c4767cf1ac
Fix plugin removal and clean code (#3277)
* cmd: Fix summary of few "L" sub-commands
* util: start decluttering plugins handling

- Add Doxygen docs
- Remove unused API functions and make others internal only
- Use RzLibType enum for plugin type instead of int

* util: move dlopen/dlsym/dlclose to rz_sys
* util: make rz_lib_open/close return bool
* util: simplify rz_lib_add_handler and rz_lib_open*
* libs: implement rz_*_plugin_del to remove a plugin
* core: remove commands from RzCmd when removing plugins
* librz: call plugins 'fini' method when removing a plugin
* core/cmd: do not fail if the hashmap removal fails

When removing a group command, the inner command might have the same
name, thus it would result in trying to remove the same name twice.
Ignore it, as it is fine.

* librz: make RzCrypto plugins handling like the others
* librz/crypto: add rz_crypto_reset and use it
* librz: allocate the plugin structures before adding them
2023-01-16 13:32:46 +01:00
Florian Märkl
7c6579a614 Fix asm.bits-dependent open tests
Passing arch and bits as args instead of commands ensures they take
effect earlier. This fixes these tests on platforms where the default
asm.bits is 32.
2023-01-15 19:01:18 +01:00
Florian Märkl
0acc7f11a1 Set dbg->bits in debug_dmp
This fixes the last tests in db/formats/dmp on OpenBSD/sparc64.
2023-01-15 19:01:18 +01:00
Florian Märkl
e40d9a6cf3 Fix dmp reg profile depending on host bitness
dbg->bits was checked in reg/windows_arm64.h, but when returning the reg
profile from the dmp plugin, this (deprecated) variable held the host
value when 64 was expected.
So it is better to move this check to the respective points where the
profile file is included.
2023-01-15 19:01:18 +01:00
Florian Märkl
953a81afc0
Make afs respect the cc (Fix #3291) (#3292)
Applying a function signature with afs to a function was using a
combination of the existing args and wrong stack addresses to apply the
args to function variables. This generally resulted in incorrect
locations. Instead, we now use the info from the cc.
2023-01-15 13:40:14 +01:00
Peter B
ca3c77e981
Set refptr for Xtensa l32r opcode for better disassembly output (#3289) 2023-01-15 09:32:37 +08:00
Giovanni
4a9740d11d
Fix pxj output (#3290) 2023-01-14 14:14:34 +08:00
Riccardo Schirone
48ece26787 librz: remove non existing functions 2023-01-12 08:55:58 +01:00
Giovanni
3edb12c2d2
Temporary fix for the meta strings (#3283)
* Temporary fix for the meta strings
* Fix unit test
* Added test for Csl with raw binary
2023-01-11 12:31:49 +08:00