Rizin
unix-like reverse engineering framework and cli tools
ne.h File Reference
#include <rz_types.h>
#include <rz_list.h>
#include <rz_util.h>
#include <rz_bin.h>
#include "ne_specs.h"

Go to the source code of this file.

Classes

struct  rz_ne_resource_entry
 
struct  rz_ne_resource
 
struct  rz_bin_ne_obj_t
 

Functions

void rz_bin_ne_free (rz_bin_ne_obj_t *bin)
 
rz_bin_ne_obj_trz_bin_ne_new_buf (RzBuffer *buf, bool verbose)
 
RzListrz_bin_ne_get_relocs (rz_bin_ne_obj_t *bin)
 
RzListrz_bin_ne_get_imports (rz_bin_ne_obj_t *bin)
 
RzListrz_bin_ne_get_symbols (rz_bin_ne_obj_t *bin)
 
RzListrz_bin_ne_get_segments (rz_bin_ne_obj_t *bin)
 
RzListrz_bin_ne_get_entrypoints (rz_bin_ne_obj_t *bin)
 

Function Documentation

◆ rz_bin_ne_free()

void rz_bin_ne_free ( rz_bin_ne_obj_t bin)

Definition at line 659 of file ne.c.

659  {
660  if (!bin) {
661  return;
662  }
663  // rz_list_free (bin->imports); // double free
664  rz_list_free(bin->resources);
665  free(bin->entry_table);
666  free(bin->ne_header);
667  free(bin->resident_name_table);
668  free(bin->segment_entries);
669  free(bin);
670 }
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
Definition: malloc.c:26

References free(), and rz_list_free().

Referenced by destroy(), and rz_bin_ne_new_buf().

◆ rz_bin_ne_get_entrypoints()

RzList* rz_bin_ne_get_entrypoints ( rz_bin_ne_obj_t bin)

Definition at line 384 of file ne.c.

384  {
386  if (!entries) {
387  return NULL;
388  }
389  RzBinAddr *entry;
390  RzList *segments = rz_bin_ne_get_segments(bin);
391  if (!segments) {
393  return NULL;
394  }
395  if (bin->ne_header->csEntryPoint) {
397  if (!entry) {
399  return NULL;
400  }
401  entry->bits = 16;
402  RzBinSection *s = rz_list_get_n(segments, bin->ne_header->csEntryPoint - 1);
403  entry->paddr = bin->ne_header->ipEntryPoint + (s ? s->paddr : 0);
405  }
406  ut32 off = 0;
407  while (off < bin->ne_header->EntryTableLength) {
408  ut8 bundle_length = *(ut8 *)(bin->entry_table + off);
409  if (!bundle_length) {
410  break;
411  }
412  off++;
413  if (off >= bin->ne_header->EntryTableLength) {
414  break;
415  }
416  ut8 bundle_type = *(ut8 *)(bin->entry_table + off);
417  off++;
418  int i;
419  for (i = 0; i < bundle_length; i++) {
421  if (!entry) {
423  return NULL;
424  }
425  off++;
426  if (!bundle_type) { // Skip
427  off--;
428  free(entry);
429  break;
430  } else if (bundle_type == 0xFF) { // Moveable
431  off += 2;
432  ut8 segnum = *(bin->entry_table + off);
433  off++;
434  ut16 segoff = *(ut16 *)(bin->entry_table + off);
435  if (!segnum) {
436  free(entry);
437  continue;
438  }
439  entry->paddr = (ut64)bin->segment_entries[segnum - 1].offset * bin->alignment + segoff;
440  } else { // Fixed
441  ut16 *p = (ut16 *)(bin->entry_table + off);
442  if (off >= bin->ne_header->EntryTableLength || bundle_type > bin->ne_header->SegCount) {
443  free(entry);
444  continue;
445  }
446  entry->paddr = (ut64)bin->segment_entries[bundle_type - 1].offset * bin->alignment + (*p);
447  }
448  off += 2;
450  }
451  }
452  rz_list_free(segments);
453  bin->entries = entries;
454  return entries;
455 }
lzma_index ** i
Definition: index.h:629
RzList * entries(RzBinFile *bf)
Definition: bin_ne.c:98
#define NULL
Definition: cris-opc.c:27
uint16_t ut16
uint32_t ut32
uint8_t ut8
Definition: lh5801.h:11
void * p
Definition: libc.cpp:67
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
RZ_API RZ_BORROW void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
Definition: list.c:574
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
RzList * rz_bin_ne_get_segments(rz_bin_ne_obj_t *bin)
Definition: ne.c:78
int off
Definition: pal.c:13
static RzSocket * s
Definition: rtr.c:28
#define RZ_NEW0(x)
Definition: rz_types.h:284
Definition: zipcmp.c:77
ut64(WINAPI *w32_GetEnabledXStateFeatures)()

References entries(), free(), i, NULL, off, p, rz_bin_ne_get_segments(), rz_list_append(), rz_list_free(), rz_list_get_n(), rz_list_newf(), RZ_NEW0, s, and ut64().

Referenced by entries(), and rz_bin_ne_get_symbols().

◆ rz_bin_ne_get_imports()

RzList* rz_bin_ne_get_imports ( rz_bin_ne_obj_t bin)

Definition at line 348 of file ne.c.

348  {
350  if (!imports) {
351  return NULL;
352  }
353  ut16 off = bin->ne_header->ImportNameTable + bin->header_offset + 1;
354  int i;
355  for (i = 0; i < bin->ne_header->ModRefs; i++) {
357  if (!imp) {
358  break;
359  }
360  ut8 sz;
361  if (!rz_buf_read8_at(bin->buf, off, &sz)) {
362  break;
363  }
364  if (!sz) {
365  rz_bin_import_free(imp);
366  break;
367  }
368  off++;
369  char *name = malloc((ut64)sz + 1);
370  if (!name) {
371  break;
372  }
373  rz_buf_read_at(bin->buf, off, (ut8 *)name, sz);
374  name[sz] = '\0';
375  imp->name = name;
376  imp->ordinal = i + 1;
377  rz_list_append(imports, imp);
378  off += sz;
379  }
380  bin->imports = imports;
381  return imports;
382 }
RZ_API void rz_bin_import_free(RzBinImport *imp)
Definition: bin.c:137
RzList * imports(RzBinFile *bf)
Definition: bin_ne.c:106
void * malloc(size_t size)
Definition: malloc.c:123
const char * name
Definition: op.c:541
RZ_API bool rz_buf_read8_at(RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *result)
Read a byte at the specified address in the buffer.
Definition: buf.c:876
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
Definition: buf.c:1136
void(* RzListFree)(void *ptr)
Definition: rz_list.h:11
unsigned char * buf
Definition: gzjoin.c:83
Definition: z80asm.h:102
ut32 ordinal
Definition: rz_bin.h:707
char * name
Definition: rz_bin.h:701

References bin::buf, i, imports(), malloc(), name, rz_bin_import_t::name, NULL, off, rz_bin_import_t::ordinal, rz_bin_import_free(), rz_buf_read8_at(), rz_buf_read_at(), rz_list_append(), rz_list_newf(), RZ_NEW0, and ut64().

Referenced by imports(), and rz_bin_ne_buf_init().

◆ rz_bin_ne_get_relocs()

RzList* rz_bin_ne_get_relocs ( rz_bin_ne_obj_t bin)

Definition at line 457 of file ne.c.

457  {
458  RzList *segments = bin->segments;
459  if (!segments) {
460  return NULL;
461  }
462  RzList *entries = bin->entries;
463  if (!entries) {
464  return NULL;
465  }
466  RzList *symbols = bin->symbols;
467  if (!symbols) {
468  return NULL;
469  }
470 
471  ut16 *modref = calloc(bin->ne_header->ModRefs, sizeof(ut16));
472  if (!modref) {
473  return NULL;
474  }
475  rz_buf_read_at(bin->buf, (ut64)bin->ne_header->ModRefTable + bin->header_offset, (ut8 *)modref, bin->ne_header->ModRefs * sizeof(ut16));
476 
478  if (!relocs) {
479  free(modref);
480  return NULL;
481  }
482 
483  ut64 bufsz = rz_buf_size(bin->buf);
484  RzListIter *it;
485  RzBinSection *seg;
486  int index = -1;
487  rz_list_foreach (segments, it, seg) {
488  index++;
489  if (!(bin->segment_entries[index].flags & RELOCINFO)) {
490  continue;
491  }
492  ut32 off, start = off = seg->paddr + seg->size;
493  if ((ut64)off + 2 > bufsz) {
494  continue;
495  }
496  ut16 length;
497  if (!rz_buf_read_le16_at(bin->buf, off, &length)) {
498  continue;
499  }
500 
501  if (!length) {
502  continue;
503  }
504  off += 2;
505  while (off < start + length * sizeof(NE_image_reloc_item) && off + sizeof(NE_image_reloc_item) <= bufsz) {
506  RzBinReloc *reloc = RZ_NEW0(RzBinReloc);
507  if (!reloc) {
508  return NULL;
509  }
511  rz_buf_read_at(bin->buf, off, (ut8 *)&rel, sizeof(rel));
512  reloc->paddr = seg->paddr + rel.offset;
513  switch (rel.type) {
514  case LOBYTE:
515  reloc->type = RZ_BIN_RELOC_8;
516  break;
517  case SEL_16:
518  case OFF_16:
519  reloc->type = RZ_BIN_RELOC_16;
520  break;
521  case POI_32:
522  case OFF_32:
523  reloc->type = RZ_BIN_RELOC_32;
524  break;
525  case POI_48:
526  reloc->type = RZ_BIN_RELOC_64;
527  break;
528  }
529 
530  ut32 offset;
531  if (rel.flags & (IMPORTED_ORD | IMPORTED_NAME)) {
533  if (!imp) {
534  free(reloc);
535  break;
536  }
537  char *name = NULL;
538  if (rel.index > bin->ne_header->ModRefs || !rel.index) {
539  name = rz_str_newf("UnknownModule%d_%x", rel.index, off); // ????
540  } else {
541  offset = modref[rel.index - 1] + bin->header_offset + bin->ne_header->ImportNameTable;
543  }
544  if (rel.flags & IMPORTED_ORD) {
545  imp->ordinal = rel.func_ord;
546  imp->name = rz_str_newf("%s.%s", name, __func_name_from_ord(name, rel.func_ord));
547  } else {
548  offset = bin->header_offset + bin->ne_header->ImportNameTable + rel.name_off;
549  char *func = __read_nonnull_str_at(bin->buf, offset);
550  imp->name = rz_str_newf("%s.%s", name, func);
551  free(func);
552  }
553  free(name);
554  reloc->import = imp;
555  } else if (rel.flags & OSFIXUP) {
556  // TODO
557  } else {
558  if (strstr(seg->name, "FIXED")) {
559  RzBinSection *s = rz_list_get_n(segments, rel.segnum - 1);
560  if (s) {
561  offset = s->paddr + rel.segoff;
562  } else {
563  offset = -1;
564  }
565  } else {
567  if (entry) {
568  offset = entry->paddr;
569  } else {
570  offset = -1;
571  }
572  }
573  reloc->addend = offset;
574  RzBinSymbol *sym = NULL;
575  RzListIter *sit;
576  rz_list_foreach (symbols, sit, sym) {
577  if (sym->paddr == reloc->addend) {
578  reloc->symbol = sym;
579  break;
580  }
581  }
582  }
583 
584  if (rel.flags & ADDITIVE) {
585  reloc->additive = 1;
586  rz_list_append(relocs, reloc);
587  } else {
588  do {
589  rz_list_append(relocs, reloc);
590  ut16 tmp_offset;
591  if (!rz_buf_read_le16_at(bin->buf, reloc->paddr, &tmp_offset)) {
592  reloc = NULL;
593  break;
594  }
595 
596  offset = tmp_offset;
597 
598  RzBinReloc *tmp = reloc;
599  reloc = RZ_NEW0(RzBinReloc);
600  if (!reloc) {
601  break;
602  }
603  *reloc = *tmp;
604  reloc->paddr = seg->paddr + offset;
605  } while (offset != 0xFFFF);
606  free(reloc);
607  }
608 
609  off += sizeof(NE_image_reloc_item);
610  }
611  }
612  free(modref);
613  return relocs;
614 }
RzList * symbols(RzBinFile *bf)
Definition: bin_ne.c:102
RzList * relocs(RzBinFile *bf)
Definition: bin_ne.c:114
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 start
Definition: sflib.h:133
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
voidpf uLong offset
Definition: ioapi.h:144
void * calloc(size_t number, size_t size)
Definition: malloc.c:102
static char * __read_nonnull_str_at(RzBuffer *buf, ut64 offset)
Definition: ne.c:38
static char * __func_name_from_ord(char *module, ut16 ordinal)
Definition: ne.c:55
@ RELOCINFO
Definition: ne_specs.h:55
@ SEL_16
Definition: ne_specs.h:9
@ POI_48
Definition: ne_specs.h:12
@ POI_32
Definition: ne_specs.h:10
@ OFF_16
Definition: ne_specs.h:11
@ LOBYTE
Definition: ne_specs.h:8
@ OFF_32
Definition: ne_specs.h:13
@ IMPORTED_ORD
Definition: ne_specs.h:18
@ ADDITIVE
Definition: ne_specs.h:21
@ OSFIXUP
Definition: ne_specs.h:20
@ IMPORTED_NAME
Definition: ne_specs.h:19
struct _RELOC NE_image_reloc_item
@ RZ_BIN_RELOC_32
Definition: rz_bin.h:176
@ RZ_BIN_RELOC_16
Definition: rz_bin.h:174
@ RZ_BIN_RELOC_64
Definition: rz_bin.h:177
@ RZ_BIN_RELOC_8
Definition: rz_bin.h:173
#define rz_buf_read_le16_at(b, addr, result)
Definition: rz_buf.h:270
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
Definition: buf.c:1225
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
ut16 index
Definition: ne_specs.h:29
ut16 func_ord
Definition: ne_specs.h:41
ut16 segoff
Definition: ne_specs.h:33
ut8 flags
Definition: ne_specs.h:26
ut8 segnum
Definition: ne_specs.h:31
ut16 offset
Definition: ne_specs.h:27
ut16 entry_ordinal
Definition: ne_specs.h:37
ut8 type
Definition: ne_specs.h:25
ut16 name_off
Definition: ne_specs.h:45
ut64 paddr
the paddr where the value should be patched into
Definition: rz_bin.h:717
RzBinRelocType type
Definition: rz_bin.h:712
RzBinImport * import
Definition: rz_bin.h:714
bool additive
Definition: rz_bin.h:720
st64 addend
Definition: rz_bin.h:715
RzBinSymbol * symbol
Definition: rz_bin.h:713
char * name
Definition: rz_bin.h:619

References __func_name_from_ord(), __read_nonnull_str_at(), rz_bin_reloc_t::addend, ADDITIVE, rz_bin_reloc_t::additive, bin::buf, calloc(), entries(), _RELOC::entry_ordinal, _RELOC::flags, free(), _RELOC::func_ord, rz_bin_reloc_t::import, IMPORTED_NAME, IMPORTED_ORD, _RELOC::index, length, LOBYTE, rz_bin_section_t::name, rz_bin_import_t::name, _RELOC::name_off, NULL, off, OFF_16, OFF_32, _RELOC::offset, rz_bin_import_t::ordinal, OSFIXUP, rz_bin_section_t::paddr, rz_bin_symbol_t::paddr, rz_bin_reloc_t::paddr, POI_32, POI_48, RELOCINFO, relocs(), RZ_BIN_RELOC_16, RZ_BIN_RELOC_32, RZ_BIN_RELOC_64, RZ_BIN_RELOC_8, rz_buf_read_at(), rz_buf_read_le16_at, rz_buf_size(), rz_list_append(), rz_list_get_n(), rz_list_newf(), RZ_NEW0, rz_str_newf(), s, _RELOC::segnum, _RELOC::segoff, SEL_16, rz_bin_section_t::size, start, rz_bin_reloc_t::symbol, symbols(), autogen_x86imm::tmp, _RELOC::type, rz_bin_reloc_t::type, and ut64().

Referenced by relocs().

◆ rz_bin_ne_get_segments()

RzList* rz_bin_ne_get_segments ( rz_bin_ne_obj_t bin)

Definition at line 78 of file ne.c.

78  {
79  int i;
80  if (!bin) {
81  return NULL;
82  }
84  if (!segments) {
85  return NULL;
86  }
87  for (i = 0; i < bin->ne_header->SegCount; i++) {
89  NE_image_segment_entry *se = &bin->segment_entries[i];
90  if (!bs || !se) {
91  free(bs);
92  return segments;
93  }
94  bs->size = se->length;
95  bs->vsize = se->minAllocSz ? se->minAllocSz : 64000;
96  bs->bits = RZ_SYS_BITS_16;
97  bs->is_data = se->flags & IS_DATA;
98  bs->perm = __translate_perms(se->flags);
99  bs->paddr = (ut64)se->offset * bin->alignment;
100  bs->name = rz_str_newf("%s.%" PFMT64d, se->flags & IS_MOVEABLE ? "MOVEABLE" : "FIXED", bs->paddr);
101  bs->is_segment = true;
102  rz_list_append(segments, bs);
103  }
104  bin->segments = segments;
105  return segments;
106 }
RZ_API void rz_bin_section_free(RzBinSection *bs)
Definition: bin.c:1116
static int __translate_perms(int flags)
Definition: ne.c:23
@ IS_MOVEABLE
Definition: ne_specs.h:52
@ IS_DATA
Definition: ne_specs.h:51
@ RZ_SYS_BITS_16
Definition: rz_sys.h:19
#define PFMT64d
Definition: rz_types.h:394
ut16 offset
Definition: ne_specs.h:67
ut16 minAllocSz
Definition: ne_specs.h:70
ut16 flags
Definition: ne_specs.h:69
ut16 length
Definition: ne_specs.h:68
bool is_segment
Definition: rz_bin.h:634

References __translate_perms(), rz_bin_section_t::bits, _SEGMENT::flags, free(), i, IS_DATA, rz_bin_section_t::is_data, IS_MOVEABLE, rz_bin_section_t::is_segment, _SEGMENT::length, _SEGMENT::minAllocSz, rz_bin_section_t::name, NULL, _SEGMENT::offset, rz_bin_section_t::paddr, rz_bin_section_t::perm, PFMT64d, rz_bin_section_free(), rz_list_append(), rz_list_newf(), RZ_NEW0, rz_str_newf(), RZ_SYS_BITS_16, rz_bin_section_t::size, ut64(), and rz_bin_section_t::vsize.

Referenced by rz_bin_ne_get_entrypoints(), and sections().

◆ rz_bin_ne_get_symbols()

RzList* rz_bin_ne_get_symbols ( rz_bin_ne_obj_t bin)

Definition at line 121 of file ne.c.

121  {
122  RzBinSymbol *sym;
123  ut16 off = bin->ne_header->ResidNamTable + bin->header_offset;
125  if (!symbols) {
126  return NULL;
127  }
129  bool resident = true, first = true;
130  while (true) {
131  ut8 sz;
132  if (!rz_buf_read8_at(bin->buf, off, &sz)) {
133  break;
134  }
135  if (!sz) {
136  first = true;
137  if (resident) {
138  resident = false;
139  off = bin->ne_header->OffStartNonResTab;
140  if (!rz_buf_read8_at(bin->buf, off, &sz)) {
141  break;
142  }
143  if (!sz) {
144  break;
145  }
146  } else {
147  break;
148  }
149  }
150  char *name = malloc((ut64)sz + 1);
151  if (!name) {
152  break;
153  }
154  off++;
155  rz_buf_read_at(bin->buf, off, (ut8 *)name, sz);
156  name[sz] = '\0';
157  off += sz;
158  sym = RZ_NEW0(RzBinSymbol);
159  if (!sym) {
160  break;
161  }
162  ne_sanitize_name(name, sz);
163  sym->name = name;
164  if (!first) {
166  }
167  ut16 entry_off;
168  if (!rz_buf_read_le16_at(bin->buf, off, &entry_off)) {
169  rz_bin_symbol_free(sym);
170  break;
171  }
172  off += 2;
173  RzBinAddr *entry = rz_list_get_n(entries, entry_off);
174  if (entry) {
175  sym->paddr = entry->paddr;
176  } else {
177  sym->paddr = -1;
178  }
179  sym->ordinal = entry_off;
180  rz_list_append(symbols, sym);
181  first = false;
182  }
183  RzListIter *it;
184  RzBinAddr *en;
185  int i = 1;
186  rz_list_foreach (entries, it, en) {
188  sym = RZ_NEW0(RzBinSymbol);
189  if (!sym) {
190  break;
191  }
192  sym->name = rz_str_newf("entry%d", i - 1);
193  sym->paddr = en->paddr;
195  sym->ordinal = i;
196  rz_list_append(symbols, sym);
197  }
198  i++;
199  }
200  bin->symbols = symbols;
201  return symbols;
202 }
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
Definition: bin.c:175
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.
Definition: list.c:620
static void ne_sanitize_name(char *name, ut16 count)
Definition: ne.c:112
RzList * rz_bin_ne_get_entrypoints(rz_bin_ne_obj_t *bin)
Definition: ne.c:384
static int __find_symbol_by_paddr(const void *paddr, const void *sym)
Definition: ne.c:108
#define RZ_BIN_BIND_GLOBAL_STR
Definition: rz_bin.h:107
ut64 paddr
Definition: rz_bin.h:187
const char * bind
Definition: rz_bin.h:681
char * name
Definition: rz_bin.h:675
ut32 ordinal
Definition: rz_bin.h:692

References __find_symbol_by_paddr(), rz_bin_symbol_t::bind, bin::buf, entries(), free(), i, malloc(), name, rz_bin_symbol_t::name, ne_sanitize_name(), NULL, off, rz_bin_symbol_t::ordinal, rz_bin_addr_t::paddr, rz_bin_symbol_t::paddr, RZ_BIN_BIND_GLOBAL_STR, rz_bin_ne_get_entrypoints(), rz_bin_symbol_free(), rz_buf_read8_at(), rz_buf_read_at(), rz_buf_read_le16_at, rz_list_append(), rz_list_find(), rz_list_get_n(), rz_list_newf(), RZ_NEW0, rz_str_newf(), symbols(), and ut64().

Referenced by symbols().

◆ rz_bin_ne_new_buf()

rz_bin_ne_obj_t* rz_bin_ne_new_buf ( RzBuffer buf,
bool  verbose 
)

Definition at line 672 of file ne.c.

672  {
674  if (!bin) {
675  return NULL;
676  }
677  if (!rz_bin_ne_buf_init(buf, bin)) {
679  return NULL;
680  }
681  return bin;
682 }
voidpf void * buf
Definition: ioapi.h:138
void rz_bin_ne_free(rz_bin_ne_obj_t *bin)
Definition: ne.c:659
bool rz_bin_ne_buf_init(RzBuffer *buf, rz_bin_ne_obj_t *bin)
Definition: ne.c:616

References NULL, rz_bin_ne_buf_init(), rz_bin_ne_free(), and RZ_NEW0.

Referenced by load_buffer().