diff --git a/libr/io/io_memory.c b/libr/io/io_memory.c index 77dc85a645e75..f8056e4b7d149 100644 --- a/libr/io/io_memory.c +++ b/libr/io/io_memory.c @@ -79,7 +79,7 @@ R_IPI bool io_memory_resize(RIO *io, RIODesc *fd, ut64 count) { R_IPI int io_memory_read(RIO *io, RIODesc *fd, ut8 *buf, int count) { R_RETURN_VAL_IF_FAIL (io && fd && buf, -1); - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); if (!fd->data) { return -1; } diff --git a/libr/io/p/io_bochs.c b/libr/io/p/io_bochs.c index 4241aca9a4027..4bac0949cee9f 100644 --- a/libr/io/p/io_bochs.c +++ b/libr/io/p/io_bochs.c @@ -64,7 +64,7 @@ static ut64 __lseek(RIO *io, RIODesc *fd, ut64 offset, int whence) { } static int __read(RIO *io, RIODesc *fd, ut8 *buf, int count) { - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); ut64 addr = io->off; if (!desc || !desc->data) { return -1; diff --git a/libr/io/p/io_dsc.c b/libr/io/p/io_dsc.c index a9dd4317faa79..e990255183f28 100644 --- a/libr/io/p/io_dsc.c +++ b/libr/io/p/io_dsc.c @@ -922,7 +922,7 @@ static int r_io_posix_open(const char *file, int perm, int mode, bool nocache) { static int dsc_object_read(RIO *io, RIODesc *fd, ut8 *buf, int count) { R_RETURN_VAL_IF_FAIL (fd && fd->data && buf, -1); if (io->off == UT64_MAX) { - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); return count; } RIODscObject *dsc = fd->data; diff --git a/libr/io/p/io_gdb.c b/libr/io/p/io_gdb.c index bcaf8aa5a7d70..11b0838ef44dc 100644 --- a/libr/io/p/io_gdb.c +++ b/libr/io/p/io_gdb.c @@ -166,7 +166,7 @@ static int __read(RIO *io, RIODesc *fd, ut8 *buf, int count) { if (!io || !fd || !buf || count < 1) { return -1; } - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); ut64 addr = io->off; if (!desc || !desc->data) { return -1; diff --git a/libr/io/p/io_gzip.c b/libr/io/p/io_gzip.c index 397ea035d1738..0b3d6bcaa6550 100644 --- a/libr/io/p/io_gzip.c +++ b/libr/io/p/io_gzip.c @@ -104,7 +104,7 @@ static bool __resize(RIO *io, RIODesc *fd, ut64 count) { } static int __read(RIO *io, RIODesc *fd, ut8 *buf, int count) { - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); if (!fd || !fd->data) { return -1; } diff --git a/libr/io/p/io_mach.c b/libr/io/p/io_mach.c index 0dfbd76746d91..32ddad9793b2c 100644 --- a/libr/io/p/io_mach.c +++ b/libr/io/p/io_mach.c @@ -233,7 +233,7 @@ static int __read(RIO *io, RIODesc *desc, ut8 *buf, int len) { if (dd ->magic != r_str_hash ("mach")) { return -1; } - memset (buf, 0xff, len); + memset (buf, io->Oxff, len); int pid = __get_pid (desc); task_t task = pid_to_task (desc, pid); if (task_is_dead (desc, pid)) { @@ -260,12 +260,12 @@ static int __read(RIO *io, RIODesc *desc, ut8 *buf, int len) { break; case KERN_INVALID_ADDRESS: if (blocksize == 1) { - memset (buf+copied, 0xff, len-copied); + memset (buf+copied, io->Oxff, len-copied); return size+copied; } blocksize = 1; blen = 1; - buf[copied] = 0xff; + buf[copied] = io->Oxff; break; } if (err == -1 || size < 1) { @@ -273,12 +273,12 @@ static int __read(RIO *io, RIODesc *desc, ut8 *buf, int len) { } if (size == 0) { if (blocksize == 1) { - memset (buf + copied, 0xff, len - copied); + memset (buf + copied, io->Oxff, len - copied); return len; } blocksize = 1; blen = 1; - buf[copied] = 0xff; + buf[copied] = io->Oxff; } copied += blen; } diff --git a/libr/io/p/io_procpid.c b/libr/io/p/io_procpid.c index 2886f446158ac..932bf5258696b 100644 --- a/libr/io/p/io_procpid.c +++ b/libr/io/p/io_procpid.c @@ -34,7 +34,7 @@ static int debug_os_read_at(int fdn, void *buf, int sz, ut64 addr) { } static int __read(RIO *io, RIODesc *fd, ut8 *buf, int len) { - memset (buf, 0xff, len); // TODO: only memset the non-readed bytes + memset (buf, io->Oxff, len); // TODO: only memset the non-readed bytes return debug_os_read_at (RIOPROCPID_FD (fd), buf, len, io->off); } diff --git a/libr/io/p/io_qnx.c b/libr/io/p/io_qnx.c index c265f58a1d994..2363e9b7145fe 100644 --- a/libr/io/p/io_qnx.c +++ b/libr/io/p/io_qnx.c @@ -131,7 +131,7 @@ static ut64 __lseek(RIO *io, RIODesc *fd, ut64 offset, int whence) { } static int __read(RIO *io, RIODesc *fd, ut8 *buf, int count) { - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); ut64 addr = io->off; if (!desc) { return -1; diff --git a/libr/io/p/io_r2k.c b/libr/io/p/io_r2k.c index e26f2fe5569ba..1e1e85a75aa67 100644 --- a/libr/io/p/io_r2k.c +++ b/libr/io/p/io_r2k.c @@ -1,4 +1,4 @@ -/* io_r2k - radare2 - LGPL - Copyright 2016-2024 - SkUaTeR + panda */ +/* io_r2k - radare2 - LGPL - Copyright 2016-2025 - pancake, SkUaTeR, panda */ #include #include @@ -49,12 +49,12 @@ static int r2k__read(RIO *io, RIODesc *fd, ut8 *buf, int count) { return ReadMemory (io, fd, IOCTL_READ_PHYSICAL_ADDR, r2k_struct.pid, io->off, buf, count); default: R_LOG_ERROR ("Undefined beid in r2k__read"); - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); return count; } #else R_LOG_TODO ("r2k not implemented for this plataform"); - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); return count; #endif } @@ -135,7 +135,7 @@ static RIODesc *r2k__open(RIO *io, const char *pathname, int rw, int mode) { RIOPlugin r_io_plugin_r2k = { .meta = { .name = "r2k", - .desc = "Kernel access API io", + .desc = "Client side to comunicate with the r2k kernel module", .author = "skuater,panda", .license = "LGPL-3.0-only", }, diff --git a/libr/io/p/io_reg.c b/libr/io/p/io_reg.c index f9df2fb60560f..40c1b0aa40d7a 100644 --- a/libr/io/p/io_reg.c +++ b/libr/io/p/io_reg.c @@ -33,7 +33,7 @@ static int __read(RIO *io, RIODesc *fd, ut8 *buf, int len) { return -1; } int left = arena->size - io->off; - memset (buf, 0xff, len); + memset (buf, io->Oxff, len); memcpy (buf, arena->bytes + io->off, R_MIN (left, len)); return len; } @@ -76,9 +76,8 @@ static ut64 __lseek(RIO *io, RIODesc *fd, ut64 offset, int whence) { case R_IO_SEEK_SET: if (offset >= size) { return size; - } else { - return offset; } + return offset; case R_IO_SEEK_CUR: return io->off + offset; case R_IO_SEEK_END: diff --git a/libr/io/p/io_self.c b/libr/io/p/io_self.c index e9ab78a9061d3..b44b4f80cb375 100644 --- a/libr/io/p/io_self.c +++ b/libr/io/p/io_self.c @@ -395,7 +395,7 @@ static int __read(RIO *io, RIODesc *desc, ut8 *buf, int len) { return newlen; } } - memset (buf, 0xff, len); + memset (buf, io->Oxff, len); return 0; } diff --git a/libr/io/p/io_sysgdb.c b/libr/io/p/io_sysgdb.c index bba0b5cededfd..2a5d34068267f 100644 --- a/libr/io/p/io_sysgdb.c +++ b/libr/io/p/io_sysgdb.c @@ -166,7 +166,7 @@ static int __read(RIO *io, RIODesc *fd, ut8 *buf, int count) { left = count - 1024; count = 1024; } - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); if (count > 0) { char *cmd = r_str_newf ("x/%db 0x%"PFMT64x, count, addr); char *ores = runcmd (cmd); diff --git a/libr/io/p/io_winedbg.c b/libr/io/p/io_winedbg.c index 2b14951dd20f8..96de85c73cd0a 100644 --- a/libr/io/p/io_winedbg.c +++ b/libr/io/p/io_winedbg.c @@ -101,7 +101,7 @@ Wine-dbg> int wordSize = 4; ut32 *w = (ut32*)buf; int i; - memset (buf, 0xff, count); + memset (buf, io->Oxff, count); int words = count / wordSize; // XXX must pad align to 4 for (i = 0; i < words ; i++) { ut64 addr = io->off + (i * wordSize); @@ -116,7 +116,7 @@ Wine-dbg> int left = count % wordSize; if (left > 0) { - ut32 n = 0xff; + ut32 n = UT32_MAX; ut8 *wn = (ut8*)&n; ut64 addr = io->off + (i * wordSize); char *cmd = r_str_newf ("x 0x%"PFMT64x, addr); diff --git a/libr/io/undo.c b/libr/io/undo.c index 9587ac3fc1e17..52a490d535659 100644 --- a/libr/io/undo.c +++ b/libr/io/undo.c @@ -225,7 +225,7 @@ R_API void r_io_wundo_new(RIO *io, ut64 off, const ut8 *data, int len) { R_FREE (uw); return; } - memset (uw->o, 0xff, len); + memset (uw->o, io->Oxff, len); r_io_read_at (io, off, uw->o, len); r_list_append (io->undo.w_list, uw); }