Commit graph

193 commits

Author SHA1 Message Date
Khairul Azhar Kasmiran
7fa052d3af
Remove rz_test_chdir() (#4766) 2024-12-14 18:44:14 +08:00
Khairul Azhar Kasmiran
925e2e9d34
rz-test: Fix last line of diff when REGEXP_FILTER_OUT/_ERR is set (#4763) 2024-12-14 14:31:47 +08:00
Khairul Azhar Kasmiran
19ff7720d3
rz-test: Refactor call to rz_regex_full_match_str() (#4761) 2024-12-10 23:36:42 +08:00
Khairul Azhar Kasmiran
3fae9c0f1e
Fix rz-test -i fixing when REGEXP_FILTER_OUT/_ERR is set (#4760) 2024-12-09 23:01:18 +08:00
Khairul Azhar Kasmiran
82d5596b05
Revert "rz-test: Set default test dir to '.' (#4741)" (#4759)
* Revert "rz-test: Set default test dir to '.' (#4741)"
This reverts commit 9051d00b25.
* Add comment for rz_test_chdir()
* Add comment for rz_test_chdir_fromtest()
2024-12-09 18:33:14 +08:00
Khairul Azhar Kasmiran
9051d00b25
rz-test: Set default test dir to '.' (#4741) 2024-11-25 21:10:20 +08:00
Khairul Azhar Kasmiran
9f421d962a
Add -1 to man rizin (#4694) 2024-10-30 21:22:27 +08:00
wargio
5896b15354 Add elapsed time when errored or verbose 2024-09-23 14:24:41 +08:00
Khairul Azhar Kasmiran
f6d763c858
Print stderr for failing asm tests (#4646) 2024-09-22 13:33:57 +08:00
Giovanni
483b775309
Fix permission of xorencoder.asm (#4642) 2024-09-20 17:04:42 +08:00
Khairul Azhar Kasmiran
9c6d50d46a
Print asm test exit status for failing asm tests (#4640) 2024-09-18 20:20:43 +08:00
satk0
e3d27c9316
Add environment variables documentation to manpages and -hh (#4560) 2024-07-10 11:12:48 +08:00
TheN00bBuilder
ea5cee2ed0
Added documentation for MS-DOS and Win32 timestamp conversions (#4528) 2024-06-02 12:52:15 +08:00
Khairul Azhar Kasmiran
7b91fb69c2
Revert #4506 (#4519) 2024-05-27 21:50:58 +08:00
Giovanni
d19fc9d0d8
Add N_THREAD_LIMIT to limit the max number of threads (upper limit). (#4510) 2024-05-24 16:12:08 +08:00
wargio
bce7bd76c1 Refactoring rz-test to use thread safe functions. 2024-05-22 22:27:41 +08:00
Khairul Azhar Kasmiran
524119c017
rizin: Remove -Q flag (#4468) 2024-05-11 22:48:05 +08:00
pelijah
f2d8e0db3d
Add HtSP, HtSS, HtSU, SetS (#4415)
- All `ht_*_new0()` are removed
- `freefn` field of HT options was renamed to `finiKV`
- `finiKV_user` fields was added to HT options
- Added `ht_*_new_opt_size` API
- `HtSP` and `HtUP` are created with `ValueFree` callback  that allows to reduce extra LOC and prevent bugs
- `SetP` replaced with `SetS` (based on `HtSP`)
- `rz_th_ht_*_new0()` and `rz_th_ht_*_new_opt()` are replaced with `rz_th_ht_*_new(HtXX *)`
2024-04-16 20:27:48 +08:00
Huzaifa
2c85412a50
Rz-find -E "filename" to execute command on match (#4200) 2024-03-08 13:49:04 +08:00
Giovanni
64f8a5ae57
Move parse into arch. (#4342) 2024-03-07 23:50:22 +08:00
wargio
d47ceedbd3 Merge rz_asm and rz_analysis into one library but keep deprecated apis.
The tms320c64x has been merged into tms320.
2024-03-07 18:38:49 +08:00
Anton Kochkov
f8318bec30
doc: improve man pages (#4288) 2024-02-23 20:13:19 +08:00
Ahmed_Hany
a5297b57c2
Add help and colors for rz-run -h (#4225) (#4237)
* `-l` flag for listing profile options
* `-d` for ouputing a base profile template.
* Updated relevant manpage.
2024-02-16 01:54:12 +08:00
Anton Kochkov
4fec9a49e4
man: minor formatting fixes (#4205) 2024-02-11 15:59:37 +08:00
Anton Kochkov
1b53c5c8f6
Update PACKAGERS.md (#4201) 2024-02-10 17:50:57 +08:00
billow
ddad724740
DWARF: rz-bin -dd download DWARF from debuginfod server (#4194) 2024-02-08 18:12:40 +08:00
Rot127
5afc51f0e2
Replace current regex engine with PCRE2 (#4185)
* 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.
2024-02-05 12:51:16 +08:00
Anton Kochkov
69a9b851f9
Improve man pages formatting (#4182) 2024-02-02 23:22:50 +08:00
Anton Kochkov
838ea61161
Minor fixes in man pages (#4176) 2024-02-02 00:17:45 +08:00
byteninjaa0
8cfd11b104
Update tools help and man pages (#4145)
* Update man pages
* Update help messages
2024-02-01 00:24:38 +08:00
Anton Kochkov
02d4e67090
Update rz-sign man page (#4136) 2024-01-22 15:36:50 +08:00
byteninjaa0
5a341348d7
rz-test: colorize help (#4105) 2024-01-15 07:49:34 +08:00
Peiwei Hu
a666628bf4
Show how many pending failure cases are there in rz-test -i (#4079) 2024-01-10 19:19:56 +08:00
Giovanni
ccbfe57b68
Allow to cancel and to print progress of the current diffing job (#4051) 2023-12-29 14:25:38 +08:00
sohail1734
cafebbf9c3
Actualize rizin and rz-diff man pages 2023-08-26 09:38:18 +08:00
Riccardo Schirone
8bc33bae5c
Remove unused rz-bb binary, probably left from r2 times (#3596) 2023-06-21 20:48:21 +08:00
Riccardo Schirone
497c2b2e05
Remove old bash-based rz-pm (#3360) 2023-02-07 18:26:38 +08:00
wargio
aee62e62ab Ensure a name is set in the json output of rz-test 2022-12-06 10:07:38 +08:00
Giovanni
e7e2156eed
Do not load sigdb from system and home when running rz-test (#3222) 2022-12-05 02:51:36 +01:00
Florian Märkl
bdef1913b3
Show test path and name in rz-test -i failures (#3173) 2022-11-08 20:41:46 +01:00
Anton Kochkov
9f6e13f364
Remove rz-agent (#3087) 2022-10-12 10:34:46 +02:00
Giovanni
4063f7d2de
Fix android binaries and missing main callbacks (#3044)
* Rename `rassign2` to `rz-sign`
* Refactor code from rz_main
* Rename struct
* Update main.c
2022-09-23 17:30:17 +08:00
Giovanni
1f952bc7e7
Fix pointless expression due wrong bit check on rz-test (#3038) 2022-09-18 15:38:08 +02:00
Dean
59b38e6efa
Add /*<type>*/ comments everywhere (#2986)
Adds /*<type>*/ comments and a linter check from rz-bindgen to enforce
their existence and consistency

Also includes the following fixes made when adding the annotations:
* removed unused intern_table arguments in pyc_dis.c, pyc_dis.h, asm_pyc.c
* removed unused classes argument from place_nodes in agraph.c
* removed unused recurse and recurse_bb functions in canalysis.c
* removed unused vars field from RzPrint struct
* removed unused RzAnalysisType* structs from rz_analysis.h
* removed unused list field from RzEgg struct
* fixed bug in bp_plugin.c where duplication-checking logic iterates over the wrong list
* removed unused q_regs field from RzDebug struct
* removed unused backtrace field from RzDebugPlugin struct
* removed unused classes_list field from RzBinNXOObj struct
* removed unused methods_list and classes_list fields from RzBinZimgObj struct
2022-09-11 13:04:53 +08:00
Giovanni
f8d15acd8b
Disable rz-pm (script) installation (#3007) 2022-09-05 20:15:46 +02:00
Khairul Azhar Kasmiran
1c9f93f7ef
Move rz_str version funcs into version.c (#2890)
* Move rz_str version funcs into `version.c`
* Move func prototypes into `rz_util/rz_version.h`
* Use `rz_version_` prefix instead of `rz_str_`
2022-08-08 22:30:28 +08:00
Daniel
a29dfce524 docs: replace rahash2 reference 2022-07-22 17:15:46 +02:00
Riccardo Schirone
8939fdbd7d
Use add_global_arguments instead of passing cflags/ldflags all around (#2812)
See also 66a0e22293/docs/TESTING_WITH_SANITIZERS.md (clang)
2022-07-17 21:33:51 +08:00
GustavoLCR
adfaa180e6
rz-test: Avoid PATH search when launching binaries (#2770) 2022-07-03 15:12:15 +02:00
Riccardo Schirone
87d1bc2175
rz-test: do not use rz_vector_insert if there are no tests to add (#2717) 2022-06-21 18:45:23 +02:00
Giovanni
a988941bf2
Refactor thread code and add RzThreadQueue (#2683)
* Kill the thread only if is alive.
* Remove rz_th_lock_guard.
* Use rz_sys_usleep since pthread_yield/sched_yield are not portable.
* Kill threads only on error.
* Avoid killing already-dead threads.
* RzThreadFunction now returns void* and added test_thread_queue.
* Removed pthread_exit
2022-06-19 21:07:13 +08:00
Peiwei Hu
63e736c648
Rz-test: assign the expected successful and failed test (#2693) 2022-06-16 18:14:41 +08:00
Florian Märkl
b06868ee30 Simplify rz-test time and rz_time_now_mono() on ppc Mac OS X
mach_timebase_info() already does some caching internally (can be seen in xnu
source), so the additional check is not necessary.
2022-04-02 12:48:59 +02:00
Peiwei Hu
a0ea1f6f57
rz-test: support exclude directories (#2440) 2022-03-24 16:54:25 +08:00
Khairul Azhar Kasmiran
1407c65c98
run.c: Rename remove_cr to crlf2lf (#2424) 2022-03-18 16:04:23 +01:00
Khairul Azhar Kasmiran
f78043d73a
remove_cr: Use more efficient algorithm (#2422) 2022-03-18 22:00:35 +08:00
Riccardo Schirone
86d20b2d16
RzShell: Remove possibility to switch to oldshell (#2420)
Due to some commands/tests still using the legacy "..." commands, we
can't fully remove oldshell code yet, but with this patch we just hide
it from the end users. Rzshell is now the default and only shell and
rzshell autocompletion is the default and only autocompletion engine.
2022-03-17 14:49:34 +01:00
GustavoLCR
170ab3eb3b
Remove windows.h include from rz_types.h (#2410)
* Create `rz_windows.h`
* Move `RzThread` structure definitions to internal header
* Create and use `rz_th_get_user()` API to avoid exposing `RzThread` layout in external header
* Make `rz_th_self()` an IPI
* Use `_wmkdir()` in `rz_sys_mkdir()` on Windows
* Remove unused `winkd_break_read` function
* Remove `RzIORap` definition from `rz_io.h`
* Remove include of `Windows.h` from `rz_types.h`
* Use `rz_windows.h` when necessary
* Remove `RzCoreRtrHost` definition from `rz_core.h`
* Remove `rz_socket.h` include from `rz_core.h`
2022-03-16 13:54:41 +01:00
Khairul Azhar Kasmiran
934588cfa5
!!: Fix extra \r on Windows (#2401)
* `!!`: Fix extra `\r` on Windows
* Use more efficient algorithm
* "Fix" cmd_pipe test
* "Fix" shared_memory.py
* Move feat_redirect test to archos/not-windows-any
2022-03-14 21:55:12 +08:00
Khairul Azhar Kasmiran
d525579475
Add tests for Rizin prompt (#2377) 2022-03-03 17:24:22 +01:00
Florian Märkl
4185ee34cf
Add asm auto-fix and diff to rz-test (#2196) 2022-01-11 19:41:53 +01:00
Florian Märkl
7e36f4bd38 Add IL lifting testing to rz-test 2022-01-10 19:27:09 +01:00
Riccardo Schirone
6f40dfe493
Move remaining things from shlr/ to meson subprojects (#2126)
* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
2021-12-22 09:20:39 +08:00
Florian Märkl
ce262c485b
Remove binrz/preload (#2045)
This is not used at all.
2021-11-29 18:08:23 +01:00
GustavoLCR
53a7694631
Add support for Windows on ARM (#1502)
* Support building for Windows on ARM

* Fix usage of reserved function name on ARM
* Fix architecture dependent `CONTEXT` fields access

* Fixes for debugging on Windows on ARM

* Fix breakpoint behavior on windows on ARM
* Fix register profile when debugging
* Remove `drx` error message if not supported
* Add support for hardware breakpoints
* Disable support for hardware single-stepping

* Fix Windows Message breakpoints on ARM

* Fix software single-stepping on return instruction on ARM

* Consider link register as destination for return instructions

* Fix setting debug bits to 16

* Rename `r12` to `ip` for windows arm register profile

* Remove debug bits hardcoding on windows

* Add 32bit registers to Windows ARM64 register profile

* Fix software step breakpoint alignment when entering thumb mode

* Define `RZ_TEST_ARCH` for `arm` and `arm64`

* Use `StackWalk64` API for backtracing on Windows

* Fix software single-stepping ARM in thumb mode

* Sync `asm.bits` with debugger

* Cleanup windows_debug.c

* Add SPDX for cross-arm64-windows.txt

* Add floating point control register flags

* Fix Windows Arm register profile alignment

* Keep `drx` warning
2021-11-24 20:13:42 +08:00
Khairul Azhar Kasmiran
906ece4211
Add asan build for clang (#1910) 2021-11-17 21:02:02 +08:00
Khairul Azhar Kasmiran
ac496744c8
Fix #1887: Sync test results with testfile (#1906) 2021-10-30 18:25:25 +08:00
Florian Märkl
97c3b81035 Disable codesign on old Mac OS X 2021-10-26 10:50:22 +02:00
Khairul Azhar Kasmiran
db0fdffc4e
archos/: Support <os>-any test categories (#1795) 2021-10-05 17:33:42 +08:00
wargio
3ba03e4940 Fixed GCC 11 warning in rz-test 2021-09-24 01:52:11 +02:00
Khairul Azhar Kasmiran
fe9e1beed9
archos/: Support any arch for not- categories (#1713) 2021-09-18 20:21:19 +08:00
Khairul Azhar Kasmiran
67e323174b
Add not-windows-x64 category to archos/ (#1700) 2021-09-17 00:06:15 +08:00
Rot127
79751e358e
rz-test: check for undeclared keys to fix segfault. (#1689) 2021-09-15 09:32:58 +00:00
ryancaicse
0b993f9771 Fix un released lock
Fix un released lock state.lock in the main before the program exits.

Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
2021-09-15 10:31:26 +08:00
Giovanni
8ace435328
Fix coverity bugs (#1654)
* CID 316614: Use after free (USE_AFTER_FREE)
* CID 316535: Use after free (USE_AFTER_FREE)
* CID 316652: Use after free (USE_AFTER_FREE)
* CID 316504: Unsigned compared against 0 (NO_EFFECT)
* CID 316439: Resource leak (RESOURCE_LEAK)
* CID 356127: Dereference after null check (name can never be NULL)
* CID 320881: Resource leak (RESOURCE_LEAK)
* CID 320885: Missing break in switch (MISSING_BREAK)
* CID 316679: Resource leak (RESOURCE_LEAK)
* CID 316574: Explicit null dereferenced (FORWARD_NULL)
* CID 356105: Resource leak (RESOURCE_LEAK)
* Fixed uninitialized building issue
2021-09-11 09:30:57 +02:00
Khairul Azhar Kasmiran
eb262e4df9 Use UTC timezone for tests 2021-09-08 23:14:46 +02:00
Giovanni
cacce543b7
Fix rz-test coverity issues (#1593)
* CID 316425: Resource leak (RESOURCE_LEAK)

* CID 316759: Dereference before null check (REVERSE_INULL)

* CID 354049: Dereference after null check (FORWARD_NULL)

* CID 315924: Out-of-bounds access (OVERRUN)
2021-09-04 14:30:41 +02:00
Riccardo Schirone
727ab8ced0
Use FREE_UTF8_ARGV, not UTF8_ARGV_FREE (#1550) 2021-08-30 16:27:44 +08:00
GustavoLCR
d7e7bae79e
Use wide version of Windows APIs (#1531)
* Use wide version of Windows APIs in subprocess functions
* Use `wmain` on Windows to get UTF16 arguments
* Use wide version of APIs in `rz_cons`
* Always try to set console codepage to UTF8

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2021-08-27 15:23:26 +08:00
Riccardo Schirone
6041ae6bb3
rz-test: Make sure to correctly free path_left ht (#1372) 2021-07-29 01:14:25 +08:00
Giovanni
7a7ca18e20
Fix some warnings related casting ut8* to char* (#1371)
* Fix some warnings related casting ut8* to char*
* Fixed runtime casting on aes code ut8 to ut32
2021-07-28 17:33:48 +02:00
Giovanni
8fe4d0b0a5
Convert ! commands to newshell (#1235)
* Updated core_plugin_example.c
* Removed RZ_BYTES and RZ_BLOCK
Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2021-07-28 10:33:33 +02:00
GustavoLCR
1ab628d83d
Fix some clang-cl warnings (#1298) 2021-07-15 12:15:17 +08:00
Riccardo Schirone
3a3e21ce2d Define rizin_exe also when using blob feature
Unit tests need the path of the rizin executable to properly run in some
cases, thus define rizin_exe variable both in regular build and when
rizin is built with -Dblob=true.
2021-07-05 09:26:54 +02:00
Khairul Azhar Kasmiran
417d966fb1
rz-test: Remove broken diffchar option (#1158) 2021-05-21 21:17:26 +08:00
Giovanni
6fec281af7
Rewrite rz-diff and internal diffing library (#1126) 2021-05-14 19:47:30 +08:00
seanachao
a2f8631b6c
Change -, --, = argument and = command meaning (#930)
* Swap = & - R (#615)&(#616)
* Fix R replace =
2021-04-21 16:20:24 +08:00
Anton Kochkov
891092b00b
Remove unused Travis and Purge action in rz-pm (#1038) 2021-04-19 16:44:49 +08:00
Anton Kochkov
5f37d846b5
rz-pm fetch alll reference to checkout selected tags (#1039)
`git clone --depth 1` doesn't fetch tags thus failing later `git checkout <tag>`.
2021-04-19 15:21:47 +08:00
Anton Kochkov
24ee8cb457 Fix Coverity CID 316740 (String not terminated) 2021-04-15 11:42:47 +08:00
Florian Märkl
3bfa44c8f3
Make rz_diff_buffers_unified() use the Subprocess API (#981) 2021-04-08 17:43:02 +02:00
Riccardo Schirone
db04bed503
Fix autocompletion of rz- commands in rizin shell and rename wrong rz_ (#944) 2021-03-31 16:10:54 +02:00
Aswin C
9c10bfb267
Refactor to use more API in various commands and improve code quality (#821)
* Handle all cases of `=H&`
* Use PJ in `pcj`
* Use `rz_core_cmd_help` for `ft`
* Fix the missing format string in `pcj`
* Add `rz_core_regs2flags` after `rz_core_esil_step`
2021-03-15 17:28:29 +08:00
Riccardo Schirone
53bf5c497f SPDX Copyright text for all files based on history
- Add LICENSES directory
- Download additional licenses used
- Add .reuse directory
- Add doc about SPDX/reuse

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-03-05 19:39:15 +08:00
Alexis Ehret
b6f99ec7ba Fix uninitialized data errors for rz-test
test with:
* valgrind -s --track-origins=yes --log-file=log.txt rz-test -C test
* valgrind -s --track-origins=yes --log-file=log.txt rz-test -L -C test
2021-02-24 20:52:16 +01:00
Alexis Ehret
c9230c7f90 Fix memory leak binrz/rz-test/rz-test.c 2021-02-24 20:52:16 +01:00
Riccardo Schirone
10f72d818c
Implement rz_subprocess_start_opt API to choose pipes (#243) 2021-02-22 12:57:31 +00:00
Riccardo Schirone
2c54547ec0 Clean dependencies between modules and put them in order 2021-01-28 11:57:28 +01:00
Riccardo Schirone
cee8d470c2 Remove Makefiles and many related scripts 2021-01-28 11:57:28 +01:00
Riccardo Schirone
1173049e2b Consider DESTDIR in macos_sign.sh during install script 2021-01-21 16:38:38 +01:00