Commit graph

61 commits

Author SHA1 Message Date
NOT XVilka
851ab98455
Fix memory leaks across core, bin, and PDB parsing (#6579)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2026-06-30 19:04:28 +08:00
loki
8fcf3e736b
Fix aav.aav.* naming #2205 (#6079) 2026-03-29 17:49:04 +08:00
Khairul Azhar Kasmiran
d9f41e8074
Shorten rz_list_iter_has_prev/next() to rz_list_has_prev/next() (#5822)
* Shorten rz_list_iter_has_prev() to rz_list_has_prev()

* Shorten rz_list_iter_has_next() to rz_list_has_next()
2026-01-21 13:53:43 +00:00
Khairul Azhar Kasmiran
c1fc1419e4
Rename some rz_list funcs to rz_list_XXX_val (part 1) (#5671)
* Rename rz_list_find_ptr() to rz_list_find_val()
* Rename rz_list_delete_data() to rz_list_delete_val()
2025-12-25 22:01:49 +08:00
Khairul Azhar Kasmiran
b96202ad48
Rename rz_list_first() / rz_list_last() to rz_list_first_val() / rz_list_last_val() (#5654) 2025-12-20 17:08:59 +08:00
Rot127
bc30c934fc
Fix tests on AArch64 machine by resetting the flag spaces with obs. (#5353) 2025-09-10 23:09:26 +08:00
Giovanni
db1e4993a0
Replace strdup with rz_str_dup (#4634) 2024-09-15 19:12:07 +08:00
pelijah
706a6bf6c2
sdb: remove unused cas and expire features (#4487) 2024-05-12 18:27:54 +08:00
pelijah
f818ca4296
Refactor sdb_foreach and related APIs (#4471)
* Refactor sdb_foreach and related APIs
* Strengthen bounds check in sdb_dump_next()
* Switch to RzPVector
* Use length info in filter_noreturn()
* Fix cmp function
* Remove unused sdb_like() API
* Pass SdbKv to SdbForeachCallback
* Add sdbkv_dup_value() helper
2024-05-07 07:57:52 +08:00
pelijah
f2d8e0db3d
Add HtSP, HtSS, HtSU, SetS (#4415)
- All `ht_*_new0()` are removed
- `freefn` field of HT options was renamed to `finiKV`
- `finiKV_user` fields was added to HT options
- Added `ht_*_new_opt_size` API
- `HtSP` and `HtUP` are created with `ValueFree` callback  that allows to reduce extra LOC and prevent bugs
- `SetP` replaced with `SetS` (based on `HtSP`)
- `rz_th_ht_*_new0()` and `rz_th_ht_*_new_opt()` are replaced with `rz_th_ht_*_new(HtXX *)`
2024-04-16 20:27:48 +08:00
Florian Märkl
eeda6b1b59 Remove RzFlag.base
The only place where this field was set to a non-zero value was the now
removed fb command, and it was never used for anything sensible. Thus it
is safe to remove.
2024-04-04 13:22:57 +02:00
Florian Märkl
f223247b46 Remove fb command
The fb command can modify the offset of a flag, but does not update the
skiplist they are stored in, leading to a corrupted flag database. This
can be seen for example when executing
f test @ 0x4; fb 0x10 test; fl; pd 0x8 @ 0
2024-04-04 13:22:57 +02:00
Giovanni
c7ddd77546
Remove rz_list_get_top/bottom & rz_list_get_head/tail_data (#4348) 2024-03-09 18:24:23 +08:00
wargio
e978d7d442 Backtrace info should be fetched only in certain flag spaces 2024-02-19 19:39:00 +08:00
Anton Kochkov
25fd417a28
Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
Anton Kochkov
08272c0cec
Remove some of the sdb_fmt() calls (#4131) 2024-01-21 12:26:37 +08:00
Giovanni
8fba9b4189
Force usage of RzList methods instead of direct access of the fields (#4036) 2023-12-18 21:05:57 +08:00
Florian Märkl
b9851b7c24
Make rz_flag_set_next() try the addr before incremental numbers as suffix (#3986)
In binaries with a large number of flags of the same name, like in macho
with many relocs to the same symbol, using an incremental number as
suffix to generate unique flag names leads to quadratic runtime. We can
avoid this by first trying to append the address, which as a nice side
effect also results in more meaningful names.
2023-11-18 23:15:50 +01:00
Riccardo Schirone
3b903caa96
librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08: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
Florian Märkl
4e5857cacf
Meson refactor: collect modules in dict and centralize config (#2945)
Duplicated code for pkg-config and cmake configuration is avoided by
letting every rizin module register itself in a global dictionary
called "modules" which is then iterated in one place to perform any
shared logic, inspired by how qemu handles multiple targets in its meson
build system.

This is an almost pure refactor, so the resulting .pc/.cmake files
should be identical with the following exceptions:
- rz_reg.pc does not have plugindir anymore as rz_reg has no plugins.
- Some other modules have their dependencies in .pc files altered to be
  consistent with cmake.
2022-08-20 19:59:27 +02:00
wingdeans
a6a7a5f530 Fix annotation inconsistencies 2022-08-03 00:29:56 -04:00
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
Riccardo Schirone
8939fdbd7d
Use add_global_arguments instead of passing cflags/ldflags all around (#2812)
See also 66a0e22293/docs/TESTING_WITH_SANITIZERS.md (clang)
2022-07-17 21:33:51 +08:00
Florian Märkl
0950e823a4
Refactor rz_core_analysis_get_stats() and fix edge cases (#2645)
Range is now explicitly inclusive/inclusive to allow generating stats
for the entire 64bit range.
This especially also removes the obscure "Cannot alloc for this range",
which could be observed in Cutter, and adds a more meaningful error to
the p- command whenever no range is available.
2022-05-30 04:59:47 +00:00
Anton Kochkov
2188b4564d
Various Coverity fixes (#2615)
* Fix CID 392733 - memory leak

* Fix CID 392732 - memory leak

* Fix CID 392730 - memory leak

* Fix CID 392729 - memory leak

* Fix `rz_analysis_diff_free()` API function

* Fix CID 392685 - memory leak

* Fix CID 392012 - use after free

* Fix CID 391968 - uninitialized pointer read

* Fix CID 391966 - memory leak

* Fix CID 391964 - uninitialized pointer read

* Fix CID 390013 - memory leak

* Fix CID 389939 - memory leak

* Fix CID 379249 - memory leak

* Fix CID 378881 - uninitialized scalar variable

* Fix CID 378973 - uninitialized scalar variable

* Fix CID 378850 - uninitialized scalar variable

* Fix CID 371079 - memory leak

* Fix CID 367478 - memory leak

* Fix CID 366821 - memory leak

* Fix CID 366736 - memory leak

* Fix CID 361684 - uninitialized scalar value

* Fix CID 352581 - memory leak

* Fix CID 352557 - memory leak

* Fix CID 348937 - memory leak

* Fix CID 322229 - memory leak

* Fix CID 320122 - memory leak

* Fix CID 317611 - memory leak
2022-05-15 23:15:28 +08:00
Riccardo Schirone
ce6ac3e467 meson: use major/minor only in the lib soversion 2022-05-10 21:04:43 +02:00
Giovanni
bfec86a12e
Add option to install sigdb systemwise and custom user location for additional signatures (#2328) 2022-02-28 14:32:38 +01:00
Giovanni
687b8e8fec
Rename functions properly and ensure to remove the old flags. (#2289)
* Rename functions properly and ensure to remove the old flags.
* Rename flag instead of deleting it
* When renamed, the flags are not set in the right flag space.

This reverts commit bf39802452b7545551f52c4c32f8c01764ab2a75.
2022-02-06 22:21:21 +08:00
Anton Kochkov
2f638cad1e Convert f commands to rzshell
* Changed behavior of `f` to only add flag if there is none
* Changed behavior of `f+` to add flag in any case
* Moved listing subcommands from `f` to `fl`
* Moved listing subcommands from `f.` to `f.l`
* Added subcommand `f.l*` to list all local flags in all functions
* Listing flags at the current offset became `fl.`
* Moved `f=` to `fl=`
* Old `fl` (flag length) now became `fL`
* Removed original `fe` commands
* Old `f?` (check if flag exists) now became `fe`
* Removed `fV` commands
* Removed `fn` commands in favor of `fl` and `asm.flags.real=true`
* Removed `fS` commands (`fSo` and `fSn`)
* `fo` became `fortune` and moved from "flags" to "shell" category
* Removed oldshell handlers of the `z` commands
2022-02-03 21:46:42 +08:00
Anton Kochkov
d80d70a361 Port fz commands to the rzshell 2022-01-08 10:59:10 +08:00
Anton Kochkov
9c18ea0dc6
Port ft commands to the rzshell (#2162) 2022-01-03 00:33:01 +08:00
Paul I
5b11e88736
Fix several memleaks (#2143) 2021-12-27 18:19:34 +01:00
Riccardo Schirone
6f40dfe493
Move remaining things from shlr/ to meson subprojects (#2126)
* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
2021-12-22 09:20:39 +08:00
Riccardo Schirone
47e1cb8335
Provide CMake config files for CMake projects (#2057)
* Remove wrong librz.pc.in file
* Add plugindir variable to .pc files to allow easy plugin configuration
* Add CMake config files to find Rizin in CMake projects
* Add CI jobs to check cmake files
* Provide workaround for mesonbuild/meson#9702
* Use .lib suffix and no prefix on MSVC to make CMake files work
* Disable cmake files on static libraries build
2021-12-17 09:16:25 +00:00
Khairul Azhar Kasmiran
906ece4211
Add asan build for clang (#1910) 2021-11-17 21:02:02 +08:00
Anton Kochkov
b9cb29ac90
Rename RNum to the RzNum (#1539) 2021-08-29 21:06:29 +02:00
Aswin C
dafa52b48b
RzArch: Fix clang-ci and Coverity warnings (#1302) 2021-07-13 10:15:11 +02:00
Riccardo Schirone
7088e33aee
commands: remove "comment" argument from zi* and f* (#891)
* core/cmd_zign: remove comment argument, unused and feels strange
* flag: remove pfx while printing flags in rizin commands
2021-03-24 21:40:38 +08:00
Khairul Azhar Kasmiran
eaa69a364d
Refactor code into new API function rz_flag_unset_all_in_space 2021-03-16 22:35:37 +08:00
Yuuoniy
2d702b7d18
Fix rz_name_validate_char in name.c & update tests 2021-03-12 08:18:27 +08:00
Anton Kochkov
b37d6fbe0e Cleanup flag zones code 2021-03-10 15:29:46 +08:00
Anton Kochkov
c319449fed Add some missing copyright marks 2021-03-08 15:33:54 +08:00
Riccardo Schirone
53bf5c497f SPDX Copyright text for all files based on history
- Add LICENSES directory
- Download additional licenses used
- Add .reuse directory
- Add doc about SPDX/reuse

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-03-05 19:39:15 +08:00
Florian Märkl
6f4336dcc4
Rename RJson to RzJson (#545) 2021-02-08 19:02:32 +00:00
Florian Märkl
d93d3f3770
Move Serialization Helpers to Global API (#522) 2021-02-06 12:10:43 +01:00
Florian Märkl
ed6d93d4d2 Make rz_base64_encode use the right types 2021-02-03 15:40:29 -01:00
Riccardo Schirone
cee8d470c2 Remove Makefiles and many related scripts 2021-01-28 11:57:28 +01:00
Anton Kochkov
a0be4e2e64 Run clang-format 2021-01-21 22:05:44 +08:00
GustavoLCR
b823017cb1 PDB: Fix NULL deref with unsupported leaf type (#17996) ##bin 2020-12-07 23:18:29 -06:00