* 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
- 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 *)`
The move_mount syscall number on x86_64 that was introduced in patch
a564f13856 (PR #3854) was wrong.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Some identical code from both mach-o 32 and 64 has been moved to
mach0_common.c to avoid duplicate compilation.
rz_mach0_platform_to_string() now recognizes all known platforms and the
information is shown as the subsys in the i command.
The "os" value was previously unreliably and ios sometimes showed as
"ios" and sometimes as "darwin" depending on the binary. Now the os is
"darwin" for all platforms. ios-* syscall files have thus been removed
as only darwin-* ones will be used.
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
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.
* 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
* 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
* Remove `RIZIN_EXTRAS` because useless
Extras plugin should be treated as any other regular plugin, they should
not have their own directory. I believe we did not have anyway any
plugin using that directory.
* Do not use `<version>` in `/usr/share`
Users can only install one version of Rizin at a time anyway, thus
splitting the `/usr/share/rizin` directories does not really bring
multi-version install possible. At the same time, we stick to what's
common for other tools, which do not use version in `/usr/share`
* Move plugin directory to `/usr/lib64/rizin/plugins`
* Remove `RZ_HOME_BIN` env var because not useful anymore
* Introduce `rz_util/rz_path` to provide rizin paths
* Use `rz_path_system_sdb_types` whenever it makes sense
* Use some others `rz_path_*` functions instead of custom ones
* Use `rz_path` APIs for themes, fortunes and signatures
* Remove `rz_sys_prefix`
* Reduce the number of defines needed to handle home and system paths
* Reduce the number of `rz_path` functions
* Make the lib debug depending on log level and `RZ_LOG_DEBUG`
* Refactor a bit how directory of plugins are loaded
* Keep supporting old plugins directory for at least 0.4.0
* Fixed memory leak in rz_syscall
* Fixed warning of null format on sprintf
* Fixed warning of null fmt on printf
* fixed array subscript 5 is above array bounds of ‘char[5]’
* Refactor `rz_arch_profile_add_flag_every_io` to not let it depend on `RzCore`
* Remove the definition of `RzCore` from `rz.arch.h`
* Fix Coverity scan errors
* Resource leak (overwriting) in L169 of `cpu_name`
- Fixed by defining it inside the loop
* Check for `NULL` for `cpu_name`
* Check for `NULL` for asmcpu in cconfig
* Fix overwriting by freeing `path` before assigning again
* Cast `RzFlag` while parsing the hashtables
* Move the `arch`'s check for `NULL` to the beginning of the function
* Rename the APIs which load the SDBs for RzSysregsDB and RzArchTarget
* Use `RZ_SYS_DIR` for creating the path in `rz_arch_profiles_init`
* Introduce `RzArchProfile` and add the CPU profiles
* Create `rz_arch.h` and `arch_profile.c`
* Add the CPU Profile's SDB files
* Add the `meson.build` for compiling SDB files
* Add the hashtables and the flagspaces
* Add a test and compare the `type` in `rz_sysreg_get`
* Update the list of AVR CPUs in `asm_avr`
* Run clang-format and include rz_arch.h in rz_analysis.h
* Fix the install directory of the compiled SDB files
* Introduce `RzArchTarget` which houses `RzArchProfile`
* Support for loading a new profile when `asm.cpu` is changed
* Change the variables names to lowercase and add tests
* Add a test for loading a new CPU profile when CPU is changed
* Add Doxygen documentation, run `clang-format` and correct the requested changes
* Remove unnecessary zero-initializations and other improvements
* Reversed a condition while creating the path in `rz_arch_profiles_init`
* Fixed four tests: three regarding printing the flagspaces and one from printing flags after analysis in AVR
* Free the required pointers and check for `NULL`
* Free the pointers that was allocated previously, before returning `NULL`
* Free the pointer in `rz_sysregs_db_new`
* Support for adding a fallback profile for unsupported CPUs
`portable` makes rizin use paths relative to the executable binary path,
so that all resource files (e.g. SDB files) can be retrieved without
having an hard-coded prefix in the binary. By doing so, rizin
installation directory can be moved from location to location and still
work. This is useful when having a static rizin that you want to execute
on another system.
It makes sure that all PATHs defined in rz_userconf.h are just relative
to the prefix and that, in the code, the prefix is prepended to all
these paths.
* Clear syscall and sysregs sdbs if their files are not found
* "Fix" cmd_k tests
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
Multiline scripts had issues on my windows system while building
from `cmd`. I removed some "pre_sdb" scripts used to read symlinks
because there are only two and it's probably easier to just avoid
symlinks for better portability.
Also moved a bunch of inlined script to separate files in sys/.