* Add function to memcpy memory with offset.
* Add count trailing zeros function.
* Add function to determine pointer alignment.
* Add helper to swap sequences of 2 bytes.
* Add helper to swap sequences of 4 bytes.
* Print pointer in warning
* Fix tests
* Use uintptr_t type to prevent undefined behavior.
* Remove alignment requirement and rely on malloc promises.
* Add in place byte swap functions.
* Move the endianness swapping into util/rz_endian
* Use GNU builtin __builtin_ctzll/clzll.
Also fixes the include guards of __builtin_clzll
and handles the undefined case of x == 0 of it.
* Add doxygen
* Added build files [Capstone to Zydis]
* x86 Analysis [Capstone to Zydis]
* Changed x86 RzIL [Capstone to Zydis]
* Changed asm and arch files [Capstone to Zydis]
* Compilation, build error and test fixes [Capstone to Zydis]
* Test changes [Capstone to Zydis]
* Remaining changes [Capstone to Zydis]
* Added BE support [Capstone to Zydis]
---------
Co-authored-by: tushar3q34 <tushar3q34@gmail.com>
* Added a CI-task to check if rizin could be used as subproject
* Fixed some new global-arguments in meson-build
Co-authored-by: amibranch <amibranch@users.noreply.github.com>
* Setting GNU99/C99 standard for subprojects
* Remove use of `add_global_arguments`
* Added extern "C" linkage specification to some public headers of rizin
* Changed the meson_git_wrapper.py-script to explicitly specify the output-path
* Made the RIZIN_BUILD_PATH conditional in the integration-test meson-build
Co-authored-by: amibranch <amibranch@users.noreply.github.com>
* Use pre-v5 enum names which are now supported by compatibility macros.
* Bump CS version to newest next
* Remove Capstone v6 job until v6 patch release is out.
* Check for support of enum compare/conversion warnings.
* Add a new test for checking 80-bit floating point operations
* New test `f80_ieee_div_test` tests the division of two 80-bit
floats
* Add SoftFloat 2c as a meson subproject
* Add softfloat code to make the failing test case pass
* Update the hash for the latest softfloat revision
* Implement `rz_float_sqrt` using SoftFloat
* Run the `f80_ieee_div_test` only for x86
* Replace SoftFloat version 2c with 3e
* 3e has less bugs and more features
* Modify the implementation in accordance
* Update SoftFloat revision and add a guard around the 80-bit div test
* Use SoftFloat for add, sub, mul operations as well
* Make rem and mod also use SoftFloat functions
* Also add test for mod and rem, and fix behavior of rem
* Add comment about behavior of mod and rem
* Add comments for tests which have different results for mod and rem
* Simplify usage of loop variable as suggested in review
* Remove unused macro from float.c
* Implement `FMA` and `ROUND` using SoftFloat API
* Add more tests for 80-bit floats
* Change remote to a repository under rizinorg
* Add info about the rounding mode in the Doxygen for rem and mod
* Add comments in tests for rem and mod in `test_float.c`
* Use bitvectors to initialize 80-bit soft floats
* This makes the tests more portable and hence they can be run on
any platform
* Remove guards for f80 tests since they are portable now
* 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.
This commit refactors the AArch64 and partially the ARM
plugin to make it Capstone v6 compatible.
Due to the big API changes in Capstone v6 several changes
had to be made.
Because we need to be compatible to Capstone v4 and v5
many include guards are added as well.
Overview of changes done:
**ARM**
- Instruction alias were introduced. This leads to different
decoding and analysis paths taken for certain instructions.
Some alias have their IL code generated like the real
instruction now (no special handling needed anymore).
This change is responsible for many changes you'll encounter.
- The operand details of each instruction are now always the
one of the real instruction. Also for alias.
For example, if "MOV <Wd>, #<imm>" is an alias for `ORR <Wd>, WZR, #<imm>`,
the details by CS hold all three operands of "ORR".
Before, they held only the two of "MOV".
- Several bugs in variable and argument generation
were fixed. Especially the default variable width
for ARM Thumb was changed to 32bit instead of the 16bit.
**AArch64/ARM64**
The changes listed above for ARM, also apply to AArch64.
Additionally:
- Capstone v6 changed the name ARM64 now everywhere to AArch64.
To be compatible with Capstone v4/v5 AArch64 names must be wrapped
into macros which resolve the name, depending on the CS version used.
- Capstone v6 is now more consistent with
register real and alias names.
From now on we use the register alias by default.
**List squashed commit messages:**
[AArch64 CS v6 BEGIN] Change subproject config to use cs-auto-sync-aarch64 branch
Replace ARM64 with version sensitive macros.
Exclude alias if CS version >= 6
Update access to writeback member
Exclude instr alias from inclusion
Update memory operand printing to json.
Enable real instr. detail only for AArch64
Set correct arch name in meson.build for CS
Fix U/SBFM instructions and their alias.
Mark parameters with RZ_OUt/BORROW
Optimize register extension to skip some, if the width already matches.
Adapt width and lsb of U/SBFM alias instructions (ImmR and ImmS are from U/SBFM).
Fix tests correct semantic buy bad syntax
Pass alias MOV instructions to mov()
Handle CSET and CSETM alias
Fix lsl, lsr and asr by handling them as alias.
Fix mov alias.
Handle TST alias
Fix CNEG, CINV alias
Fix bfi and bfxil alias.
Fix sign extensions.
Fix compare instructions.
Fix NEG, NGC, NGCS, NEGS, MVN
Fix CINC
Fix multiply instructions.
Fix ROR
Run clang-format
Handle CMP for ESIL
Handle new position of memory disponents of post index operands.
Fix post-index operations.
Add missing writeback checks for Post and preindex
Handle UBFM and SBFM alias
Handl BFM alias
Handle CMP, CSET and CINC alias
Update meson file of for cs-aarch64 branch
Fix asm tests. Use reg alias now.
Fix condition confusion and incorrect operand usage.
Fix plf test.
Run clang-format
Use register alias in tests
Add support for fp and lr reg alias assembly.
Use reg alias in test
Rename cond tranlate functions r2 -> rz
Fix condition check which assume 0 == invalid.
Fix issues intruduced by rebase
Set CS commit to current next branch.
Rename ARM64 -> AArch64
Add missing source file to meson.build
Remove DisassemblerExtension.c file for CS v5
Update to newest capstone next branch
Bump up CS version
REVERT ME: Get Capstone v4/v5 via git clone until new tars are released.
Wrap setting of CS_DETAIL_REAL into CS version check
Add maybe-unitialized to Capstone C args.
Fix CS pre v6 build by adding guards.
Use reg alias now printed by default by CS.
Bump CS version to most recent next.
Fix build errors due to stircter alias handling in ARM.
Fix RzIL tests introduced by alias introduction to ARM.
Fix ESIL bugs introduced with ARM alias introduction.
- stackptr hasn't been set for POP and PUSH
Add support again for Thumb1 pop/push
Handle PUSHW and POPW alias
Update test case
Add more POP and PUSH alias and enrich detail for other versions of them.
Fix incorrect mem access width guesses for ARM thumb.
Set POP return info if it writes to PC
Fix tests about default var size and POP mem write direction.
Bump CS version to newest next.
Fix incorrect tests.
- TriCore: Functions were in ro section.
- Default arg width in ARM thumb is 32bit.
Revert check for a set stackptr.
stackptr is used in different ways:
1. Safes the offset from the stack frame base.
2. Is interpreted as somthing else for x86 and I cannot find out what, in a reasonably time.
Hence we cannot use it here consistently.
Remove check for non existing ARM_GRP_RET in CSv5
Fix incorrect stack offsets of variables.
'push <reg-list>' instructions for which the second register was the FP,
reset the stackptr variable to 0. This led to wrong bp offsets in the variable names.
In this case it was +0xc.
Bump CS version.
Add copy of meta-programming macros for capstone-sys build.
Update capstone-next.wrap
Use bracket-less met-programming macro to fix Windows build warnings.
Update wrap files for Capstone with branch names
Add new meta-programming macro
Add workaround for MSVC pre-processor bug.
- `RZ_PROJECT_VERSION` 14
- Add `RzCallable`.has_unspecified_parameters
- Add `RzAnalysis`.debug_info
- Add `RzAnalysisVarStorageType` composite and `eval` `pending`
- Support for parse DWARF section "debug_loclists", "debug_ranges", "debug_rnglists"
- Partial support for eval DWARF expr_loc
- Support for anonymous Type, function variable, struct member
- Cache all DWARF information in `RzAnalysisDebugInfo` and remove `SDB` based caching.
- Add arm32, arm64, TriCore DWARF register name
- Fix same name basetype
Before there was a special case for the root dir and it was implemented
by using `os.sep` as the representation for the root. That did not work
on Windows. This commit rewrite the BINDIR_DEPTH computation's logic to
use Path objects instead.