8 #define DEX_INVALID_CLASS "Lunknown_class;"
9 #define DEX_INVALID_METHOD "unknown_method"
16 #define read_le_bits_or_fail(bits, buf, val, fail) \
18 if (!rz_buf_read_le##bits(buf, &val)) { \
23 #define read_le_at_bits_or_fail(bits, buf, val, offset, fail) \
25 if (!rz_buf_read_le##bits##_at(buf, offset, &val)) { \
30 #define read_le32_or_fail(buf, val, fail) read_le_bits_or_fail(32, buf, val, fail)
31 #define read_le16_or_fail(buf, val, fail) read_le_bits_or_fail(16, buf, val, fail)
32 #define read_le32_at_or_fail(buf, val, offset, fail) read_le_at_bits_or_fail(32, buf, val, offset, fail)
33 #define read_le16_at_or_fail(buf, val, offset, fail) read_le_at_bits_or_fail(16, buf, val, offset, fail)
35 #define dex_is_static(a) (a & ACCESS_FLAG_STATIC)
36 #define dex_is_varargs(a) (a & ACCESS_FLAG_VARARGS)
38 #define dex_fail_if_bad_ids(name, z, s, g) \
40 ut64 end = name##_offset; \
41 end += name##_size * (z); \
47 #define CLASS_ACCESS_FLAGS_SIZE 18
118 ut32 parameters_offset = 0;
124 if (parameters_offset > 0) {
131 goto dex_proto_id_new_fail;
134 parameters_offset +=
sizeof(
ut32);
142 dex_proto_id_new_fail:
147 #define dex_field_id_free free
160 dex_field_id_new_fail:
165 #define dex_method_id_free free
178 dex_method_id_new_fail:
197 if (!encoded_field) {
208 *diff_value_prev = diff_value;
210 encoded_field->
field_idx = *diff_value_prev + diff_value;
211 *diff_value_prev = encoded_field->
field_idx;
213 return encoded_field;
218 if (!encoded_method) {
222 ut64 code_offset = 0;
231 *diff_value_prev = diff_value;
233 encoded_method->
method_idx = *diff_value_prev + diff_value;
234 *diff_value_prev = encoded_method->
method_idx;
237 if (code_offset > 0) {
245 encoded_method->
code_offset = code_offset + 16 + base;
255 return encoded_method;
257 dex_new_encoded_method_fail:
258 free(encoded_method);
268 ut64 static_fields_size = 0;
269 ut64 instance_fields_size = 0;
270 ut64 direct_methods_size = 0;
271 ut64 virtual_methods_size = 0;
272 ut64 diff_value_prev;
293 goto dex_class_def_new_fail;
299 goto dex_class_def_new_fail;
312 goto dex_class_def_new_fail;
320 for (
ut64 i = 0;
i < static_fields_size; ++
i) {
324 goto dex_class_def_new_fail;
328 for (
ut64 i = 0;
i < instance_fields_size; ++
i) {
332 goto dex_class_def_new_fail;
336 for (
ut64 i = 0;
i < direct_methods_size; ++
i) {
339 free(encoded_method);
340 goto dex_class_def_new_fail;
344 for (
ut64 i = 0;
i < virtual_methods_size; ++
i) {
347 free(encoded_method);
348 goto dex_class_def_new_fail;
354 dex_class_def_new_fail:
365 if (method_id == to_resolve ||
366 method_id->
class_idx != superclass_idx ||
415 rz_list_foreach (class_def->
direct_methods, iter_l, encoded_method) {
485 RZ_LOG_ERROR(
"dex bin: invalid buffer size (size < 116)\n");
539 ut32 string_offset = 0;
662 free(dex->relocs_code);
717 if (access_flags & afr->
flag) {
752 bstr->
paddr =
string->offset;
755 bstr->
length =
string->size;
756 bstr->
size =
string->size;
777 RZ_LOG_INFO(
"cannot find string with index %u\n", string_idx);
785 RZ_LOG_INFO(
"cannot find type_id with index %u\n", type_idx);
794 RZ_LOG_INFO(
"cannot find proto_id with index %u\n", proto_idx);
822 RZ_LOG_INFO(
"cannot find param string with index %d\n", dex->
types[type_idx]);
900 if (!library || library[0] !=
'L') {
903 char *demangled =
strdup(library + 1);
905 demangled[strlen(demangled) - 1] = 0;
953 }
else if (inserted[encoded_method->
method_idx]) {
970 }
else if (inserted[encoded_method->
method_idx]) {
1017 rz_list_foreach (class_def->
static_fields, it, encoded_field) {
1021 }
else if (inserted[encoded_field->
field_idx]) {
1024 inserted[encoded_field->
field_idx] =
true;
1038 }
else if (inserted[encoded_field->
field_idx]) {
1041 inserted[encoded_field->
field_idx] =
true;
1084 rz_list_foreach (class_def->
static_fields, it, encoded_field) {
1090 inserted[encoded_field->
field_idx] =
true;
1105 inserted[encoded_field->
field_idx] =
true;
1144 if ((n_methods > 0 && !inserted_methods) || (n_fields > 0 && !inserted_fields)) {
1145 free(inserted_fields);
1146 free(inserted_methods);
1152 free(inserted_fields);
1153 free(inserted_methods);
1178 free(inserted_fields);
1179 free(inserted_methods);
1219 if (dex->relocs_code) {
1240 if (n_fields > 0 && !inserted) {
1283 if ((n_methods > 0 && !inserted_methods) || (n_fields > 0 && !inserted_fields)) {
1284 free(inserted_fields);
1285 free(inserted_methods);
1291 free(inserted_fields);
1292 free(inserted_methods);
1300 if (class_symbols) {
1306 if (class_symbols) {
1315 if (inserted_fields[j++]) {
1340 if (inserted_methods[j++]) {
1371 free(inserted_fields);
1372 free(inserted_methods);
1390 if (n_classes < 1) {
1415 bool class_found =
false;
1416 for (
ut32 i = 0;
i < n_classes; ++
i) {
1417 if (
field_id->class_idx == class_ids[
i]) {
1446 import->libname = class_name ?
strdup(
object + 1) :
NULL;
1447 import->classname =
strdup(class_name ? class_name :
object + 1);
1450 import->ordinal = ordinal;
1462 bool class_found =
false;
1463 for (
ut32 i = 0;
i < n_classes; ++
i) {
1494 import->libname = class_name ?
strdup(
object + 1) :
NULL;
1495 import->classname =
strdup(class_name ? class_name :
object + 1);
1498 import->ordinal = ordinal;
1514 return strcmp((
const char *)
a, (
const char *)
b);
1530 if (n_classes < 1) {
1554 bool class_found =
false;
1555 for (
ut32 i = 0;
i < n_classes; ++
i) {
1566 if (
RZ_STR_ISEMPTY(
object) || *
object !=
'L' || !strncmp(
object,
"Ljava/", strlen(
"Ljava/"))) {
1572 if ((
p = strchr(
p,
'/')) && (
p = strchr(
p + 1,
'/'))) {
1598 rz_list_foreach (class_def->
direct_methods, it, encoded_method) {
1610 if (strcmp(
name,
"<init>") != 0 && strcmp(
name,
"<clinit>") != 0) {
1615 if (strcmp(
name,
"main") != 0) {
1643 if (strcmp(
name,
"<init>") != 0 && strcmp(
name,
"<clinit>") != 0) {
1648 if (strcmp(
name,
"main") != 0) {
1703 rz_list_foreach (class_def->
direct_methods, it, encoded_method) {
1720 if (strcmp(
name,
"main") != 0 && strcmp(
name,
"<init>") != 0 && strcmp(
name,
"<clinit>") != 0) {
1735 entrypoint->
paddr = 0;
1764 if (strcmp(
name,
"main") != 0 && strcmp(
name,
"<init>") != 0 && strcmp(
name,
"<clinit>") != 0) {
1779 entrypoint->
paddr = 0;
1823 return dex->relocs_buffer;
1905 RZ_LOG_INFO(
"cannot find string with index %u\n", string_idx);
1917 if (type_idx >= dex->type_ids_size) {
1918 RZ_LOG_INFO(
"cannot find type_id with index %u\n", type_idx);
1921 DexTypeId type_id = dex->types[type_idx];
1932 RZ_LOG_INFO(
"cannot find method with index %u\n", method_idx);
1952 if (type_idx >= dex->type_ids_size) {
1953 RZ_LOG_INFO(
"cannot find type_id with index %u\n", type_idx);
1956 DexTypeId type_id = dex->types[type_idx];
1992 hash->type =
"adler32";
1993 hash->len =
sizeof(dex->checksum);
1994 hash->addr = dex->checksum_offset;
1995 hash->from = dex->checksum_offset +
sizeof(dex->checksum);
1996 hash->to = dex->file_size - hash->from;
2005 hash->type =
"sha1";
2007 hash->addr = dex->signature_offset;
2008 hash->from = dex->signature_offset +
sizeof(dex->signature);
2009 hash->to = dex->file_size - hash->from;
2010 memcpy(hash->buf, dex->signature,
sizeof(dex->signature));
2020 if (!strncmp((
char *)dex->version,
"009", 3)) {
2021 return strdup(
"Android M3 release (Nov-Dec 2007)");
2022 }
else if (!strncmp((
char *)dex->version,
"013", 3)) {
2023 return strdup(
"Android M5 release (Feb-Mar 2008)");
2024 }
else if (!strncmp((
char *)dex->version,
"035", 3)) {
2025 return strdup(
"Android 3.2 (API level 13 and earlier)");
2026 }
else if (!strncmp((
char *)dex->version,
"037", 3)) {
2027 return strdup(
"Android 7 (API level 24 and earlier)");
2028 }
else if (!strncmp((
char *)dex->version,
"038", 3)) {
2029 return strdup(
"Android 8 (API level 26 and earlier)");
2030 }
else if (!strncmp((
char *)dex->version,
"039", 3)) {
2031 return strdup(
"Android 9 (API level 28 and earlier)");
2032 }
else if (!strncmp((
char *)dex->version,
"040", 3)) {
2033 return strdup(
"Android 10+ (Aug 2019)");
const aarch64_field fields[]
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
RZ_API void rz_bin_string_free(void *_str)
RZ_API void rz_bin_field_free(RzBinField *field)
RZ_API void rz_bin_import_free(RzBinImport *imp)
RZ_API void rz_bin_section_free(RzBinSection *bs)
static RzList * classes(RzBinFile *bf)
static RzList * libraries(RzBinFile *bf)
static RzList * entrypoints(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
RzList * imports(RzBinFile *bf)
RzList * sections(RzBinFile *bf)
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 count
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 pread
RZ_API RZ_OWN RzList * rz_bin_dex_symbols(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinSymbol*> containing the dex symbols.
RZ_API RZ_OWN RzList * rz_bin_dex_libraries(RZ_NONNULL RzBinDex *dex)
Returns a RzList<char*> containing the dex libraries.
#define dex_method_id_free
static RzList * dex_resolve_fields_in_class(RzBinDex *dex, DexClassDef *class_def, ut8 *inserted)
static RzBinSection * section_new(const char *name, ut32 perm, ut32 size, ut64 paddr, ut64 vaddr)
static RzBinField * dex_field_to_bin_field(RzBinDex *dex, DexEncodedField *encoded_field, DexFieldId *field_id, bool is_static)
static RzBinSymbol * dex_field_to_symbol(RzBinDex *dex, DexEncodedField *encoded_field, DexFieldId *field_id, bool is_imported)
#define read_le32_at_or_fail(buf, val, offset, fail)
static const DexAccessFlagsReadable access_flags_list[CLASS_ACCESS_FLAGS_SIZE]
RZ_API void rz_bin_dex_checksum(RZ_NONNULL RzBinDex *dex, RZ_NONNULL RzBinHash *hash)
Sets the RzBinHash dex checksum (adler32)
static void dex_proto_id_free(DexProtoId *string)
struct dex_access_flags_readable_t DexAccessFlagsReadable
static RzList * dex_resolve_fields_in_class_as_symbols(RzBinDex *dex, DexClassDef *class_def, ut8 *inserted)
RZ_API void rz_bin_dex_free(RZ_NULLABLE RzBinDex *dex)
Frees a RzBinDex struct.
static RzList * dex_resolve_methods_in_class(RzBinDex *dex, DexClassDef *class_def, ut8 *inserted)
RZ_API RZ_OWN char * rz_bin_dex_resolve_class_by_idx(RZ_NONNULL RzBinDex *dex, ut32 class_idx)
Returns the resolved string linked to the given class id.
static char * dex_resolve_string_id(RzBinDex *dex, ut32 string_idx)
RZ_API RZ_OWN char * rz_bin_dex_resolve_string_by_idx(RZ_NONNULL RzBinDex *dex, ut32 string_idx)
Returns the resolved string linked to the given string id.
static DexEncodedField * dex_new_encoded_field(RzBuffer *buf, ut64 base, ut64 *diff_value_prev, bool first)
#define dex_fail_if_bad_ids(name, z, s, g)
static DexFieldId * dex_field_id_new(RzBuffer *buf, ut64 offset)
RZ_API ut64 rz_bin_dex_resolve_method_offset_by_idx(RZ_NONNULL RzBinDex *dex, ut32 method_idx)
Returns the resolved offset linked to the given method id.
#define read_le16_at_or_fail(buf, val, offset, fail)
static ut64 dex_access_flags_to_bin_flags(ut64 access_flags)
static void free_rz_bin_class(RzBinClass *bclass)
static bool dex_parse(RzBinDex *dex, ut64 base, RzBuffer *buf)
static DexMethodId * dex_method_id_new(RzBuffer *buf, ut64 offset)
#define read_le32_or_fail(buf, val, fail)
RZ_API RZ_OWN char * rz_bin_dex_resolve_method_by_idx(RZ_NONNULL RzBinDex *dex, ut32 method_idx)
Returns the resolved string linked to the given method id.
static bool dex_resolve_symbol_in_class_methods(RzBinDex *dex, DexClassDef *class_def, RzBinSpecialSymbol resolve, ut64 *paddr, ut64 *vaddr)
static char * dex_resolve_type_id(RzBinDex *dex, ut32 type_idx)
RZ_API RZ_OWN RzBinAddr * rz_bin_dex_resolve_symbol(RZ_NONNULL RzBinDex *dex, RzBinSpecialSymbol resolve)
Returns a RzBinAddr pointer containing the resolved RzBinSpecialSymbol.
#define dex_is_varargs(a)
RZ_API RZ_BORROW RzBuffer * rz_bin_dex_relocations(RZ_NONNULL RzBinDex *dex)
RZ_API RZ_OWN RzList * rz_bin_dex_fields(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinField*> containing the dex fields.
static DexString * dex_resolve_string_id_native(RzBinDex *dex, ut32 string_idx)
static RzList * dex_resolve_entrypoints_in_class(RzBinDex *dex, DexClassDef *class_def)
static void dex_string_free(DexString *string)
RZ_API RZ_OWN RzList * rz_bin_dex_sections(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinSection*> containing the dex sections.
static void dex_resolve_virtual_method_code(RzBinDex *dex, DexMethodId *to_resolve, ut32 superclass_idx)
RZ_API ut64 rz_bin_dex_debug_info(RZ_NONNULL RzBinDex *dex)
Returns the dex debug info RzBin values.
RZ_API RZ_OWN RzBinDex * rz_bin_dex_new(RZ_NONNULL RzBuffer *buf, ut64 base, RZ_NONNULL Sdb *kv)
Parses the dex file and returns a RzBinDex struct.
RZ_API ut64 rz_bin_dex_resolve_string_offset_by_idx(RZ_NONNULL RzBinDex *dex, ut32 string_idx)
Returns the resolved offset linked to the given string id.
static DexClassDef * dex_class_def_new(RzBuffer *buf, ut64 offset, ut64 base, RzPVector *method_ids)
static char * dex_resolve_library(const char *library)
RZ_API RZ_OWN RzList * rz_bin_dex_classes(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinClass*> containing the dex classes.
RZ_API RZ_OWN RzList * rz_bin_dex_entrypoints(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinAddr*> containing the dex entripoints.
static DexString * dex_string_new(RzBuffer *buf, ut64 offset, st64 *pread)
RZ_API RZ_OWN char * rz_bin_dex_resolve_type_id_by_idx(RZ_NONNULL RzBinDex *dex, ut32 type_idx)
Returns the resolved string linked to the given type id.
RZ_API RZ_OWN char * rz_bin_dex_resolve_field_by_idx(RZ_NONNULL RzBinDex *dex, ut32 field_idx)
Returns the resolved string linked to the given field id.
RZ_API RZ_OWN RzList * rz_bin_dex_imports(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinImport*> containing the dex imports.
static DexEncodedMethod * dex_new_encoded_method(RzBuffer *buf, ut64 base, ut64 *diff_value_prev, bool first, RzPVector *method_ids)
RZ_API RZ_OWN char * rz_bin_dex_version(RZ_NONNULL RzBinDex *dex)
Returns the dex version (string format)
RZ_API RZ_OWN char * rz_bin_dex_access_flags_readable(ut32 access_flags)
static void dex_class_def_free(DexClassDef *class_def)
static DexProtoId * dex_proto_id_new(RzBuffer *buf, ut64 offset)
#define read_le16_or_fail(buf, val, fail)
static bool dex_create_relocations(RzBinDex *dex)
RZ_API RZ_OWN RzList * rz_bin_dex_strings(RZ_NONNULL RzBinDex *dex)
Returns a RzList<RzBinString*> containing the dex strings.
static char * dex_resolve_proto_id(RzBinDex *dex, const char *name, ut32 proto_idx, bool varargs)
RZ_API ut64 rz_bin_dex_resolve_type_id_offset_by_idx(RZ_NONNULL RzBinDex *dex, ut32 type_idx)
Returns the resolved offset linked to the given type id.
static int compare_strings(const void *a, const void *b)
RZ_API void rz_bin_dex_sha1(RZ_NONNULL RzBinDex *dex, RZ_NONNULL RzBinHash *hash)
Sets the RzBinHash dex digest (sha1)
static RzBinSymbol * dex_method_to_symbol(RzBinDex *dex, DexEncodedMethod *encoded_method, DexMethodId *method_id, bool is_imported)
#define dex_field_id_free
#define CLASS_ACCESS_FLAGS_SIZE
RZ_API RZ_OWN char * rz_bin_dex_resolve_proto_by_idx(RZ_NONNULL RzBinDex *dex, ut32 proto_idx)
Returns the resolved string linked to the given prototype id.
static void dex_resolve_all_virtual_methods(RzBinDex *dex)
checking print the parsed form of the magic use in n conjunction with m to debug a new magic file n before installing it n output MIME type strings(--mime-type and\n"
" --mime-encoding)\n") OPT('s'
RZ_API void Ht_() free(HtName_(Ht) *ht)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_find(RZ_NONNULL const RzList *list, const void *p, RZ_NONNULL RzListComparator cmp)
Returns RzListIter element which matches via the RzListComparator.
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API bool rz_list_join(RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
Joins 2 list into one (list2 pointer needs to be freed by the user)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
#define RZ_BIN_BIND_WEAK_STR
#define RZ_BIN_TYPE_FIELD_STR
#define RZ_BIN_METH_CONSTRUCTOR
#define RZ_BIN_METH_SYNCHRONIZED
#define RZ_BIN_METH_PUBLIC
#define RZ_BIN_TYPE_METH_STR
#define RZ_BIN_METH_VARARGS
#define RZ_BIN_METH_SYNTHETIC
#define RZ_BIN_METH_STRICT
@ RZ_BIN_SPECIAL_SYMBOL_ENTRY
@ RZ_BIN_SPECIAL_SYMBOL_INIT
@ RZ_BIN_SPECIAL_SYMBOL_MAIN
#define RZ_BIN_METH_ABSTRACT
#define RZ_BIN_METH_DECLARED_SYNCHRONIZED
#define RZ_BIN_METH_FINAL
#define RZ_BIN_BIND_LOCAL_STR
#define RZ_BIN_BIND_GLOBAL_STR
#define RZ_BIN_METH_BRIDGE
#define RZ_BIN_METH_STATIC
#define RZ_BIN_METH_PRIVATE
#define RZ_BIN_METH_PROTECTED
#define RZ_BIN_TYPE_FUNC_STR
#define RZ_BIN_METH_NATIVE
RZ_API ut64 rz_buf_tell(RZ_NONNULL RzBuffer *b)
Return the current cursor position.
RZ_API st64 rz_buf_seek(RZ_NONNULL RzBuffer *b, st64 addr, int whence)
Modify the current cursor position in the buffer.
RZ_API st64 rz_buf_uleb128(RZ_NONNULL RzBuffer *buffer, RZ_NONNULL ut64 *value)
Decodes ULEB128 from RzBuffer.
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_bytes(RZ_NULLABLE RZ_BORROW const ut8 *bytes, ut64 len)
Creates a new buffer with a bytes array.
RZ_API st64 rz_buf_read(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
static void rz_write_le32(void *dest, ut32 val)
void(* RzListFree)(void *ptr)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API const char * rz_str_rchr(const char *base, const char *p, int ch)
#define RZ_STR_ISEMPTY(x)
RZ_API int rz_str_replace_ch(char *s, char a, char b, bool g)
RZ_API int rz_str_replace_char(char *s, int a, int b)
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API bool rz_strbuf_append_n(RzStrBuf *sb, const char *s, size_t l)
static void ** rz_pvector_reserve(RzPVector *vec, size_t capacity)
static size_t rz_pvector_len(const RzPVector *vec)
RZ_API RzPVector * rz_pvector_new(RzPVectorFree free)
void(* RzPVectorFree)(void *e)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void rz_pvector_free(RzPVector *vec)
static void * rz_pvector_at(const RzPVector *vec, size_t index)
#define rz_pvector_foreach(vec, it)
static struct sockaddr static addrlen static backlog const void static flags void flags
ut32 static_values_offset
static const char * resolve(struct Type *t, const char *foo, const char **bar)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
#define buffer_size(buffer)
int read(izstream &zs, T *x, Items items)