Lines Matching refs:ms
69 toomany(struct magic_set *ms, const char *name, uint16_t num) in toomany() argument
71 if (ms->flags & MAGIC_MIME) in toomany()
73 if (file_printf(ms, ", too many %s (%u)", name, num) == -1) in toomany()
351 dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, in dophn_core() argument
362 if (ms->flags & MAGIC_MIME) in dophn_core()
366 if (file_printf(ms, ", no program header") == -1) in dophn_core()
371 if (file_printf(ms, ", corrupted program header size") == -1) in dophn_core()
382 if (file_printf(ms, in dophn_core()
405 if (file_printf(ms, " can't read note section at %jd", in dophn_core()
414 offset = donote(ms, nbuf, offset, CAST(size_t, bufsize), in dophn_core()
427 do_note_netbsd_version(struct magic_set *ms, int swap, void *v) in do_note_netbsd_version() argument
433 if (file_printf(ms, ", for NetBSD") == -1) in do_note_netbsd_version()
453 if (file_printf(ms, " %u.%u", ver_maj, ver_min) == -1) in do_note_netbsd_version()
460 if (file_printf(ms, ".%u", ver_patch) == -1) in do_note_netbsd_version()
464 if (file_printf(ms, "Z") == -1) in do_note_netbsd_version()
468 if (file_printf(ms, "%c", 'A' + ver_rel - 1) == -1) in do_note_netbsd_version()
476 do_note_freebsd_version(struct magic_set *ms, int swap, void *v) in do_note_freebsd_version() argument
482 if (file_printf(ms, ", for FreeBSD") == -1) in do_note_freebsd_version()
512 if (file_printf(ms, " 4.6.2") == -1) in do_note_freebsd_version()
515 if (file_printf(ms, " %d.%d", desc / 100000, in do_note_freebsd_version()
519 if (file_printf(ms, ".%d", desc / 1000 % 10) == -1) in do_note_freebsd_version()
522 if (file_printf(ms, " (%d)", desc) == -1) in do_note_freebsd_version()
525 if (file_printf(ms, " %d.%d", desc / 100000, in do_note_freebsd_version()
529 if (file_printf(ms, " (%d)", desc) == -1) in do_note_freebsd_version()
532 if (file_printf(ms, ".%d", desc / 10 % 10) == -1) in do_note_freebsd_version()
536 if (file_printf(ms, " %d.%d", desc / 100000, in do_note_freebsd_version()
541 if (file_printf(ms, " (%d)", desc) == -1) in do_note_freebsd_version()
544 if (file_printf(ms, ".%d", desc / 10 % 10) == -1) in do_note_freebsd_version()
553 do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_bid_note() argument
577 if (file_printf(ms, ", BuildID[%s]=", btype) == -1) in do_bid_note()
581 if (file_printf(ms, "%02x", desc[i]) == -1) in do_bid_note()
588 if (file_printf(ms, ", Go BuildID=%s", in do_bid_note()
598 do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_os_note() argument
606 if (file_printf(ms, ", for SuSE %d.%d", nbuf[doff], in do_os_note()
617 if (file_printf(ms, ", for GNU/") == -1) in do_os_note()
621 if (file_printf(ms, "Linux") == -1) in do_os_note()
625 if (file_printf(ms, "Hurd") == -1) in do_os_note()
629 if (file_printf(ms, "Solaris") == -1) in do_os_note()
633 if (file_printf(ms, "kFreeBSD") == -1) in do_os_note()
637 if (file_printf(ms, "kNetBSD") == -1) in do_os_note()
641 if (file_printf(ms, "<unknown>") == -1) in do_os_note()
644 if (file_printf(ms, " %d.%d.%d", elf_getu32(swap, desc[1]), 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()
670 if (file_printf(ms, ", for OpenBSD") == -1) in do_os_note()
680 if (file_printf(ms, ", for DragonFly") == -1) in do_os_note()
684 if (file_printf(ms, " %d.%d.%d", desc / 100000, in do_os_note()
696 if (file_printf(ms, ", for Android %d", api_level) == -1) in do_os_note()
705 if (file_printf(ms, ", built by NDK %.64s (%.64s)", in do_os_note()
715 do_pax_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_pax_note() argument
738 if (desc && file_printf(ms, ", PaX: ") == -1) in do_pax_note()
744 if (file_printf(ms, "%s%s", did++ ? "," : "", in do_pax_note()
754 do_memtag_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_memtag_note() argument
777 if (desc && file_printf(ms, ", Android Memtag: ") == -1) in do_memtag_note()
783 if (file_printf(ms, "%s%s", did++ ? "," : "", in do_memtag_note()
793 do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_core_note() argument
830 if (file_printf(ms, ", %s-style", os_style_names[os_style]) in do_core_note()
845 if (file_printf(ms, ", from '%.31s', pid=%u, uid=%u, " in do_core_note()
847 file_printable(ms, sbuf, sizeof(sbuf), in do_core_note()
871 if (file_printf(ms, ", from '%.80s'", nbuf + doff + in do_core_note()
876 if (file_printf(ms, ", pid=%u", in do_core_note()
985 if (file_printf(ms, ", from '%s'", in do_core_note()
1004 get_offset_from_virtaddr(struct magic_set *ms, int swap, int clazz, int fd, in get_offset_from_virtaddr() argument
1017 if (file_printf(ms, in get_offset_from_virtaddr()
1038 get_string_on_virtaddr(struct magic_set *ms, in get_string_on_virtaddr() argument
1048 offset = get_offset_from_virtaddr(ms, swap, clazz, fd, ph_off, ph_num, in get_string_on_virtaddr()
1052 (void)file_printf(ms, ", can't read elf string at %jd", in get_string_on_virtaddr()
1072 do_auxv_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, in do_auxv_note() argument
1117 file_error(ms, 0, "Too many ELF Auxv elements"); in do_auxv_note()
1158 buflen = get_string_on_virtaddr(ms, swap, clazz, fd, in do_auxv_note()
1164 if (file_printf(ms, ", %s: '%s'", tag, buf) == -1) in do_auxv_note()
1167 if (file_printf(ms, ", %s: %d", tag, in do_auxv_note()
1179 dodynamic(struct magic_set *ms, void *vbuf, size_t offset, size_t size, in dodynamic() argument
1200 ms->mode |= 0111; in dodynamic()
1202 ms->mode &= ~0111; in dodynamic()
1215 donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, in donote() argument
1254 (void)file_printf(ms, ", bad note name size %#lx", in donote()
1260 (void)file_printf(ms, ", bad note description size %#lx", 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()
1344 if (file_printf(ms, ", note=%u", xnh_type) == -1) in donote()
1354 file_printf(ms, ", %s: %s", tag, in donote()
1413 doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, in doshn() argument
1428 if (ms->flags & MAGIC_MIME) in doshn()
1432 if (file_printf(ms, ", no section header") == -1) in doshn()
1437 if (file_printf(ms, ", corrupted section header size") == -1) in doshn()
1445 if (file_printf(ms, ", missing section headers at %jd", in doshn()
1453 if (file_printf(ms, ", too large section header offset %jd", in doshn()
1464 if (file_printf(ms, in doshn()
1478 if (file_printf(ms, ", can't read elf section at %jd", in doshn()
1507 if (file_printf(ms, in doshn()
1517 if (xsh_size > ms->elf_shsize_max) { in doshn()
1518 file_error(ms, errno, "Note section size too " in doshn()
1520 ms->elf_shsize_max); in doshn()
1524 file_error(ms, errno, "Cannot allocate memory" in doshn()
1532 if (file_printf(ms, in doshn()
1543 noff = donote(ms, nbuf, CAST(size_t, noff), in doshn()
1567 file_badseek(ms); in doshn()
1583 file_badread(ms); in doshn()
1594 if (file_printf(ms, in doshn()
1606 if (file_printf(ms, ", unknown gnu" in doshn()
1627 if (file_printf(ms, in doshn()
1648 if (file_printf(ms, ", with debug_info") == -1) in doshn()
1651 if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1) in doshn()
1670 if (file_printf(ms, ", uses") == -1) in doshn()
1675 if (file_printf(ms, in doshn()
1683 if (file_printf(ms, in doshn()
1689 if (file_printf(ms, in doshn()
1697 if (file_printf(ms, in doshn()
1705 if (file_printf(ms, in doshn()
1721 dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, in dophn_exec() argument
1735 if (file_printf(ms, ", no program header") == -1) in dophn_exec()
1740 if (file_printf(ms, ", corrupted program header size") == -1) in dophn_exec()
1750 if (file_printf(ms, in dophn_exec()
1771 if (file_printf(ms, in dophn_exec()
1796 if (file_printf(ms, in dophn_exec()
1810 ms->mode &= ~0111; in dophn_exec()
1814 offset = dodynamic(ms, nbuf, offset, in dophn_exec()
1820 if (ms->flags & MAGIC_MIME) in dophn_exec()
1826 if (ms->flags & MAGIC_MIME) in dophn_exec()
1835 if (ms->flags & MAGIC_MIME) in dophn_exec()
1845 offset = donote(ms, nbuf, offset, in dophn_exec()
1853 if (ms->flags & MAGIC_MIME) in dophn_exec()
1858 if (ms->flags & MAGIC_MIME) in dophn_exec()
1868 if (file_printf(ms, ", %s linked", linking_style) == -1) in dophn_exec()
1871 if (file_printf(ms, ", interpreter %s", file_printable(ms, in dophn_exec()
1880 file_tryelf(struct magic_set *ms, const struct buffer *b) in file_tryelf() argument
1899 if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) in file_tryelf()
1919 fd = file_pipe2file(ms, fd, buf, nbytes); in file_tryelf()
1922 file_badread(ms); in file_tryelf()
1934 file_badread(ms); in file_tryelf()
1959 if (file_printf(ms, ", unknown class %d", clazz) == -1) in file_tryelf()