1714 Commits

Author SHA1 Message Date
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
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