rizin/librz
Anton Kochkov 689bafb7a4
Rewrite the RzNum parser and calculator on tree-sitter (#4326)
Replace the hand-written parser in calc.c with a tree-sitter grammar
(subprojects/rizin-math-parser) and a typed evaluator. The old parser
could only ever produce a ut64 and folded anything it failed to read to
0, which left callers unable to tell a failed expression from one that
evaluated to zero.

Expressions now evaluate to an RzNumValue, a tagged union over ut64,
double, RzBitVector, arbitrary-precision integer and arbitrary-precision
decimal, carrying an RzNumError rather than signalling failure as 0.
Literals keep the width they were written with (5u8, 0xffu128, any width
from 1 to 65536), results that outgrow 64 bits promote to a big number on
their own, and a parse error, division by zero or unresolved identifier
reaches the caller.

rz_num_math() is deprecated. rz_num_math_ut64() keeps its exact behaviour
for callers that want a ut64, and rz_num_math_value() exposes the typed
result. rz_core_math() adds the RzCore-backed form used by the % command,
with rz_core_math_ut64() deprecated alongside it. rz-ax routes through the
typed API, so it prints values at full precision, reports errors on stderr
and exits non-zero. rz_il_lift_num() converts an expression to an
RzILOpPure, so a numeric argument can be lifted instead of pre-evaluated.

Legacy input still works: trailing base suffixes (101b, 35o, 212t), the
trailing-'h' hex form and the k/m/g scale suffixes are all accepted and
warn once, pointing at the 0b/0o/0t prefixes. doc/math.md documents the
language and doc/math-il-lift.md the lift; the grammar, the evaluator,
rz-ax and the % command are covered by unit and db tests.
2026-07-24 02:57:27 +08:00
..
arch Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
bin librz/arch/c166: Coverity fixes 2026-07-09 00:20:49 +08:00
config Change rz_config variables to use Set instead of List (#6623) 2026-07-23 15:09:58 +00:00
cons Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
core Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
crypto librz/bin: add CaRT container format support (#5964) 2026-03-07 20:51:50 +08:00
debug Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
demangler Bump rz-libdemangle to get the dlang demangler (#6566) 2026-06-28 12:50:08 +08:00
diff Implement lcs-roll distance (myers+fastcdc) (#6512) 2026-06-15 23:23:54 +08:00
egg librz/egg: fix endian-dependent x86/x64 string immediates and refresh rz-gg tests (#6481) 2026-06-08 00:20:46 +08:00
flag Allow seek to flag realnames (#6593) 2026-07-14 16:12:05 +02:00
hash When sm3 on openssl is not available, compile algorithms/sm3/sm3.c (#6615) 2026-07-15 22:50:41 +08:00
il Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
include Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
io Implement file download from the remote machine in GDB protocol (#6576) 2026-07-18 14:49:31 +08:00
lang Remove static global variables from armass.c, rtr.c, rtr_http.c, and c.c (#6183) 2026-04-09 00:53:01 +08:00
magic Convert %ll format specifiers to PFMT64 (#6267) 2026-04-22 05:57:04 +08:00
main Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
mark Rename some rz_list funcs to rz_list_XXX_val (part 1) (#5671) 2025-12-25 22:01:49 +08:00
reg librz/reg: derive CC with more than four argument registers (#6600) 2026-07-06 03:35:41 +08:00
search Use stdint types for ut64 and friends (#6276) 2026-04-22 21:43:04 +08:00
sign Convert %ll format specifiers to PFMT64 (#6267) 2026-04-22 05:57:04 +08:00
socket build: propagate OpenSSL in CMake exports (#6284) 2026-05-06 10:04:34 +00:00
syscall doc(syscall): improve README and add example (#5135) (#5619) 2025-12-15 14:02:55 +08:00
type Fix memory leaks in bin, type parser, core meta and debug (#6594) 2026-07-05 02:56:19 +08:00
util Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
meson.build build: propagate OpenSSL in CMake exports (#6284) 2026-05-06 10:04:34 +00:00
plugins.h.in Merge rz_asm and rz_analysis into one library but keep deprecated apis. 2024-03-07 18:38:49 +08:00
README.md librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
RizinConfig.cmake.in build: propagate OpenSSL in CMake exports (#6284) 2026-05-06 10:04:34 +00:00
RzModulesConfig.cmake.in build: propagate OpenSSL in CMake exports (#6284) 2026-05-06 10:04:34 +00:00

Rizin Libs (librz)

The Rizin framework is composed of several pieces that work together to provide a reverse-engineering framework useful for a variety of use-cases and tasks. All tools present in binrz are based on the libraries present in this directory, so getting a general idea of what these libraries are and do is key to navigate the codebase.