rizin/librz
Rot127 a6c7864198
Fix mismatch 'rz_cons_break_push' and 'rz_cons_break_pop' calls. (#4289)
If a function calls 'rz_cons_break_push()' but never calls 'rz_cons_break_pop()' before return,
the stack count of 'RzConsContext->break_stack' contains too many elements (each time one too much).

This in turn will lead to not resetting 'RzConsContext->breaked' flag.
Because the flag is only set to false, if 'rz_stack_is_empty(context->break_stack) == true'
(in 'rz_cons_context_break_push()').

This wasn't a problem so far, because 'RzConsContext->breaked' is simply never set to true
(exceptions are some timeout cases as far as I can see).
Also these cases when 'rz_cons_break_pop()' was forgetten to be called, were edge error cases.
So not often hit.

But if Rizin is usd by Cutter 'RzConsContext->breaked' is set to 'true',
if an `AnalysisTask` interrupt is handled (in 'AnalysisTask::interrupt()').
This interrupt is triggered for example, when the introduction dialog is closed
and the main Cutter window opens (after the optional 'aaa').

Now, if the binary file was analysed with 'aaa', and a lot of error cases were hit,
those error cases sometimes never called 'rz_cons_break_pop()' before returning from their function.
Although, of course, they should have to the `RzConsContext->break_stack` is in a proper state.

This means, when the main Cutter window opens binary files which trigger many error edge cases,
the `RzConsContext->break_stack` is not empty
(because of the not executed 'rz_cons_break_pop()').

This also means, that the last thing done, was setting 'RzConsContext->breaked = true'
(by 'AnalysisTask::interrupt()').

If Cutter wants to show some disassembly, it calls 'rz_core_print_disasm()' which checks
'RzConsContext == false' via 'rz_cons_is_breaked()'. This condition is never true, because
the flag was not reset to `false` because the stack was never empty.
So it returns before anything was disassembled.

Hence Cutter gets no disassembly text.

Fixes https://github.com/rizinorg/cutter/issues/2552
Fixes https://github.com/rizinorg/cutter/issues/3275
2024-02-23 23:50:11 +08:00
..
analysis Fix mismatch 'rz_cons_break_push' and 'rz_cons_break_pop' calls. (#4289) 2024-02-23 23:50:11 +08:00
asm Disassembler arch for RX microcontroller (MCU) family (#4198) 2024-02-17 22:29:16 +08:00
bin Fix memleaks related to RzBin::default_hashes (#4286) 2024-02-23 20:20:19 +08:00
bp librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
config Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
cons Trim grep expression before processing it. (#4227) 2024-02-14 21:43:42 +08:00
core Fix mismatch 'rz_cons_break_push' and 'rz_cons_break_pop' calls. (#4289) 2024-02-23 23:50:11 +08:00
crypto Introducing SM4 encryption and decryption (#3863) 2023-12-03 13:36:38 +08:00
debug Fix mismatch 'rz_cons_break_push' and 'rz_cons_break_pop' calls. (#4289) 2024-02-23 23:50:11 +08:00
demangler librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
diff Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
egg librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
flag Backtrace info should be fetched only in certain flag spaces 2024-02-19 19:39:00 +08:00
hash Fix openssl 3.0 support due changes on legacy algorithms. (#4215) 2024-02-12 17:44:04 +08:00
il Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
include core/analysis: API to calculate multiple instructions size (#4279) 2024-02-21 21:08:58 +08:00
io Remove some more of sdb_fmt() calls (#4140) 2024-01-30 22:36:39 +08:00
lang Convert from rz_str_new to rz_str_dup (#4178) 2024-02-07 00:07:53 +08:00
magic Replace current regex engine with PCRE2 (#4185) 2024-02-05 12:51:16 +08:00
main Remove old options and replace with new global ones for string search. 2024-02-19 19:39:00 +08:00
parse Don't match numbers with a '.', '*' and '\w' prefix. 2024-02-16 16:57:31 +08:00
reg Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
search Update rz_search_keyword_new() doxygen and variable names. 2024-02-17 15:04:47 +08:00
sign Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00
socket Add help and colors for rz-run -h (#4225) (#4237) 2024-02-16 01:54:12 +08:00
syscall Remove some more of sdb_fmt() calls (#4140) 2024-01-30 22:36:39 +08:00
type type/format: fix typedefs self-reference (#4270) 2024-02-19 23:07:16 +08:00
util Fix several memleaks in regex.c (#4274) 2024-02-20 11:29:59 +08:00
config.h.in
meson.build
README.md librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
RizinConfig.cmake.in
RzModulesConfig.cmake.in

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.