Commit graph

28 commits

Author SHA1 Message Date
Giovanni
ade374378e
Add free-pascal demangling support (#3011)
* Add free-pascal demangling support
* Fixed tests
2022-09-06 10:39:58 +08:00
Riccardo Schirone
0a5b00edd2 Fix all db/cmd tests 2021-10-27 09:31:50 +02:00
Theofilos Pechlivanis
2f181b9053
Fix #469 by checking the value of analysis.jmp.cref (#1594) 2021-10-13 14:32:47 +02:00
Anton Kochkov
3c59df7e98
Refactor RzTypes to use structs instead of SDB + New Tree-Sitter based C Parser (#1047)
- Removed oldshell version of `t` (types) commands
- Removed `tk` command because types storage switched to the hashtable
- Added `tfc` command to show the calling convention of the function or set it
- Added `tsl` (RZ_OUTPUT_MODE_LONG) to show structure members' sizes and offsets
- Added `tul` (RZ_OUTPUT_MODE_LONG) to show union members' sizes
- Switched the types storage to the hashtable instead of SDB
- Added load and export from/to SDB for standard type libraries and serialization for Projects
- Changed all `char *type` occurences to the proper `RzType`
- Added `RzCallable` type for the function/class method types
- Changed all function types API to use the `RzCallable` API
- Switched the function types (`RzCallable`) storage to the hashtable instead of SDB
- Added a connection between `RzAnalysisFunction` and `RzCallable` - `rz_analysis_function_derive_type()` API function to derive new `RzCallable` type from the `RzAnalysisFunction` even if it doesn't exist in the RzTypeDB.
- Moved type links to the RzAnalysis where they belong
- Removed TCC and MPC-based parsers
- Added Tree-Sitter-based parser for C grammar (see `librz/type/parser/*`)
- Reworked type databases in `librz/analysis/d/` to be consistent with C standard, libc, platform-specific definitions
- Switched the type links from `char *` to `RzType`
- Switched the type links from SDB to the hashtable
- Added concept of the "type paths", e.g. `a.b[20].c` where `b` is a member of `a` (`a` is either structure or a union) and `c` is a member of `b`, and `b` is an array where we take 20-th element.
- Added concept of the typeclasses (a bit similar to Haskell) for numerical types: `None` (the most generic one), `Num` (includes `Integral` and `Floating`), `Integral` (includes `Signed Integral` and `Unsigned Integral`), `Floating`.
- Added concept of type equality (`rz_types_equal(a, b)` API function)
- Added Doxygen documentation to every API function in the `librz/type/*`.
- Updated the project format from **V2** to **V3**, added migration.
2021-07-20 01:46:45 +08:00
GustavoLCR
146d3b5d4f
Reduce analysis recursion (#1284)
* Reduce recursion when analyzing function control-flow
* Jump table refactoring
* Use rz_ prefix for the API
* Use struct instead of long parameter list
* Add `analysis.jmp.tblmax` to configure maximun amount of cases to analyze
* Remove recursion
2021-07-10 13:52:31 +02:00
Anton Kochkov
7c95b30089 Remove sdb_types access from RzAnalysisVar 2021-04-12 21:00:02 +08:00
Florian Märkl
5b95327c17 Prevent infinite Recursion in Dwarf Types Parsing 2021-04-05 12:00:24 +02:00
Florian Märkl
f28f6e80eb Add some missing DW_AT_KIND_STRING checks 2021-04-05 12:00:24 +02:00
Florian Märkl
0daea20ac6 Merge CL and iX into ix 2021-03-30 13:07:05 +08:00
Florian Märkl
05c79b1c9a Refactor Rest to use RzBinSourceLineInfo 2021-03-30 13:07:05 +08:00
Florian Märkl
0103d14505 Make Dwarf emit RzBinSourceLineInfo 2021-03-30 13:07:05 +08:00
Florian Märkl
8dae647a78 Split Dwarf Line Parsing in Parsing, Running and Printing 2021-03-19 18:24:40 +01:00
Florian Märkl
764be93b4b Rewrite Dwarf aranges Parsing 2021-03-19 18:24:40 +01:00
Florian Märkl
11426e1e4c Pull some Dwarf Printing from Bin to Core 2021-03-19 18:24:40 +01:00
Florian Märkl
a3fb364dae Make Dwarf Functions RzBinFile-local 2021-03-19 18:24:40 +01:00
Florian Märkl
436dd8b2e1 Add Test for Dwarf Printing (id) 2021-03-19 18:24:40 +01:00
Itay Cohen
c2f44b4c78
Disable function size by default ##breaking (#669) 2021-02-28 15:05:10 +02:00
Itay Cohen
4ac005d489
Set asm.tabs to 6 and enable asm.tabs.once by default ##config (#290)
* Set asm.tabs to 6
* Enabl asm.tabs.once by default
2021-01-04 17:45:35 +02:00
Aswin C
d42cde8ca5
Disable asm.bytes by default ##cons (#155)
* Disable `asm.bytes` by default

* Fix tests by adding `e asm.bytes=true` (1/n)

* Fix tests by adding  (2/n)

* Fix tests by adding `e asm.bytes=true` (3/n)

* Fix tests by adding `asm.bytes=true` (4/n)

* Fix test by adding `asm.bytes=true` (5/n)

* Fix mostly all broken tests

* Attemp to fix the rzpipe test

* Attempt to fix the tests in `db/cmd/cmd_pipe`

* Fix tests again

* Fix cmd_pipe test

* Add a test where `asm.bytes` is false

Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2020-12-15 12:47:33 +01:00
Florian Märkl
d53d1e3845
Final Analysis Renaming (#124)
* Rename missing Analysis Defines
* Rename analysis config vars and other lower case stuff
* Rename test/db/analysis
* Fix analysis tests

Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2020-12-08 15:05:24 +08:00
Giovanni
35a9ef94c9
Code and comments cleanup (#108) 2020-12-04 18:11:51 +08:00
karliss
0222bfe238
Use sdb_set instead of sdb_querys (aaaa is now 7x faster) (#17640) ##performance 2020-09-17 14:15:41 +02:00
HoundThe
eca62ba4db
Fix big endian DWARF parsing ##bin (#17503) 2020-09-02 11:01:16 +08:00
HoundThe
605f48fb20
Add DWARF tests for Ada and Freepascal ##anal (#17504) 2020-08-25 12:05:38 +08:00
HoundThe
5845ec39ca
Add function information from DWARF ##anal ##bin (#17434) 2020-08-19 18:21:20 +08:00
HoundThe
914624a921
DWARF .debug_info parsing fix and improvement (#17007)
* Get .debug_info working for DWARF 2, 3
* Fill up missing information in abbrev string table
* Add 64bit dwarf option into debug_info
* Add DWARF4 and DWARF5 forms
* Add unit tests
* added basic test

Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
2020-06-19 19:25:59 +08:00
Francesco Tamagni
e1ae1c7e5c Tweak tests for DWARF 2020-05-05 18:47:23 +02:00
pancake
346eb5bd38
Move test/new/* into test/ ##tests (#16511) 2020-04-13 19:49:23 +02:00
Renamed from test/new/db/cmd/dwarf (Browse further)