* Move ESIL into its own namespace
* Remove RzAnalysisEsilInterState from RzAnalysis
* More cleanup to split cil.c from ESIL code
* Rename RzAnalysisRzilTrace to RzAnalysisILTrace
* Fix various null-derefs.
* Remove rz_analysis_get/set_esil_inter_state
* Fix use after free and leaks
* fix: format with clang-format-20
* fix: fix clang-format linter with rewrite '^#define.*/\*.*\\$'
* fix: update clang-format to version 20 in workflows and documentation
* fix: add SPDX license information to .git-blame-ignore-revs
* Rename `maxDescLength` to `max_desc_len`
* Rename `descLength` to `desc_len`
* Rename `maxFlagAndArgLength` to `max_flag_and_arg_len`
* Rename `flagAndArgLength` to `flag_and_arg_len`
* Rename `flagLength` to `flag_len`
* Rename `argLength` to `arg_len`
* Rename `maxOptSpaces` to `max_opt_spaces`
* Rename `remainingSpaces` to `remaining_spaces`
* Rename `maxDescSpaces` to `max_desc_spaces`
* Change `flag_and_arg_len` to `flag_n_arg_len`
* Fix asm tokens leaking horrendously because they used Vector and PVector.
* Fix some resource leaks related to asm tokens
* Fix some resource leaks of the hexagon module error cases.
* Fix possible NULL ptr dereference
* Fix leak of asm tokens by fun fini on RzAsmOp.
The RzAsmOp passed here could be a previously initialized one.
With allocated asm_tokens. Doing memset just leaks those tokens.
* Simplify the copy_asm_op function
* Always fini RzAsmOp before initializeing it.
* Set asm_toks to NULL after freeing
* Fix leak in asm_bf
* Fix leaks in test_token
* Initialize all RzAsmOps with 0 and free the asm_toks on init.
In practice rz_asm_op_init() is the best place to free the asm_toks reliably.
Simply because this is always called in the old code, before an instruction is disassembled.
Only in fini() is not enough, because there are too many place it is not called, leaking the tokens.
* Fresh mind, new attempt. Fini asmop at all occurrences of rz_asm_disassemble
* Fix definition of alignment.
Alignments for code and data is not defind for 0, bubt nonetheless it
was assigned this value everytwhere. This changes the default value to 1.
* Enforce an alignment of at least 1.
* Fix alignment checks (default is now 1).
* Fix alignment check. 1 was assumed to be valid.
* Fix places where an alignment of 0 is considered still a valid value.
* Fix integration test with invalid alignment
* Remove debug printf
* Remove addrmod member.
It was pressumingly used to indicate aligned addresses in print mode.
But it wasn't documented and the usefulness is dubious.
Since it is easy to spot for users to see if addresses are aligned or not anyways.
* Fix tests after cherry-pick
* Fix rz-find test which consumed the '-X' as number value for '-a'.
* Fix case of arch module not defining value alignments.
* Replace OpenBSD regex library with PCRE2.
PCRE2 has way better performance than the OpenBSD
library (something around 20 times faster).
The following flags are enabled for every pattern:
- PCRE2_UTF
- PCRE2_MATCH_INVALID_UTF
- PCRE2_NO_UTF_CHECK
All the others are optional.
Changes made:
- Adds PCRE2 as subproject.
- Changes the API away from POSIX to PCRE2.
- Edits many regex patterns because:
- ' ' is skipped in patterns, if the EXTENDED flag is set for matching. '\s' must be set now.
- '.' doesn't match newlines by default.
- Changes the API so matches and their groups are bundled into PVectors.
- Moves the regex component to rz_util.
* Fix cross build - add copy of PCRE2 dependecy
Meson currently doesn't support subprojects to be native and non-native at the same time.
See: https://github.com/mesonbuild/meson/issues/10947
Unfortunately, sdb depends on rz_util which in turn depends on PCRE2.
Excluding PCRE2 from the native build makes linking of rz_util not possible anymore.
Adding it, will make Meson complain that the dependencies cannot be mixed.
Hence, we compile a copy of PCRE2 for the native build if required.
* Replace on s390x failing tms320 c55x test with c55x+ test.
* Fix resource leaks of parse paramters.
* Revive unreachable code.
* Raplace test with one which has not a different asm string in Capstone v3.
* Rename `new` to `newt` since `new` is a keyword and should not be used as var name.
This introduces the ability to split asm strings into tokens and assign a type to them.
This means:
* Each asm strings is assigned a list of tokens. Each token points to a sub-string.
* A token has a type attached which describes it (e.g. register token, operator token, mnemonic token etc.)
* A generic parsing method is introduced which splits an asm string into tokens. The pattern it parses is `<mnem> <op> <op> ...`.
* Instead of the generic method, plugins can create the token strings on their own.
* An API method was introduced to help plugins implement their own parsing methods via regex patterns.
* Custom token strings are stored in `RzAsmOp.asm_toks`
Additionally the coloring of asm strings is now exclusively done via the token strings.
* For this a function was added to colorize tokenized asm strings according to their token types.
* Moved rz_print_2bpp_* under rz_core
* Moved rz_print_string to rz_str_stringify_raw_buffer
* Added test for print urlencode and added pu0
* Removed RzCoreString and implemented utf32be/utf16be
* Add option to print instruction packets syntax in objdump style.
* Add the config `plugins.hexagon.sdk` to toggle syntax.
* Remove unused trimming.
* Trim only newlines from the assembly string.
* Add new trim functions to allow trimming of certain chars.
* 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]’