Lines Matching refs:nbuf

357 	unsigned char nbuf[NBUFSIZE];  in dophn_core()  local
402 len = xph_filesz < sizeof(nbuf) ? xph_filesz : sizeof(nbuf); in dophn_core()
404 if ((bufsize = pread(fd, nbuf, len, offs)) == -1) { in dophn_core()
414 offset = donote(ms, nbuf, offset, CAST(size_t, bufsize), in dophn_core()
553 do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_bid_note() argument
557 if (NAMEEQUALS(RCAST(char *, &nbuf[noff]), "GNU") && in do_bid_note()
579 memcpy(desc, &nbuf[doff], descsz); in do_bid_note()
585 if (namesz == 4 && memcmp(RCAST(char *, &nbuf[noff]), "Go", 3) == 0 && in do_bid_note()
590 RCAST(const char *, &nbuf[doff]))) == -1) in do_bid_note()
598 do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_os_note() argument
602 const char *name = RCAST(const char *, &nbuf[noff]); in do_os_note()
606 if (file_printf(ms, ", for SuSE %d.%d", nbuf[doff], in do_os_note()
607 nbuf[doff + 1]) == -1) in do_os_note()
614 memcpy(desc, &nbuf[doff], sizeof(desc)); in do_os_note()
653 if (do_note_netbsd_version(ms, swap, &nbuf[doff]) == -1) in do_os_note()
661 if (do_note_freebsd_version(ms, swap, &nbuf[doff]) in do_os_note()
682 memcpy(&desc, &nbuf[doff], sizeof(desc)); in do_os_note()
694 memcpy(&api_level, &nbuf[doff], sizeof(api_level)); in do_os_note()
706 &nbuf[doff + 4], &nbuf[doff + 4 + 64]) == -1) in do_os_note()
715 do_pax_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_pax_note() argument
719 const char *name = RCAST(const char *, &nbuf[noff]); in do_pax_note()
735 memcpy(&desc, &nbuf[doff], sizeof(desc)); in do_pax_note()
754 do_memtag_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_memtag_note() argument
758 const char *name = RCAST(const char *, &nbuf[noff]); in do_memtag_note()
774 memcpy(&desc, &nbuf[doff], sizeof(desc)); in do_memtag_note()
793 do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_core_note() argument
799 const char *name = RCAST(const char *, &nbuf[noff]); in do_core_note()
843 memcpy(&pi, nbuf + doff, MIN(descsz, sizeof(pi))); in do_core_note()
871 if (file_printf(ms, ", from '%.80s'", nbuf + doff + in do_core_note()
877 elf_getu32(swap, *RCAST(uint32_t *, (nbuf + in do_core_note()
923 c = nbuf[noffset]; in do_core_note()
969 && isprint(nbuf[no]); in do_core_note()
975 &nbuf[doff + prpsoffsets(i)]); in do_core_note()
976 for (cp = cname; cp < nbuf + size && *cp in do_core_note()
1072 do_auxv_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_auxv_note() argument
1114 memcpy(xauxv_addr, &nbuf[doff + off], xauxv_sizeof); in do_auxv_note()
1224 unsigned char *nbuf = CAST(unsigned char *, vbuf); in donote() local
1240 memcpy(xnh_addr, &nbuf[offset], xnh_sizeof); in donote()
1285 if (do_os_note(ms, nbuf, xnh_type, swap, in donote()
1291 if (do_bid_note(ms, nbuf, xnh_type, swap, in donote()
1297 if (do_pax_note(ms, nbuf, xnh_type, swap, in donote()
1302 if (do_memtag_note(ms, nbuf, xnh_type, swap, in donote()
1308 if (do_core_note(ms, nbuf, xnh_type, swap, in donote()
1314 if (do_auxv_note(ms, nbuf, xnh_type, swap, in donote()
1320 if (NAMEEQUALS(RCAST(char *, &nbuf[noff]), "NetBSD")) { in donote()
1351 str = RCAST(const char *, &nbuf[doff]); in donote()
1421 void *nbuf; in doshn() local
1523 if ((nbuf = malloc(xsh_size)) == NULL) { in doshn()
1529 if (pread(fd, nbuf, xsh_size, offs) < in doshn()
1531 free(nbuf); in doshn()
1543 noff = donote(ms, nbuf, CAST(size_t, noff), in doshn()
1549 free(nbuf); in doshn()
1728 unsigned char nbuf[NBUFSIZE]; in dophn_exec() local
1791 size_t len = xph_filesz < sizeof(nbuf) ? xph_filesz in dophn_exec()
1792 : sizeof(nbuf); in dophn_exec()
1794 bufsize = pread(fd, nbuf, len, offs); in dophn_exec()
1814 offset = dodynamic(ms, nbuf, offset, in dophn_exec()
1828 if (bufsize && nbuf[0]) { in dophn_exec()
1829 nbuf[bufsize - 1] = '\0'; in dophn_exec()
1830 memcpy(interp, nbuf, CAST(size_t, bufsize)); in dophn_exec()
1845 offset = donote(ms, nbuf, offset, in dophn_exec()
1872 CAST(char *, nbuf), sizeof(nbuf), in dophn_exec()