* core: do not show realnames in flags if not set
* core: show flag name as comments when realnames are displayed
* test: fix db/analysis/riscv test
Just fix the test, because the pseudo code seems wrong.`sym.printf` should already be present in the instruction, thus the flag is redudant.
* switch from RzList to RzPvector
* Removed the commented line of code
* Removed tab to support clang format
* Added space after foreach statement to support clang format
ARM
- Updated ARM identifiers and API changes.
- Fixed shift amounts to be always decimal.
- Fixed incorrect usages of memory disponents.
- Fixed restoring of condition codes.
- Updated IDs for new ones.
- Fixed 8-byte stores.
- Added flag checking for MOV with shifts.
Capstone Integration
- Removed capstone-auto-sync subproject and replaced with next.
- Checked for NEON features.
- Used https://github.com/capstone-engine/capstone/pull/2122 for better system operand support.
- Distinguished between 32 and 64-bit cc checks.
- Checked for CS API version >5.
- Checked for CS_NEXT_VERSION instead of CS_API_MAJOR.
- Fixed VSTn and VLDn instructions to use corrected memory operands.
- Excluded multiple instruction aliases that are no longer valid IDs.
- Used CS_NEXT_VERSION as include guard.
- Added CS v6 include guards.
- Added CS v6 support to branch conditions for Rzil.
- Added more CSv6 guards.
PPC
- Fixed: Compare instructions do not use the branch predicate.
- Fixed conditional and CTR checks.
- Fixed MTSPR and MFSPR instructions.
- Excluded more branch aliases no longer present in v6 from switch cases.
- Fixed incorrectly assigned variables.
- Fixed condition checks for branches.
- Used ITE for condition checks, to prevent unnecessary reads of CTR or CR.
- Fixed rzil tests with new semantics using register 0.
- Updated include guards for Capstone versions to use CS_NEXT_VERSION.
- Initialized spr_name to prevent uninitialized use.
- Used mem.offset register for CSv6.
- Always used real operand details.
- Used mem operand for DCBZ.
- Fixed tests that are semantically identical.
- Handled LI LIS alias.
- Fixed rzil tests (with simplified semantics).
- Fixed branch alias with new cond test method.
- Handled clrl. alias.
- Handled SL/SR alias.
- Fixed conditional branches in ESIL.
- Fixed possible multiplication result overflow.
- Added RZ_NONNULL.
- Added 0 register.
- Handled LIS alias.
- Fixed: Print crX reg name in CS v6.
- Handled all general branch instructions into a single case statement.
- Fixed no semantic issues in tests.
- Added newly discovered calls.
- Moved direction check to inline function.
- Added link of root cause for broken test.
- Added QPX support.
- Set Capstone next branch to latest commit.
- Fixed uninitialized warning.
- Set CS next branch to newest commit.
* Fix div by zero in le_create_maps()
* Fix heap buffer overflow in marshal.c
* Make error messages like in cpython
* Refactor le_create_maps()
* Refactor marshal.c
If the operand is rw, av gets assigned to op->src[i] and op->dst.
Later when op is freed, op->src[i] and op->dst are freed both and
so we run into the double free.
We update the documentation with examples and fix an overflow bug in
the calculation of the decoded message. The documentation for this
decoded message length is also updated.
1. Add name to copyright.
2. Modify public API type from int to st64.
For style reasons, also:
1. Remove 'else' statements.
2. Add brackets.
3. Prefer ! operator to NULL comparison.
The new Base64 code is fixing the previous bugs which were illustrated
with unit tests. Documentation is added and as a "breaking" API
change, the input and output parameters are allowed to be NULL
consistently (not just some, but all.) The rest of the behavior is the
same, save for the bugs that were fixed, and the decoding function
which is now even laxer in what it is able to decode (which seemed to
be the original intention but had a bug as demonstrated by a unit
test.)
An integer overflow bug, in the calculation of the string length, is
also fixed.
The Base64 implementation has some bugs in its decoding function that
we demonstrate with unit tests:
- In test_rz_base64_decode_invalid, we add a unit test to show that
the invalid characters are not ignored correctly. I believe the
intention of the original code is to ignore them, however this is not
correctly achieved. The two common options, ignoring invalid
characters or rejecting the message, are mentioned in RFC 4648. What
the current base64 decoding function does is a complicated logic that
may reject, or otherwise, it appears to overwrite previously encoded
data.
We show this in the test by decoding two inequivalent Base64-encoded
messages, which under current implementation both result in the same
string "foo", but they should be different.
- In test_rz_base64_decode_offby1, we demonstrate an off-by-1 buffer
overflow. An initial buffer of content { 'A', 0, 'B', 0 } is passed to
the encoding function with intention of encoding the single character
'A'. When decoding back into plaintext, the decoding function is:
1) inserting a NUL byte (out of courtesy?) which may not be
desirable. However, this NUL byte is already present in our original
buffer.
2) Reaching past the NUL byte, overwriting the character 'B' with a
NUL byte.
We demonstrate 2) with the assertion in the unit test.
* librz: rename function parameter
The function parameter is renamed from _dest to dest. In the body of
the function, the identifiers _dest and dest are swapped
accordingly. This makes these functions have the same parameter name
as all others of the same kind in the header.
* librz: add swap macros when builtins missing
The rz_swap_ macros are only defined when the compiler builtins are
available. We define them in case they are not for uniformity of
presence in the preprocessor namespace.
* librz: add documentation for rz_endian.h
Every function and macro is documented except for the signed swap
macros.
* librz: return max value in read if parameter is NULL
The read functions in rz_endian.h sometimes returned the MAX value
when the source parameter was NULL and sometimes didn't. For example,
compare rz_read_be16 which doesn't check NULL and rz_read_le16 which
does.
We fix this by inserting checks for NULL in every integer read
function.
We also insert these checks for the floating-point read
functions. They also too sometimes checked for NULL indirectly by
calling the corresponding integer read functions, but the read
functions with the offset parameter did not check for NULL.
Separately, The NULL checks in rz_read_le8 and rz_read_me8 were
removed because they were duplicate; they call rz_read_ble8 which
checks for NULL.
* librz: add documentation in swap functions for NULL source parameter
The case where the source parameter is NULL is documented in all the
read functions in rz_endian.h
A mistake in the documentation of rz_read_at_ble64 is fixed; it
incorrectly mentioned 128-bit instead of 64-bit integers.
* librz: add missing 24-bit macros
The 24-bit macros for minimum and maximum value are added.
* librz: add missing endianness functions
For the readers and writers, certain endianness and bit number
combinations were missing. Some missing big-endian, little-endian,
middle-endian functions as well as helper functions are added.
The documentation of some read blue functions is corrected to mention
"specified" order instead of "big-endian".
* librz: fixing some compiler errors from typos
* librz: remove UT24 macros
We remove the UT24_ macros due to PR review.
* librz: replace UT24_MAX with UT32_MAX
It is better to return the maximum value held by the return type
instead of returning a max 24-bit value.
* test: add more rz_endian tests
All the integral endian functions for read and write are ran through
some basic tests.
* librz: remove unused internal functions
The signed rz_swap functions are removed because they are not used
anywhere in the source code. They are duplicates of the corresponding
unsigned functions. Moreover, the rz_swap_st16 function has an
incorrect implementation when the compiler builtin is missing.
Instead of fixing, adding documentation, and unit tests, which means
we would also need to create an environment with the compiler builtin
check undefined, we simply remove them, because they are not used
anywhere.
* librz: remove unnecessary define macros
These macros were added during the PR and were requested to be removed
again.
* test: fix MSVC complaining on erroneous commas
The string literal #__VA_ARGS__ is equal to "" in a conforming
implementation when there is an empty list of variadic arguments. On
MSVC 2017, it is completely missing, causing an error. These issues
appear to have been fixed in VS2019 v16.5 and later using the
/Zc:preprocessor compiler switch and in Visual Studio 2017 version
15.8 using /experimental:preprocessor.
In any case, we use string concatenating to force an empty string to
appear even if #__VA_ARGS__ is missing.
The source and header file of cdb is documented. There is also
documentation added for the private sdb header which contains helpful
macros and static functions.
* Do not use designater array initializer because MSVC complains
* Add new Appveyor CI test for including C headers from C++ files
* Need to test whether Rizin headers can be included in C++ when
using MSVC, needed for Cutter to build successfully
* Changed the name of `build-cpp` CI job in GitHUb jobs to
`build-cpp-linux` to make it obvious that it only performs the
test for Linux