1532 Commits

Author SHA1 Message Date
GustavoLCR
cef191cde3
Fix #14024 - Make r_io_map_get() faster (#17324) ##io
* Fix O(n) in r_io_map_get() ##io
* Kill `map_skyline_shadow` and `do_skyline`
2020-07-31 10:04:57 +02:00
Zi Fan
ac126508d5
Fix debugger to run debuggee with original environment variables ##debug (#17116)
* Change `fork_and_ptraceme` to start debuggee with rarun2 profile on Linux & Mac
* Add two new commands `doe` and `doe!` to show and edit rarun2 startup profile
* Fix `r_run_parse` to read last line
2020-07-24 16:25:55 +08:00
pancake
9cc1ce3c80
Fix wrong function signature in io.gdb (#17318)
Co-authored-by: pancake <pancake@nopcode.org>
2020-07-20 19:38:43 +08:00
Khairul Azhar Kasmiran
d970c64292
Move r2r diffchar code into r_util (#17316) 2020-07-20 00:44:27 +08:00
Riccardo Schirone
594b940b7c
Fixes some of the issues in Travis (#17267)
* Do not check with r_return_ if the convention is present

Let's just assume the NULL default in such a case, so that architectures
for which we don't have a defined calling convention can still be
processed somehow by the analysis code. It won't be precise, but it's
better than nothing.

Also add a warning message so users are aware when the calling
convention is not defined.

* Fix oob-read when # is at the end of the cmd string

* Do not set TMPDIR when the new value is the empty string

When TMPDIR is set to empty value, clang+ld behaves in weird ways and
you cannot compile files from within the r2 shell (e.g. when using #!c
or #!cpipe)

* Use meson and add -lasan to pkgconfig files when sanitizer are used
2020-07-16 20:47:30 +08:00
David CARLIER
74d5a677e1
io_self update DragonFly support and fix one typo. ##libr (#17274)
Applying patch from Dports.
Using higher level API rather than querying direct fields which are prone to changes.

Original author: @zrj-rimwis.
2020-07-14 21:57:30 +08:00
pancake
cccaf55a6c
Initial implementation of io.fd plugin ##io (#17158)
Useful for `self://` and r2frida when injecting the lib inside a target process

Co-authored-by: pancake <pancake@nopcode.org>
2020-07-08 11:28:08 +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
David CARLIER
5c71b01097
Support self:// for Solaris (#17196) ##io
enabled only on 64 bits unsupported on 32 bits with large files.
missing cfmakeraw function on this platform for socket et cons.
2020-07-03 18:59:24 +02:00
pancake
d47aed440a
Fix covs from 2020-06-29 (#17184)
* Fix covs from 2020-06-29

* CIDs: 1293553 1408695 1430058 1430059 1430060
1430061 1430062 1430063 1430064 1430065 1430067

* More fixes

Co-authored-by: pancake <pancake@nopcode.org>
2020-07-01 09:33:38 +08: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
f56ae25d35
Haiku OS - implement io_self ##libr (#17164)
Update debug thread wrapper and implement basic io_self plugin
2020-06-29 13:06:07 +08:00
David CARLIER
4d22e92d6d
Haiku build fix proposal (#17117) ##sys 2020-06-27 17:20:43 +02:00
pancake
bd9a604a87
Check for return values in about ~50 method calls (#17025) 2020-06-15 11:24:43 +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
Anton Kochkov
ffe743ef39
Fix #4056 - rename DEPS to R2DEPS ##build (#17020)
* Rename DEPS to R2DEPS
* Cleanup of sys/build.sh
2020-06-12 10:49:28 +08:00
pancake
75ee57bfb0
Update SDB with boolified SdbForeachCallback (#17040) 2020-06-11 11:25:23 +02:00
Riccardo Schirone
72f97959e8
Fix Tests after Reports by asan (#16776)
* Fix memory leak in IO
* Fix memory leak in cmd_api
* Remove unused variables in test_table
* Fix memory leak in test_flags
* Fix memory leak in test_list
* Fix memory leaks in test_anal_var
2020-05-08 21:45:01 +02:00
pancake
55f99ba4f4
Fix regression loading large files (>2GB) on 32bit systems ##io (#16648) 2020-04-28 22:09:30 +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
cc9b4a0063
Use ut64 in counter for gdb.write via LGTM (#16672) 2020-04-22 01:24:40 +02:00
pancake
315050e7ab Fix last coverities 2020-04-13 23:57:16 +02:00
Disconnect3d
1026faaf01 Fix off by one in "dr*" matching
The string literal `"dr*"` has a length of 3 so the strncmp used should have size argument of 3 instead of 2.

PS: I am not sure if this fix is correct but it seems so. If it is not, please close this PR. However, if the fix is incorrect it seems there could be some bug as next `else if` checks for `"dr"` too.
2020-04-13 20:23:17 +02:00
pancake
d0c0cf13a8 Boolify r_io_shift 2020-04-13 20:05:03 +02:00
pancake
54617455de
Initial refactoring of the rap:// protocol (-75 LOC) ##socket (#16534)
* It's implemented in IO, Socket and Core
* Remove duplicated apis and defines, everything in in RSocket now
* RIO now owns an RCoreBind instead of 3 fcn pointers + 1 void*
* Use proper filenames in libr/socket following public api names
* Use RSocket.block apis in the rap client + server apis
2020-04-12 16:40:55 +02:00
pancake
e9eb1a2ab3
Fix #16432 - openbsd fork+attach EBUSY issue ##debug (#16505)
* Implement is_pid_already_attached() for OpenBSD
2020-04-11 01:56:50 +02:00
Khairul Azhar Kasmiran
f31e6ca527
Fix #16283 - Continue as normal even if detachee is not found (#16500) 2020-04-09 23:07:03 +02:00
Florian Märkl
9a2effd5ed
Use RPVector for io->maps - speedup map traversal ##io
- The 64K section bin now loads in 15s instead of 26s
2020-04-07 12:43:41 +02:00
Riccardo Schirone
90d77e2a21
r_buffer: do not move seek when using _at APIs (#16401) ##util
This allows to use r_buf_read/r_buf_write to read/write sequentially but
at the same time having random reads/writes in the buffer if needed,
without the need to save/restore the seek every time.

* Fix some uses of r_buf_read_at/write_at that assumed seek change
2020-04-04 10:31:48 +02:00
radare
3f77b9a76b
Avoid duplicated module filenames to fix static.sh ##build (#16403) 2020-04-02 14:30:27 +02:00
Florian Märkl
0eb98d24be
Fix all Warnings for GCC 9 (#16223) 2020-03-17 13:31:28 +01:00
Florian Märkl
0b5e78e923
Make size arg of r_file_slurp() size_t (#16221) 2020-03-15 23:34:38 +01:00
Rikard Falkeborn
158668c876
Fix wrong return value in error path (#16201)
Returning -1 in a function with bool as return type is the same as returning
true. This is not the intended behaviour when e.g. allocation fails.
2020-03-13 12:13:57 +08:00
radare
72093ac706
Fix #16138 - Do not preincrement when it's not necessary (#16151) 2020-03-05 19:06:59 +01:00
radare
5e629a3260
Avoidify the strTrim() APIs + cleanup/refactor ##util (#16056) 2020-03-02 21:39:37 +01:00
Paul I
0e62dda341
Fix fgets() usage (#16068) 2020-02-29 20:47:10 +01:00
radare
6ae8806411
Do not use the elvis operator for bool expressions (#16073) 2020-02-28 15:19:37 +01:00
Anton Kochkov
9ae41ae69f
Revert "Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor" (#16055)
This reverts commit 38b61c7bcfe55a727b9c3cedbc0f3147018e7c6b.
2020-02-26 09:59:04 +08:00
radare
38b61c7bcf
Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor 2020-02-25 17:53:09 +01:00
pancake
5f82d077eb When esil.stack.addr is -1 set it to the next unallocated address ##esil 2020-02-24 01:16:14 +01:00
pancake
5677390ca6 Fix #10696 - Kill r_io_map_add_next_available
The function is just renamed to be reused and we have no tests for it, but it may fall into an infinite loop
2020-02-24 01:16:14 +01:00
Riccardo Schirone
2ec4a2a92c Fix memory leak due to not freed uri 2020-02-21 23:58:24 +01:00
dodococo
2c3249c2f3 Fix #15789: Increment offset for reads as well (#15865) ##io 2020-01-20 17:39:16 -05:00
pancake
35b05d8697 Fix warnings 2020-01-19 17:11:07 -05:00
David CARLIER
7ef9dc813e Mach-O io: mem leak fix proposal. (#15829) 2020-01-17 13:31:09 +08:00
yossizap
f64f2211fb Added reverse step and continue support to gdbr ##debug
This feature only works with server implementations that have ReverseStep
and ReverseContinue enabled, such as rr. The official gdbserver doesn't support it.
2020-01-15 09:49:03 +01:00
GustavoLCR
a5b41b9592 Fix reading on invalid process memory ##windows (#15743)
This fixes situations that if a read contained even a byte inside invalid memory, the entire read would fail
2020-01-04 01:56:17 +01:00
Anton Kochkov
d5d5cd3bfa
Some coverity fixes (#15643) 2019-12-16 04:36:46 -06:00
yossizap
89a5320e5f Fixed a crash caused by reopening gdb ##debug
The plugin would try to work with an old version of desc that was already
freed by r_io_close_all after closing the session. I set debug_gdb's
global 'desc' to NULL in detach as a temporary solution. We should convert
to **desc to keep an updated copy of the pointer.
2019-12-16 01:23:27 +01:00
Paul I
9a4578a915 Replace some strstr() calls with strchr() 2019-12-15 23:37:27 +01:00