Lines Matching +full:android +full:- +full:24
1 /* file.c - describe file type
3 * Copyright 2016 The Android Open Source Project
13 usage: file [-bhLs] [file...]
17 -b Brief (no filename)
18 -h Don't follow symlinks (default)
19 -L Follow symlinks
20 -s Show block/char device contents
39 // Values from include/linux/elf-em.h (plus arch/*/include/asm/elf.h)
46 {189, "microblaze"}, {0xbaab, "microblaze-old"}, {8, "mips"},
47 {10, "mips-old"}, {89, "mn10300"}, {0xbeef, "mn10300-old"}, {113, "nios2"},
48 {92, "openrisc"}, {0x8472, "openrisc-old"}, {15, "parisc"}, {20, "ppc"},
49 {21, "ppc64"}, {243, "riscv"}, {22, "s390"}, {0xa390, "s390-old"},
51 {188, "tile"}, {191, "tilegx"}, {3, "386"}, {6, "486"}, {62, "x86-64"},
52 {94, "xtensa"}, {0xabc7, "xtensa-old"}
70 // "64-bit"
71 if (bits == 1) printf("32-bit ");
72 else if (bits == 2) printf("64-bit ");
92 bits--;
113 // With binutils, phentsize seems to only be non-zero if phnum is non-zero.
114 // Such ELF files are rare, but do exist. (Android's crtbegin files, say.)
115 if (phnum && (phentsize != 32+24*bits)) {
187 } else if (n_namesz==8 && !memcmp(note+12, "Android", 8)) {
188 if (n_type==1 /*.android.note.ident*/ && n_descsz >= 4) {
189 printf(", for Android %d", (int)elf_int(note+20, 4));
193 printf(", built by NDK %.64s (%.64s)", note+24, note+24+64);
198 sh_size -= notesz;
223 // PNG is big-endian: https://www.w3.org/TR/PNG/#7Integers-and-byte-order in do_regular_file()
231 // https://www.w3.org/TR/PNG/#6Colour-values in do_regular_file()
238 xprintf(", %d x %d, %d-bit/%s, %sinterlaced", (int)peek_be(s, 4), in do_regular_file()
239 (int)peek_be(s+4, 4), s[8], c, s[12] ? "" : "non-"); in do_regular_file()
244 // https://www.w3.org/Graphics/GIF/spec-gif89a.txt in do_regular_file()
255 (int)peek_be(s+2, 2), (int)peek_be(s, 2), (int)peek_be(s+2, 2)-44); in do_regular_file()
257 // https://source.android.com/devices/tech/dalvik/dex-format#dex-file-magic in do_regular_file()
259 xprintf("Android dex file, version %s\n", s); in do_regular_file()
267 if (toybuf[5] == '7') cpioformat = "pre-SVR4 or odc"; in do_regular_file()
272 if (magic == 0143561) printf("byte-swapped "); in do_regular_file()
294 xprintf("Mach-O %d-bit ", bit); in do_regular_file()
296 if (s[4] == 7) what = (bit==32)?"x86":"x86-"; in do_regular_file()
333 int hz = le ? peek_le(s+24,4) : peek_be(s+24,4); in do_regular_file()
337 if (bits != 0) xprintf("%d-bit, ", bits); in do_regular_file()
339 else xprintf("%d-channel, ", channels); in do_regular_file()
345 else if (format == 0x06) xprintf("A-law"); in do_regular_file()
346 else if (format == 0x07) xprintf("µ-law"); in do_regular_file()
361 // https://docs.microsoft.com/en-us/typography/opentype/spec/otff in do_regular_file()
366 } else if (strstart(&s, "-----BEGIN CERTIFICATE-----")) { in do_regular_file()
369 // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx in do_regular_file()
371 (magic=peek_le(s+0x3c,4))<len-4 && !memcmp(s+magic, "\x50\x45\0\0", 4)) { in do_regular_file()
372 xprintf("MS PE32%s executable %s", (peek_le(s+magic+24, 2)==0x20b)?"+":"", in do_regular_file()
382 xprintf("%s\n", (peek_le(s+magic+4, 2)==0x14c)?"x86":"x86-64"); in do_regular_file()
390 …// https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/perf.data-file-format.txt in do_regular_file()
394 // https://android.googlesource.com/platform/system/core/+/master/libsparse/sparse_format.h in do_regular_file()
396 xprintf("Android sparse image v%d.%d, %d %d-byte blocks (%d chunks)\n", in do_regular_file()
400 …// https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/master/include/bo… in do_regular_file()
401 } else if (len>1632 && !memcmp(s, "ANDROID!", 8)) { in do_regular_file()
402 xprintf("Android boot image v%d\n", (int) peek_le(s+40, 4)); in do_regular_file()
404 // https://source.android.com/devices/architecture/dto/partitions in do_regular_file()
406 xprintf("Android DTB/DTBO v%d, %d entries\n", (int) peek_be(s+28, 4), in do_regular_file()
418 for (what = s; (s-toybuf)<len && !isspace(*s); s++); in do_regular_file()
421 // Distinguish ASCII text, UTF-8 text, or data in do_regular_file()
425 if ((bytes = utf8towc(&wc, s+i, len-i))>0 && wcwidth(wc)>=0) { in do_regular_file()
426 i += bytes-1; in do_regular_file()
427 if (!what) what = "UTF-8 text"; in do_regular_file()
452 int fd = !strcmp(name, "-"); in file_main()
455 xprintf("%s: %*s", name, (int)(TT.max_name_len - strlen(name)), ""); in file_main()
467 else if ((fd = openro(name, O_RDONLY)) != -1) { in file_main()