1501 Commits

Author SHA1 Message Date
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
Anton Kochkov
e11b2a9145
Some Coverity defect fixes (#15626) 2019-12-13 11:25:19 -06:00
GustavoLCR
e43c9e7caf Fix some warnings (#15549) 2019-12-08 12:49:58 +01:00
yossizap
6c8cc9294b Add breaking to ood in linux to avoid execvp freezing ##debug
Execvp may hang until a signal is received on some systems(reproduced in
arch linux) in case the file can't be executed for some reason(broken
symlink, different arch, etc).
2019-12-05 13:28:58 +01:00
Kārlis Seņko
7da14518bc Try showing offset when there are no redo items. 2019-12-01 13:07:34 +01:00
Kārlis Seņko
a50b3a630a Fix handling of many seek history items and other edge cases. 2019-12-01 13:07:34 +01:00
GustavoLCR
ebaf8b603e Fix some warnings on Windows (#15532) 2019-11-30 00:49:16 +01:00
yossizap
e0b1977668 Fixed overflow that broke remote debugger reopening ##debug (#15525)
opt->sz is initialized with r_buf_size at r_bin_open_io using an io
buffer if r_bin_open_io can't open a file buffer. Since the debuggers
returned unsigned values to opt->sz which is signed, opt->sz would
overflow and contain a negative value, causing r_bin_open_buf to fail.
Went ahead and modified CUR_END values for all debuggers even though this
should only affect remote debuggers. ST64_MAX should be enough.
2019-11-29 11:36:28 +01:00
GustavoLCR
635f27068b Fix WinDbg IO in page boundaries ##debug
Before we didn't check if a virtual address read/write would go through a page boundary. This fixes it.

Also do some formatting and re-enable some useful error messages
2019-11-26 12:37:39 +01:00
pancake
d00d44dd04 Fix #15495 - show current seek history position in sj 2019-11-24 17:40:19 +01:00
GustavoLCR
a598e640df Fix #15456 - Fix reopening in write mode ##windows 2019-11-14 17:51:26 +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
David CARLIER
e69907ef5d Uses the setitimer api instead for the alarm in self:// ##io 2019-11-10 19:03:42 +01:00
dok
34e4bd7291 Use sigaction instead of signal ##core 2019-11-06 12:41:36 +01:00
GustavoLCR
36114b35f3 Fix attaching to a pid on Windows (#15406) ##debug 2019-11-04 11:05:55 +01:00
yossizap
29e2ffe476 Fix issues in windows thread switching (#15366)
* Fixed issues in windows thread switching by implementing thread attach for w32dbg =!pid

Previously the function attempted to OpenProcess even though the main
pid is already opened by __open and the fact that re-opening the main
pid wouldn't do anything. This way it attaches to new threads when
called by r_debug_select.

* Modified w32_continue to update rio->pi.dwThreadId after switching to the requested thread

Manually changing iop->pi.dwThreadId in io_w32dbg's =!pid created a
problematic scenario when w32_continue is called with the last event's
tid from dbg_wait. This solution makes sure iop->pi.dwThreadId keeps
being updated after events on other threads arrive and that w32_continue
actually uses the given tid.

* Modified w32_continue return values
2019-10-28 11:06:57 +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
David CARLIER
ba17532cd1 Setting the upper address limit for OpenBSD ##io_self (#15318)
Here it is more an additional 'safety blanket' as sysctl
call would fail once reached then end of the address mapping
anyway.
2019-10-20 23:36:55 +02:00
Florian Märkl
f9002e6624 Fix ptrace io plugin open (#15314) 2019-10-20 12:31:17 +02:00
David CARLIER
406e34d7f4 Checking pid if attached on FreeBSD implementation #io_ptrace (#15311) 2019-10-20 12:21:06 +02:00
Anton Kochkov
0f430b5871 Fix #15296 - *BSD builds (#15309) ##build 2019-10-19 01:28:01 +02:00
yossizap
f6bda32cb9 Fixed ptrace 'Operation not permitted' errors (#15287) ##debug 2019-10-16 13:08:38 +02:00
Maijin
9227815fdb Change radare->radareorg links 2019-10-07 10:48:31 +02:00
Paul I
78f2b12d0b Fix potential memleaks (#15057) 2019-09-17 02:14:32 +02:00
pancake
91b1ca30bb Remove the shm_open call until properly tested 2019-09-16 11:48:54 +02:00
pancake
892e119c25 Fix 32bit limit issue in shm:// 2019-09-16 11:38:24 +02:00
Paul I
4eabb42f88 Fix potential bugs 2019-09-16 09:37:43 +02:00
GustavoLCR
7549d171dd Fix Linux Build 2019-09-16 09:35:14 +02:00
Paul I
102642077f Fix Windows build 2019-09-16 09:32:57 +02:00
pancake
43c61fccbd Support shm_open in shm:// and some code cleanup ##io 2019-09-15 22:43:51 +02:00
David CARLIER
88eb337602 Fixing perms for Darwin ##io_self (#15038) 2019-09-14 20:59:27 +02:00