/freebsd/contrib/llvm-project/llvm/lib/BinaryFormat/ |
H A D | Magic.cpp | 1 //===- llvm/BinaryFormat/Magic.cpp - File magic identification --*- C++ -*-===// 9 #include "llvm/BinaryFormat/Magic.h" 28 static bool startswith(StringRef Magic, const char (&S)[N]) { in startswith() argument 29 return Magic.starts_with(StringRef(S, N - 1)); in startswith() 32 /// Identify the magic in magic. 33 file_magic llvm::identify_magic(StringRef Magic) { in identify_magic() argument 34 if (Magic.size() < 4) in identify_magic() 36 switch ((unsigned char)Magic[ in identify_magic() [all...] |
/freebsd/sys/dev/drm2/ |
H A D | drm_auth.c | 42 * Find the file with the given magic number. 45 * \param magic magic number. 48 * the one with matching magic number, while holding the drm_device::struct_mutex 51 static struct drm_file *drm_find_file(struct drm_master *master, drm_magic_t magic) in drm_find_file() argument 59 if (!drm_ht_find_item(&master->magiclist, (unsigned long)magic, &hash)) { in drm_find_file() 68 * Adds a magic number. 72 * \param magic magic number. 75 * associated the magic number hash key in drm_device::magiclist, while holding 79 drm_magic_t magic) in drm_add_magic() argument 83 DRM_DEBUG("%d\n", magic); in drm_add_magic() [all …]
|
/freebsd/contrib/file/python/ |
H A D | magic.py | 21 return ctypes.cdll.LoadLibrary(find_library('magic')) 24 _libraries['magic'] = _init() 70 _open = _libraries['magic'].magic_open 74 _close = _libraries['magic'].magic_close 78 _file = _libraries['magic'].magic_file 82 _descriptor = _libraries['magic'].magic_descriptor 86 _buffer = _libraries['magic'].magic_buffer 90 _error = _libraries['magic'].magic_error 94 _setflags = _libraries['magic'].magic_setflags 98 _load = _libraries['magic'].magic_load [all …]
|
H A D | README.md | 1 # `file-magic`: Python Bindings 8 You can install `file-magic` either with: 14 pip install file-magic 19 import magic 21 detected = magic.detect_from_filename('magic.py')
|
/freebsd/contrib/file/doc/ |
H A D | file.man | 37 filesystem tests, magic tests, and language tests. 61 When modifying magic files or the program itself, make sure to 83 The magic tests are used to check for files with data in 94 .Dq magic number 101 .Dq magic number 106 magic file 112 .Pa $HOME/.magic.mgc 114 .Pa $HOME/.magic 115 exists, it will be used in preference to the system magic files. 117 If a file does not match any of the entries in the magic file, [all …]
|
H A D | libmagic.man | 48 .Nd Magic number recognition library 91 operate on the magic database file 94 .Xr magic __FSECTION__ . 98 creates a magic cookie pointer and returns it. 101 if there was an error allocating the magic cookie. 104 argument specifies how the other magic functions should behave: 126 Check the magic database for consistency and print warnings to stderr. 137 as real errors, instead of printing them in the magic buffer. 159 Don't consult magic files. 177 .Xr magic __FSECTION__ [all …]
|
H A D | Makefile.am | 1 MAGIC = $(pkgdatadir)/magic macro 3 man_MAGIC = magic.5 5 man_MAGIC = magic.4 10 EXTRA_DIST = file.man magic.man libmagic.man 18 -e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@ 20 magic.${fsect}: Makefile magic.man 25 -e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@ 32 -e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@
|
H A D | magic.man | 1 .\" $File: magic.man,v 1.103 2023/07/20 14:32:07 christos Exp $ 5 .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. 7 .Nm magic 8 .Nd file command's magic pattern file 10 This manual page documents the format of magic files as 19 .Dq "magic patterns" . 21 .Dq "magic patterns" 24 or a directory of source text magic pattern fragment files in 44 The first direct offset of the magic entry (at continuation level 0), 81 characters in the magic match both lower and upper case characters in the [all …]
|
/freebsd/lib/libmagic/ |
H A D | Makefile | 9 LIB= magic 14 MAN= libmagic.3 magic.5 20 is_tar.c magic.c print.c readcdf.c readelf.c seccomp.c softmagic.c 21 INCS= magic.h 25 CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H 30 CLEANFILES+= magic magic.mgc 32 FILES= magic magic.mgc 35 MAGFILES= ${CONTRDIR}/magic/Header \ 36 ${CONTRDIR}/magic/Localstuff \ 37 ${CONTRDIR}/magic/Magdir/[a-z]* [all …]
|
/freebsd/contrib/file/magic/Magdir/ |
H A D | magic | 3 # $File: magic,v 1.11 2023/06/27 13:42:49 christos Exp $ 4 # magic: file(1) magic for magic files 8 0 string/t #\ Magic\ magic text file for file(1) cmd 18 >>0 use magic-fragment 23 >>>0 use magic-fragment 28 >>>>0 use magic-fragment 33 >>>>>0 use magic-fragment 38 >>0 use magic-fragment 42 >>>0 use magic-fragment 43 # display information (lines) about magic text fragment [all …]
|
/freebsd/contrib/libarchive/libarchive/test/ |
H A D | test_open_failure.c | 27 #define MAGIC 123456789 29 int magic; 46 assertEqualInt(MAGIC, private->magic); in my_read() 58 assertEqualInt(MAGIC, private->magic); in my_write() 68 assertEqualInt(MAGIC, private->magic); in my_open() 78 assertEqualInt(MAGIC, private->magic); in my_close() 28 #define MAGIC global() macro 30 int magic; global() member [all...] |
/freebsd/contrib/file/src/ |
H A D | Makefile.am | 1 MAGIC = $(pkgdatadir)/magic macro 3 nodist_include_HEADERS = magic.h 7 AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' 10 libmagic_la_SOURCES = buffer.c magic.c apprentice.c softmagic.c ascmagic.c \ 24 CLEANFILES = magic.h 25 EXTRA_DIST = magic.h.in cdf.mk BNF memtest.c 26 HDR= $(top_srcdir)/src/magic.h.in 27 BUILT_SOURCES = magic.h 29 magic.h: ${HDR}
|
H A D | file.c | 38 #include "magic.h" 165 { "name", 0, FILE_NAME_MAX, "use limit for name/use magic", 203 struct magic_set *magic = NULL; in main() local 205 const char *magicfile = NULL; /* where the magic is */ in main() 280 if (magic == NULL) in main() 281 if ((magic = load(magicfile, flags)) == NULL) in main() 283 applyparam(magic); in main() 284 e |= unwrap(magic, optarg); in main() 332 (void)fprintf(stdout, "magic file from %s\n", in main() 377 file_warnx("Compiled magic version [%d] " in main() [all …]
|
H A D | magic.c | 36 FILE_RCSID("@(#)$File: magic.c,v 1.121 2023/02/09 17:45:19 christos Exp $") 39 #include "magic.h" 125 "%s/share/misc/magic.mgc", in _w32_get_magic_relative_to() 126 "%s/magic.mgc", in _w32_get_magic_relative_to() 149 "%s/../share/misc/magic.mgc", dllpath); in _w32_get_magic_relative_to() 177 static const char hmagic[] = "/.magic/magic.mgc"; in get_default_magic() 189 return MAGIC; in get_default_magic() 191 if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0) in get_default_magic() 192 return MAGIC; in get_default_magic() 195 if (asprintf(&hmagicpath, "%s/.magic", home) < 0) in get_default_magic() [all …]
|
/freebsd/contrib/file/ |
H A D | README.md | 21 It knows the 'magic number' of several thousands of file types. 25 The major changes for 5.x are CDF file parsing, indirect magic, 53 4.[23] Berkeley one. That is, the file /etc/magic contains much of 55 My version knows a little more magic (including tar archives) than 56 System V; the /etc/magic parsing seems to be compatible with the 57 (poorly documented) System V /etc/magic format (with one exception; 60 In addition, the /etc/magic file is built from a subdirectory 62 magic numbers assigned to all sorts of data files that 63 are in reasonable circulation. Send your magic numbers, 64 in magic(5) format please, to the maintainer, Christos Zoulas. [all …]
|
H A D | ChangeLog | 67 * Add octal indirect magic (Michal Gorny) 72 * PR/373: Obey MAGIC_CONTINUE with multiple magic files (vismarli) 97 random magic files. 137 * Fix relationship tests with "search" magic, don't short circuit 153 * PR/270: Don't translate unprintable characters in %s magic formats 167 * PR/259: aleksandr.v.novichkov: mime printing through indirect magic 239 * Introduce "offset" magic type that can be used to 241 * document DER better in the magic man page. 273 * PR/140: Avoid abort with hand-crafted magic file (gockelhahn) 274 * PR/139 Avoid DoS in printf with hand-crafted magic file (gockelhahn) [all …]
|
H A D | TODO | 10 reimplement the apprentice and non-pattern magic methods in Python, 11 and compile the magic patterns to a giant regex (or something similar; 14 required for soft magic, not the more detailed information given by 16 BSD-licensed, has a magic reimplementation in Python. 18 Read the kerberos magic entry for more ideas. 20 Write a string merger to make magic entry sizes dynamic. 43 important yet as we don't have yet cases where use/indirect magic
|
/freebsd/contrib/elftoolchain/libpe/ |
H A D | libpe_init.c | 42 char magic[sizeof(PE_DosHdr)]; in libpe_open_object() local 73 if (read(pe->pe_fd, magic, 2) != 2) { in libpe_open_object() 78 if (magic[0] == 'M' && magic[1] == 'Z') { in libpe_open_object() 80 if (read(pe->pe_fd, &magic[2], sizeof(PE_DosHdr) - 2) != in libpe_open_object() 85 return (libpe_parse_msdos_header(pe, magic)); in libpe_open_object() 87 } else if (magic[0] == 'P' && magic[1] == 'E') { in libpe_open_object() 88 if (read(pe->pe_fd, magic, 2) != 2) { in libpe_open_object() 92 if (magic[0] == '\0' && magic[1] == '\0') { in libpe_open_object() 94 if (read(pe->pe_fd, magic, sizeof(PE_CoffHdr)) != in libpe_open_object() 99 return (libpe_parse_coff_header(pe, magic)); in libpe_open_object() [all …]
|
/freebsd/sys/dev/ocs_fc/ |
H A D | ocs_list.h | 46 #define ocs_list_magic_decl uint32_t magic; 49 #define ocs_list_set_list_magic list->magic = OCS_LIST_LIST_MAGIC 50 #define ocs_list_set_link_magic list->magic = OCS_LIST_LINK_MAGIC 123 ocs_list_assert(list->magic == OCS_LIST_LIST_MAGIC, 1); in ocs_list_empty() 138 return (list->magic == OCS_LIST_LIST_MAGIC); in ocs_list_valid() 156 ocs_list_assert((a->magic == OCS_LIST_LIST_MAGIC) || (a->magic == OCS_LIST_LINK_MAGIC)); in _ocs_list_insert_link() 160 ocs_list_assert((b->magic == OCS_LIST_LIST_MAGIC) || (b->magic == OCS_LIST_LINK_MAGIC)); in _ocs_list_insert_link() 164 ocs_list_assert((c->magic == OCS_LIST_LIST_MAGIC) || (c->magic == OCS_LIST_LINK_MAGIC)); in _ocs_list_insert_link() 181 * For debugging a linked list link element has a magic number that is initialized, 194 ocs_list_assert(list->magic == OCS_LIST_LIST_MAGIC); in ocs_list_init_link() [all …]
|
/freebsd/usr.sbin/binmiscctl/ |
H A D | binmiscctl.8 | 40 .Fl -magic 41 .Ar magic 82 .Fl -magic 83 .Ar magic 99 .Ar magic 104 .Ar magic 115 may be specified for the magic bytes using the 172 --fake-argv0=#a'' --magic ''BC\\xc0\\xde'' --size 4 \e 208 --magic "\ex7f\ex45\ex4c\ex46\ex02\ex01\ex01\ex00\ex00\ex00\e 219 --magic "\ex7f\ex45\ex4c\ex46\ex01\ex01\ex01\ex00\ex00\ex00\e [all …]
|
H A D | binmiscctl.c | 73 "\t\t--magic <magic_bytes> [--mask <mask_bytes>] \\\n" 120 { "magic", required_argument, NULL, 'm' }, 197 printf("magic size: %u\n", xbe->xbe_msize); in printxbe() 198 printf("magic offset: %u\n", xbe->xbe_moffset); in printxbe() 200 printf("magic: "); in printxbe() 284 char *magic = NULL, *mask = NULL; in add_cmd() local 304 free(magic); in add_cmd() 305 magic = strdup(optarg); in add_cmd() 341 if (NULL != magic) in add_cmd() 342 free(magic); in add_cmd() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/JITLink/ |
H A D | MachO.cpp | 36 uint32_t Magic; in createLinkGraphFromMachOObject() local 37 memcpy(&Magic, Data.data(), sizeof(uint32_t)); in createLinkGraphFromMachOObject() 39 dbgs() << "jitLink_MachO: magic = " << format("0x%08" PRIx32, Magic) in createLinkGraphFromMachOObject() 44 if (Magic == MachO::MH_MAGIC || Magic == MachO::MH_CIGAM) in createLinkGraphFromMachOObject() 46 else if (Magic == MachO::MH_MAGIC_64 || Magic == MachO::MH_CIGAM_64) { in createLinkGraphFromMachOObject() 56 if (Magic == MachO::MH_CIGAM_64) in createLinkGraphFromMachOObject() 72 return make_error<JITLinkError>("Unrecognized MachO magic value"); in createLinkGraphFromMachOObject()
|
/freebsd/contrib/mandoc/ |
H A D | dbm_map.c | 63 const int32_t *magic; in dbm_map() local 81 magic = dbm_getint(0); in dbm_map() 82 if (be32toh(*magic) != MANDOCDB_MAGIC) { in dbm_map() 85 "Bad initial magic %x (expected %x)", in dbm_map() 86 fname, be32toh(*magic), MANDOCDB_MAGIC); in dbm_map() 94 magic = dbm_getint(1); in dbm_map() 95 if (be32toh(*magic) != MANDOCDB_VERSION) { in dbm_map() 97 fname, be32toh(*magic), MANDOCDB_VERSION); in dbm_map() 108 if ((magic = dbm_get(*dbm_getint(3))) == NULL) { in dbm_map() 112 if (be32toh(*magic) != MANDOCDB_MAGIC) { in dbm_map() [all …]
|
/freebsd/contrib/jemalloc/src/ |
H A D | div.c | 26 * n / 2 ^ k < 1 by setting k = 32. This gets us a value of magic that works. 34 * This would make the value of magic too high to fit into a uint32_t in div_init() 35 * (we would want magic = 2^32 exactly). This would mess with code gen in div_init() 41 uint32_t magic = (uint32_t)(two_to_k / d); in div_init() local 44 * We want magic = ceil(2^k / d), but C gives us floor. We have to in div_init() 49 magic++; in div_init() 51 div_info->magic = magic; in div_init()
|
/freebsd/contrib/ncurses/man/ |
H A D | scr_dump.5 | 63 A \*(``magic number\*('' is written to the beginning of the dump file, 67 that requires a new magic number 91 # ncurses5 (and before) did not use a magic number, 131 but does not write a \*(``magic number\*('' to identify the file format. 166 identified the file format by writing a \*(``magic number\*('' at the 176 /* terminfo magic number */ 179 /* curses screen dump magic number */ 189 has no magic number for SVr4 (1989). 192 use a magic number that would correspond to the following. 196 /* curses screen dump magic number */ [all …]
|