Commit Graph

104 Commits

Author SHA1 Message Date
Anton Kochkov
d5e1247757
Remove some of MSVC warnings (#17811) 2020-10-21 15:00:10 +08:00
Riccardo Schirone
3e3efcc005 Test compilation with various capstone versions ##build
Do not use #include <capstone/..>

This ensures compatibility with both capstone v3 and capstone as
installed on most distributions, where the pkg-config file of capstone
already adds -I/usr/include/capstone (with that dir directly containing
the headers).
2020-09-09 15:39:33 +02:00
Zi Fan
0ba897f5c9
Add network support for WinDbg/KD (KDNET) ##debug (#17340)
* Add network support for WinDbg/KD (KDNET) ##debug
* Add iob_net io_backend plugin for shlr/winkd
* Add Windows 10 (May 2019 Update) build 18362 profile
* Add r_hash_do_hmac_sha256 function to r_hash
* Change r_socket_connect to bind source port for UDP connection
2020-08-26 10:24:20 +08:00
GustavoLCR
489538e02b
Add DbgEng based debug backend for Windows ##debug (#17491)
* Rename `windbg` plugin to `winkd` ##debug
* Add DbgEng based debug backend for Windows ##debug
2020-08-24 19:01:10 +08:00
Riccardo Schirone
48c30dfd99
Support compilation with meson on old systems like CentOS6/DebianWheezy ##build (#17345)
* Compile tree-sitter and newshell parser with gnu99 if possible ##meson
* Make sure to use `-lrt` when needed to use clock_gettime ##meson
2020-07-27 12:25:06 +08:00
Riccardo Schirone
2d160f2509
Avoid sdb double headers (#17249) ##build
* Avoid duplication of SDB headers in libr/include

SDB is an external project and as such it should live in shlr. However,
for simplicity in dealing with the include flags, the SDB headers were
copied in libr/include as well. This patch just keeps the SDB files
confined in shlr/sdb and make sure various r_* libs use the headers from
there.

* Fix pkgconfig file generation
2020-07-21 10:28:43 +02:00
Riccardo Schirone
f8cafe4f2f
Update spp to 1.2.0 (#17243)
* Update spp to 1.2.0
* Make sure to use USE_R2=1 when compiling spp
2020-07-09 17:20:06 +08:00
Riccardo Schirone
04074845e4
Update tree-sitter to 86a5dabbcbdac650c53a889183bf56d7e721e09e (#17244) 2020-07-09 12:03:32 +08:00
pancake
f91f2ac1d8
Update capstone git commits for v4 and next branches (#17215)
Co-authored-by: pancake <pancake@nopcode.org>
2020-07-06 12:12:00 +08:00
Riccardo Schirone
d6c9bd4542
Add support for binr/blob and fix android build ##meson ##build (#17150)
* Make sure meson can build with `system` = `android`.

* Add support for binr/blob in meson build

* Add also r_util as dependency

* Create sdb_version.py to get the SDBVER value from config.mk

* Set unknown sdb version if something fails
2020-07-05 10:53:37 +08:00
Khairul Azhar Kasmiran
80202e6ad5
Use type instead of Get-Content to prevent BOM insertion on sdb generation in Windows (#17203) 2020-07-04 19:46:36 +08:00
Riccardo Schirone
a14f5c0777
Update tree-sitter to 0.16.8 (#16991)
* Fix CentOS6 CI by specifying PKG_CONFIG_PATH
* Do not define var inside for-loop
2020-06-03 15:01:47 +02:00
Khairul Azhar Kasmiran
a103293ec4
Unpin AppVeyor's Meson ##build (#16925)
* Unpin AppVeyor's Meson
* Don't use absolute path from meson.current_source_dir() with static_library()
2020-05-20 11:55:15 +08:00
Ishi Tatsuyuki
1390d1fc4e
Move yxml into shlr (#16799) 2020-05-12 11:58:10 +02:00
Liumeo
34be38f96e
remove dl.h and dl.c (#16696) 2020-04-24 09:17:36 +02:00
Eli Schwartz
03bc3c59b5
Add an option to build with system tree-sitter (#16679)
As of https://github.com/tree-sitter/tree-sitter/pull/602 it is possible
to install tree-sitter as a system shared library, and distributions that want to
be able to disable vendored code.
2020-04-23 13:54:52 +08:00
Riccardo Schirone
06ab29b93c
Compile new shell parser by default (#16660)
* Move radare2-shell-parser/tree-sitter into shlr
* compile new shell parser by default, available with cfg.newshell variable
* Add README for radare2-shell-parser
* Improve CI
* Add gitattributes file
2020-04-21 13:44:30 +02:00
Riccardo Schirone
784aa48c05
Fix cmd_substitution in grep_specifier ##newshell (#16625)
* Allow cmd_substitution in grep_specifier and set core->tmpseek
2020-04-18 11:07:25 +02:00
Riccardo Schirone
58cbee4144
Add support for foreach commands ##newshell (#16607) 2020-04-17 10:33:45 +02:00
Riccardo Schirone
b4b3013197
Add support for pf commands (#16586) 2020-04-16 13:23:54 +08:00
Riccardo Schirone
0cd90b6b7e Update radare2-shell-parser for new macro syntax and fix tests 2020-03-24 15:23:35 +01:00
radare
5e1d5faebd
Support iter_hit_command and update radare2-shell-parser (#16132) ##core 2020-03-05 14:41:37 +01:00
Riccardo Schirone
d88a76d2df
tree-sitter: support iter commands (#16111) ##core
* radare2-shell-parser: shrink to single-command output when substituing

Before this patch, when substituing arguments the entire input string
was considered, making the process potentially slow if the input was
long. With this patch, substitute_args and parse_args work on a shrinked
version of the input, which includes only the current command.

Not only it improves performance, but it also prevents issues where
other non-related parts of the input string could be replaced during
apply_edits.

* radare2-shell-parser: implement some iter commands
* Add support for number_command and recursive help
* cmd_ignbithints should be set everywhere for consistency
* Save rnum->value before doing a cmd substitution
* Update radare2-shell-parser to fix null deref in html_disable_command
2020-03-03 12:42:38 +01:00
pancake
22ac83ca8a Upgrade capstone v4 and next branches 2020-02-25 02:36:56 +01:00
Riccardo Schirone
f322c1b1bc
Add support for @* commands in new r2-shell-parser (#16038)
* Use TSSymbol instead of comparing type strings

This patch uses ts_node_symbol instead of ts_node_type to check whether
a node is of a given type. Since TSSymbol is just an integer, the check
will be much faster. Also, it allows to store commands handler in an
hashtable, instead of having if-cascade.

* Make sure r_config_hold works even when keys do not exist or are freed

* Add support for all _tmp_commands

* Make sure to always reuse the same TSLanguage

* Update both tree-sitter and radare2-shell-parser

This way we use TSLanguage version 11, which fixes some problems with
TSSymbols.

* Compute is_last_cmd on each single command and fix logging

is_last_cmd should be set on a per-command basis, so if you analyze
things like `pd 3; .; .; .;` the `.` refers to `pd 3`.

This also fixes logging, so when an invalid command is parsed, it is
still available in the history.

* Add comment about directly using r2-shell-parser in r_core_cmd_lines

r_core_cmd_lines tries to parse the input and split it in lines, but at
least in theory, we don't need it as the new parser can already handle
full scripts.

* Allow other tasks to run between commands even in the new parser

* Update radare2-shell-parser
2020-02-24 09:46:15 +01:00
Riccardo Schirone
a295504570 Use the "concatenation" concept in radare2-shell-parser 2020-02-20 00:35:41 +01:00
Khairul Kasmiran
78e21373be Revert "ONE_STREAM_HACK & scr.onestream: Force expected ONE_STREAM order if necessary (#15535)"
This reverts commit 39b40cdedd.
2020-02-17 00:00:46 +01:00
Riccardo Schirone
78db2b12dc new parser: fix multiple words in grep and add support for > $alias 2020-02-14 16:29:36 +01:00
Riccardo Schirone
037a521d39
Use state struct and start handling cmd_substition_arg in tree-sitter (#15966) ##core
* Fix escape/unescape in new shell parser
2020-02-13 20:41:00 +01:00
Riccardo Schirone
65d959f299
Run a travis job that uses the radare2-shell-parser (#15879)
* Run a travis job to use the radare2-shell-parser
* radare2-shell-parser: add support for grep_commands, pipes, and others
2020-01-23 09:10:28 +01:00
Riccardo Schirone
6c2ed0d81b
Update radare2-shell-parser and improve tree-sitter related code in cmd.c (#15875)
* A bit of refactoring in the code that deals with tree-sitter cmds
* Fix redirect_command parsing
* Better handling of last_commands and update radare2-shell-parser
* Fix printing of helps for @, @@, @@@
2020-01-22 11:05:24 +01:00
Riccardo Schirone
f410795ec4 Update radare2-shell-parser 2020-01-19 22:57:40 +01:00
Riccardo Schirone
46e0a8d169
Do not compile radare2-shell-parser by default (#15769)
Last release (4.1.0) did compile it by default, but the build requires
internet access to download the repositories. For now, since the feature
is anyway very experimental, we disable it at compile time so that
distributions can just compile their packages without internet access.
In the future we may want to use submodules or augment the release
tarball to include the tree-sitter and radare2-shell-parser archives.
2020-01-07 13:37:04 +01:00
Riccardo Schirone
595cb21ad4 Compile tree-sitter with std=c99 flag (#15654) 2019-12-16 23:21:43 +01:00
Khairul Azhar Kasmiran
39b40cdedd
ONE_STREAM_HACK & scr.onestream: Force expected ONE_STREAM order if necessary (#15535) 2019-12-02 23:09:38 +08:00
pancake
f0998c01b7 Update capstone v4/next from Git 2019-11-10 19:05:08 +01:00
yossizap
e35f447a2a Added break to gdbserver vCont and refactored the code to use locks (#15433)
The previous gdbr implementation didn't allow interrupting background
tasks with &b since send_vcon wasn't properly configured with the cons
api. In addition to that, gdbserver doesn't support processing multiple
commands at the same time, resulting in undefined behavior once cons
were set up for vcont.
This commit adds the relevant cons api and solves the concurrency issues
by adding locks on all socket related logic.
2019-11-10 19:03:56 +01:00
Riccardo Schirone
4ebd400fa7
Very simple tree sitter integration (#15414) ##command
* tree-sitter-integration: support tmp-seek, arged, and interpret commands
* Make meson automatically download tree-sitter and radare2-shell-parser grammar
* Add tree-sitter/radare2-shell-parser directories in gitignore
* Add Support for tree-sitter in acr/makefile
* Just use one script to download 3rd party repositories in shlr
* Use cfg.newshell
2019-11-06 10:33:23 +01:00
GustavoLCR
47a440cae5 Implement w32dbg_wrap 2019-10-28 05:56:10 +01:00
Florian Märkl
aad2a2c79e Link sdb fully into r_util in meson (#15338) ##build 2019-10-23 15:52:19 +02:00
Florian Märkl
a30c1f62a0 Update SDB after diff update (#15334) 2019-10-23 12:05:34 +02:00
pancake
37abed265d Update capstone from git 2019-10-08 19:39:26 +02:00
Paul I
5094ab44cf Meson: export sdb symbols from r_util on Windows (#15098) 2019-09-23 00:00:21 +02:00
pancake
bb810cfc4c Implement anal.norevisit using SetU instead of Sdb ##anal
* Fixes the infinite loop in aac, but it's just a leaky workaround
2019-09-17 00:46:07 +02:00
pancake
f3618747dd Add m680x arch support for the meson builds 2019-09-16 19:34:06 +02:00
radare
87308db077
Update capstone again (#14862) 2019-08-21 12:40:20 +02:00
radare
8915a0a515
Update capstone (#14780) 2019-08-10 00:07:36 +02:00
Florian Märkl
24d3a9cb5d Add r_parse_ctype ##parse (#14596)
* Add r_parse_ctype

* Add mpc to acr

* Readability

* Fix r_parse for acr
2019-07-20 12:50:27 +02:00
pancake
b32a09db05 Update capstone v4 and next 2019-07-18 04:06:01 +02:00
lzutao
7b7f069c9e mesonbuild: Backport to python 3.5 ##build
Python 3.5 (the lowest version that meson supports) has no f-String
but only old %-formatting and str.format().
2019-06-26 12:11:06 +02:00