Commit graph

1840 commits

Author SHA1 Message Date
Anton Kochkov
fd64b7ee25 Convert pr commands to the rzshell 2023-02-02 08:21:09 +08:00
Anton Kochkov
5082c1f0e8 Convert p= commands to rzshell 2023-01-31 08:27:30 +08:00
Giovanni
c3f9d4c1d3
Fix #2859 - Use minstring in all bin plugins (#3328)
* Do not hardcode min string size for bins using `rz_bin_file_strings()`
* Fix rz-bin to set properly `bin.[min|max]str`
* Add and fix tests
2023-01-30 18:38:08 +08:00
Giovanni
21333133d9
Fix bx after add lr, pc, 0 in arm32 (#3326)
Co-authored-by: pancake <pancake@nopcode.org>
2023-01-28 15:10:14 +08:00
Florian Märkl
62c0a6b880 Raise timeout for 6502 rzil test
On some platforms, the rizin startup itself takes multiple seconds,
which can make these tests timeout even if they would otherwise work.
2023-01-26 20:39:24 +01:00
Riccardo Schirone
d6c586bc3b
core: replace 'it' with 'iT' (#3320)
`it` is the table mode of the `i` command, thus leave it available and
use `iT` instead.
2023-01-26 16:01:06 +08:00
Florian Märkl
77a334a2af
Refactor srec reading to not use sscanf (#3321)
Parsing with sscanf turned out to cause an extreme slowdown. As only hex
values are being read, this can be done with RzUtil-provided
functionality. Relevant test cases exist in test/db/io/srec.
2023-01-25 16:42:46 +01:00
Anton Kochkov
38a909738c
Convert pC commands to rzshell (#3213) 2023-01-23 17:54:52 +08:00
Anton Kochkov
a3885e8f99
Remove legacy unit tests (#3088) 2023-01-23 17:46:21 +08:00
Rizan
bbc5457b7a
Use compiler intrinsics for rz_swap_* functions (#3300)
* Using `__builtin_swap*()` whenever available instead of `rz_swap*()`
* Moved `test_endian()` from test_utils.c to test_endian.h
* Added test cases
2023-01-22 21:30:21 +08:00
Florian Märkl
3f4570cd7a
Fix string flag sizes after aar (Fix #3305) (#3307)
Regression from 7af1353166, but most
likely already broken before and only made visible by it: String flags
set from bin had their size set to how many bytes the string takes, but
were overwritten to a size of 1 after running aar.
2023-01-21 15:28:05 +01:00
Giovanni
7af1353166
Use proper methods to detect strings in analysis loop. (#3284) 2023-01-20 12:02:10 +08:00
Riccardo Schirone
c4767cf1ac
Fix plugin removal and clean code (#3277)
* cmd: Fix summary of few "L" sub-commands
* util: start decluttering plugins handling

- Add Doxygen docs
- Remove unused API functions and make others internal only
- Use RzLibType enum for plugin type instead of int

* util: move dlopen/dlsym/dlclose to rz_sys
* util: make rz_lib_open/close return bool
* util: simplify rz_lib_add_handler and rz_lib_open*
* libs: implement rz_*_plugin_del to remove a plugin
* core: remove commands from RzCmd when removing plugins
* librz: call plugins 'fini' method when removing a plugin
* core/cmd: do not fail if the hashmap removal fails

When removing a group command, the inner command might have the same
name, thus it would result in trying to remove the same name twice.
Ignore it, as it is fine.

* librz: make RzCrypto plugins handling like the others
* librz/crypto: add rz_crypto_reset and use it
* librz: allocate the plugin structures before adding them
2023-01-16 13:32:46 +01:00
Florian Märkl
7c6579a614 Fix asm.bits-dependent open tests
Passing arch and bits as args instead of commands ensures they take
effect earlier. This fixes these tests on platforms where the default
asm.bits is 32.
2023-01-15 19:01:18 +01:00
Florian Märkl
953a81afc0
Make afs respect the cc (Fix #3291) (#3292)
Applying a function signature with afs to a function was using a
combination of the existing args and wrong stack addresses to apply the
args to function variables. This generally resulted in incorrect
locations. Instead, we now use the info from the cc.
2023-01-15 13:40:14 +01:00
Peter B
ca3c77e981
Set refptr for Xtensa l32r opcode for better disassembly output (#3289) 2023-01-15 09:32:37 +08:00
Giovanni
4a9740d11d
Fix pxj output (#3290) 2023-01-14 14:14:34 +08:00
Giovanni
3edb12c2d2
Temporary fix for the meta strings (#3283)
* Temporary fix for the meta strings
* Fix unit test
* Added test for Csl with raw binary
2023-01-11 12:31:49 +08:00
Florian Märkl
70c1a3e109
Fix some tests for platforms without native debugger (#3278) 2023-01-09 17:57:39 +01:00
Florian Märkl
01a82490d7 Raise timeout for some aez tests
On some platforms, the rizin startup itself takes multiple seconds,
which can make these tests timeout even if they would otherwise work.
2023-01-09 10:26:30 +08:00
Florian Märkl
1b4385e224
Make xnu reg profile depend on cpu type instead of RzDebug.bits (#3270)
RzDebug.bits often has nonsensical contents set from all kinds of
places. Specifically, when debugging fat binaries on arm64, it had a
value not matching the debuggee when the reg profile was loaded,
resulting in the arm32 profile being used.
The right way to determine the profile is to do it after attach, when
the cpu type of the debuggee is known.
2023-01-07 17:43:41 +01:00
Florian Märkl
de5aa96af9 Patch Mach-O chained ptrs into sparse overlay RzBuffer
Patching the chained ptrs on the fly during every read as before turned
out to be a major bottleneck on larger binaries. So now we patch
everything once into a sparse overlay buffer, like it is already done in
ELF and classic Mach-O relocs.
2023-01-07 11:04:22 +08:00
Florian Märkl
29adadc2b8 Speed up ppc64 IL tests by not loading hashes 2023-01-07 10:18:57 +08:00
Florian Märkl
d6bd4a57b0
Remove temporary type string conversion in DWARF integration (#3266)
Due to the DWARF parsing having been implemented before proper RzTypes,
it was still generating C-like strings that we then parsed into RzType.
This is fragile and was identified to be a major performance bottleneck
on OpenBSD/sparc64. Instead, we now generate RzTypes directly where
possible.
There are still cases left where strings have to be generated
from those types to be stored in an SDB. This should be changed in the
future too.

rz_type_pointer_of_type() is now also always creating a pointer type of
the given type. Before, it would have failed when the pointee was an
identifier that did not exist in the database. But this may be a valid
case e.g. while still building the database from DWARF and such
sanitization goes beyond what one would expect from
rz_type_pointer_of_type().
2023-01-05 19:14:59 +01:00
Florian Märkl
fa15d2fbab Fix type bitsizes for struct/union member loops
Even if the case is nonsensical in practice, we can't rule out the
possibility that a struct or union may contain itself as a member
(optionally through multiple recursion steps). This must be caught when
calculating the size of the type in order to not recurse infinitely.
Structs containing pointers to itself are not meant by this, as that is
perfectly valid and the size is determined without recursion.
However typedefs and arrays must be taken into account.
2023-01-04 09:39:10 +08:00
Florian Märkl
5a229ca6a7 Fix rz_type_db_get_bitsize() without specifier and add tests 2023-01-04 09:39:10 +08:00
Giovanni
2c91585125
Fix wrong subvar in json (#3263) 2023-01-03 16:53:03 +01:00
Florian Märkl
d9950f7479
Replace bp/sp-vars by generic stack-based ones (#3167)
Variables on the stack are not identified by bp/sp+<offset> anymore, but
by their address from the bottom of the stack frame (RzStackAddr),
independent of how they are accessed.
So now there are only two kinds of variables: stack and register.

This required some major refactoring and other changes:
* RzAnalysisVar.isarg was removed. Whether a variable is an argument is
  now specified implicitly by its storage location.
* Varsub of struct fields had to be rewritten so fields can be queried
  by arbitrary stack addresses using the recently introduced sp
  tracking, as the old approach to fill a list with all fields would not
  work anymore.
* analysis.vars.stackname was removed, new behavior is more similar to
  this being true before.
* Variables will not be created at stack+0 now, because the return
  address is there. Before, vars were only created sometimes in such
  cases.
* Variables created from bp offsets in x86 are not deleted anymore if
  the function's bp_frame is false (see removed
  rz_analysis_function_delete_vars_by_kind(fcn,
  RZ_ANALYSIS_VAR_KIND_BPV); calls). This may lead to some
  false-positive detected variables. Whether this really is a practical
  issue is yet to be seen. At least there are no meaningful tests that
  are broken by this.
* Applying variables from dwarf needed some fixes for determining the
  correct stack locations of variables in order to write meaningful
  tests. The handling is still not entirely correct for all
  possibilities of dwarf info, but at least the changed/added test cases
  are right and serve as a reference for future changes.
* Projects version 11 is introduced.
* afvb commands have been removed, afvs now handles all stack vars.
2023-01-02 11:36:21 +08:00
Dhruv Maroo
61e8ace32a
Fixing some Coverity issues (#3261)
* Use signed long long for `src_readlen`, so we can check for -1

    * Fixes Coverity defect 396947 and 356103

* Replace Unicode quotes with ASCII

* Ue signed structure in case -1 is returned (CID 396933)

* Need signed to check negative (CID 395560)

* Fix memleaks in `test_autocmplt_global`

    * Related CIDs: 356309, 356307

* Set initial value of `ret` to false
2022-12-31 16:57:19 +08:00
Dhruv Maroo
d20f68d7ab
Add *pty API (#3221)
* Initial function signatur and struct for `RzPty` API

* Change type annotation to borrow

* Implement `rz_subprocess_login_tty`

* Add fork mode enum and move pty struct; restructure ifdef guards

* Add rough implementation of forkpty

  * Add `rz_sys` versions for `forkpty` family of functions

* Add forkpty code; Make changes according to review

* Implement forkpty properly and add unit test

  * Add `test_interactive_pty`

* Add documentation

* Remove const in function argument

  * Apparently, MacOS as non-const arguments for `openpty` and `forkpty`

* Add more tests for subprocess forkin using forkpty

  * `test_interactive_pipe_pty`: Create pipes between the slave's PTY
    and master and use them
  * `test_interactive_custom_pty`: Use a custom PTY for the slave

* Add PTY functions exist checks for unit tests

* Move terminal param code inside the forkpty branch

* Add comment about why we need to check `n_bytes = 0` in `subprocess_wait`

* Remove forkpty with a specified `RzPTY`

  * Also, no piping done in forkpty

* Add checks to disallow using `forkpty` with piping

* Make changes according to review

  * No need to check proc file descriptors for -1 in `forkpty` mode, since
    they *will* be -1
  * No need to check `n_bytes == 0` in for `std{out,err}_pty`

* Extract pipe initialization code in `init_pipes` function

* Allow using custom PTY for `rz_subprocess_forkpty`

* Remove const qualifiers for termios and winsize arguments

  * This makes the build pass on MacOS, which does accepts non-const
    arguments

* Change `pid_t` to int so that it compiles on Windows

* Add empty implementation for PTY API for Windows

  * Update function signature for `rz_subprocess_start_opt` for Windows
  * Re-add `#define` for `pid_t` in `librz/socket/run.c`

* Move functions to remove duplicate definitions

* Allow specifying piping options even in `forkpty` mode

    * Only expose the master fd for the streams which have pipe create
      as their piping option

* Add comment about not using `master_fd` directly

* Fix types in definition for Windows

* Free the allocated `RzPTY` object

* Add const qualifiers for `RzPTY` argument

* Assign `fork_mode` and `pty` in all instances of subprocess opt start

    * for good measure

* Compare master fd with -1, not 0

* Remove stray file

* Add second comment about the terminal attribute

* Overhaul the whole PTY implementation

    * Now the caller can either use a pipe or PTY to send and receive
      data from any of the streams
    * Extra option `make_raw` to use the slave PTY in raw mode
    * Add documentation for all the new functions

* Fix UAF bug

* Add error handling for `tcgetattr`

* Move the term param setting code

* Add documentation for the subprocess API and sys API

* Format according to clang-format
2022-12-29 20:38:39 +08:00
Peiwei Hu
276306b587
Add search.case_sensitive for grep case-sensitive/insensitive (#3241) 2022-12-28 09:38:32 +08:00
Peiwei Hu
1938890035
Fix: grep(~) will change the original result when ignores case (#3259) 2022-12-25 08:01:06 +08:00
Florian Märkl
13cd3942d1
Rewrite stack pointer tracking and storage (#3207)
The stack pointer was previously already tracked during analysis for
variables and their accesses, but not stored in any sensible form for
further use. RzAnalysisBlock.stackptr and parent_stackptr were used in
some places, but they had no evident meaning.
Now we store the sp at the entry of a basic block and the difference
from that for every instruction inside the block to allow for efficient
querying of the sp value at arbitrary analyzed addresses.
RzAnalysisFunction.stackptr is now deprecated as its previous use was
primarily as a temporary accumulator, which is now handled locally, but
full removal of it would go beyond the scope here.

asm.stackptr visualizes both the absolute sp value and the delta of each
instruction in disassembly.

Changes in librz/analysis/p fix some test cases with the new tracking.

Introduces project version v10 with sp_entry/sp_delta instead of
stackptr/parent_stackptr.
2022-12-23 15:01:15 +01:00
Dhruv Maroo
a3ebd3fa99
Dalvik disassembly should not throw error for single opcode (#3255) 2022-12-20 22:36:56 +05:30
Riccardo Schirone
f64ef48277 test: fix 'core: ' message in help log error 2022-12-19 11:46:18 +01:00
Riccardo Schirone
efa5598e5e test/unit: Add small unit test for rz_log 2022-12-19 11:46:18 +01:00
Anton Kochkov
1d3fbac74a
Add Nord color theme (#3250) 2022-12-18 11:48:15 +08:00
Anton Kochkov
dcaf3ecd69
Add Mars color theme (#3252) 2022-12-17 20:25:41 +08:00
Dhruv Maroo
f8f042f818
Fix searching for strings in rz-bin when the file format is invalid (#3245)
* Fix searching for strings in `rz-bin` when the file format is invalid

  * Always try with "any" bin plugin before giving up searching a file
  * Add a test in `db/tools/rz_bin` for this

* Remove `EXPECT_ERR` from `rz-bin broken MZ` test
2022-12-15 23:08:48 +08:00
Riccardo Schirone
adf8b0717e
bin/formats/elf: consider stripped bins without sections (#3248)
Backport radare2 commit https://github.com/radareorg/radare2/pull/20864
2022-12-15 20:29:19 +08:00
billow
291d2a683c
Uplifting 8051 architecture to new IL (#2999) 2022-12-14 13:13:21 +01:00
Florian Märkl
3e75e1f6c7 Rewrite and extend type paths from offset
Tests and extends deriving paths into types at a given offset in the
following ways:
- Parameter for limiting the depth of the path
- Array support, e.g. `.member[5].anothermember`
- Typedef support
- Paths can be taken from arbitrary RzTypes, not only RzBaseType
- Removed the typename in the beginning of paths, which can be added by
  the caller if needed
2022-12-10 11:15:37 +01:00
Florian Märkl
ff778e7507 Unify and fix typedef loop handling
Even if the case is nonsensical in practice, we can't rule out the
possibility that the reference chain induced by a typedef may not
contain a loop, which could lead to infinite recursion when trying to
infer the actual underlying type.
Previously only the case where a typedef points to itself directly was
handled, but loops in multiple steps are possible too. So we introduce
rz_type_db_base_type_unwrap_typedef(), which handles the full
(multi-step) loop-aware unwrapping in one place and use it wherever
needed.
2022-12-10 11:15:37 +01:00
Giovanni
4f19d80aee
Fix #3191 - Esil wrong order in X86_INS_POP (#3236) 2022-12-09 20:18:03 +01:00
Giovanni
55e690990b
Fix endianness for win pagedump and winkd (#3204) 2022-12-09 11:41:28 +01:00
wargio
d7f793bb6f Fix endianness in analysis mips.gnu plugin 2022-12-06 07:51:33 +08:00
Giovanni
89717b141c
Fix wB test due broken pv1 (#3225) 2022-12-06 06:50:19 +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
86269942d0
Fix leaks in rz_type and tests (#3223)
All leaks detected by running valgrind on test/unit/test_type.
2022-12-04 20:42:46 +01:00
wargio
a3b8ed48b7 Remove esil debugger since it is a big todo 2022-12-04 16:53:58 +01:00
Dhruv Maroo
ce80a13aed
x86 RzIL uplifting (#2747) 2022-11-28 09:33:19 +08:00
Florian Märkl
6479bd53ab
Add missing project migrations tests up to v9 and fix leaks (#3205)
Even though many of the migrations were trivial, for all previous
versions X it is important to have both tests for X->X+1 migrations
and loading X in current rizin.
See leading comment in test_project_migrate.c for details.
Leaks detected by these tests were also fixed.
2022-11-27 09:39:10 +08:00
Florian Märkl
0a3e96a6f0
Make color promt test not load user settings (#3202)
When a color theme is set in rizinrc, this test would fail.
2022-11-25 10:22:51 +01:00
Khairul Azhar Kasmiran
3ddbda0a9a
rz_heap_glibc.h: Add have_fastchunks member to RzHeap_MallocState_ structs (#3200)
* Add `have_fastchunks` member to `RzHeap_MallocState_` structs

* Show only last few lines of `dmh` output in "dmh allocated" test
2022-11-24 09:42:07 +08:00
Khairul Azhar Kasmiran
ea07efdfb8
Improve "dmh allocated" test (#3199) 2022-11-22 18:29:38 +01:00
Anton Kochkov
70a7016d97
Convert p- commands to rzshell (#3198) 2022-11-22 23:46:40 +08:00
Khairul Azhar Kasmiran
1b57ec3c2e
Make "dmi ld" test more robust to different ld (#3190) 2022-11-17 22:13:51 +08:00
Anton Kochkov
f2ca09fe24
Extract histograms and bars into RzCons (#3189) 2022-11-17 14:41:50 +01:00
Khairul Azhar Kasmiran
83eea37c4e
Make first dbg_dmh test invariant to r13 (#3188) 2022-11-16 21:36:13 +08:00
Khairul Azhar Kasmiran
935361e31b
Mask out ebx too in "Conditional dr/ar" test (#3183) 2022-11-13 14:51:33 +08:00
Khairul Azhar Kasmiran
315433d286
Make "dbg.px0" test invariant to ld (#3181) 2022-11-12 21:05:31 +08:00
Khairul Azhar Kasmiran
13a5aebea3
Make "debug stepback from callee" test invariant to env (#3179) 2022-11-12 00:28:07 +08:00
Khairul Azhar Kasmiran
5611bc3c79
Make dbg.stepback test invariant to env (#3176) 2022-11-10 19:32:08 +08:00
Anton Kochkov
2ed75e8364
Backport rz-ax conversion fixes (#3166)
* rz-ax: fix base64 null byte decoding bug
* rz-ax: fix broken tests for long number conversion
* rz-ax: add tests for 64-bit binary numbers

Co-authored-by: Sylvain Pelissier <sylvain.pelissier@gmail.com>
2022-11-07 00:27:17 +08:00
Florian Märkl
2a02548ec2 Fix some db/formats/mach0 tests on hosts with asm.bits=32
Fatmacho loading selects the file based on both arch and bits, so if the
preselected asm.bits was not 64 (which is the case on OpenBSD/sparc64
for some reason), these tests would fail.
2022-11-06 23:58:01 +08:00
Florian Märkl
b3c498dee0 Fix endian in macho reloc parsing 2022-11-06 23:58:01 +08:00
Khairul Azhar Kasmiran
2314f18063
Nop out calls_x64's printf call in some dbg_step and dbg_step_back tests (#3159) 2022-11-05 22:42:47 +08:00
Florian Märkl
3f077bce4a Remove deprecated rz_analysis_var_all_list()
This function only did a needlessly inefficient clone of
RzAnalysisFunction.vars, which can also be iterated directly.
Test differences are from different ordering of variables iterated, but
both are fine as there was no deliberate order before either.
2022-11-04 16:24:50 +01:00
Florian Märkl
47c63c59a9 Add rz_pvector_clone() and clone without free function
A clone function that also copies the free function is very prone for
misuse and resulting double-free/uaf. Current cases were only fine
because they either did not have a free function or pathced it to NULL
on the result manually, meaning they do not need this behavior anyway.
2022-11-04 16:24:50 +01:00
wargio
b59d9a03b2 Fix test 2022-11-02 00:53:54 +01:00
wargio
2b3c6b5102 Updated all tests 2022-11-01 10:58:16 +08:00
wargio
fe00dcdf68 Rewrite RzReg to use RzBitVector 2022-11-01 10:58:16 +08:00
wargio
bf6d162909 Implement float80 and RzFloat to decimal string 2022-11-01 10:58:16 +08:00
OGRE
3f6a8d54ba
Replace " with ' in ag* dot command (#3133) 2022-10-28 08:34:30 +08:00
wargio
da68d2507a Fix tests 2022-10-26 21:46:22 +02:00
Giovanni
3e5217456d
Fix mdmp endianness (#3126)
* MiniDmpHeader & MiniDmpLocDescr32/64 & MiniDmpMemDescr32/64

* MiniDmpException & MiniDmpExcStream

* MiniDmpModule

* MiniDmpThread & MiniDmpThreadList

* MiniDmpThreadEx & MiniDmpThreadExList

* Removed struct minidump_string

* MiniDmpDir

* MiniDmpExcPointers & MiniDmpExcInfo & MiniDmpFuncTableDescr

* MiniDmpFuncTableStream & MiniDmpHandleDataStream

* MiniDmpExcRecord & MiniDmpHandleDescr/2

* MiniDmpHandleObjInfo

* MiniDmpMemList64 & MiniDmpMemDescr64 (init)

* MiniDmpMemInfo & MiniDmpMemInfoList

* MiniDmpMiscInfo

* MiniDmpMiscInfo2

* MiniDmpSysInfo

* MiniDmpThreadInfoList & MiniDmpThreadInfo

* MiniDmpTokenInfo & MiniDmpTokenInfoList

* MiniDmpUnloadedModule & MiniDmpUnloadedModuleList

* MiniDmpUserStream & MiniDmpUserStreamInfo

* MiniDmpIncludeThreadCallback

* MiniDmpModuleCallback

* MiniDmpIncludeModuleCallback

* MiniDmpIOCallback

* MiniDmpReadMemoryFailureCallback

* MiniDmpCallbackOutput

* AVRFBacktraceInfo & AVRFHandleOp & MiniDmpHandleOpList

* MiniDmpObj
2022-10-25 09:37:05 +08:00
Giovanni
5789f6557e
Threaded analysis matching (#3090) 2022-10-24 00:40:42 +02:00
Giovanni
64a9459ea4
Fix flirt detection when function size is less than 32 bytes (#3118) 2022-10-23 16:34:43 +02:00
wargio
3b19487f87 Cleanup plugin names. 2022-10-23 11:36:17 +02:00
wargio
174d02b4a7 Fix ninds plugin endianness and improved it 2022-10-23 11:36:17 +02:00
Florian Märkl
9a379f345d
Make dyld_chained_ptr_* parsing endian-independent (#3113)
Fixes test/db/cmd/cmd_tc and test/db/formats/mach0/arm64e on big endian
2022-10-22 01:03:24 +02:00
wargio
ab5c0cb869 Fix endianness in px command 2022-10-20 23:12:58 +02:00
Giovanni
e2ee0c3fd6
Rewritten bin_nin3ds.c and add test (#3110) 2022-10-20 19:56:17 +02:00
Florian Märkl
68a06e69d2
Rewrite reading in io_mach (#3101)
The previous reading code was slow (performed too many
vm_region_recurse_64 calls) and broken, for example at boundaries of
memory maps. Details can be found in the code comments.
2022-10-17 09:15:59 +08:00
Rot127
36d6c07b75
Fix PPC RZIL endianness issue on SystemZ (#3096)
* Fix endianness issue by passing `cs_ppc_op.reg` instead of `.imm` to cs_reg_name.

The issue with using the `.imm` union member is that it is a `st64` while `.reg` is an enum (on SystemZ 32bit wide).
On little endian systems `.reg == .imm`. Not so on big endian systems. In which
case it is `.reg == .imm >> 32`.

* Set correct test for broken instruction `bne cr5, <target>`.

See issue: https://github.com/capstone-engine/capstone/issues/1914
2022-10-15 20:39:37 +08:00
Florian Märkl
2237870395
Mach-O: Add support for DYLD_CHAINED_PTR_64 (#3094)
The added test case was checked against execution on real iOS.
2022-10-14 19:59:29 +02:00
Anton Kochkov
9f6e13f364
Remove rz-agent (#3087) 2022-10-12 10:34:46 +02:00
Anton Kochkov
4a037c2f2a
Convert dk commands to the rzshell (#3078) 2022-10-11 18:02:52 +08:00
Giovanni
171612c5e1
Add ssdeep hash (#3084) 2022-10-10 17:03:26 +02:00
Anton Kochkov
24503df48b
Convert pF commands to the rzshell (#3071)
* Convert `pF` commands to the rzshell
* Add json output for PKCS7 and x509 and rename test due FS issues

Co-authored-by: wargio <wargio@libero.it>
2022-10-09 19:18:05 +02:00
wargio
5ecc9b8a36 Added pF tests 2022-10-09 08:09:00 +08:00
Khairul Azhar Kasmiran
4cdad14ccd
Remove dk 9 from debug tests (#3070)
* Add `dk 9` test
2022-10-08 16:44:22 +08:00
Khairul Azhar Kasmiran
137d376f54
Kill debugged process on exit if non-interactive and dbg.exitkills is true (#3068) 2022-10-07 22:46:36 +08:00
wargio
fbad0b4859 Remove agd and add rz_analysis_similarity/match + refactoring
- Introduce the following new methods:
  * `rz_analysis_similarity_basic_block()`
  * `rz_analysis_similarity_function()`
  * `rz_analysis_similarity_basic_block_2()`
  * `rz_analysis_similarity_function_2()`
  * `rz_analysis_match_basic_blocks()`
  * `rz_analysis_match_functions()`
  * `rz_analysis_match_basic_blocks_2()`
  * `rz_analysis_match_functions_2()`
- Remove `RzAnalysisDiff` and its usages
- Remove `librz/analysis/diff.c` entirely to and adds `librz/analysis/similarity.c`
- Remove a lot of unused structures and simplified the code by a lot
- Fix typo in levenshtein
- Remove `librz/core/gdiff.c` and `gdiff` functions since they were unused or only used in rz-diff
- Remove `difftype` (or "color") from `RzANode` which lead to dead code
- Decrease serialized data in projects.
- Add `RzAnalysisVarKind` and `RzAnalysisVarType` and replaces all the hardcoded values
- Remove command `agd`
- Remove all `rz_core_gdiff` usages from `rz_core.h`
- Refactor `rz_analysis_var_list` and `rz_analysis_var_count` due unused argument (`RzAnalysis` was not used)
- Add new method `rz_analysis_var_count_total` to simplify some usages
- Remove `rz_core_graph_diff`
- Add `typedef RzAnalysisFcnType` on `enum``used for function types
- Remove unused `RZ_ANALYSIS_FCN_VARKIND_LOCAL`
- Remove from `RzAnalysisFunction` the following variables:
  * `fingerprint`
  * `fingerprint_size`
  * `diff`
  * `diff_ops`
  * `diff_thbb`
  * `diff_thfcn`
- Remove from `RzAnalysisBlock` the following variables:
  * `fingerprint`
  * `diff`
- Remove `RZ_ANALYSIS_THRESHOLDBB` and `RZ_ANALYSIS_THRESHOLDFCN`
- Remove the following callbacks from `RzAnalysisPlugin`
  * `RzAnalysisDiffBBCallback`
  * `RzAnalysisDiffFcnCallback`
  * `RzAnalysisDiffEvalCallback`
- Fix fancy table columns/rows when a color string is in a cell
- Bumped project version to 9
2022-10-04 20:02:35 +02:00
Florian Märkl
2e8ec8ac75
Always detach when quitting from -q or -Q (#3058)
Previously, on macOS we were detaching properly when the user quit rizin
after an interactive `rz -d <file>` session, but not on
`rz -d -Qc <cmd> <file>`, which would leave behind a zombie process.
Now, the process is detached and keeps running, which also matches the
behavior on Linux. Hence the `dk 9` additions in the tests, to not
spoil the output with whatever the processes print.
2022-10-01 17:38:01 +02:00
Anton Kochkov
4bf6b67212
Convert dd commands to rzshell (#3049)
* Convert `dd` command to rzshell
* Remove unimplemented `dH` command
* Remove `ddt` command
* Move `date` command to the "shell" category
2022-09-29 08:24:50 +08:00
Giovanni
5b1e5e6762
Support blake3 hash algo (#3030) 2022-09-17 18:38:21 +02:00
wargio
8f40517990 Refactor rz_float_new_from_utXX_as_fXX 2022-09-16 21:55:58 +08:00
Anton Kochkov
52260857b5
Convert some of the a commands to the rzshell (#3025)
* Remove `ap` command
* Convert `ad` commands to rzshell
* Convert `aF` command to the rzshell
2022-09-15 21:09:15 +02:00
Heersin
b13202b934
RzUtil: softfloat support based on bitvector (#2784) 2022-09-14 14:38:22 +02:00