Commit graph

61 commits

Author SHA1 Message Date
Riccardo Schirone
4fe99052f4
build: propagate OpenSSL in CMake exports (#6284)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: NOT XVilka <notxvilka@proton.me>
2026-05-06 10:04:34 +00:00
Premade
06061654db
Add: Mark API (#5313)
* Add: Bookmark API

* Fix: missing licenses + project migration

* Fix: migration

* Fix: formatting

* Fix: migrate info in cmd/project test

* Rename: Bookmark to Mark

* Remove: bookmark

* Fix: function type comment

* Fix: code coverage

* Add: tests, docs, ownership type annotations

- Added test/db/cmd/cmd_mark test
- Improved API documentation with \brief, \param, \return and proper grammar
- Added RZ_BORROW / RZ_OWN annotations to relevant API functions

* Fix: missed annotation

* Fix: type annotations + update meson.build

* Fix: License in `cmd_mark.yaml`

* `serialize_mark.c`: add NULL checks
2025-09-01 22:06:01 +00:00
Giovanni
144b47d455
Move RzBreakpoint into RzDebug (#5124)
- Move trap/sw breakpoint into RzArch
- Remove RzBreakpointPlugin & RzBreakpointArch
- Add get_sw_breakpoint_at/get_sw_breakpoint_size_at binds
- Remove `dbh-`
- Change `dbh` to just list supported archs for sw breakpoints
- Implement correct PPC traps
- Add missing x86 breakpoint callback
2025-05-13 01:57:37 +08:00
Rot127
42dc673fa5 String/Hex-Search 6/9: Add core implementation of new search (by deroad).
Adds the core implementation of the new search.

The rough architecture is the following:

A search for a certain type of information (strings, bytes, keys etc.)
creates a collections of items to search for (byte patterns, regular expressions etc.).

Then specifies some settings how the search (number of threads, maxum hits...)
and the finding is performed (string length, inverse match etc.).

It also defines a search space, which is currently only the IO buffer.
But can be anything in the future, like a graphs or the knowledge base.

The search splits up the search space into windows (for IO: address ranges)
and dispatches each search window into a 'find()' thread.

The 'find()' handler (provided by a specific search implementation)
checks the given window and produces search hits matching the elements in the search collection.

The main search handler collects the hits of the dispatched workers
and returns them to the user.

Note: The byte and string search implementations are added in the next two commits.

Part 6/9. Likely won't build in between parts.

Co-authored-by: wargio <deroad@kumo.xn--q9jyb4c>
2025-02-22 04:12:49 +08:00
Giovanni
64f8a5ae57
Move parse into arch. (#4342) 2024-03-07 23:50:22 +08:00
wargio
d47ceedbd3 Merge rz_asm and rz_analysis into one library but keep deprecated apis.
The tms320c64x has been merged into tms320.
2024-03-07 18:38:49 +08:00
Florian Märkl
06ee5e3aaf
Replace meson cmake module usage by plain configure_file() (#2948)
As due to https://github.com/mesonbuild/meson/issues/9702 we are not
using the expansion of @PACKAGE_INIT@ anyway, the cmake module provides
little additional value over a plain configure_file().
More importantly, by not using it, we get full support for muon, which
does not implement the cmake module yet.
2022-08-21 22:01:54 +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
Riccardo Schirone
a689f0a86e librz: refactor a bit how plugins are built
Rely on RZ_ARRAY_SIZE to add librz plugins instead of NULL terminators.
2022-07-20 22:04:02 +02:00
Riccardo Schirone
fd3a79f9e3 bin: remove Ldr plugins
RzBinLdrPlugins were not used. There was just one for Linux, but it was
not doing anything.
2022-07-20 22:04:02 +02:00
Giovanni
ea02b0d25f
Remove zignatures and move aaF[l] -> F[al] , zf[sdc] -> F[sdc] (#2682) 2022-06-29 07:49:43 +08:00
Riccardo Schirone
2987e035da hash: use RzHash in most hash APIs 2022-06-28 21:55:26 +08: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
Florian Märkl
544905631c
[RzIL] Fix concept of Effects and Effect ops (#2109)
This brings our concept of effects in line with BAP and fixes issues
like values being evaluated prematurely in seq. The main point is that
ops themselves are the effects, rather than returning them to be
evaluated later.
2021-12-20 14:21:40 +00: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
Giovanni
bda1e9cfca
Disable GPL code and Add RISC-V support via Capstone 5 (#2087)
* -Duse_gpl=false is supported by rizin and added riscv_cs for capstone v5
* Added GPL build workflow in CI
2021-12-11 13:30:01 +01:00
Anton Kochkov
8c1ef7672b
Remove unused and untested PPC GNU target (#2090) 2021-12-10 19:40:22 +01:00
Anton Kochkov
715dd14811
Remove unused, unupdated and largely untested ARM WineDBG and GNU (Binutils) plugins (#2085)
* Remove WineDBG ARM RzAsm plugin
* Remove unused and untested ARM GNU target
2021-12-10 16:40:58 +01:00
Paul I
40d125aef2
Remove pq commands (#2069) 2021-12-04 19:50:33 +01:00
Anton Kochkov
4508b25a20
Fix installing bitvector headers (#2056) 2021-12-02 13:15:21 +08:00
Dhruv Maroo
648c267bc7
Rename and refactor to use RzBitVector instead of RzILBitVector (#2048) 2021-12-01 14:28:04 +05:30
Riccardo Schirone
64469f2811
Changes in how paths are handled (#1997)
* 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
2021-11-30 13:36:38 +08:00
Dhruv Maroo
0801f7adf6
Port c commands to newshell (#1854)
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2021-11-25 17:55:08 +05:30
Giovanni
87311c3759
Basefind (#1966)
Co-authored-by: gnole <olegbouchin@gmail.com>
2021-11-15 22:33:38 +01:00
Florian Märkl
d82eea1415
Remove unused RzCache and rz_prof_t (#1971) 2021-11-13 15:44:15 +01:00
Giovanni
f41ea3c284
[FLIRT] Refactoring and create rz_sign library (#1960) 2021-11-11 20:29:59 +01:00
Giovanni
d68aa4517c
[RzIL] Print events on single/multi step aezse/aezsej (#1912)
* implemented aezse and aezsej to see RW events
* Added rzil.step.events.read and rzil.step.events.write to filter events
2021-11-01 12:19:19 +01:00
Anton Kochkov
514f9fa75b
Remove unused RzBinheap API (#1865) 2021-10-21 15:14:57 +02:00
Anton Kochkov
c14a09f946 Remove unused RzFList 2021-10-21 16:45:09 +08:00
Giovanni
69b509a157
Fix RzIL headers (#1819)
* Fixed RzIL headers and il
* Added c++ guards
2021-10-11 17:53:23 +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
Khairul Azhar Kasmiran
65cbec7267
Rename pj.h to rz_pj.h (#1783) 2021-10-01 21:35:39 +08:00
Giovanni
e224ee7b28
Add demangling as plugins and libdemangle as external dependency (#1656)
* Added demangling as plugins and libdemangle as external dependency
* Added iDl to return the list of demanglers
* moved demangling tests into rz-libdemangle and keep only bin tests
2021-10-01 10:45:38 +00:00
Luca Borzacchiello
f211163b70
UTF-16 be, UTF-32 be support (#1535)
* Refactored string search

string search logic moved from librz/bin/bfile.c to
librz/util/str_search.c

* UTF-16BE and UTF-32BE support

* Decoupled rz_str_search with rz_bin

* Changed parameter order in rz_scan_strings

* Fixed needle reset in rz_string_search

Now when the string search fails, needle is restored to original_needle+1,
i.e., we continue the searching process starting from the next byte.

* Changed heuristic for UTF BE detection

one more byte in for the detection (6 instead of 5)

* Fixed unit test in str_search

* Refactored rz_scan_strings and better UTF16-LE and UTF16-BE detection

Now if there is an ambiguity between UTF16-LE and UTF16-BE, we take the
longest one.

* Changed UTF BE heuristic

If there is any ambiguity about big-endian or little-endian, always
choose little endian

* Small format fixes in str_search

* Added preferred endianess switch in RzUtilStrScanOptions

* Fixed str_search regression tests
2021-09-17 16:37:35 +08:00
Pulak Malhotra
a911891298
Add API calls of Windows Heap for Cutter (#1386)
* Added API calls of windows heap for Cutter
* Added header to meson build
* Separate windows specific code
* Move API calls to `cheap.c`
* Add documentation and RZ_OWN
2021-08-05 12:54:46 +08:00
Aswin C
c7ae12e654
Introduce RzArchProfile and add support for CPU profiles (#1193)
* 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
2021-06-11 20:29:12 +08:00
Florian Märkl
bf5b9c41be Remove defunct Dyldcache Xtr Plugin 2021-05-31 12:13:23 +02:00
Manolache Marius-Alexndru
79541b2b43
SREC format support (#948)
* switched to a new branch cause the old one was messy
* add test for srec reading
* finished SRecord PR
* 32 bit records require S7 terminator
* added srec with arm elf

Co-authored-by: wargio <wargio@libero.it>
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2021-05-28 12:34:25 +02:00
Giovanni
82e7917294
Refactoring Hash (#1082)
* Added authors and licenses and plugin access to crypto related files
* removed `rz_hash` and related files
* introduced `rz_msg_digest_*` with plugins
* updated all old methods with newer ones.
* added HMAC support to `rz-hash` (moved key option under `-K`)
* removed wrong algorithms on `woD`/`woE`
* fixed parity digest size
* fixed the behaviour on all hash functions
* added unit test for hash
* optimized code for HMAC key calculation
* removed hash legacy tests
2021-05-02 20:47:17 +08:00
Anton Kochkov
788fdb3d8e
Extracting types handling into RzType (librz/type) ##refactor (#896)
* RzType introduction
* Move format processing to RzTypes from RzUtil
* Rename RzType to RzTypeDB
* Join RzType and RzAnalysis noreturn functions
* Add noreturn column in `aflt` output
* Remove D (disassembly) pf tests
* Fix `tn` test
* Add function noreturn serialization
* Modify meaningless type test
* Fix wrongly written `Cf` test
* Fix `za t` (zignature type) command
* Fix signature type test
2021-04-06 18:04:00 +08:00
Florian Märkl
bed31a6173 Remove Whitespace Asm+Analysis Plugins because the Results are wrong 2021-03-25 08:52:39 +08:00
Heersin
d0092b0398
Implement luac bin-plugin ##bin (#753)
* ##bin add bin plugin for luac format
* ##build Update meson scripts and some headers for luac bin plugin
* Update luac specified macros
* Update luac struct according to packed ines_hdr
* Update info function in luac plugin
* Reconstruct bin_luac for version switching
* Update meson script
* Add {-I} function for luac bin plugin
* Add some load utils of lua bin plugin
* Add src file info as guid info in lua bin plugin
* Define INNER_BUFFER_SIZE as macro
* Fix stolen byte in luac plugin and update test script
* Add asm plugin to target and enable it
* Implement a quick and dirty simple lua 5.4 analysis plugin
* Implement luac bin plugin sections, symbols, entry
* Test luac bin format {is, iz, iS, ie, pd}
* Add luac disasm test
* Add luac analysis test
2021-03-21 09:21:59 +08:00
Giovanni
5442c53b4f
enable pyc (#779) 2021-03-07 13:19:32 +01:00
Maijin
9e5fff30e8 Remove io_rbuf #751 2021-03-05 14:41:43 +08:00
wargio
8005c480b2 Moving java from shlr to core
Removed unused code and comments.
Removed dead code
Moved print method outside class.c
Moved json method outside class.c
Removed yc_w_refs and i_mref which never worked.
Fixed set_flags method to work as intended.
Fixed various parsing errors.
Fixed many memory leaks.
Fixed "insecure" rz_cons_printf warning.
removed `#define V`, `#define U` and `#define _`
Implemented newshell calls.
Optimized code.
Refactoring rz_bin_java_get_field_offsets
Avoid loading static core plugins when not needed.
Removed useless `if 0`
2021-02-25 12:02:20 +01:00
Riccardo Schirone
ffb6431292 Remove io_mmap plugin and just rely on default implementation 2021-01-03 11:42:38 +01:00
Florian Märkl
40a29cba29
Remove Pseudo-Sandbox (#239) 2020-12-21 21:31:32 +01:00
Maijin
feb7feb19a
Remove a2f (#219)
Co-authored-by: Maijin <maijin21@gmail.com>
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2020-12-18 20:37:00 +08:00
Riccardo Schirone
09d305ec10 Extract subprocess API used in rz-test into RzUtil 2020-12-15 10:18:50 +01:00
Florian Märkl
f0d3199872
Add Basic SPC700 Analysis Plugin (#132) 2020-12-08 20:29:57 +01:00