11 #define SET_BIT(p, n) ((p) |= (1 << (n)))
12 #define CLR_BIT(p, n) ((p) &= (~(1) << (n)))
33 for (
i = 0;
i <
len;
i++) {
44 for (j = 0; j < osize &&
i < dsize; j++) {
69 for (
i = 0;
i <
len;
i++) {
73 int ret = memcmp(mdest, morig,
len);
85 srcmask = dstmask = 0;
121 const int wholeBytes = bitoffset / 8;
122 const int remainingBits = bitoffset % 8;
124 return (
src[wholeBytes] & 1 << remainingBits);
128 const int byte =
i / 8;
129 const int bit = (
i % 8);
143 if (doff < 0 || soff < 0 || !
dst || !
src) {
247 int i, until = hlen - nlen + 1;
248 if (hlen < 1 || nlen < 1) {
251 for (
i = 0;
i < until;
i++) {
252 if (!memcmp(haystack +
i, needle, nlen)) {
261 int i, until = hlen - nlen + 1;
265 if (hlen < 1 || nlen < 1) {
269 until -= (until % align);
271 for (
i = 0;
i < until;
i += align) {
272 if (!memcmp(haystack +
i, needle, nlen)) {
282 if (strchr(
prot,
'x')) {
285 if (strchr(
prot,
'r')) {
288 if (strchr(
prot,
'w')) {
297 r = strchr(
prot,
'r') ? 1 : 0;
298 w = strchr(
prot,
'w') ? 1 : 0;
299 x = strchr(
prot,
'x') ? 1 : 0;
304 p = PAGE_EXECUTE_READ;
310 if (!VirtualProtect(ptr,
size,
p,
NULL)) {
314 #warning Unknown platform
330 for (
i = 0;
i <
end;
i++) {
339 for (
i = 0;
i < la;
i++) {
349 for (
i = 0;
i < l;
i++) {
367 RtlSecureZeroMemory(
dst, l);
369 #if HAVE_EXPLICIT_BZERO
370 explicit_bzero(
dst, l);
371 #elif HAVE_EXPLICIT_MEMSET
372 (void)explicit_memset(
dst, 0, l);
375 __asm__
volatile(
"" ::
"r"(
dst)
int bits(struct state *s, int need)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork mprotect
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void prot
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
#define rz_return_val_if_fail(expr, val)
static void rz_write_le32(void *dest, ut32 val)
static void rz_write_le16(void *dest, ut16 val)
static ut16 rz_read_le16(const void *src)
static ut32 rz_read_le32(const void *src)
static ut8 rz_read_le8(const void *src)
static ut64 rz_read_le64(const void *src)
static void rz_write_le64(void *dest, ut64 val)
static void rz_write_le8(void *dest, ut8 val)
#define RZ_BIT_UNSET(x, y)
RZ_API int rz_mem_protect(void *ptr, int size, const char *prot)
RZ_API bool rz_mem_is_printable(const ut8 *a, int la)
RZ_API void rz_mem_reverse(ut8 *b, int l)
RZ_API void rz_mem_copybits_delta(ut8 *dst, int doff, const ut8 *src, int soff, int bits)
RZ_API void * rz_mem_copy(void *dest, size_t dmax, const void *src, size_t smax)
RZ_API void rz_mem_swapendian(ut8 *dest, const ut8 *orig, int size)
RZ_API void * rz_mem_dup(const void *s, int l)
RZ_API int rz_mem_cmp_mask(const ut8 *dest, const ut8 *orig, const ut8 *mask, int len)
static void writebit(ut8 *dst, int i, bool c)
static char readbit(const ut8 *src, int bitoffset)
RZ_API int rz_mem_eq(const ut8 *a, const ut8 *b, int len)
Compares memory a with b over len bytes.
RZ_API void rz_mem_copyloop(ut8 *dest, const ut8 *orig, int dsize, int osize)
RZ_API int rz_mem_set_num(ut8 *dest, int dest_size, ut64 num)
RZ_API void rz_mem_free(void *p)
RZ_API void rz_mem_copybits(ut8 *dst, const ut8 *src, int bits)
RZ_API const ut8 * rz_mem_mem_aligned(const ut8 *haystack, int hlen, const ut8 *needle, int nlen, int align)
RZ_API void * rz_mem_alloc(int sz)
RZ_API void rz_mem_swaporcopy(ut8 *dest, const ut8 *src, int len, bool big_endian)
RZ_API void rz_mem_memzero(void *dst, size_t l)
RZ_API const ut8 * rz_mem_mem(const ut8 *haystack, int hlen, const ut8 *needle, int nlen)
RZ_API bool rz_mem_is_zero(const ut8 *b, int l)
RZ_API int rz_mem_count(const ut8 **addr)
RZ_API ut64 rz_mem_get_num(const ut8 *b, int size)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()