mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-24 06:48:46 +00:00
* Fix RCore.read_at vapi and partial reads
This commit is contained in:
parent
0cd30e9a24
commit
e4094a0cee
@ -132,8 +132,12 @@ R_API int r_core_read_at(RCore *core, ut64 addr, ut8 *buf, int size) {
|
||||
return R_FALSE;
|
||||
r_io_set_fd (core->io, core->file->fd); // XXX ignore ret? -- ultra slow method.. inverse resolution of io plugin brbrb
|
||||
ret = r_io_read_at (core->io, addr, buf, size);
|
||||
if (ret != size) {
|
||||
if (ret<size && ret>0)
|
||||
memset (buf+ret, 0xff, size-ret);
|
||||
else memset (buf, 0xff, size);
|
||||
}
|
||||
if (addr>=core->offset && addr<=core->offset+core->blocksize)
|
||||
r_core_block_read (core, 0);
|
||||
else memset (buf, 0xff, size);
|
||||
return (ret!=UT64_MAX);
|
||||
}
|
||||
|
@ -75,8 +75,8 @@ public class RCore {
|
||||
public void rtr_session(string input);
|
||||
public void rtr_cmd(string input);
|
||||
/* io */
|
||||
public int read_at(uint64 addr, uint8 *buf, int size);
|
||||
public int write_at(uint64 addr, uint8 *buf, int size);
|
||||
public bool read_at(uint64 addr, uint8 *buf, int size);
|
||||
public bool write_at(uint64 addr, uint8 *buf, int size);
|
||||
//public int write_op(uint64 addr, string arg, char op);
|
||||
public int block_read(bool next);
|
||||
public int block_size(int size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user