Rizin
unix-like reverse engineering framework and cli tools
macros.h File Reference

Go to the source code of this file.

Macros

#define READ_UINT64(p)
 
#define WRITE_UINT64(p, i)
 
#define READ_UINT32(p)
 
#define WRITE_UINT32(p, i)
 
#define READ_UINT24(p)
 
#define WRITE_UINT24(p, i)
 
#define READ_UINT16(p)
 
#define WRITE_UINT16(p, i)
 
#define LE_READ_UINT64(p)
 
#define LE_WRITE_UINT64(p, i)
 
#define LE_READ_UINT32(p)
 
#define LE_WRITE_UINT32(p, i)
 
#define LE_READ_UINT16(p)
 
#define LE_WRITE_UINT16(p, i)
 
#define FOR_BLOCKS(length, dst, src, blocksize)
 
#define ROTL32(n, x)   (((x)<<(n)) | ((x)>>((-(n)&31))))
 
#define ROTL64(n, x)   (((x)<<(n)) | ((x)>>((-(n))&63)))
 
#define INCREMENT(size, ctr)
 
#define MD_INCR(ctx)   ((ctx)->count_high += !++(ctx)->count_low)
 
#define MD_UPDATE(ctx, length, data, f, incr)
 
#define MD_PAD(ctx, size, f)
 

Macro Definition Documentation

◆ FOR_BLOCKS

#define FOR_BLOCKS (   length,
  dst,
  src,
  blocksize 
)
Value:
assert( !((length) % (blocksize))); \
for (; (length); ((length) -= (blocksize), \
(dst) += (blocksize), \
(src) += (blocksize)) )
lzma_index * src
Definition: index.h:567
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133
char * dst
Definition: lz4.h:724
assert(limit<=UINT32_MAX/2)
static int blocksize
Definition: visual.c:15

Definition at line 148 of file macros.h.

◆ INCREMENT

#define INCREMENT (   size,
  ctr 
)
Value:
do { \
unsigned increment_i = (size) - 1; \
if (++(ctr)[increment_i] == 0) \
while (increment_i > 0 \
&& ++(ctr)[--increment_i] == 0 ) \
; \
} while (0)
voidpf void uLong size
Definition: ioapi.h:138

Definition at line 162 of file macros.h.

◆ LE_READ_UINT16

#define LE_READ_UINT16 (   p)
Value:
( (((uint32_t) (p)[1]) << 8) \
| ((uint32_t) (p)[0]))
void * p
Definition: libc.cpp:67
unsigned int uint32_t
Definition: sftypes.h:29

Definition at line 137 of file macros.h.

◆ LE_READ_UINT32

#define LE_READ_UINT32 (   p)
Value:
( (((uint32_t) (p)[3]) << 24) \
| (((uint32_t) (p)[2]) << 16) \
| (((uint32_t) (p)[1]) << 8) \
| ((uint32_t) (p)[0]))

Definition at line 122 of file macros.h.

◆ LE_READ_UINT64

#define LE_READ_UINT64 (   p)
Value:
( (((uint64_t) (p)[7]) << 56) \
| (((uint64_t) (p)[6]) << 48) \
| (((uint64_t) (p)[5]) << 40) \
| (((uint64_t) (p)[4]) << 32) \
| (((uint64_t) (p)[3]) << 24) \
| (((uint64_t) (p)[2]) << 16) \
| (((uint64_t) (p)[1]) << 8) \
| ((uint64_t) (p)[0]))
unsigned long uint64_t
Definition: sftypes.h:28

Definition at line 100 of file macros.h.

◆ LE_WRITE_UINT16

#define LE_WRITE_UINT16 (   p,
  i 
)
Value:
do { \
(p)[1] = ((i) >> 8) & 0xff; \
(p)[0] = (i) & 0xff; \
} while(0)
lzma_index ** i
Definition: index.h:629

Definition at line 141 of file macros.h.

◆ LE_WRITE_UINT32

#define LE_WRITE_UINT32 (   p,
  i 
)
Value:
do { \
(p)[3] = ((i) >> 24) & 0xff; \
(p)[2] = ((i) >> 16) & 0xff; \
(p)[1] = ((i) >> 8) & 0xff; \
(p)[0] = (i) & 0xff; \
} while(0)

Definition at line 128 of file macros.h.

◆ LE_WRITE_UINT64

#define LE_WRITE_UINT64 (   p,
  i 
)
Value:
do { \
(p)[7] = ((i) >> 56) & 0xff; \
(p)[6] = ((i) >> 48) & 0xff; \
(p)[5] = ((i) >> 40) & 0xff; \
(p)[4] = ((i) >> 32) & 0xff; \
(p)[3] = ((i) >> 24) & 0xff; \
(p)[2] = ((i) >> 16) & 0xff; \
(p)[1] = ((i) >> 8) & 0xff; \
(p)[0] = (i) & 0xff; \
} while (0)

Definition at line 110 of file macros.h.

◆ MD_INCR

#define MD_INCR (   ctx)    ((ctx)->count_high += !++(ctx)->count_low)

Definition at line 180 of file macros.h.

◆ MD_PAD

#define MD_PAD (   ctx,
  size,
  f 
)
Value:
do { \
unsigned __md_i; \
__md_i = (ctx)->index; \
\
/* Set the first char of padding to 0x80. This is safe since there \
is always at least one byte free */ \
assert(__md_i < sizeof((ctx)->block)); \
(ctx)->block[__md_i++] = 0x80; \
if (__md_i > (sizeof((ctx)->block) - (size))) \
{ /* No room for length in this block. Process it and \
pad with another one */ \
memset((ctx)->block + __md_i, 0, sizeof((ctx)->block) - __md_i); \
f((ctx), (ctx)->block); \
__md_i = 0; \
} \
memset((ctx)->block + __md_i, 0, \
sizeof((ctx)->block) - (size) - __md_i); \
\
} while (0)
#define f(i)
Definition: sha256.c:46
if(dbg->bits==RZ_SYS_BITS_64)
Definition: windows-arm64.h:4

Definition at line 224 of file macros.h.

◆ MD_UPDATE

#define MD_UPDATE (   ctx,
  length,
  data,
  f,
  incr 
)

Definition at line 184 of file macros.h.

◆ READ_UINT16

#define READ_UINT16 (   p)
Value:
( (((uint32_t) (p)[0]) << 8) \
| ((uint32_t) (p)[1]))

Definition at line 89 of file macros.h.

◆ READ_UINT24

#define READ_UINT24 (   p)
Value:
( (((uint32_t) (p)[0]) << 16) \
| (((uint32_t) (p)[1]) << 8) \
| ((uint32_t) (p)[2]))

Definition at line 77 of file macros.h.

◆ READ_UINT32

#define READ_UINT32 (   p)
Value:
( (((uint32_t) (p)[0]) << 24) \
| (((uint32_t) (p)[1]) << 16) \
| (((uint32_t) (p)[2]) << 8) \
| ((uint32_t) (p)[3]))

Definition at line 62 of file macros.h.

◆ READ_UINT64

#define READ_UINT64 (   p)
Value:
( (((uint64_t) (p)[0]) << 56) \
| (((uint64_t) (p)[1]) << 48) \
| (((uint64_t) (p)[2]) << 40) \
| (((uint64_t) (p)[3]) << 32) \
| (((uint64_t) (p)[4]) << 24) \
| (((uint64_t) (p)[5]) << 16) \
| (((uint64_t) (p)[6]) << 8) \
| ((uint64_t) (p)[7]))

Definition at line 39 of file macros.h.

◆ ROTL32

#define ROTL32 (   n,
  x 
)    (((x)<<(n)) | ((x)>>((-(n)&31))))

Definition at line 157 of file macros.h.

◆ ROTL64

#define ROTL64 (   n,
  x 
)    (((x)<<(n)) | ((x)>>((-(n))&63)))

Definition at line 159 of file macros.h.

◆ WRITE_UINT16

#define WRITE_UINT16 (   p,
  i 
)
Value:
do { \
(p)[0] = ((i) >> 8) & 0xff; \
(p)[1] = (i) & 0xff; \
} while(0)

Definition at line 93 of file macros.h.

◆ WRITE_UINT24

#define WRITE_UINT24 (   p,
  i 
)
Value:
do { \
(p)[0] = ((i) >> 16) & 0xff; \
(p)[1] = ((i) >> 8) & 0xff; \
(p)[2] = (i) & 0xff; \
} while(0)

Definition at line 82 of file macros.h.

◆ WRITE_UINT32

#define WRITE_UINT32 (   p,
  i 
)
Value:
do { \
(p)[0] = ((i) >> 24) & 0xff; \
(p)[1] = ((i) >> 16) & 0xff; \
(p)[2] = ((i) >> 8) & 0xff; \
(p)[3] = (i) & 0xff; \
} while(0)

Definition at line 68 of file macros.h.

◆ WRITE_UINT64

#define WRITE_UINT64 (   p,
  i 
)
Value:
do { \
(p)[0] = ((i) >> 56) & 0xff; \
(p)[1] = ((i) >> 48) & 0xff; \
(p)[2] = ((i) >> 40) & 0xff; \
(p)[3] = ((i) >> 32) & 0xff; \
(p)[4] = ((i) >> 24) & 0xff; \
(p)[5] = ((i) >> 16) & 0xff; \
(p)[6] = ((i) >> 8) & 0xff; \
(p)[7] = (i) & 0xff; \
} while(0)

Definition at line 49 of file macros.h.