Rizin
unix-like reverse engineering framework and cli tools
rz_endian.h File Reference
#include <rz_types.h>

Go to the source code of this file.

Functions

static ut8 rz_read_ble8 (const void *src)
 
static ut8 rz_read_at_ble8 (const void *src, size_t offset)
 
static void rz_write_ble8 (void *dest, ut8 val)
 
static void rz_write_at_ble8 (void *dest, ut8 val, size_t offset)
 
static ut8 rz_read_be8 (const void *src)
 
static ut8 rz_read_at_be8 (const void *src, size_t offset)
 
static void rz_write_be8 (void *dest, ut8 val)
 
static void rz_write_at_be8 (void *dest, ut8 val, size_t offset)
 
static ut16 rz_read_be16 (const void *src)
 
static ut16 rz_read_at_be16 (const void *src, size_t offset)
 
static void rz_write_be16 (void *dest, ut16 val)
 
static void rz_write_at_be16 (void *dest, ut16 val, size_t offset)
 
static ut32 rz_read_be24 (const void *src)
 
static ut32 rz_read_at_be24 (const void *src, size_t offset)
 
static void rz_write_be24 (void *_dest, ut32 val)
 
static ut32 rz_read_be32 (const void *src)
 
static ut32 rz_read_at_be32 (const void *src, size_t offset)
 
static void rz_write_be32 (void *dest, ut32 val)
 
static void rz_write_at_be32 (void *dest, ut32 val, size_t offset)
 
static ut64 rz_read_be64 (const void *src)
 
static ut64 rz_read_at_be64 (const void *src, size_t offset)
 
static void rz_write_be64 (void *dest, ut64 val)
 
static void rz_write_at_be64 (void *dest, ut64 val, size_t offset)
 
static float rz_read_be_float (const void *src)
 
static float rz_read_at_be_float (const void *src, size_t offset)
 
static void rz_write_be_float (void *dest, float val)
 
static void rz_write_at_be_float (void *dest, float val, size_t offset)
 
static double rz_read_be_double (const void *src)
 
static double rz_read_at_be_double (const void *src, size_t offset)
 
static void rz_write_be_double (void *dest, double val)
 
static void rz_write_at_be_double (void *dest, double val, size_t offset)
 
static ut8 rz_read_le8 (const void *src)
 
static ut8 rz_read_at_le8 (const void *src, size_t offset)
 
static void rz_write_le8 (void *dest, ut8 val)
 
static void rz_write_at_le8 (void *dest, ut8 val, size_t offset)
 
static ut16 rz_read_le16 (const void *src)
 
static ut16 rz_read_at_le16 (const void *src, size_t offset)
 
static void rz_write_le16 (void *dest, ut16 val)
 
static void rz_write_at_le16 (void *dest, ut16 val, size_t offset)
 
static void rz_write_le24 (void *_dest, ut32 val)
 
static ut32 rz_read_le32 (const void *src)
 
static ut32 rz_read_at_le32 (const void *src, size_t offset)
 
static void rz_write_le32 (void *dest, ut32 val)
 
static void rz_write_at_le32 (void *dest, ut32 val, size_t offset)
 
static ut64 rz_read_le64 (const void *src)
 
static ut64 rz_read_at_le64 (const void *src, size_t offset)
 
static void rz_write_le64 (void *dest, ut64 val)
 
static void rz_write_at_le64 (void *dest, ut64 val, size_t offset)
 
static float rz_read_le_float (const void *src)
 
static float rz_read_at_le_float (const void *src, size_t offset)
 
static void rz_write_le_float (void *dest, float val)
 
static void rz_write_at_le_float (void *dest, float val, size_t offset)
 
static double rz_read_le_double (const void *src)
 
static double rz_read_at_le_double (const void *src, size_t offset)
 
static void rz_write_le_double (void *dest, double val)
 
static void rz_write_at_le_double (void *dest, double val, size_t offset)
 
static ut8 rz_read_me8 (const void *src)
 
static ut8 rz_read_at_me8 (const void *src, size_t offset)
 
static void rz_write_me8 (void *dest, ut8 val)
 
static void rz_write_at_me8 (void *dest, ut8 val, size_t offset)
 
static ut16 rz_read_me16 (const void *src)
 
static ut16 rz_read_at_me16 (const void *src, size_t offset)
 
static void rz_write_me16 (void *dest, ut16 val)
 
static void rz_write_at_me16 (void *dest, ut16 val, size_t offset)
 
static ut32 rz_read_me32 (const void *src)
 
static ut32 rz_read_at_me32 (const void *src, size_t offset)
 
static void rz_write_me32 (void *dest, ut32 val)
 
static void rz_write_at_me32 (void *dest, ut32 val, size_t offset)
 
static ut64 rz_read_me64 (const void *src)
 
static ut64 rz_read_at_me64 (const void *src, size_t offset)
 
static void rz_write_me64 (void *dest, ut64 val)
 
static void rz_write_at_me64 (void *dest, ut64 val, size_t offset)
 
static float rz_read_me_float (const void *src)
 
static float rz_read_at_me_float (const void *src, size_t offset)
 
static void rz_write_me_float (void *dest, float val)
 
static void rz_write_at_me_float (void *dest, float val, size_t offset)
 
static double rz_read_me_double (const void *src)
 
static double rz_read_at_me_double (const void *src, size_t offset)
 
static void rz_write_me_double (void *dest, double val)
 
static void rz_write_at_me_double (void *dest, double val, size_t offset)
 
static ut16 rz_read_ble16 (const void *src, bool big_endian)
 
static ut32 rz_read_ble32 (const void *src, bool big_endian)
 
static ut64 rz_read_ble64 (const void *src, bool big_endian)
 
static ut16 rz_read_at_ble16 (const void *src, size_t offset, bool big_endian)
 
static ut32 rz_read_at_ble32 (const void *src, size_t offset, bool big_endian)
 
static ut64 rz_read_at_ble64 (const void *src, size_t offset, bool big_endian)
 
static ut64 rz_read_ble (const void *src, bool big_endian, int size)
 
static void rz_write_ble16 (void *dest, ut16 val, bool big_endian)
 
static void rz_write_ble24 (void *dest, ut32 val, bool big_endian)
 
static void rz_write_ble32 (void *dest, ut32 val, bool big_endian)
 
static void rz_write_ble64 (void *dest, ut64 val, bool big_endian)
 
static void rz_write_ble (void *dst, ut64 val, bool big_endian, int size)
 
static ut16 rz_swap_ut16 (ut16 val)
 
static st16 rz_swap_st16 (st16 val)
 
static ut32 rz_swap_ut32 (ut32 val)
 
static st32 rz_swap_st32 (st32 val)
 
static ut64 rz_swap_ut64 (ut64 val)
 
static st64 rz_swap_st64 (st64 val)
 
static int UT64_ADD (ut64 *r, ut64 a, ut64 b)
 
static int UT64_MUL (ut64 *r, ut64 a, ut64 b)
 
static int UT64_SUB (ut64 *r, ut64 a, ut64 b)
 
static int UT32_ADD (ut32 *r, ut32 a, ut32 b)
 
static int UT32_MUL (ut32 *r, ut32 a, ut32 b)
 
static int UT32_SUB (ut32 *r, ut32 a, ut32 b)
 
static int UT16_ADD (ut16 *r, ut16 a, ut16 b)
 
static int UT16_MUL (ut16 *r, ut16 a, ut16 b)
 
static int UT16_SUB (ut16 *r, ut16 a, ut16 b)
 
static int UT8_ADD (ut8 *r, ut8 a, ut8 b)
 
static int UT8_MUL (ut8 *r, ut8 a, ut8 b)
 
static int UT8_SUB (ut8 *r, ut8 a, ut8 b)
 

Function Documentation

◆ rz_read_at_be16()

static ut16 rz_read_at_be16 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 55 of file rz_endian.h.

55  {
56  const ut8 *s = (const ut8 *)src + offset;
57  return rz_read_be16(s);
58 }
lzma_index * src
Definition: index.h:567
voidpf uLong offset
Definition: ioapi.h:144
uint8_t ut8
Definition: lh5801.h:11
static RzSocket * s
Definition: rtr.c:28
static ut16 rz_read_be16(const void *src)
Definition: rz_endian.h:50

References rz_read_be16(), s, and src.

Referenced by avr_disassembler(), decode_abs162r16(), decode_disp162r16(), decode_imm162r16(), decode_jmp_abs16(), decode_r82abs16(), decode_r82dispr16(), iob_net_read(), and rz_read_at_ble16().

◆ rz_read_at_be24()

static ut32 rz_read_at_be24 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 75 of file rz_endian.h.

75  {
76  const ut8 *s = (const ut8 *)src + offset;
77  return rz_read_be24(s);
78 }
static ut32 rz_read_be24(const void *src)
Definition: rz_endian.h:70

References rz_read_be24(), s, and src.

◆ rz_read_at_be32()

◆ rz_read_at_be64()

static ut64 rz_read_at_be64 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 114 of file rz_endian.h.

114  {
115  const ut8 *s = (const ut8 *)src + offset;
116  return rz_read_be64(s);
117 }
static ut64 rz_read_be64(const void *src)
Definition: rz_endian.h:108

References rz_read_be64(), s, and src.

Referenced by iob_net_read(), rz_core_serve(), rz_read_at_ble64(), and rz_socket_rap_client_seek().

◆ rz_read_at_be8()

static ut8 rz_read_at_be8 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 38 of file rz_endian.h.

38  {
39  return rz_read_at_ble8(src, offset);
40 }
static ut8 rz_read_at_ble8(const void *src, size_t offset)
Definition: rz_endian.h:19

References rz_read_at_ble8(), and src.

◆ rz_read_at_be_double()

static double rz_read_at_be_double ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 166 of file rz_endian.h.

166  {
167  const ut8 *s = (const ut8 *)src + offset;
168  return rz_read_be_double(s);
169 }
static double rz_read_be_double(const void *src)
Definition: rz_endian.h:157

References rz_read_be_double(), s, and src.

◆ rz_read_at_be_float()

static float rz_read_at_be_float ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 138 of file rz_endian.h.

138  {
139  const ut8 *s = (const ut8 *)src + offset;
140  return rz_read_be_float(s);
141 }
static float rz_read_be_float(const void *src)
Definition: rz_endian.h:129

References rz_read_be_float(), s, and src.

◆ rz_read_at_ble16()

static ut16 rz_read_at_ble16 ( const void *  src,
size_t  offset,
bool  big_endian 
)
inlinestatic

Definition at line 505 of file rz_endian.h.

505  {
506  return big_endian ? rz_read_at_be16(src, offset) : rz_read_at_le16(src, offset);
507 }
static ut16 rz_read_at_le16(const void *src, size_t offset)
Definition: rz_endian.h:214
static ut16 rz_read_at_be16(const void *src, size_t offset)
Definition: rz_endian.h:55

References rz_read_at_be16(), rz_read_at_le16(), and src.

Referenced by rz_bin_pe_get_exports().

◆ rz_read_at_ble32()

static ut32 rz_read_at_ble32 ( const void *  src,
size_t  offset,
bool  big_endian 
)
inlinestatic

Definition at line 509 of file rz_endian.h.

509  {
510  return big_endian ? rz_read_at_be32(src, offset) : rz_read_at_le32(src, offset);
511 }
static ut32 rz_read_at_le32(const void *src, size_t offset)
Definition: rz_endian.h:248
static ut32 rz_read_at_be32(const void *src, size_t offset)
Definition: rz_endian.h:93

References rz_read_at_be32(), rz_read_at_le32(), and src.

Referenced by buf_fwd_checksum(), and rz_bin_pe_get_exports().

◆ rz_read_at_ble64()

static ut64 rz_read_at_ble64 ( const void *  src,
size_t  offset,
bool  big_endian 
)
inlinestatic

Definition at line 513 of file rz_endian.h.

513  {
514  return big_endian ? rz_read_at_be64(src, offset) : rz_read_at_le64(src, offset);
515 }
static ut64 rz_read_at_le64(const void *src, size_t offset)
Definition: rz_endian.h:272
static ut64 rz_read_at_be64(const void *src, size_t offset)
Definition: rz_endian.h:114

References rz_read_at_be64(), rz_read_at_le64(), and src.

◆ rz_read_at_ble8()

static ut8 rz_read_at_ble8 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 19 of file rz_endian.h.

19  {
20  return rz_read_ble8(((const ut8 *)src) + offset);
21 }
static ut8 rz_read_ble8(const void *src)
Definition: rz_endian.h:12

References rz_read_ble8(), and src.

Referenced by rz_read_at_be8(), rz_read_at_le8(), rz_read_at_me8(), and rz_reg_get_value().

◆ rz_read_at_le16()

static ut16 rz_read_at_le16 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 214 of file rz_endian.h.

214  {
215  if (!src) {
216  return UT16_MAX;
217  }
218  const ut8 *s = (const ut8 *)src + offset;
219  return rz_read_le16(s);
220 }
static ut16 rz_read_le16(const void *src)
Definition: rz_endian.h:206
#define UT16_MAX

References rz_read_le16(), s, src, and UT16_MAX.

Referenced by avr_disassembler(), cr16_decode_bal(), cr16_decode_bcond_br(), cr16_decode_biti(), cr16_decode_i_r(), cr16_decode_ld_st(), cr16_decode_movd(), decode_3operands(), decode_bit_op(), decode_extended(), decode_jarl(), decode_load_store(), msp430_decode_command(), msp430_op(), rz_read_at_ble16(), rz_xor16_update(), and update().

◆ rz_read_at_le32()

static ut32 rz_read_at_le32 ( const void *  src,
size_t  offset 
)
inlinestatic

◆ rz_read_at_le64()

static ut64 rz_read_at_le64 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 272 of file rz_endian.h.

272  {
273  const ut8 *s = ((const ut8 *)src) + offset;
274  return rz_read_le64(s);
275 }
static ut64 rz_read_le64(const void *src)
Definition: rz_endian.h:266

References rz_read_le64(), s, and src.

Referenced by rz_read_at_ble64(), and wasm_dis().

◆ rz_read_at_le8()

static ut8 rz_read_at_le8 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 194 of file rz_endian.h.

194  {
195  return rz_read_at_ble8(src, offset);
196 }

References rz_read_at_ble8(), and src.

Referenced by read_ShortInlineBrTarget().

◆ rz_read_at_le_double()

static double rz_read_at_le_double ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 324 of file rz_endian.h.

324  {
325  const ut8 *s = (const ut8 *)src + offset;
326  return rz_read_le_double(s);
327 }
static double rz_read_le_double(const void *src)
Definition: rz_endian.h:315

References rz_read_le_double(), s, and src.

◆ rz_read_at_le_float()

static float rz_read_at_le_float ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 296 of file rz_endian.h.

296  {
297  const ut8 *s = (const ut8 *)src + offset;
298  return rz_read_le_float(s);
299 }
static float rz_read_le_float(const void *src)
Definition: rz_endian.h:287

References rz_read_le_float(), s, and src.

◆ rz_read_at_me16()

static ut16 rz_read_at_me16 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 369 of file rz_endian.h.

369  {
370  if (!src) {
371  return UT16_MAX;
372  }
373  const ut8 *s = (const ut8 *)src + offset;
374  return rz_read_me16(s);
375 }
static ut16 rz_read_me16(const void *src)
Definition: rz_endian.h:361

References rz_read_me16(), s, src, and UT16_MAX.

◆ rz_read_at_me32()

static ut32 rz_read_at_me32 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 396 of file rz_endian.h.

396  {
397  if (!src) {
398  return UT32_MAX;
399  }
400  const ut8 *s = (const ut8 *)src + offset;
401  return rz_read_me32(s);
402 }
static ut32 rz_read_me32(const void *src)
Definition: rz_endian.h:387

References rz_read_me32(), s, src, and UT32_MAX.

Referenced by rz_read_me64().

◆ rz_read_at_me64()

static ut64 rz_read_at_me64 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 420 of file rz_endian.h.

420  {
421  const ut8 *s = ((const ut8 *)src) + offset;
422  return rz_read_me64(s);
423 }
static ut64 rz_read_me64(const void *src)
Definition: rz_endian.h:414

References rz_read_me64(), s, and src.

◆ rz_read_at_me8()

static ut8 rz_read_at_me8 ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 349 of file rz_endian.h.

349  {
350  return rz_read_at_ble8(src, offset);
351 }

References rz_read_at_ble8(), and src.

◆ rz_read_at_me_double()

static double rz_read_at_me_double ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 472 of file rz_endian.h.

472  {
473  const ut8 *s = (const ut8 *)src + offset;
474  return rz_read_me_double(s);
475 }
static double rz_read_me_double(const void *src)
Definition: rz_endian.h:463

References rz_read_me_double(), s, and src.

◆ rz_read_at_me_float()

static float rz_read_at_me_float ( const void *  src,
size_t  offset 
)
inlinestatic

Definition at line 444 of file rz_endian.h.

444  {
445  const ut8 *s = (const ut8 *)src + offset;
446  return rz_read_me_float(s);
447 }
static float rz_read_me_float(const void *src)
Definition: rz_endian.h:435

References rz_read_me_float(), s, and src.

◆ rz_read_be16()

static ut16 rz_read_be16 ( const void *  src)
inlinestatic

Definition at line 50 of file rz_endian.h.

50  {
51  const ut8 *s = (const ut8 *)src;
52  return (((ut16)s[0]) << 8) | (((ut16)s[1]) << 0);
53 }
uint16_t ut16

References s, and src.

Referenced by chip8_anop(), decode_addressing_modes(), decode_opcode(), disassemble(), java_constant_pool_resolve(), java_constant_pool_stringify(), rz_read_at_be16(), and rz_read_ble16().

◆ rz_read_be24()

static ut32 rz_read_be24 ( const void *  src)
inlinestatic

Definition at line 70 of file rz_endian.h.

70  {
71  return rz_read_be8(src) << 16 | rz_read_be8((const ut8 *)src + 1) << 8 |
72  rz_read_be8((const ut8 *)src + 2);
73 }
static ut8 rz_read_be8(const void *src)
Definition: rz_endian.h:34

References rz_read_be8(), and src.

Referenced by decode_addressing_modes(), and rz_read_at_be24().

◆ rz_read_be32()

◆ rz_read_be64()

static ut64 rz_read_be64 ( const void *  src)
inlinestatic

Definition at line 108 of file rz_endian.h.

108  {
109  ut64 val = ((ut64)(rz_read_be32(src))) << 32;
110  val |= rz_read_at_be32(src, sizeof(ut32));
111  return val;
112 }
ut16 val
Definition: armass64_const.h:6
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References rz_read_at_be32(), rz_read_be32(), src, ut64(), and val.

Referenced by _processControlPacket(), _sendResponsePacket(), java_constant_pool_stringify(), parse_thread(), rz_core_visual_view_rop(), rz_read_at_be64(), rz_read_be_double(), rz_read_ble64(), and rz_socket_rap_server_continue().

◆ rz_read_be8()

static ut8 rz_read_be8 ( const void *  src)
inlinestatic

Definition at line 34 of file rz_endian.h.

34  {
35  return rz_read_ble8(src);
36 }

References rz_read_ble8(), and src.

Referenced by rz_read_be24().

◆ rz_read_be_double()

static double rz_read_be_double ( const void *  src)
inlinestatic

Definition at line 157 of file rz_endian.h.

157  {
158  union {
159  ut64 bits;
160  double dbl;
161  } p;
162  p.bits = rz_read_be64(src);
163  return p.dbl;
164 }
int bits(struct state *s, int need)
Definition: blast.c:72
void * p
Definition: libc.cpp:67

References bits(), p, rz_read_be64(), src, and ut64().

Referenced by add_file_hash(), handle_entropy(), java_constant_pool_stringify(), rz_hash_cfg_calculate_small_block_string(), rz_hash_cfg_get_result_string(), rz_hash_entropy(), rz_hash_entropy_fraction(), and rz_read_at_be_double().

◆ rz_read_be_float()

static float rz_read_be_float ( const void *  src)
inlinestatic

Definition at line 129 of file rz_endian.h.

129  {
130  union {
131  ut32 bits;
132  float flt;
133  } p;
134  p.bits = rz_read_be32(src);
135  return p.flt;
136 }

References bits(), p, rz_read_be32(), and src.

Referenced by java_constant_pool_stringify(), and rz_read_at_be_float().

◆ rz_read_ble()

static ut64 rz_read_ble ( const void *  src,
bool  big_endian,
int  size 
)
inlinestatic

Definition at line 517 of file rz_endian.h.

517  {
518  switch (size) {
519  case 8:
520  return (ut64)((const ut8 *)src)[0];
521  case 16:
522  return rz_read_ble16(src, big_endian);
523  case 32:
524  return rz_read_ble32(src, big_endian);
525  case 64:
526  return rz_read_ble64(src, big_endian);
527  default:
528  return UT64_MAX;
529  }
530 }
voidpf void uLong size
Definition: ioapi.h:138
static ut64 rz_read_ble64(const void *src, bool big_endian)
Definition: rz_endian.h:501
static ut32 rz_read_ble32(const void *src, bool big_endian)
Definition: rz_endian.h:497
static ut16 rz_read_ble16(const void *src, bool big_endian)
Definition: rz_endian.h:493
#define UT64_MAX
Definition: rz_types_base.h:86

References rz_read_ble16(), rz_read_ble32(), rz_read_ble64(), src, ut64(), and UT64_MAX.

Referenced by analysis_mask(), cmd_pxr(), decode_from_table(), ds_print_data_type(), ds_print_ptr(), get_category_t(), get_class_name(), get_class_ro_t(), get_class_t(), get_ivar_list_t(), get_method_list_t(), get_objc_property_list(), get_protocol_list_t(), init_hdr(), lang_byte_array_c_cpp(), parse_classes(), propagate_types_among_used_variables(), read_ptr(), read_ptr_pa(), rtti_msvc_read_base_class_descriptor(), rtti_msvc_read_class_hierarchy_descriptor(), rtti_msvc_read_complete_object_locator(), rz_bin_elf_get_sp_val(), rz_cmd_disassemble_ropchain_handler(), rz_core_print_hexdump_byline_str(), rz_core_print_string_c_cpp(), rz_coresym_cache_element_new(), rz_io_read_i(), and rz_print_jsondump_str().

◆ rz_read_ble16()

◆ rz_read_ble32()

◆ rz_read_ble64()

◆ rz_read_ble8()

static ut8 rz_read_ble8 ( const void *  src)
inlinestatic

Definition at line 12 of file rz_endian.h.

12  {
13  if (!src) {
14  return UT8_MAX;
15  }
16  return *(const ut8 *)src;
17 }
#define UT8_MAX

References src, and UT8_MAX.

Referenced by buf_format(), cmd_print_pv(), num_callback(), parse_dwarf_location(), parse_symtab(), rz_analysis_try_get_fcn(), rz_core_write_value_inc_at(), rz_print_hexdump_str(), rz_read_at_ble8(), rz_read_be8(), rz_read_le8(), and rz_read_me8().

◆ rz_read_le16()

◆ rz_read_le32()

static ut32 rz_read_le32 ( const void *  src)
inlinestatic

Definition at line 239 of file rz_endian.h.

239  {
240  if (!src) {
241  return UT32_MAX;
242  }
243  const ut8 *s = (const ut8 *)src;
244  return (((ut32)s[3]) << 24) | (((ut32)s[2]) << 16) |
245  (((ut32)s[1]) << 8) | (((ut32)s[0]) << 0);
246 }

References s, src, and UT32_MAX.

Referenced by arc_op(), carve_deps_at_address(), create_cache_bins(), dalvik_op(), dump_element(), extract_addr_from_code(), get_main_offset_arm64(), get_main_offset_arm_glibc_non_thumb(), get_main_offset_arm_glibc_thumb(), get_main_offset_linux_64_pie(), get_main_offset_mips(), get_main_offset_x86_non_pie(), get_main_offset_x86_pie(), get_module_timestamp(), header(), hexagon_reverse_opcode(), init_hdr(), init_module_runtime_functions(), is_delta_pointer_table(), load_omf_data(), load_omf_segdef(), load_omf_symb(), mconvert(), parse_symbol_table(), parseDragons(), parseHeader(), parseMetadata(), pic_pic18_disassemble(), process_constructors(), read_InlineSwitch(), read_slot32(), readDword(), resolve_mig_subsystem(), resource_value(), rtti_msvc_read_base_class_array(), rz_analysis_walkthrough_casetbl(), rz_analysis_walkthrough_jmptbl(), rz_asm_disassemble(), rz_cmd_print_timestamp_dos_handler(), rz_core_transform_op(), rz_coresym_cache_element_new(), rz_fletcher64_update(), rz_mem_get_num(), rz_print_hexdump_str(), rz_read_at_le32(), rz_read_ble32(), rz_read_le64(), rz_read_le_float(), rz_rebase_info_new_from_mach0(), sections(), string_scan_range_cfstring(), symbols(), unwind_function(), update(), winkd_read_ptr_at(), and winkd_walk_vadtree().

◆ rz_read_le64()

◆ rz_read_le8()

static ut8 rz_read_le8 ( const void *  src)
inlinestatic

Definition at line 187 of file rz_endian.h.

187  {
188  if (!src) {
189  return UT8_MAX;
190  }
191  return rz_read_ble8(src);
192 }

References rz_read_ble8(), src, and UT8_MAX.

Referenced by rz_analysis_walkthrough_casetbl(), rz_analysis_walkthrough_jmptbl(), and rz_mem_get_num().

◆ rz_read_le_double()

static double rz_read_le_double ( const void *  src)
inlinestatic

Definition at line 315 of file rz_endian.h.

315  {
316  union {
317  ut64 bits;
318  double dbl;
319  } p;
320  p.bits = rz_read_le64(src);
321  return p.dbl;
322 }

References bits(), p, rz_read_le64(), src, and ut64().

Referenced by rz_read_at_le_double().

◆ rz_read_le_float()

static float rz_read_le_float ( const void *  src)
inlinestatic

Definition at line 287 of file rz_endian.h.

287  {
288  union {
289  ut32 bits;
290  float flt;
291  } p;
292  p.bits = rz_read_le32(src);
293  return p.flt;
294 }

References bits(), p, rz_read_le32(), and src.

Referenced by rz_read_at_le_float().

◆ rz_read_me16()

static ut16 rz_read_me16 ( const void *  src)
inlinestatic

Definition at line 361 of file rz_endian.h.

361  {
362  if (!src) {
363  return UT16_MAX;
364  }
365  const ut8 *s = (const ut8 *)src;
366  return (((ut16)s[0]) << 8) | (((ut16)s[1]) << 0);
367 }

References s, src, and UT16_MAX.

Referenced by rz_read_at_me16().

◆ rz_read_me32()

static ut32 rz_read_me32 ( const void *  src)
inlinestatic

Definition at line 387 of file rz_endian.h.

387  {
388  if (!src) {
389  return UT32_MAX;
390  }
391  const ut8 *s = (const ut8 *)src;
392  return (((ut32)s[2]) << 24) | (((ut32)s[3]) << 16) |
393  (((ut32)s[0]) << 8) | (((ut32)s[1]) << 0);
394 }

References s, src, and UT32_MAX.

Referenced by rz_read_at_me32(), rz_read_me64(), and rz_read_me_float().

◆ rz_read_me64()

static ut64 rz_read_me64 ( const void *  src)
inlinestatic

Definition at line 414 of file rz_endian.h.

414  {
415  ut64 val = ((ut64)(rz_read_at_me32(src, sizeof(ut32)))) << 32;
416  val |= rz_read_me32(src);
417  return val;
418 }
static ut32 rz_read_at_me32(const void *src, size_t offset)
Definition: rz_endian.h:396

References rz_read_at_me32(), rz_read_me32(), src, ut64(), and val.

Referenced by rz_read_at_me64(), and rz_read_me_double().

◆ rz_read_me8()

static ut8 rz_read_me8 ( const void *  src)
inlinestatic

Definition at line 345 of file rz_endian.h.

345  {
346  return src ? rz_read_ble8(src) : UT8_MAX;
347 }

References rz_read_ble8(), src, and UT8_MAX.

◆ rz_read_me_double()

static double rz_read_me_double ( const void *  src)
inlinestatic

Definition at line 463 of file rz_endian.h.

463  {
464  union {
465  ut64 bits;
466  double dbl;
467  } p;
468  p.bits = rz_read_me64(src);
469  return p.dbl;
470 }

References bits(), p, rz_read_me64(), src, and ut64().

Referenced by rz_read_at_me_double().

◆ rz_read_me_float()

static float rz_read_me_float ( const void *  src)
inlinestatic

Definition at line 435 of file rz_endian.h.

435  {
436  union {
437  ut32 bits;
438  float flt;
439  } p;
440  p.bits = rz_read_me32(src);
441  return p.flt;
442 }

References bits(), p, rz_read_me32(), and src.

Referenced by rz_read_at_me_float().

◆ rz_swap_st16()

static st16 rz_swap_st16 ( st16  val)
inlinestatic

Definition at line 575 of file rz_endian.h.

575  {
576  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
577  return (val << 16) | (val >> 16);
578 }

References val.

◆ rz_swap_st32()

static st32 rz_swap_st32 ( st32  val)
inlinestatic

Definition at line 585 of file rz_endian.h.

585  {
586  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
587  return (val << 16) | ((val >> 16) & 0xFFFF);
588 }

References val.

◆ rz_swap_st64()

static st64 rz_swap_st64 ( st64  val)
inlinestatic

Definition at line 596 of file rz_endian.h.

596  {
597  val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL);
598  val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL);
599  return (val << 32) | ((val >> 32) & 0xFFFFFFFFULL);
600 }

References val.

◆ rz_swap_ut16()

static ut16 rz_swap_ut16 ( ut16  val)
inlinestatic

Definition at line 571 of file rz_endian.h.

571  {
572  return (val << 8) | (val >> 8);
573 }

References val.

Referenced by write_big_reg(), and write_reg_val().

◆ rz_swap_ut32()

static ut32 rz_swap_ut32 ( ut32  val)
inlinestatic

Definition at line 580 of file rz_endian.h.

580  {
581  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
582  return (val << 16) | (val >> 16);
583 }

References val.

Referenced by mips_op(), write_big_reg(), and write_reg_val().

◆ rz_swap_ut64()

static ut64 rz_swap_ut64 ( ut64  val)
inlinestatic

Definition at line 590 of file rz_endian.h.

590  {
591  val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL);
592  val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL);
593  return (val << 32) | (val >> 32);
594 }

References val.

Referenced by write_big_reg(), and write_reg_val().

◆ rz_write_at_be16()

static void rz_write_at_be16 ( void *  dest,
ut16  val,
size_t  offset 
)
inlinestatic

Definition at line 65 of file rz_endian.h.

65  {
66  ut8 *d = (ut8 *)dest + offset;
68 }
char * dest
Definition: lz4.h:697
static void rz_write_be16(void *dest, ut16 val)
Definition: rz_endian.h:60
#define d(i)
Definition: sha256.c:44

References d, dest, rz_write_be16(), and val.

Referenced by rz_write_be32().

◆ rz_write_at_be32()

static void rz_write_at_be32 ( void *  dest,
ut32  val,
size_t  offset 
)
inlinestatic

Definition at line 103 of file rz_endian.h.

103  {
104  ut8 *d = (ut8 *)dest + offset;
105  rz_write_be32(d, val);
106 }
static void rz_write_be32(void *dest, ut32 val)
Definition: rz_endian.h:98

References d, dest, rz_write_be32(), and val.

Referenced by _createKDNetPacket(), rz_sha1_fini(), and rz_write_be64().

◆ rz_write_at_be64()

static void rz_write_at_be64 ( void *  dest,
ut64  val,
size_t  offset 
)
inlinestatic

Definition at line 124 of file rz_endian.h.

124  {
125  ut8 *d = (ut8 *)dest + offset;
126  rz_write_be64(d, val);
127 }
static void rz_write_be64(void *dest, ut64 val)
Definition: rz_endian.h:119

References d, dest, rz_write_be64(), and val.

Referenced by _createKDNetPacket().

◆ rz_write_at_be8()

static void rz_write_at_be8 ( void *  dest,
ut8  val,
size_t  offset 
)
inlinestatic

Definition at line 46 of file rz_endian.h.

46  {
48 }
static void rz_write_at_ble8(void *dest, ut8 val, size_t offset)
Definition: rz_endian.h:27

References dest, rz_write_at_ble8(), and val.

Referenced by _createKDNetPacket(), and rz_write_be16().

◆ rz_write_at_be_double()

static void rz_write_at_be_double ( void *  dest,
double  val,
size_t  offset 
)
inlinestatic

Definition at line 180 of file rz_endian.h.

180  {
181  ut8 *d = (ut8 *)dest + offset;
183 }
static void rz_write_be_double(void *dest, double val)
Definition: rz_endian.h:171

References d, dest, rz_write_be_double(), and val.

◆ rz_write_at_be_float()

static void rz_write_at_be_float ( void *  dest,
float  val,
size_t  offset 
)
inlinestatic

Definition at line 152 of file rz_endian.h.

152  {
153  ut8 *d = (ut8 *)dest + offset;
155 }
static void rz_write_be_float(void *dest, float val)
Definition: rz_endian.h:143

References d, dest, rz_write_be_float(), and val.

◆ rz_write_at_ble8()

static void rz_write_at_ble8 ( void *  dest,
ut8  val,
size_t  offset 
)
inlinestatic

Definition at line 27 of file rz_endian.h.

27  {
28  ut8 *d = (ut8 *)dest + offset;
30 }
static void rz_write_ble8(void *dest, ut8 val)
Definition: rz_endian.h:23

References d, dest, rz_write_ble8(), and val.

Referenced by rz_write_at_be8(), rz_write_at_le8(), and rz_write_at_me8().

◆ rz_write_at_le16()

static void rz_write_at_le16 ( void *  dest,
ut16  val,
size_t  offset 
)
inlinestatic

Definition at line 227 of file rz_endian.h.

227  {
228  ut8 *d = (ut8 *)dest + offset;
229  rz_write_le16(d, val);
230 }
static void rz_write_le16(void *dest, ut16 val)
Definition: rz_endian.h:222

References d, dest, rz_write_le16(), and val.

Referenced by rz_write_le32(), update(), and write_image_section_header().

◆ rz_write_at_le32()

static void rz_write_at_le32 ( void *  dest,
ut32  val,
size_t  offset 
)
inlinestatic

Definition at line 261 of file rz_endian.h.

261  {
262  ut8 *d = ((ut8 *)dest) + offset;
263  rz_write_le32(d, val);
264 }
static void rz_write_le32(void *dest, ut32 val)
Definition: rz_endian.h:256

References d, dest, rz_write_le32(), and val.

Referenced by avr_custom_des(), rz_md4_fini(), rz_write_le64(), and write_image_section_header().

◆ rz_write_at_le64()

static void rz_write_at_le64 ( void *  dest,
ut64  val,
size_t  offset 
)
inlinestatic

Definition at line 282 of file rz_endian.h.

282  {
283  ut8 *d = (ut8 *)dest + offset;
284  rz_write_le64(d, val);
285 }
static void rz_write_le64(void *dest, ut64 val)
Definition: rz_endian.h:277

References d, dest, rz_write_le64(), and val.

◆ rz_write_at_le8()

static void rz_write_at_le8 ( void *  dest,
ut8  val,
size_t  offset 
)
inlinestatic

Definition at line 202 of file rz_endian.h.

202  {
204 }

References dest, rz_write_at_ble8(), and val.

Referenced by rz_write_le16().

◆ rz_write_at_le_double()

static void rz_write_at_le_double ( void *  dest,
double  val,
size_t  offset 
)
inlinestatic

Definition at line 338 of file rz_endian.h.

338  {
339  ut8 *d = (ut8 *)dest + offset;
341 }
static void rz_write_le_double(void *dest, double val)
Definition: rz_endian.h:329

References d, dest, rz_write_le_double(), and val.

◆ rz_write_at_le_float()

static void rz_write_at_le_float ( void *  dest,
float  val,
size_t  offset 
)
inlinestatic

Definition at line 310 of file rz_endian.h.

310  {
311  ut8 *d = (ut8 *)dest + offset;
313 }
static void rz_write_le_float(void *dest, float val)
Definition: rz_endian.h:301

References d, dest, rz_write_le_float(), and val.

◆ rz_write_at_me16()

static void rz_write_at_me16 ( void *  dest,
ut16  val,
size_t  offset 
)
inlinestatic

Definition at line 382 of file rz_endian.h.

382  {
383  ut8 *d = (ut8 *)dest + offset;
384  rz_write_me16(d, val);
385 }
static void rz_write_me16(void *dest, ut16 val)
Definition: rz_endian.h:377

References d, dest, rz_write_me16(), and val.

Referenced by rz_write_me32().

◆ rz_write_at_me32()

static void rz_write_at_me32 ( void *  dest,
ut32  val,
size_t  offset 
)
inlinestatic

Definition at line 409 of file rz_endian.h.

409  {
410  ut8 *d = ((ut8 *)dest) + offset;
411  rz_write_me32(d, val);
412 }
static void rz_write_me32(void *dest, ut32 val)
Definition: rz_endian.h:404

References d, dest, rz_write_me32(), and val.

Referenced by rz_write_me64().

◆ rz_write_at_me64()

static void rz_write_at_me64 ( void *  dest,
ut64  val,
size_t  offset 
)
inlinestatic

Definition at line 430 of file rz_endian.h.

430  {
431  ut8 *d = (ut8 *)dest + offset;
432  rz_write_me64(d, val);
433 }
static void rz_write_me64(void *dest, ut64 val)
Definition: rz_endian.h:425

References d, dest, rz_write_me64(), and val.

◆ rz_write_at_me8()

static void rz_write_at_me8 ( void *  dest,
ut8  val,
size_t  offset 
)
inlinestatic

Definition at line 357 of file rz_endian.h.

357  {
359 }

References dest, rz_write_at_ble8(), and val.

Referenced by rz_write_me16().

◆ rz_write_at_me_double()

static void rz_write_at_me_double ( void *  dest,
double  val,
size_t  offset 
)
inlinestatic

Definition at line 486 of file rz_endian.h.

486  {
487  ut8 *d = (ut8 *)dest + offset;
489 }
static void rz_write_me_double(void *dest, double val)
Definition: rz_endian.h:477

References d, dest, rz_write_me_double(), and val.

◆ rz_write_at_me_float()

static void rz_write_at_me_float ( void *  dest,
float  val,
size_t  offset 
)
inlinestatic

Definition at line 458 of file rz_endian.h.

458  {
459  ut8 *d = (ut8 *)dest + offset;
461 }
static void rz_write_me_float(void *dest, float val)
Definition: rz_endian.h:449

References d, dest, rz_write_me_float(), and val.

◆ rz_write_be16()

static void rz_write_be16 ( void *  dest,
ut16  val 
)
inlinestatic

Definition at line 60 of file rz_endian.h.

60  {
61  rz_write_be8(dest, val >> 8);
62  rz_write_at_be8(dest, (ut8)val, sizeof(ut8));
63 }
static void rz_write_at_be8(void *dest, ut8 val, size_t offset)
Definition: rz_endian.h:46
static void rz_write_be8(void *dest, ut8 val)
Definition: rz_endian.h:42

References dest, rz_write_at_be8(), rz_write_be8(), and val.

Referenced by assemble(), encode_addr16(), encode_const_pool16(), encode_const_pool16_ut8(), encode_st16(), plugin_crca_final(), rz_core_transform_op(), rz_reg_set_value(), rz_write_at_be16(), rz_write_be32(), and rz_write_ble16().

◆ rz_write_be24()

static void rz_write_be24 ( void *  _dest,
ut32  val 
)
inlinestatic

Definition at line 80 of file rz_endian.h.

80  {
81  ut8 *dest = (ut8 *)_dest;
82  rz_write_be8(dest++, val >> 16);
83  rz_write_be8(dest++, val >> 8);
85 }

References dest, rz_write_be8(), and val.

Referenced by rz_write_ble24().

◆ rz_write_be32()

◆ rz_write_be64()

static void rz_write_be64 ( void *  dest,
ut64  val 
)
inlinestatic

◆ rz_write_be8()

static void rz_write_be8 ( void *  dest,
ut8  val 
)
inlinestatic

Definition at line 42 of file rz_endian.h.

42  {
44 }

References dest, rz_write_ble8(), and val.

Referenced by plugin_crca_final(), rz_write_be16(), and rz_write_be24().

◆ rz_write_be_double()

static void rz_write_be_double ( void *  dest,
double  val 
)
inlinestatic

Definition at line 171 of file rz_endian.h.

171  {
172  union {
173  ut64 bits;
174  double dbl;
175  } p;
176  p.dbl = val;
177  rz_write_be64(dest, p.bits);
178 }

References bits(), dest, p, rz_write_be64(), ut64(), and val.

Referenced by rz_entropy_final(), and rz_write_at_be_double().

◆ rz_write_be_float()

static void rz_write_be_float ( void *  dest,
float  val 
)
inlinestatic

Definition at line 143 of file rz_endian.h.

143  {
144  union {
145  ut32 bits;
146  float flt;
147  } p;
148  p.flt = val;
149  rz_write_be32(dest, p.bits);
150 }

References bits(), dest, p, rz_write_be32(), and val.

Referenced by rz_write_at_be_float().

◆ rz_write_ble()

static void rz_write_ble ( void *  dst,
ut64  val,
bool  big_endian,
int  size 
)
inlinestatic

Definition at line 548 of file rz_endian.h.

548  {
549  switch (size) {
550  case 8:
551  ((ut8 *)dst)[0] = (ut8)val;
552  break;
553  case 16:
554  rz_write_ble16(dst, (ut16)val, big_endian);
555  break;
556  case 24:
557  rz_write_ble24(dst, (ut32)val, big_endian);
558  break;
559  case 32:
560  rz_write_ble32(dst, (ut32)val, big_endian);
561  break;
562  case 64:
563  rz_write_ble64(dst, val, big_endian);
564  break;
565  default:
566  break;
567  }
568 }
#define ut8
Definition: dcpu16.h:8
char * dst
Definition: lz4.h:724
static void rz_write_ble32(void *dest, ut32 val, bool big_endian)
Definition: rz_endian.h:540
static void rz_write_ble64(void *dest, ut64 val, bool big_endian)
Definition: rz_endian.h:544
static void rz_write_ble16(void *dest, ut16 val, bool big_endian)
Definition: rz_endian.h:532
static void rz_write_ble24(void *dest, ut32 val, bool big_endian)
Definition: rz_endian.h:536

References dst, rz_write_ble16(), rz_write_ble24(), rz_write_ble32(), rz_write_ble64(), ut8, and val.

Referenced by _patch_reloc(), analysis_mask(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), esil_poke_n(), esil_poke_some(), rz_core_write_seq_at(), rz_egg_patch_num(), and rz_io_write_i().

◆ rz_write_ble16()

static void rz_write_ble16 ( void *  dest,
ut16  val,
bool  big_endian 
)
inlinestatic

◆ rz_write_ble24()

static void rz_write_ble24 ( void *  dest,
ut32  val,
bool  big_endian 
)
inlinestatic

Definition at line 536 of file rz_endian.h.

536  {
537  big_endian ? rz_write_be24(dest, val) : rz_write_le24(dest, val);
538 }
static void rz_write_be24(void *_dest, ut32 val)
Definition: rz_endian.h:80
static void rz_write_le24(void *_dest, ut32 val)
Definition: rz_endian.h:232

References dest, rz_write_be24(), rz_write_le24(), and val.

Referenced by rz_write_ble().

◆ rz_write_ble32()

static void rz_write_ble32 ( void *  dest,
ut32  val,
bool  big_endian 
)
inlinestatic

◆ rz_write_ble64()

static void rz_write_ble64 ( void *  dest,
ut64  val,
bool  big_endian 
)
inlinestatic

◆ rz_write_ble8()

static void rz_write_ble8 ( void *  dest,
ut8  val 
)
inlinestatic

Definition at line 23 of file rz_endian.h.

23  {
24  *(ut8 *)dest = val;
25 }

References dest, and val.

Referenced by rz_core_write_value_at(), rz_core_write_value_inc_at(), rz_reg_set_value(), rz_write_at_ble8(), rz_write_be8(), rz_write_le8(), and rz_write_me8().

◆ rz_write_le16()

static void rz_write_le16 ( void *  dest,
ut16  val 
)
inlinestatic

Definition at line 222 of file rz_endian.h.

222  {
224  rz_write_at_le8(dest, val >> 8, sizeof(ut8));
225 }
static void rz_write_at_le8(void *dest, ut8 val, size_t offset)
Definition: rz_endian.h:202
static void rz_write_le8(void *dest, ut8 val)
Definition: rz_endian.h:198

References dest, rz_write_at_le8(), rz_write_le8(), and val.

Referenced by assemble(), relocs_foreach(), rz_fletcher16_final(), rz_mem_set_num(), rz_reg_set_value(), rz_write_at_le16(), rz_write_ble16(), rz_write_le32(), rz_xor16_final(), and v_writebuf().

◆ rz_write_le24()

static void rz_write_le24 ( void *  _dest,
ut32  val 
)
inlinestatic

Definition at line 232 of file rz_endian.h.

232  {
233  ut8 *dest = (ut8 *)_dest;
234  rz_write_le8(dest++, val);
235  rz_write_le8(dest++, val >> 8);
236  rz_write_le8(dest, val >> 16);
237 }

References dest, rz_write_le8(), and val.

Referenced by rz_write_ble24().

◆ rz_write_le32()

static void rz_write_le32 ( void *  dest,
ut32  val 
)
inlinestatic

◆ rz_write_le64()

static void rz_write_le64 ( void *  dest,
ut64  val 
)
inlinestatic

◆ rz_write_le8()

static void rz_write_le8 ( void *  dest,
ut8  val 
)
inlinestatic

Definition at line 198 of file rz_endian.h.

198  {
200 }

References dest, rz_write_ble8(), and val.

Referenced by rz_fletcher8_final(), rz_mem_set_num(), rz_write_le16(), rz_write_le24(), and v_writebuf().

◆ rz_write_le_double()

static void rz_write_le_double ( void *  dest,
double  val 
)
inlinestatic

Definition at line 329 of file rz_endian.h.

329  {
330  union {
331  ut64 bits;
332  double dbl;
333  } p;
334  p.dbl = val;
335  rz_write_le64(dest, p.bits);
336 }

References bits(), dest, p, rz_write_le64(), ut64(), and val.

Referenced by rz_write_at_le_double().

◆ rz_write_le_float()

static void rz_write_le_float ( void *  dest,
float  val 
)
inlinestatic

Definition at line 301 of file rz_endian.h.

301  {
302  union {
303  ut32 bits;
304  float flt;
305  } p;
306  p.flt = val;
307  rz_write_le32(dest, p.bits);
308 }

References bits(), dest, p, rz_write_le32(), and val.

Referenced by rz_write_at_le_float().

◆ rz_write_me16()

static void rz_write_me16 ( void *  dest,
ut16  val 
)
inlinestatic

Definition at line 377 of file rz_endian.h.

377  {
378  rz_write_me8(dest, val >> 8);
379  rz_write_at_me8(dest, (ut8)val, sizeof(ut8));
380 }
static void rz_write_me8(void *dest, ut8 val)
Definition: rz_endian.h:353
static void rz_write_at_me8(void *dest, ut8 val, size_t offset)
Definition: rz_endian.h:357

References dest, rz_write_at_me8(), rz_write_me8(), and val.

Referenced by rz_write_at_me16(), and rz_write_me32().

◆ rz_write_me32()

static void rz_write_me32 ( void *  dest,
ut32  val 
)
inlinestatic

Definition at line 404 of file rz_endian.h.

404  {
406  rz_write_at_me16(dest, val >> 16, sizeof(ut16));
407 }
static void rz_write_at_me16(void *dest, ut16 val, size_t offset)
Definition: rz_endian.h:382

References dest, rz_write_at_me16(), rz_write_me16(), and val.

Referenced by rz_write_at_me32(), rz_write_me64(), and rz_write_me_float().

◆ rz_write_me64()

static void rz_write_me64 ( void *  dest,
ut64  val 
)
inlinestatic

Definition at line 425 of file rz_endian.h.

425  {
427  rz_write_at_me32(dest, val >> 32, sizeof(ut32));
428 }
static void rz_write_at_me32(void *dest, ut32 val, size_t offset)
Definition: rz_endian.h:409

References dest, rz_write_at_me32(), rz_write_me32(), and val.

Referenced by rz_write_at_me64(), and rz_write_me_double().

◆ rz_write_me8()

static void rz_write_me8 ( void *  dest,
ut8  val 
)
inlinestatic

Definition at line 353 of file rz_endian.h.

353  {
355 }

References dest, rz_write_ble8(), and val.

Referenced by rz_write_me16().

◆ rz_write_me_double()

static void rz_write_me_double ( void *  dest,
double  val 
)
inlinestatic

Definition at line 477 of file rz_endian.h.

477  {
478  union {
479  ut64 bits;
480  double dbl;
481  } p;
482  p.dbl = val;
483  rz_write_me64(dest, p.bits);
484 }

References bits(), dest, p, rz_write_me64(), ut64(), and val.

Referenced by rz_write_at_me_double().

◆ rz_write_me_float()

static void rz_write_me_float ( void *  dest,
float  val 
)
inlinestatic

Definition at line 449 of file rz_endian.h.

449  {
450  union {
451  ut32 bits;
452  float flt;
453  } p;
454  p.flt = val;
455  rz_write_me32(dest, p.bits);
456 }

References bits(), dest, p, rz_write_me32(), and val.

Referenced by rz_write_at_me_float().

◆ UT16_ADD()

static int UT16_ADD ( ut16 r,
ut16  a,
ut16  b 
)
inlinestatic

Definition at line 663 of file rz_endian.h.

663  {
664  if (UT16_MAX - a < b) {
665  return 0;
666  }
667  if (r) {
668  *r = a + b;
669  }
670  return 1;
671 }
#define r
Definition: crypto_rc6.c:12
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41

References a, b, r, and UT16_MAX.

◆ UT16_MUL()

static int UT16_MUL ( ut16 r,
ut16  a,
ut16  b 
)
inlinestatic

Definition at line 673 of file rz_endian.h.

673  {
674  if (a && UT16_MAX / a < b) {
675  return 0;
676  }
677  if (r) {
678  *r = a * b;
679  }
680  return 1;
681 }

References a, b, r, and UT16_MAX.

◆ UT16_SUB()

static int UT16_SUB ( ut16 r,
ut16  a,
ut16  b 
)
inlinestatic

Definition at line 683 of file rz_endian.h.

683  {
684  if (b > a) {
685  return 0;
686  }
687  if (r) {
688  *r = a - b;
689  }
690  return 1;
691 }

References a, b, and r.

◆ UT32_ADD()

static int UT32_ADD ( ut32 r,
ut32  a,
ut32  b 
)
inlinestatic

Definition at line 633 of file rz_endian.h.

633  {
634  if (UT32_MAX - a < b) {
635  return 0;
636  }
637  if (r) {
638  *r = a + b;
639  }
640  return 1;
641 }

References a, b, r, and UT32_MAX.

Referenced by rz_bin_elf_add_addr(), and rz_bin_elf_add_off().

◆ UT32_MUL()

static int UT32_MUL ( ut32 r,
ut32  a,
ut32  b 
)
inlinestatic

Definition at line 643 of file rz_endian.h.

643  {
644  if (a && UT32_MAX / a < b) {
645  return 0;
646  }
647  if (r) {
648  *r = a * b;
649  }
650  return 1;
651 }

References a, b, r, and UT32_MAX.

Referenced by parse_dysymtab(), parse_segments(), parse_symtab(), rz_bin_elf_mul_addr(), and rz_bin_elf_mul_off().

◆ UT32_SUB()

static int UT32_SUB ( ut32 r,
ut32  a,
ut32  b 
)
inlinestatic

Definition at line 653 of file rz_endian.h.

653  {
654  if (b > a) {
655  return 0;
656  }
657  if (r) {
658  *r = a - b;
659  }
660  return 1;
661 }

References a, b, and r.

◆ UT64_ADD()

static int UT64_ADD ( ut64 r,
ut64  a,
ut64  b 
)
inlinestatic

Definition at line 603 of file rz_endian.h.

603  {
604  if (UT64_MAX - a < b) {
605  return 0;
606  }
607  if (r) {
608  *r = a + b;
609  }
610  return 1;
611 }

References a, b, r, and UT64_MAX.

Referenced by rz_bin_elf_add_addr(), and rz_bin_elf_add_off().

◆ UT64_MUL()

static int UT64_MUL ( ut64 r,
ut64  a,
ut64  b 
)
inlinestatic

Definition at line 613 of file rz_endian.h.

613  {
614  if (a && UT64_MAX / a < b) {
615  return 0;
616  }
617  if (r) {
618  *r = a * b;
619  }
620  return 1;
621 }

References a, b, r, and UT64_MAX.

Referenced by rz_bin_elf_mul_addr(), and rz_bin_elf_mul_off().

◆ UT64_SUB()

static int UT64_SUB ( ut64 r,
ut64  a,
ut64  b 
)
inlinestatic

Definition at line 623 of file rz_endian.h.

623  {
624  if (b > a) {
625  return 0;
626  }
627  if (r) {
628  *r = a - b;
629  }
630  return 1;
631 }

References a, b, and r.

◆ UT8_ADD()

static int UT8_ADD ( ut8 r,
ut8  a,
ut8  b 
)
inlinestatic

Definition at line 693 of file rz_endian.h.

693  {
694  if (UT8_MAX - a < b) {
695  return 0;
696  }
697  if (r) {
698  *r = a + b;
699  }
700  return 1;
701 }

References a, b, r, and UT8_MAX.

◆ UT8_MUL()

static int UT8_MUL ( ut8 r,
ut8  a,
ut8  b 
)
inlinestatic

Definition at line 703 of file rz_endian.h.

703  {
704  if (a && UT8_MAX / a < b) {
705  return 0;
706  }
707  if (r) {
708  *r = a * b;
709  }
710  return 1;
711 }

References a, b, r, and UT8_MAX.

◆ UT8_SUB()

static int UT8_SUB ( ut8 r,
ut8  a,
ut8  b 
)
inlinestatic

Definition at line 713 of file rz_endian.h.

713  {
714  if (b > a) {
715  return 0;
716  }
717  if (r) {
718  *r = a - b;
719  }
720  return 1;
721 }

References a, b, and r.