Move the `pj `command to RzShell. It also does some clean ups:
- Remove `pj.`, because it was an alias for pj @ 0
- Remove `pj..`, because the JSON path function always returned NULL (never a valid value), and did not document what it does in the first place.
- Print message for user if no valid data was found at address.
- Change description of command to be more clear it only prints formatted JSON strings.
- Remove unused size/len argument.
- Add a new test for `pj`.
- Add some general documentation how to implement or find a command.
* Fix NE relocation naming
* Name NE relocations by combining `src` and `flag`
* Fix old test + add additional tests
* use CONCAT_RELOC_STR instead of CONCAT to avoid issues.
* Fix freeing of relocation array when no relocations are present
* Reimplement canary checking for PE for speed + getting rid of memory leak when calling imports()
1. Everything is based off of Microsoft's PE format documentation [found here](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format)
2. Up until now, imports were used for relocations in the PE & MDMP format,
which is wrong. PE uses base relocations.
3. PE relocations do not have symbols associated with them, and thus
have no name. In order to still have flags in relocs flagspace, dummy
symbols were allocated with generic names composed of the relocation's
virtual address space.
* Remove old code of setting import entries to PE relocations
* Parse PE base relocations
* Implement converting from the specific RzBinPeRelocEnt type to the
general RzBinReloc type
* Implement corrent type naming of PE relocations
* Add missing `PE_IMAGE_FILE_MACHINE` types
* Add PE base relocation types
* Fix PE format 'has_canary' function
* Remove 'RzBinPEObj.endian' and use 'RzBinPEObj.big_endian' instead
* Removed a.exe and b.exe tests, as they don't contain base relocations
and swapped them with correct tests
* Corrected old PE relocation tests
* Add new PE base relocation tests
MDMP doesn't have any relocations (base or COFF), only contains imports of the dumped executable.
Up until now, imports were used which is wrong.
* Remove MDMP relocations
* Remove MDMP relocations tests
* 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 <[email protected]>
* Add xtensa arch capstone plugin
* Remove xtensa-gnu
* fix: `asm.cpu` is not set correctly, when there is no “,” in asm plugin -> cpus
* fix core_disassembly when n_bytes==0
* fix xtensa_analyze_op_esil
* fix xtensa esil pc mod
* fix xtensa esil l32r
* fix xtensa esil call0
* fix xtensa esil extui
* fix xtensa esil store
* fix xtensa stack inc and ret
* keep `asm.cpu` when valid in cb_asmarch
* fix cb_asmarch
* fix max op size
* xtensa: add cpu select
* xtensa: mark PUSH POP
* xtensa: set src dst
* xtensa: set dir
* xtensa: fix stackframe
* Force Function Rename
New function to forcefully rename a function. Multiple retries will be
performed by adding a numeric suffix to function name until the number
of retries max's out
* Improve Force Rename & Add Tests
* Add RZ_NONNULL to Function Declarations
* Add RZ_BORROW To Force Rename
* Apply Suggested Edits & Improve Tests
The whole point of force rename is that simple rename op might fail, so
I added a test to make sure it actually fails when we need it to...
hence the need for existence of force rename
* Free Variables & More Checks Added To Tests
* Check Full Name Of Renamed Function
Instead of just checking whether the starting of function matches with
expected name, check the complete name to be exactly same.
* Change Documentation Style
* Update COFF relocations
* Break down `relocs_foreach` to sub functions for readability
* Migrate to using `RzBinReloc.print_name` for reloc name printing
* Update COFF relocation tests
* Change ELF relocation type names to the naming used by SysV ABI
* Modified `bin_reloc_type_name` to return correct naming if possible,
otherwise return the old ADD/SET naming.
* Add `print_name` field to `RzBinReloc`
* Fix ELF relocations tests
* bump capstone next f6f967961b913cf4fc1c6233f6cf42194a0938ca
* fix: tricore il and test
* Fix code scanning alert no. 1874: Multiplication result converted to larger type
* 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 <[email protected]>
* 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.
* Refactor: Use HtSP for storing plugins.
This saves iterations when searching for a plugin of a given name.
It also allows to save plugin configurations and data in hash table,
all addressed by their name. Hence, usage is more streamlined.
* Fix: iterators iterate over pointers of pointers.
* Soften the NULL check.
If arch is passed on from another struct, NULL is an allowed invalid value.
* Fix some leaks
* Fix NULL checks and incorrect inits
* Fix more leaks
* Add warning if plugin with same name was added before and is overwritten.
* Document rz_str_cmp
* Add function to create new list from iterator.
* Sort plugins alphabetically when listed.
* Fix parameter attributes, NULL checks, leaks and single rename.
* Bumps Capstone version to newest Capstone next (beyond first v6-Alpha1).
* Fixes leaks
* Fixes build and change to AArch64 and SystemZ compatibility headers.
* Marks M68k test as broken (see commit message).
* Fix AArch64 and SystemZ tests
* Handle op.size == 0 for x86 IL ops
* Attempt of passing pointers from RzAsm to RzAnalysis and wise versa.
* Refactor Hexagon module to make use of hacky pointer sharing.
* Refactor plugin specific configutations.
Because static values are no longer allowed, it has to be sure
that the 'user' pointer for the config value setter is always the plugin data.
So the plugin can change its internal state, according to the configuration value.
This was not possible before.
Also it adds a seperated hash map for plugin values. So they are logically more separated.
* Fix the whole pre-decoding logic for Hexagon.
Also resolves the problems with not knowing what is a valid instruction and which one not.
Leads to way more stability in decoding.
* Formatting and docs.
* Save utf8 flag to state to save memcpy.
* Fix inconsistency in function declaration.
* Fix token tests and fix hexagon plugin to handle none IO buffers.
* Fix test. Empty buffer before printing same instruction again.
* Assign state to rz_reverse struct so it can be passed o hex_get_il_op() in analysis_hexagon.c
* Rename and document alignment fields better.
* Add test for out of order packet decoding.
* Add ownership information
* Import relative headers.
* Remove usage of rz_core_cmd_strf
* Expose APIs for rz-solver
* Fix mismatched fn annotation
* Add compound OP for rz-solver
* Add new APIs for compound OPs
* Add new testcases for compound op
* Fix testcases for rop constraint