Commit graph

1840 commits

Author SHA1 Message Date
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
Khairul Azhar Kasmiran
344b460f6e
dbg.follow: Follow when pc >= core->offset + dbg.follow (#3499) 2023-05-06 07:18:47 +08:00
Anton Kochkov
c7c42afb61
Remove incomplete ESIL support for WASM (#3497) 2023-05-04 16:33:39 +08:00
Giovanni
14c29cc472
Add thread-safe hash tables (#3491) 2023-05-02 22:11:53 +08:00
Gilad Reti
466c54fdbc
RzEgg: return error codes on failures (#3484)
* Return error codes on failures

Many rz_egg_* APIs can fail, but failures were previously ignored by rz-gg (or just logged).
Exit on failure, and attempt to detect more possible failures.

* Fix rz_egg_padding error format

* Mark failing tests as broken

This is not a perfect solution. the problem is that in big-endian environments, immediates
are encoded according to the host endianness for some reason.
In any case, add a test that the compilation does not fail completely.
2023-04-27 00:03:44 +08:00
Giovanni
59080758fb
Split bin field from class fields and fix demangling on java (#3479)
* Split Bin Field from Class fields.
* Fix tests and plugins
2023-04-26 15:25:42 +08:00
Giovanni
ca547fc6fb
Add threaded iterators (#3480) 2023-04-26 13:23:15 +08:00
Giovanni
29c1aa8187
Demangle rust and add classes/methods and bump lib version (#3481) 2023-04-24 23:55:50 +08:00
Gilad Reti
51ad1fede5 mark no longer broken tests as unbroken 2023-04-23 08:15:04 +08:00
ifyGecko
9a67b52184
ELF symbol versioning fixes (#3474)
* verneed vn_cnt bug fix

* versym bug fixed

* added test for elf symbol version bugs

since the bugs are just problems loading the elf files the test is just looking for a timeout
2023-04-22 09:51:57 +08:00
Giovanni
f115011642
Bump version of libdemangle to support Delphi C++ (#3472)
* Bump version of libdemangle to support Delphi C++
* Removed some WITH_GPL barriers.
2023-04-20 15:05:36 +08:00
ez2take
a36f34da2b
Add Undo/Redo to dietline emacs mode. (#3445) 2023-04-14 11:56:01 +08:00
Anton Kochkov
309398b1ca
Add RzBin symbols API test (#3458) 2023-04-13 19:35:41 +08:00
Siddharth Mishra
9ab709bc34
Improve cmd_help.yaml and fix random number generator (#3452)
* Improve cmd_help.yaml and fix a small bug
* Add support for 64bit random numbers
* Make a distinction between 32- and 64-bit PRNG
* Add documentation for new functions
* Change the RBTree test to use 32-bit random numbers
2023-04-07 20:22:01 +08:00
Giovanni
15c35ce974
Convert ps to newshell (#3451) 2023-04-06 08:43:04 +08:00
Riccardo Schirone
10f7f1f92a db/cmd/cmd_r: do not hardcode the fd num 2023-04-05 17:15:52 +08:00
Riccardo Schirone
e28345946a util: fix resize of mmap-ed files
When resizing files through `r` commands, although the buffers seemed to
be resized while the file was opened, the files were not really
truncated. Thus when re-opening the written file, no actual change was
made.
2023-04-05 17:15:52 +08:00
brightprogrammer
16e722cffc
Replace rz_core_cmd0 calls in tui/panels.c and port cmd_help commands to RzShell as cmd_math (#3421) 2023-03-30 18:36:48 +08:00
你不要过来啊
0e1bbd28f8
Remove RzBitmap in favor of RzBitvector (#3433) 2023-03-27 00:29:30 +08:00
Anton Kochkov
e0c0886873 Move non-x86 tests out of x86 2023-03-24 15:40:20 +08:00
Anton Kochkov
2762beba68 Support BE platforms in value range search 2023-03-24 15:40:20 +08:00
Florian Märkl
8c9568e733 Add analysis for Objective-C selector stubs
aalo is renamed to aalor to make room for the new aalos command, which
analyzes the __objc_stubs section and assigns names to all detected
selector stubs there. The stub patterns currently supported are all that
are hardcoded in ld64 version 820.
This analysis is also run automatically in aaa if the binary is detected
to potentially having such stubs.
To cleanly rename functions which have been created previously at
unnamed stub locations, rz_core_analysis_function_rename() has been
enhanced to not leave behind flags called fcn.0x<offset>.
2023-03-21 19:33:49 +01:00
Florian Märkl
c79d7d2611 Add support for DYLD_CHAINED_PTR_32
arm64_32 is AArch64, but using 32bit pointers, which is primarily used
on watchOS. Handling DYLD_CHAINED_PTR_32 fixups is necessary to
correctly load such binaries.
2023-03-21 19:33:49 +01:00
Heersin
3a7d511624
Add validation for rzil float theory (#3420) 2023-03-11 09:53:13 +01:00
Giovanni
c7dfbbcdcd
Fix ar naming and io read/write api (#3419) 2023-03-10 06:21:39 +00:00
Giovanni
125f0333aa
Set perm to 644 to multiple text files (#3418)
Co-authored-by: Giovanni Grazioli <giovanni.grazioli@ubisoft.com>
2023-03-10 13:42:42 +08:00
Giovanni
eb3f7f80c5
Fix archive file io plugin (#3417)
* Fix loading .lib/.a files
* Add windows lib test for ar:// uri
2023-03-10 08:13:26 +08:00
billow
a8a6f36354
8051 RzIL fixes (#3413)
* fix `ljmp`
* fix `mov`
* fix push stack
* rename register `a` -> `acc`
* fix `ret`
* fix `j*`
* `dptr` -> `dpl`+`dph`
* memory mapping registers
* replace flags with `psw`
* fix duplicate register reads
* fix relative addressing
* fix reg_profile
* fix `mul` and `pc`
2023-03-05 12:54:25 +08:00
Pavel I
121e28a742
x86 IL: fix infinite loop caused by x86_il_get_parity (#3402)
* x86 IL: fix infinite loop caused by x86_il_get_parity
* Update tests
2023-02-28 10:01:41 +08:00
Anton Kochkov
315ba643b0 Fix CI by making GAS test Linux x86-only 2023-02-22 17:42:39 +08:00
R4444
0e8828c54e
Add GAS/AT&T syntax support in asm.c assembler (#3384) 2023-02-22 13:11:13 +08:00
Heersin
2b748567fa
Add fbasic theory to rzil using rz_util/float (#3184)
* Fbasic dev build test

* Add fbasic structure and enums

* Add fbasic op new

* Add fbasic op dup

* Add fbasic op free

* Add partial theory of float

* Add fbasic handlers to pure table default

* Add fbasic stringfy

* Add temporary float functions

* Add rz-float value and evaluation

* Add float json dump functions, todo add mode info in il_opdmp_* functions and compelete il_resolve_pure

* Complete fbasic il in il_export

* Fix detected error in compilation

* Add doxygen for il/definition/float

* Pack float_round function

* Add new version of rounding

* Add cast and convert, todo add 'float_get_sign' and 'float_get_no_bias_exp'

* Add comments and fix new version rounding

* Add util float functions

* Implement theory fbasic : cast, convert and round

* Remove bv_one warning

* Move basic functions into rz_util from definition/float

* Add two basic test cmp and extra format test

* Add test to fsucc, fpred and fneg

* Add round significant test case 1 and fix bug to pass it

* Test round significant and bug fixes

* Add 6 types test cases to round_and_pack function

* Finish round significant and round_pack test with bug fixes and signature changes

* Leave fround as unimplement now

* Pass all test to cast and convert

* Add SPDX header

* Add SPDX header

* Add round to integral float with test and bug fixes

* Add more tests to cast_sint and bug fixes

* Fix mem leak in cast_sfloat

* Replace the deprecated rounding method, fix bugs and pass tests

* Resolve some reviewed issues

* Fix most memleak and bug found

* Remove deprecated round_bv

* Remove unused functions to eliminate warnings

* Fix typo in comments

* Uncommented implmented operations

* Add test cases and bug fixes for fbasic theory in rzil

* Fix ret type of new_bitv_from_* from Bool to BitVector

* Add new float op from f32 and f64
2023-02-15 18:18:40 +08:00
Riccardo Schirone
c9d6ad9ee6
io: return error when reading/writing to unmapped memory (#3323)
* core: 'wow' command was replaced with 'wb'

* io: on_map_skyline returns false when nothing was done

Before this patch on_map_skyline returned true even when the callback
was not called on any part of the skyline. In other words,
reading/writing to an unmapped memory returned true.

This commit changes the behaviour to return false in those cases.

* analysis/esil: mem_read/mem_write were alway returning true

* use o malloc instead of oC

* librz: deal with seek errors
2023-02-11 11:36:27 +01:00
Riccardo Schirone
505bc3da7e tests/db: fix wrong tests using nonexisting eval/cmd 2023-02-09 08:44:53 +08:00
Florian Märkl
2221ab27af
Fix filling RzAnalysisDisasmText.arrow when asm.lines=false (#3361)
The arrow info is needed to print custom reflines, for example in
Cutter. In such a case, asm.lines will generally be false to not have
the lines also printed inside the text.
2023-02-09 08:00:52 +08:00
Anton Kochkov
5d7335c8b6
Add some missing Windows types (#3347) 2023-02-05 14:27:43 +08:00