Commit Graph

1892 Commits

Author SHA1 Message Date
Riccardo Schirone
13ca72df81
Make sure $( is always considered as cmd substitution ##newshell (#17699)
Sometimes argument could be "value$", but this commits ensures that if
the argument is "value$(...)", then `$(...)` is considered as a
cmd_substitution_arg.
2020-09-23 21:43:36 +02:00
Riccardo Schirone
ac6bdc1e7e
Add support for additional cmd_identifiers ##newshell (#17696) 2020-09-23 14:01:24 +02:00
Florian Märkl
ed00e85e65
Use sdb == for generating dbs in meson (#17676) 2020-09-21 15:11:46 +02:00
Riccardo Schirone
eab6061228
Allow spaces for some commands like <cmd> @ <arg-with-spaces> (#17668) 2020-09-21 12:48:47 +08:00
Riccardo Schirone
87495e591d
Fix #17351: Let external scanner parse #! cmd identifier as well ##newshell (#17629) 2020-09-15 16:06:08 +02:00
Anisse Astier
a4c76ff641
Bring merge sort and insertion sort cmp function semantics together (#17473) ##util
Merge sort uses cmp (a, b) < 0 for its first test branch, and insertion
sort cmp (a, b) > 0 ; which means the 0 boundary goes in one case in one
branch, and in the other sort function in the other branch.

It makes it possible to support compare function that return true/false
instead of -1/0/1; although this isn't an acceptable use of
RListComparator, this prevents future bugs from appearing, because this
works with insertion sort, but not merge sort.

The main advantage of this patch is that both sort functions should sort
equal elements the same way. This stability is important for zignatures
for example.
2020-09-09 15:45:34 +02: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
Zi Fan
3c88900134
Implement save and load functions for debug session ##debug (#17430)
* Add `dtst` and `dtsf` commands
* Change `RDebugSession` to store its data in their own sdb namespace
* Add `r_debug_session_serialize()` and `r_debug_session_deserialize()` API
* Add unit tests for `RDebugSession `save and load functions
2020-08-20 12:25:47 +08:00
pancake
e22b3e9bcc
Fix race condition and remove unnecessary SDB build targets ##build (#17476)
* Simplify sdb build
* This was wrong
* updadte sdb
Co-authored-by: pancake <pancake@nopcode.org>
2020-08-19 10:31:20 +02:00
abcSup
fef7638a1e Fix Linux native debugger freezes after interrupted by user in attach sessions and refactor ##debug 2020-08-18 12:23:30 +08:00
abcSup
ab70092664 Improve support for debugging multihreaded processes on Linux ##debug 2020-08-18 12:23:30 +08:00
pancake
8efd721dba
Fix Cydia/iOS packaging and compilation issues ##build (#17342) 2020-08-14 13:17:32 +08:00
pancake
8b33d764a7
Fix #3929 - Enable LTO in sys/static.sh ##build (#17141)
* Fix #3929 - Enable LTO in sys/static.sh
* Update Ubuntu to 20.04 for static build
* Use `gcc-ar` when needed
* Do not use "c" option for ${AR}
* Use `$$AR` instead of `$AR`
* Aim to fix  `-dynamiclib` issue outside darwin
* Run tests for static LTO build

Co-authored-by: pancake <pancake@nopcode.org>
Co-authored-by: Anton Kochkov <xvilka@gmail.com>
2020-08-13 13:55:39 +08:00
Riccardo Schirone
31573479e0
Directly pass multi-lines command to newshell (#17348) ##newshell
Fixes #16684
2020-07-28 18:11:14 +02:00
Zi Fan
2dfa75cc47
Update record & replay features to trace reg/mem changes ##debug (#17127)
* Update record & replay features to trace reg/mem changes ##debug
* Support tracing in r_debug_continue_kill ##debug
* Fix error writing registers when stepping back and refactor ##debug
* Implement checkpoints for reverse debugging and make tests green ##debug
* Add `dbg.trace_continue` option to enable/disable tracing every instruction when continue
* Fix continue when tracing to allow skipping and continuing ##debug
2020-07-27 12:54:33 +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
pancake
13e1636d97
Implement RLang.spp for templated scripting ##lang (#17067)
Co-authored-by: pancake <pancake@nopcode.org>
2020-07-01 14:14:18 +02:00
GustavoLCR
043b0183bd
Fixes for windows debugger ##debug (#17151)
* Fixes memleaks
* Fix compiler warnings
* Fix warning when reopening file as debugger
* Improve exception logging
* Fix inconsistencies killing/restarting a process
* Fix detaching without killing debuggee
* Fix warning when continuing after receiving CONTROL-C
* Expose exception reason for 'di'
* Fix listing opened files with 'dd'
2020-06-30 10:48:08 +08:00
David CARLIER
4d22e92d6d
Haiku build fix proposal (#17117) ##sys 2020-06-27 17:20:43 +02:00
Anton Kochkov
d6cf4f0898
Add Debian OLD (Debian 8 Jessie) (#17098) ##build
Add Debian 8 (Jessie) Docker build to ensure radare2 works
on the older Debian-based systems too.
2020-06-20 12:17:00 +08:00
Riccardo Schirone
2ffa790e0a
Generate help automatically ##newshell (#16782)
* Add additional RCmdStatuses
* ?? should be a cmd_identifier, not help_command
2020-06-17 21:29:23 +02:00
Riccardo Schirone
b18f7e4a2a
Handle # in quoted strings in newshell (#17095) 2020-06-17 15:19:02 +02:00
pancake
160fc95e66
Use (void) instead of () in function signatures (#17026) ##refactoring
* Use (void) instead of () in function signatures
* Add test to avoid further contributions to commit the same mistake
2020-06-14 16:08:32 +02:00
Riccardo Schirone
70e3d3bc56
Fix compiler warnings (#17046) 2020-06-12 10:26:55 +02:00
pancake
75ee57bfb0
Update SDB with boolified SdbForeachCallback (#17040) 2020-06-11 11:25:23 +02:00
GustavoLCR
04edfa82c1
Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being created without a protocol
* Fix socket connect with SSL ##socket
* Use select() in r_socket_ready()
* Fix read failing if received only protocol answer
* Fix double-free
* r_socket_http_get: Fail if req. SSL with no support
* Follow redirects in r_socket_http_answer()
* Fix r_socket_http_get result length with R2_CURL=1
* Also follow redirects
* Avoid using curl for downloading PDBs
* Use r_socket_http_get() on UNIXs
* Use WinINet API on Windows for r_socket_http_get()
* Fix command injection
* Fix r_sys_cmd_str_full output for binary data
* Validate GUID on PDB download
* Pass depth to socket_http_get_recursive()
* Remove 'r_' and '__' from static function names
* Fix is_valid_guid
* Fix for comments
2020-06-10 18:00:00 +02: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
Riccardo Schirone
9b6160cf5f
Fix ; at the end of the value of eq_sep_args (#16988) 2020-06-01 11:07:13 +02:00
Riccardo Schirone
7985537330
Fix pfo command without arguments (#16961)
* Fix pfo command without arguments
* Fix radare2-ci-tree-sitter tests
2020-05-28 16:29:44 +03:00
Zi Fan
e968c9442a
Fix out-of-bounds write in arch_parse_reg_profile (#16956) 2020-05-27 14:39:17 +02:00
Zi Fan
3bea2cf5ed
Fix incorrect offset and type when parsing target description via remote gdb (#16948)
* Change regsize and regoff to mean bitsize instead of byte size
* Account for both "group" and "type" fields when extracting regs
2020-05-26 22:53:36 +08: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
pancake
b49609af7f
Fix static build (#16926) 2020-05-20 00:35:06 +08:00
Riccardo Schirone
9e39499279
Fix & to list tasks (#16848) 2020-05-19 00:51:16 +08:00
Ishi Tatsuyuki
1390d1fc4e
Move yxml into shlr (#16799) 2020-05-12 11:58:10 +02:00
Riccardo Schirone
39865315c0
CentOS tree sitter fix using gnu99 when available ##build
* Update ACR to use the new CHKFLG
2020-05-05 18:43:25 +02:00
Óscar Carrasco
990a6dfa23
Fix #16343 - Do not generate numeric structs from unnamed typedefs in "ts" ##types (#16485) 2020-05-05 15:51:17 +02:00
Liumeo
7ffb7cf77a
Do not redefine assert in dis.c (#16694) 2020-04-28 19:35:29 +02:00
GustavoLCR
ac5355fb3d
Fixes for windows debugger - ##windows ##debug (#16717)
* Fix #15937 - Fix debuggee hanging when attaching to it
* Fix `dm` not working for attached processes
* Fix debuggee crashing when opening a file dialog
* Unify RIOW32Dbg and w32dbg_wrap_instance under W32DbgWInst
* Don't signal threads on select, only on continue
2020-04-26 11:54:36 +08:00
Liumeo
34be38f96e
remove dl.h and dl.c (#16696) 2020-04-24 09:17:36 +02:00
Riccardo Schirone
34b41e1d20
Add support for >? help_command (#16699) 2020-04-23 16:32:53 +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