Commit Graph

67 Commits

Author SHA1 Message Date
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
pancake
e3bfbe2ee7 Minor cleanup in IO 2019-09-11 02:25:38 +02:00
fandauchytil
4f80acf51d Fix #14755 - read-only raw search ##search 2019-08-19 17:30:20 +02:00
radare
67fbd0e0d8
Better use of perm/mode names in R_IO ##io (#14615)
* Aim to fix O_BINARY issue in rahash2 on windows
2019-07-23 10:03:33 +02:00
radare
571a080ca7
s/CORELIB/R2_PLUGIN_INCORE/g (#14295) 2019-06-13 19:12:51 +02:00
Riccardo Schirone
66f7403245 Rewrite the RBuffer API to make it safer and adjust the codebase ##refactor (#13656)
* Reimplement r_buf_fread/fwrite
* Add slice buffer and introduce readonly field
* Do nothing if size is 0
* Prevents an overflow when 8 is subtracted from size.
* Fix ragg2 when patching outside currently existing buffer
* Implement r_mem_mmap_resize for systems where mremap is not defined
* r_buf_buffer can be called with no size arg as well
* Use size_t instead of ut64
2019-05-15 15:34:06 +02:00
Riccardo Schirone
b0ac77881e
Make other RBuffer fields "private" (#13444)
* Use r_buf_size to get the size of a buffer, not the private field

* Use r_buf_seek instead of adjusting the private cur RBuffer field

* use r_buf_read instead of r_buf_read_at(.., cur, ..)

* other r_buf_read_at/r_buf_read

* Fix RBuffer usage in REgg

* Wrong replace with r_buf_resize

* Other r_buf_resize fixes

* style fixes

* other style fixes

* Introduce r_buf_tell API instead of using seek

* other style fixes

* style

* style 2

* write_at(cur) == write

* fixes

* avoid changing test

* Make most RBuffer fields private

* Add some fixme comments

* still use base_priv in some places
2019-03-20 19:01:26 +01:00
radare
ebc1ccabc8
Fix #13391 - issues when using file:// and ood together ##debug 2019-03-16 20:46:11 +01:00
Riccardo Schirone
0948f9536b
Use r_buf_size to get the size of a buffer, not the private field (#13380)
* Use r_buf_size to get the size of a buffer, not the private field
* Use r_buf_seek instead of adjusting the private cur RBuffer field
* use r_buf_read instead of r_buf_read_at(.., cur, ..)
* Fix RBuffer usage in REgg
* Introduce r_buf_tell API instead of using seek
* write_at(cur) == write
2019-03-15 20:28:52 +01:00
Deepak Chethan
3f918a927c Add usable uris field to oLj and r2 -L ##io 2019-02-11 10:27:29 +01:00
David CARLIER
fd93e26d0e Fixes #12531 proposals (#12536) 2018-12-22 10:01:03 +01:00
dav1901
ede39f120c Fix few build compiler warnings (#12490) 2018-12-16 14:54:40 +01:00
pancake
41ec949204 Fix #11112 - Rename {srwx,flags,perms} to perm. (-21 LOC)
Unify R_IO, R_BIN, R_BP, .. into R_PERM_* using 1 letter syntax
2018-09-22 11:31:45 +02:00
Paul I
bf29250ddd Fix #11487 (#11534) 2018-09-15 22:52:12 +02:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
pancake
d55bb122f3 Kill r_io_creat and make it into R_IO_CREAT, honor -ww 2018-08-11 20:44:28 +02:00
pancake
7c5745b092 Kill the R_ITV defines (-8LOC) 2018-06-15 01:20:39 +02:00
pancake
e216f08826 Lowercase some help messages 2018-05-07 12:26:01 +02:00
pancake
d0f69e7818 Handle file:// uri as for io.default 2018-01-02 04:20:53 +01:00
pancake
5132c88f4d More code cleanup and tweaks for char* r_io_system 2017-10-23 00:45:01 +02:00
pancake
94b2fc64d2 Implement RIODescData and adjust RIOMach to work with it
- Handles a magic to ensure the destination struct is the expected one
- Based on r_str_hash, but it must be cached
- Use more r_io_desc_get_pid ()
2017-09-11 01:24:13 +02:00
Álvaro Felipe Melchor
6801a89e1c Bring onIterMap from siol - there's no tomorrow 2017-08-18 20:03:29 +02:00
pancake
9a3787464c Readjustments for the last fix 2017-08-18 15:52:13 +02:00
condret
116810aeb7 beauty-fixes for pancake 2017-08-18 01:40:10 +00:00
alvarofe
2e462ec8f0 Bring RIODesc from SIOL and cleanup 2017-08-18 01:31:57 +00:00
xarkes
3da3958db8 Windbg FIX #7660 + typos (#8126) 2017-08-04 17:49:41 +02:00
SkUaTeR
beb80cfc16 Fixes for MSVC 2017-05-09 23:53:20 +02:00
xarkes
926f024909 Improved MSVC support (WIP) 2017-05-09 14:25:57 +02:00
pancake
39fa8c37b1 Fix build of nocache:// 2016-08-15 01:04:27 +02:00
pancake
d18a63e9ed Fix #5379 - Implement nocache:// for the posix io plugin 2016-08-15 00:14:36 +02:00
pancake
6479943c46 More boolification and code cleanup -70LOC 2016-06-29 11:35:16 +02:00
pancake
4caafc964d Refactor r_io, while fixing some bugs and use more RList 2016-06-20 00:29:41 +02:00
Andrey Torsunov
60de2dc6b4 Fix couple of memory leaks. Issue #2772. (#4725) 2016-04-28 10:47:50 +02:00
Álvaro Felipe Melchor
b0c6ae4409 Fix #4295 and #4155
This commit is the first attempt to improve relocation
recognition when dealing with relocatables elf-files
2016-04-04 23:09:58 +02:00
pancake
de22aa46f2 Fix COV with boolified r_io_creat 2016-01-19 13:16:24 +01:00
pancake
0880d7d4f5 Some refactor/cleanup for agf and io cache (wip) 2015-12-08 14:59:30 +01:00
pancake
49975ccf95 Fix #3286 - Use stdbool.h 2015-09-14 02:08:31 +02:00
pancake
dadc293986 Fix character devices support on FreeBSD (f.ex: /dev/da0) 2015-08-19 20:56:41 +02:00
pancake
83b9633ac2 Add iobind.section_vget 2015-07-28 03:29:16 +02:00
Jonathan Neuschäfer
523aa3af5c add .version to all plugins 2015-07-12 19:05:33 +02:00
pancake
66ead9b96b Add ate command for the anal trace logs with ESIL (and backstepping)
- r2 -e dbg.trace=true -e anal.trace=true -d ls
> 10ds  # perform 10 steps
> ate   # show anal trace logs
> .ate `atek idx` # backstepping
> ate-* # clear logs
2015-02-22 11:40:55 +01:00
jvoisin
defd2d0e96 Coverifix 2015-02-18 13:05:37 +01:00
pancake
4f24447620 Fix chrdev read and write support for OSX and iOS 2015-02-17 00:46:18 +01:00
pancake
ae367b65be Add support for UNIX Character devices 2015-02-16 22:40:05 +01:00
jvoisin
b8cdd7c0f7 Even more coverifix 2015-02-11 21:51:13 +01:00
pancake
7cc34c4387 Fix use-after-free in RCoreFile/RIO 2014-11-07 10:37:54 +01:00
pancake
1c583a4b39 Added 'oob', 'oon' and 'oo?'. Close RBinObjects with RCoreFiles 2014-10-17 00:36:00 +02:00
pancake
da866539ee Fix 'oo' bug (sync rcorefile and riofile lists), Better 'ob' 2014-10-17 00:04:52 +02:00
pancake
0e0dc63aa8 Fix r2 -d problem not loading syms. Redo the ASLR/PIE again 2014-10-15 15:41:02 +02:00
pancake
fc2bb2af7f Fix 4GB issue file and some more warnings 2014-09-20 15:53:29 +02:00