Commit graph

1875 commits

Author SHA1 Message Date
Heersin
c0850845f1
RzIL: asm tests for ARM32 VFP and NEON (#3662) 2023-07-20 11:30:17 +08:00
Parth Bansal
0ed81d522b
Add p=r command to display entropy edges (#3671) 2023-07-20 11:21:50 +08:00
Florian Märkl
aa2c54f128
Add support for PT_OPENBSD_NOBTCFI detection (#3663)
OpenBSD enables arm64 BTI or Intel IBT by default, except when the
binary was linked with -Wl,-z,nobtcfi in order to opt-out. In this case,
a PT_OPENBSD_NOBTCFI segment will exist, which we can indicate in the
bin info.
See also https://undeadly.org/cgi?action=article;sid=20230714121907

Original Commit: 4551bf03461595a9645051347ad026974227ac6d

Co-authored-by: pancake <pancake@nopcode.org>
2023-07-18 08:26:21 +08:00
Giovanni
8f2eb45b84
Add bin.demangle.flags to allow users to simplify or not mangled strings (#3659) 2023-07-17 23:31:09 +08:00
wargio
99c5f833c5 Mark as broken the ARM 16 test which fails to disassemble. 2023-07-16 13:22:47 +08:00
wargio
3578cbb4fc Improve sparc analysis and fix tests. 2023-07-16 13:22:47 +08:00
billow
e456c60e20 Fix tests for capstone v3/v4/v5
Co-authored-by: wargio <wargio@libero.it>
2023-07-16 13:22:47 +08:00
yossizap
0cf4cd75b3 Update capstone instruction ids 2023-07-16 13:22:47 +08:00
Anton Kochkov
f29171ceb1
Remove rzk and gprobe IO plugins (#3654) 2023-07-12 00:21:43 +08:00
Anton Kochkov
8e41d975bf
Easier API for creating global variable (#3655) 2023-07-11 20:53:34 +08:00
Heersin
803aa3951e
ARMv7 NEON and VFP for rzil (#3528)
* Export float basic op to op_builder header

* Basic vmov with note and question

* Add vmov for immediate

* Add vmov for NEON and VFP

* Add vmsr, vmrs. shared instruction of vfp and neon done

* Add vector logical operations for arm32 il

* Add vmvn for arm32 il

* Solve op builder for rzil float

* Add vector compare instructions (vceq/vcge/vcle/vcgt/vclt, and abs version)

* Rename vcmp to vec_cmp to avoid conflict with VCMP instruction

* Add vtst of NEON instruction set

* Fix FEQ

* Discard unecessary changes

* Add vldn for multiple n-elements

* Add vldn for single-lane and all-lane

* Add vstn

* Add vcvt for float-integer and float-float

* Check codeql warning

* Add vdup

* Fix according to reviewer

* Add vext

* Add vzip

* Fix reg_bits shadowing

* Add vuzp

* Init some eff as EMPTY for loop-seq

* Add vswap

* Add vadd and vsub

* Add vmul for float point in vfp

* Fix test_validate_forder

* Fix reg binding by add missing reg(fpscr)

* Fix memory broken caused by misuse of REG_VAL and others

* Add vldr and vstr

* Fix some bug in rzil float

* Fix a format typo bug in rzfloat

* Add rzil emulateme test for vfp

* Fix fpscr in db arm32 related tests

* Add extra argument info in vfp test

* Remove duplicated macro of float
2023-07-09 00:43:18 +08:00
Riccardo Schirone
40a01ef36f
Show even sections with 0 size/vsize (#3640) 2023-07-07 11:45:39 +08:00
Riccardo Schirone
194eabae1c
Fix /wi by removing wrong fallthrough (#3636)
/wi was falling through the switch case and it was not accepting the
input correctly. Fix this by breaking at the end of the '/w' case so
that the search can begin.
2023-07-04 17:09:28 +08:00
Giovanni
8efdb3d3a3
Refactoring debug plugin and cleanup output (#3634) 2023-07-04 10:42:41 +08:00
Anton Kochkov
8c1ce710e1
Remove type links and use global vars (#3618) 2023-07-03 02:02:12 +08:00
Florian Märkl
54640cb01c Fix rz_buf_read_at() after negative addr
rz_buf_read_at() with a negative addr on a ref (slice) buffer broke all
subsequent calls to rz_buf_read_at(). This is fixed by making sure to
always reset to the initial seek.
This bug was detected through xnu kernelcaches, where we may also skip
any obviously invalid read.
2023-07-01 22:28:28 +08:00
Giovanni
5badfe10f6
Always search for preludes if is not x86. (#3615) 2023-06-30 13:20:37 +08:00
Anton Kochkov
b5a936585a Rename analop to analysis_op and aop 2023-06-26 08:40:47 +08:00
Florian Märkl
ebe4263323 Implement chained fixups patching for binds
For bind chained fixups (pointing to imports parsed in the previous
commit) we reuse the patching code for classic relocs as the logic is
more generic here than for local chained fixups.
2023-06-25 19:39:56 +08:00
Florian Märkl
b6f984e445 Parse and use dyld chained fixup imports
The LC_DYLD_CHAINED_FIXUPS load command references a new kind of imports
table that is used for binding chained fixups. A similar table may be
reconstructed from the legacy BIND_OPCODE_THREADED info. We now display
these new imports in `ii` instead of the classic undefined symbols and
use them to assign names to relocs.

Objective-C superclass resolution for chained fixups is also changed to
first check for relocs and then for a non-zero address read from memory
instead of ignoring relocs entirely when there is a non-zero value in
memory (this did not work for chained fixups as those already have
non-zero values before patching).
2023-06-25 19:39:56 +08:00
Florian Märkl
f4796c5e66 Populate Mach-O relocs from chained fixups
Chained fixups are essentially a new kind of relocs, so it makes sense
to also represent them as RzBinRelocs. Currently the results are
sometimes less meaningful than the reloc info that was parsed before
from indirectsyms in such cases, as chained imports are not parsed yet
and thus the target symbols of bind relocs are not yet known, hence the
temporarily BROKEN tests.
2023-06-25 19:39:56 +08:00
Florian Märkl
6452be6c20
Make rz-pipe tests invariant to local user config (#3601) 2023-06-23 18:19:45 +02:00
Florian Märkl
4fd9cd7cc1
Extend Mach-O platform recognition (#3599)
Some identical code from both mach-o 32 and 64 has been moved to
mach0_common.c to avoid duplicate compilation.
rz_mach0_platform_to_string() now recognizes all known platforms and the
information is shown as the subsys in the i command.
The "os" value was previously unreliably and ios sometimes showed as
"ios" and sometimes as "darwin" depending on the binary. Now the os is
"darwin" for all platforms. ios-* syscall files have thus been removed
as only darwin-* ones will be used.
2023-06-23 13:28:41 +00:00
swedenspy
655ea987cc
MD2 - hash implementation added according to RFC 1319 (#3585) 2023-06-18 23:01:57 +08:00
Giovanni
27dc5c8650
Remove old string detection methods. (#3584)
* Remove old string detection methods.
* Allow changing encoding based on `bin.str.enc`
* Cleanup for optimization regarding RzAnalysisData and its kind
* Allow changing endianness.
2023-06-18 18:12:59 +08:00
borzacchiello
d9a5cf3d28
Python 3.10 Support (#3577)
* Extract major and minor from python version string instead of converting it to double

The patch fixes 3.10 version extraction (3.10 == 3.1)

* update latest python magic version to 3491 in get_code_object

* opcodes for python3.10

* PYC: do not search for strings in code

* PYC python 3.10 tests

* Fixed typo in "pyc 3.9 sections" test

* pyc: refactored string search

* pyc: removed parse_version_major_minor

use "magic_int_within" to check python version
2023-06-16 08:28:17 +08:00
Dhruv Maroo
5f14d0e0b5 Fix analysis tests 2023-06-14 11:04:34 +08:00
Dhruv Maroo
2f6f2cfdce Fix ROR and update instruction asm tests 2023-06-14 11:04:34 +08:00
Dhruv Maroo
aa7781b098 Remove unnecessary local variable in IL for test instruction 2023-06-14 11:04:34 +08:00
Dhruv Maroo
5211e1835b Fix integration tests for x86 IL 2023-06-14 11:04:34 +08:00
Luca Borzacchiello
d0426f9edd
Fix arguments alignment in PYC disassembler (#3569) 2023-06-11 18:38:28 +08:00
wargio
4186be8b56 Add tests for printing IL 2023-06-10 09:17:44 +08:00
Anton Kochkov
3ac8a36c7b
Remove tiny graphs (#3567) 2023-06-09 17:59:04 +08:00
billow
6f3969f8c0
Fixes for variables and arguments diplay in disasm (#3561)
* Remove ConsoleTheme from disasm.c
* Add `rz_core_analysis_var_to_string()` API method
* Avoid variable overriding arguments
* Fix tests
2023-06-08 17:22:07 +08:00
billow
6eb14128ad
Adding tricore support for rz_debug_plugin_gdb (#3557) 2023-06-06 12:53:51 +08:00
billow
d0732c5c88 Update tests 2023-06-05 22:41:20 +08:00
wargio
8cfc86a82e Fix all tests and add aaC test 2023-06-01 23:16:09 +08:00
billow
c0154a26a0
Fix function arguments augmentation with DWARF (#3530)
* Add `VariableKind` to Dwarf `Variable`
* Refactor `rz_analysis_dwarf_integrate_functions`
* Add `RzAnalysisVarKind` to `RzAnalysisVar`
* Add function parameters tests for x86, ARM, Tricore
2023-05-30 16:40:09 +08:00
Florian Märkl
ea04e76d1b
Add support for dyldcache headers up to dyld-1042.1 (#3536)
Newer dyldcaches have more fields in the header. This change adds
heuristics for determining the version and reading and displaying the
newer fields if available.
2023-05-29 19:27:45 +02:00
Anton Kochkov
e924ea7f11
Remove incomplete ESIL support for RSP (#3531) 2023-05-26 14:36:00 +08:00
billow
abfa59c1a1 Fix rz_core_file_reopen_debug 2023-05-24 08:49:05 +08:00
Florian Märkl
daffe8bbbb
Fix arm64 adrp assembler (#3519)
Fixed the calculation of the immediate value and more spaces, e.g.
"adrp     x0, 0x1234000" are allowed now.
2023-05-21 11:16:37 +08:00
Giovanni
105bc0ed50
Revert "Add float to raw bitvector conversion. (#3509)" (#3517)
This reverts commit 74c044ad63.
2023-05-20 15:39:31 +08:00
billow
9497f711eb
Add project migrate v12 (#3515)
* Revert rzdb change in 59f32b6db8
* Add `rz_project_migrate_v11_v12` and integration test
* Add v12 rzdb
2023-05-17 06:28:39 +08:00
billow
59f32b6db8
Rename asm.dwarf* to asm.debuginfo* (#3513)
* Rename `asm.dwarf` to `asm.debuginfo`
* Rename members in `RzDisasmState`
* Improve `asm.debuginfo.*` descriptions
* Rename `ds_print_dwarf` -> `ds_print_debug` and refactor
* Fix tests
2023-05-16 10:55:18 +08:00
billow
da84bb0029
Refactor disasm.c color (#3514)
* Refactor `disasm.c` color
* Fix `ds_print_dwarf`
* Fix `ds_show_functions`
* Fix `ds_init_theme`
* Flush cons when `DEBUGGER`
* Fix tests
2023-05-16 10:27:06 +08:00
billow
c7b77ce8e8
Show source lines when asm.dwarf.lines set (#3511)
Co-authored-by: Sidhub723 <sidbhat.211ee151@nitk.edu.in>
2023-05-15 12:11:40 +08:00
Giovanni
74c044ad63
Add float to raw bitvector conversion. (#3509) 2023-05-14 13:14:11 +08:00
wargio
cc08a23d03 Fix return types and args 2023-05-09 15:42:21 +08:00
Khairul Azhar Kasmiran
20081eba44
Fix dbg_step test on Ubuntu 20.04 (#3503)
* Fix dbg_step test on Ubuntu 20.04
* Move r13 to separate line
2023-05-08 10:00:13 +08:00