Rizin
unix-like reverse engineering framework and cli tools
rz_uleb128.h
Go to the documentation of this file.
1 #ifndef RZ_ULEB128_H
2 #define RZ_ULEB128_H
3 
4 #include <rz_types.h>
5 
6 // LEB128 or Little Endian Base 128 is a form of variable-length code
7 // compression used to store an arbitrarily large integer in a small number of
8 // bytes. LEB128 is used in the DWARF debug file format.
9 
10 RZ_API const ut8 *rz_uleb128(const ut8 *data, int datalen, RZ_NULLABLE ut64 *v, const char **error);
11 RZ_API const ut8 *rz_uleb128_decode(const ut8 *data, int *datalen, ut64 *v);
12 RZ_API int rz_uleb128_len(const ut8 *data, int size);
13 RZ_API ut8 *rz_uleb128_encode(const ut64 s, int *len);
14 RZ_API const ut8 *rz_leb128(const ut8 *data, int datalen, st64 *v);
15 RZ_API st64 rz_sleb128(const ut8 **data, const ut8 *end);
16 RZ_API size_t read_u32_leb128(const ut8 *p, const ut8 *max, ut32 *out_val);
17 RZ_API size_t read_i32_leb128(const ut8 *p, const ut8 *max, st32 *out_val);
18 RZ_API size_t read_u64_leb128(const ut8 *p, const ut8 *max, ut64 *out_val);
19 RZ_API size_t read_i64_leb128(const ut8 *p, const ut8 *max, st64 *out_val);
20 #endif // RZ_ULEB128_H
size_t len
Definition: 6502dis.c:15
#define RZ_API
uint32_t ut32
const char * v
Definition: dsignal.c:12
int max
Definition: enough.c:225
voidpf void uLong size
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
void * p
Definition: libc.cpp:67
static RzSocket * s
Definition: rtr.c:28
#define RZ_NULLABLE
Definition: rz_types.h:65
#define st64
Definition: rz_types_base.h:10
#define st32
Definition: rz_types_base.h:12
RZ_API const ut8 * rz_uleb128(const ut8 *data, int datalen, RZ_NULLABLE ut64 *v, const char **error)
Definition: uleb128.c:9
RZ_API size_t read_i32_leb128(const ut8 *p, const ut8 *max, st32 *out_val)
Definition: uleb128.c:211
RZ_API size_t read_i64_leb128(const ut8 *p, const ut8 *max, st64 *out_val)
Definition: uleb128.c:282
RZ_API const ut8 * rz_leb128(const ut8 *data, int datalen, st64 *v)
Definition: uleb128.c:117
RZ_API const ut8 * rz_uleb128_decode(const ut8 *data, int *datalen, ut64 *v)
Definition: uleb128.c:71
RZ_API size_t read_u64_leb128(const ut8 *p, const ut8 *max, ut64 *out_val)
Definition: uleb128.c:244
RZ_API int rz_uleb128_len(const ut8 *data, int size)
Definition: uleb128.c:57
RZ_API st64 rz_sleb128(const ut8 **data, const ut8 *end)
Definition: uleb128.c:145
RZ_API ut8 * rz_uleb128_encode(const ut64 s, int *len)
Definition: uleb128.c:89
RZ_API size_t read_u32_leb128(const ut8 *p, const ut8 *max, ut32 *out_val)
Definition: uleb128.c:186
void error(const char *msg)
Definition: untgz.c:593
ut64(WINAPI *w32_GetEnabledXStateFeatures)()