├── file ├── missing ├── stamp-h.in ├── magic.c ├── Magdir │ ├── linux │ ├── osf1 │ ├── mmdf │ ├── sc │ ├── lif │ ├── sketch │ ├── teapot │ ├── lecter │ ├── mirage │ ├── pbm │ ├── pkgadd │ ├── pdf │ ├── apl │ ├── mime │ ├── psdbms │ ├── typeset │ ├── karma │ ├── python │ ├── octave │ ├── flash │ ├── interleaf │ ├── chi │ ├── mkid │ ├── terminfo │ ├── island │ ├── allegro │ ├── amanda │ ├── project │ ├── epoc │ ├── magic │ ├── pyramid │ ├── adi │ ├── applix │ ├── vmware │ ├── rtf │ ├── zilog │ ├── amigaos │ ├── java │ ├── cisco │ ├── gnu │ ├── xdelta │ ├── diamond │ ├── lex │ ├── c-lang │ ├── rpm │ ├── news │ ├── plus5 │ ├── diff │ ├── asterix │ ├── zyxel │ ├── palm │ ├── ibm6000 │ ├── pgp │ ├── encore │ ├── vicar │ ├── alliant │ ├── blender │ ├── netscape │ ├── fsav │ ├── sccs │ ├── timezone │ ├── blit │ ├── sgml │ ├── grace │ ├── modem │ ├── lisp │ ├── troff │ ├── visx │ ├── vax │ ├── mail.news │ ├── softquad │ ├── pdp │ ├── alpha │ ├── iff │ ├── spectrum │ ├── mach │ ├── att3b │ ├── frame │ ├── vms │ ├── unknown │ ├── uuencode │ ├── bsdi │ ├── digital │ ├── intel │ ├── sequent │ ├── adventure │ ├── msvc │ ├── gimp │ ├── motorola │ ├── ibm370 │ ├── ti-8x │ ├── claris │ ├── varied.out │ ├── ncr │ ├── mcrypt │ ├── os2 │ ├── tex │ ├── maple │ ├── fonts │ ├── clipper │ ├── xenix │ ├── mathematica │ ├── jpeg │ ├── database │ ├── dump │ ├── commands │ ├── convex │ └── ispell ├── Header ├── Localstuff ├── mkinstalldirs ├── MAINT ├── acconfig.h ├── LEGAL.NOTICE ├── magic2mime ├── configure.in └── is_tar.c ├── stamp-h.in ├── compile ├── jpeg-6b ├── CVS │ ├── Repository │ └── Root ├── testimg.bmp ├── testimg.jpg ├── testimg.ppm ├── testimgp.jpg ├── testorig.jpg ├── testprog.jpg ├── makvms.opt ├── jversion.h ├── jconfig.vms ├── jconfig.dj ├── jconfig.wat ├── jconfig.sas ├── jconfig.cfg ├── jconfig.manx ├── jconfig.mac ├── rdgif.c ├── maktjpeg.st ├── jconfig.st ├── jconfig.vc ├── jconfig.bcc ├── ansi2knr.1 ├── jchuff.h ├── rdjpgcom.1 ├── jconfig.mc6 ├── makcjpeg.st ├── makdjpeg.st └── jcinit.c ├── jphide_table.h ├── xsteg.h ├── .gitignore ├── mkinstalldirs ├── compat ├── md5.h └── err.h ├── LICENSE ├── rpp.h ├── cfg.h ├── acconfig.h ├── Makefile.am ├── extraction.h ├── dct.h ├── README.md ├── break_jsteg.h ├── break_outguess.h ├── break_jphide.h ├── chi2cdf.c ├── rules.h ├── arc4.h ├── db.h ├── Makefile.android ├── discrimination.h ├── strlcpy.c ├── util.c ├── jutil.h ├── strlcat.c ├── dirname.c └── common.h /file/missing: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stamp-h.in: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /file/stamp-h.in: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.15/compile -------------------------------------------------------------------------------- /jpeg-6b/CVS/Repository: -------------------------------------------------------------------------------- 1 | stegdetect/jpeg-6b 2 | -------------------------------------------------------------------------------- /jpeg-6b/CVS/Root: -------------------------------------------------------------------------------- 1 | provos@cvs.monkey.org:/cvs 2 | -------------------------------------------------------------------------------- /file/magic.c: -------------------------------------------------------------------------------- 1 | char *magic_mem = 2 | #include "magic.inc" 3 | ; 4 | -------------------------------------------------------------------------------- /file/Magdir/linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/file/Magdir/linux -------------------------------------------------------------------------------- /jpeg-6b/testimg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/jpeg-6b/testimg.bmp -------------------------------------------------------------------------------- /jpeg-6b/testimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/jpeg-6b/testimg.jpg -------------------------------------------------------------------------------- /jpeg-6b/testimg.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/jpeg-6b/testimg.ppm -------------------------------------------------------------------------------- /jpeg-6b/testimgp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/jpeg-6b/testimgp.jpg -------------------------------------------------------------------------------- /jpeg-6b/testorig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/jpeg-6b/testorig.jpg -------------------------------------------------------------------------------- /jpeg-6b/testprog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abeluck/stegdetect/HEAD/jpeg-6b/testprog.jpg -------------------------------------------------------------------------------- /file/Magdir/osf1: -------------------------------------------------------------------------------- 1 | # 2 | # Mach magic number info 3 | # 4 | 0 long 0xefbe OSF/Rose object 5 | # I386 magic number info 6 | # 7 | 0 short 0565 i386 COFF object 8 | -------------------------------------------------------------------------------- /file/Magdir/mmdf: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # mmdf: file(1) magic for MMDF mail files 4 | # 5 | 0 string \001\001\001\001 MMDF mailbox 6 | -------------------------------------------------------------------------------- /file/Magdir/sc: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # sc: file(1) magic for "sc" spreadsheet 4 | # 5 | 38 string Spreadsheet sc spreadsheet file 6 | -------------------------------------------------------------------------------- /file/Magdir/lif: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # lif: file(1) magic for lif 4 | # 5 | # (Daniel Quinlan ) 6 | # 7 | 0 beshort 0x8000 lif file 8 | -------------------------------------------------------------------------------- /file/Magdir/sketch: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # Sketch Drawings: http://sketch.sourceforge.net/ 4 | # From: Edwin Mons 5 | 0 string ##Sketch Sketch document text 6 | -------------------------------------------------------------------------------- /jphide_table.h: -------------------------------------------------------------------------------- 1 | #ifndef _JPHIDE_TABLE_ 2 | #define _JPHIDE_TABLE_ 3 | /* Public Domain */ 4 | 5 | #define TAIL1 12000 6 | #define TAIL2 1200 7 | #define TAIL3 120 8 | 9 | extern int ltab[]; 10 | #endif /* _JPHIDE_TABLE_ */ 11 | -------------------------------------------------------------------------------- /file/Header: -------------------------------------------------------------------------------- 1 | # Magic 2 | # Magic data for file(1) command. 3 | # Machine-generated from src/cmd/file/magdir/*; edit there only! 4 | # Format is described in magic(files), where: 5 | # files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID. 6 | -------------------------------------------------------------------------------- /file/Magdir/teapot: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # teapot: file(1) magic for "teapot" spreadsheet 3 | # 4 | 0 string #!teapot\012xdr teapot work sheet (XDR format) 5 | -------------------------------------------------------------------------------- /file/Magdir/lecter: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # DEC SRC Virtual Paper: Lectern files 3 | # Karl M. Hegbloom 4 | 0 string lect DEC SRC Virtual Paper Lectern file 5 | -------------------------------------------------------------------------------- /file/Magdir/mirage: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # mirage: file(1) magic for Mirage executables 4 | # 5 | # XXX - byte order? 6 | # 7 | 0 long 31415 Mirage Assembler m.out executable 8 | -------------------------------------------------------------------------------- /file/Magdir/pbm: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # pbm: file(1) magic for Portable Bitmap files 4 | # 5 | # XXX - byte order? 6 | # 7 | 0 short 0x2a17 "compact bitmap" format (Poskanzer) 8 | -------------------------------------------------------------------------------- /file/Magdir/pkgadd: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # pkgadd: file(1) magic for SysV R4 PKG Datastreams 4 | # 5 | 0 string #\ PaCkAgE\ DaTaStReAm pkg Datastream (SVR4) 6 | -------------------------------------------------------------------------------- /jpeg-6b/makvms.opt: -------------------------------------------------------------------------------- 1 | ! A pointer to the VAX/VMS C Run-Time Shareable Library. 2 | ! This file is needed by makefile.mms and makefile.vms, 3 | ! but only for the older VAX C compiler. DEC C does not need it. 4 | Sys$Library:VAXCRTL.EXE /Share 5 | -------------------------------------------------------------------------------- /file/Magdir/pdf: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # pdf: file(1) magic for Portable Document Format 3 | # 4 | 5 | 0 string %PDF- PDF document 6 | >5 byte x \b, version %c 7 | >7 byte x \b.%c 8 | -------------------------------------------------------------------------------- /file/Magdir/apl: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # apl: file(1) magic for APL (see also "pdp" and "vax" for other APL 4 | # workspaces) 5 | # 6 | 0 long 0100554 APL workspace (Ken's original?) 7 | -------------------------------------------------------------------------------- /file/Magdir/mime: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # mime: file(1) magic for MIME encoded files 3 | # 4 | 0 string Content-Type:\ 5 | >14 string >\0 %s 6 | 0 string Content-Type: 7 | >13 string >\0 %s 8 | -------------------------------------------------------------------------------- /file/Magdir/psdbms: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # psdbms: file(1) magic for psdatabase 4 | # 5 | 0 belong&0xff00ffff 0x56000000 ps database 6 | >1 string >\0 version %s 7 | >4 string >\0 from kernel %s 8 | -------------------------------------------------------------------------------- /file/Magdir/typeset: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # typeset: file(1) magic for other typesetting 4 | # 5 | 0 string Interpress/Xerox Xerox InterPress data 6 | >16 string / (version 7 | >>17 string >\0 %s) 8 | -------------------------------------------------------------------------------- /file/Magdir/karma: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # karma: file(1) magic for Karma data files 4 | # 5 | # From 6 | 7 | 0 string KarmaRHD Version Karma Data Structure Version 8 | >16 belong x %lu 9 | -------------------------------------------------------------------------------- /file/Magdir/python: -------------------------------------------------------------------------------- 1 | # often the module starts with a multiline string 2 | 0 string """ a python script text executable 3 | # MAGIC as specified in Python/import.c (1.5.2/1.6) 4 | # 20121 ( YEAR - 1995 ) + MONTH + DAY (little endian followed by "\r\n" 5 | 0 belong 0x994e0d0a python compiled 6 | -------------------------------------------------------------------------------- /file/Magdir/octave: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # octave binary data file(1) magic, from Dirk Eddelbuettel 3 | 0 string Octave-1-L Octave binary data (little endian) 4 | 0 string Octave-1-B Octave binary data (big endian) 5 | -------------------------------------------------------------------------------- /file/Magdir/flash: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # flash: file(1) magic for Macromedia Flash file format 4 | # 5 | # See 6 | # 7 | # http://www.macromedia.com/software/flash/open/ 8 | # 9 | 0 string FWS Macromedia Flash data, 10 | >3 byte x version %d 11 | -------------------------------------------------------------------------------- /file/Magdir/interleaf: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # interleaf: file(1) magic for InterLeaf TPS: 4 | # 5 | 0 string =\210OPS Interleaf saved data 6 | 0 string =5 string ,\ Version\ = \b, version 8 | >>17 string >\0 %.3s 9 | -------------------------------------------------------------------------------- /file/Magdir/chi: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # chi: file(1) magic for ChiWriter files 4 | # 5 | 0 string \\1cw\ ChiWriter file 6 | >5 string >\0 version %s 7 | 0 string \\1cw ChiWriter file 8 | -------------------------------------------------------------------------------- /file/Magdir/mkid: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # mkid: file(1) magic for mkid(1) databases 4 | # 5 | # ID is the binary tags database produced by mkid(1). 6 | # 7 | # XXX - byte order? 8 | # 9 | 0 string \311\304 ID tags data 10 | >2 short >0 version %d 11 | -------------------------------------------------------------------------------- /file/Magdir/terminfo: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # terminfo: file(1) magic for terminfo 4 | # 5 | # XXX - byte order for screen images? 6 | # 7 | 0 string \032\001 Compiled terminfo entry 8 | 0 short 0433 Curses screen image 9 | 0 short 0434 Curses screen image 10 | -------------------------------------------------------------------------------- /file/Magdir/island: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # island: file(1) magic for IslandWite/IslandDraw, from SunOS 5.5.1 4 | # "/etc/magic": 5 | # From: guy@netapp.com (Guy Harris) 6 | # 7 | 4 string pgscriptver IslandWrite document 8 | 13 string DrawFile IslandDraw document 9 | 10 | -------------------------------------------------------------------------------- /file/Localstuff: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # Localstuff: file(1) magic for locally observed files 4 | # 5 | # $Id: Localstuff,v 1.1.1.1 2001/10/16 18:05:11 provos Exp $ 6 | # Add any locally observed files here. Remember: 7 | # text if readable, executable if runnable binary, data if unreadable. 8 | -------------------------------------------------------------------------------- /file/Magdir/allegro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # allegro: file(1) magic for Allegro datafiles 3 | # Toby Deshane 4 | # 5 | 0 belong 0x736C6821 Allegro datafile (packed) 6 | 0 belong 0x736C682E Allegro datafile (not packed/autodetect) 7 | 0 belong 0x736C682B Allegro datafile (appended exe data) 8 | -------------------------------------------------------------------------------- /file/Magdir/amanda: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # amanda: file(1) magic for amanda file format 3 | # 4 | 0 string AMANDA:\ AMANDA 5 | >8 string TAPESTART\ DATE tape header file, 6 | >>23 string X 7 | >>>25 string >\ Unused %s 8 | >>23 string >\ DATE %s 9 | >8 string FILE\ dump file, 10 | >>13 string >\ DATE %s 11 | -------------------------------------------------------------------------------- /file/Magdir/project: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # project: file(1) magic for Project management 4 | # 5 | # Magic strings for ftnchek project files. Alexander Mai 6 | 0 string FTNCHEK_\ P project file for ftnchek 7 | >10 string 1 version 2.7 8 | >10 string 2 version 2.8 to 2.10 9 | >10 string 3 version 2.11 or later 10 | -------------------------------------------------------------------------------- /file/Magdir/epoc: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # Epoc 32 : file(1) magic for Epoc Documents [psion/osaris 4 | # Stefan Praszalowicz (hpicollo@worldnet.fr) 5 | #0 lelong 0x10000037 Epoc32 6 | >4 lelong 0x1000006D 7 | >>8 lelong 0x1000007F Word 8 | >>8 lelong 0x10000088 Sheet 9 | >>8 lelong 0x1000007D Sketch 10 | >>8 lelong 0x10000085 TextEd 11 | -------------------------------------------------------------------------------- /file/Magdir/magic: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # magic: file(1) magic for magic files 4 | # 5 | 0 string #\ Magic magic text file for file(1) cmd 6 | 0 lelong 0xF11E041C magic binary file for file(1) cmd 7 | >4 lelong x (version %d) (little endian) 8 | 0 belong 0xF11E041C magic binary file for file(1) cmd 9 | >4 belong x (version %d) (big endian) 10 | -------------------------------------------------------------------------------- /file/Magdir/pyramid: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # pyramid: file(1) magic for Pyramids 4 | # 5 | # XXX - byte order? 6 | # 7 | 0 long 0x50900107 Pyramid 90x family executable 8 | 0 long 0x50900108 Pyramid 90x family pure executable 9 | >16 long >0 not stripped 10 | 0 long 0x5090010b Pyramid 90x family demand paged pure executable 11 | >16 long >0 not stripped 12 | -------------------------------------------------------------------------------- /file/Magdir/adi: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # adi: file(1) magic for ADi's objects 4 | # From Gregory McGarry 5 | # 6 | 0 leshort 0x521c COFF DSP21k 7 | >18 lelong &02 executable, 8 | >18 lelong ^02 9 | >>18 lelong &01 static object, 10 | >>18 lelong ^01 relocatable object, 11 | >18 lelong &010 stripped 12 | >18 lelong ^010 not stripped 13 | -------------------------------------------------------------------------------- /file/Magdir/applix: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # applix: file(1) magic for Applixware 4 | # From: Peter Soos 5 | # 6 | 0 string *BEGIN Applixware 7 | >7 string WORDS Words Document 8 | >7 string GRAPHICS Graphic 9 | >7 string RASTER Bitmap 10 | >7 string SPREADSHEETS Spreadsheet 11 | >7 string MACRO Macro 12 | >7 string BUILDER Builder Object 13 | -------------------------------------------------------------------------------- /jpeg-6b/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-1998, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "6b 27-Mar-1998" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" 15 | -------------------------------------------------------------------------------- /file/Magdir/vmware: -------------------------------------------------------------------------------- 1 | 2 | # ----------------------------------------------------------- 3 | # VMware specific files (deducted from version 1.1 and log file entries) 4 | # Anthon van der Neut (anthon@mnt.org) 5 | 0 belong 0x4d52564e VMware nvram 6 | 0 belong 0x434f5744 7 | >8 byte 3 VMware virtual disk 8 | >>32 lelong x (%d/ 9 | >>36 lelong x \b%d/ 10 | >>40 lelong x \b%d) 11 | >8 byte 2 VMware undoable disk 12 | >>32 string >\0 (%s) 13 | -------------------------------------------------------------------------------- /file/Magdir/rtf: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # rtf: file(1) magic for Rich Text Format (RTF) 4 | # 5 | # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk 6 | # 7 | 0 string {\\rtf Rich Text Format data, 8 | >5 byte x version %c, 9 | >6 string \\ansi ANSI 10 | >6 string \\mac Apple Macintosh 11 | >6 string \\pc IBM PC, code page 437 12 | >6 string \\pca IBM PS/2, code page 850 13 | -------------------------------------------------------------------------------- /file/Magdir/zilog: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # zilog: file(1) magic for Zilog Z8000. 4 | # 5 | # Was it big-endian or little-endian? My Product Specification doesn't 6 | # say. 7 | # 8 | 0 long 0xe807 object file (z8000 a.out) 9 | 0 long 0xe808 pure object file (z8000 a.out) 10 | 0 long 0xe809 separate object file (z8000 a.out) 11 | 0 long 0xe805 overlay object file (z8000 a.out) 12 | -------------------------------------------------------------------------------- /file/Magdir/amigaos: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # amigaos: file(1) magic for AmigaOS binary formats: 3 | 4 | # 5 | # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis) 6 | # Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG 7 | # (the others should be separate, anyway) 8 | # 9 | 0 belong 0x000003f3 AmigaOS loadseg()ble executable/binary 10 | 0 belong 0x000003e7 AmigaOS object/library data 11 | -------------------------------------------------------------------------------- /file/Magdir/java: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------ 2 | # Java ByteCode 3 | # From Larry Schwimmer (schwim@cs.stanford.edu) 4 | 0 belong 0xcafebabe compiled Java class data, 5 | >6 beshort x version %d. 6 | >4 beshort x \b%d 7 | #------------------------------------------------------------ 8 | # Java serialization 9 | # From Martin Pool (m.pool@pharos.com.au) 10 | 0 beshort 0xaced Java serialization data 11 | >2 beshort >0x0004 \b, version %d 12 | -------------------------------------------------------------------------------- /file/Magdir/cisco: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # cisco: file(1) magic for cisco Systems routers 3 | # 4 | # Most cisco file-formats are covered by the generic elf code 5 | # 6 | # Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha. 7 | 0 belong&0xffffff00 0x85011400 cisco IOS microcode 8 | >7 string >\0 for '%s' 9 | 0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode 10 | >7 string >\0 for '%s' 11 | -------------------------------------------------------------------------------- /file/Magdir/gnu: -------------------------------------------------------------------------------- 1 | # 2 | # GNU nlsutils message catalog file format 3 | # 4 | 0 string \336\22\4\225 GNU message catalog (little endian), 5 | >4 lelong x revision %d, 6 | >8 lelong x %d messages 7 | 0 string \225\4\22\336 GNU message catalog (big endian), 8 | >4 belong x revision %d, 9 | >8 belong x %d messages 10 | # message catalogs, from Mitchum DSouza 11 | 0 string *nazgul* Nazgul style compiled message catalog 12 | >8 lelong >0 \b, version %ld 13 | -------------------------------------------------------------------------------- /file/Magdir/xdelta: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # file(1) magic(5) data for xdelta Josh MacDonald 4 | # 5 | 0 string %XDELTA% XDelta binary patch file 0.14 6 | 0 string %XDZ000% XDelta binary patch file 0.18 7 | 0 string %XDZ001% XDelta binary patch file 0.20 8 | 0 string %XDZ002% XDelta binary patch file 1.0 9 | 0 string %XDZ003% XDelta binary patch file 1.0.4 10 | 0 string %XDZ004% XDelta binary patch file 1.1 11 | -------------------------------------------------------------------------------- /file/Magdir/diamond: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # diamond: file(1) magic for Diamond system 4 | # 5 | # ... diamond is a multi-media mail and electronic conferencing system.... 6 | # 7 | # XXX - I think it was either renamed Slate, or replaced by Slate.... 8 | # 9 | # The full deal is too long... 10 | #0 string \n Diamond Multimedia Document 11 | 0 string =\n3 string >\0 for %s 8 | # C program text from GNU flex, from Daniel Quinlan 9 | 21 string generated\ by\ flex C program text (from flex) 10 | # lex description file, from Daniel Quinlan 11 | 0 string %{ lex description text 12 | -------------------------------------------------------------------------------- /file/Magdir/c-lang: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # c-lang: file(1) magic for C programs (or REXX) 4 | # 5 | 6 | # XPM icons (Greg Roelofs, newt@uchicago.edu) 7 | # if you uncomment "/*" for C/REXX below, also uncomment this entry 8 | #0 string /*\ XPM\ */ X pixmap image data 9 | 10 | # this first will upset you if you're a PL/1 shop... 11 | # in which case rm it; ascmagic will catch real C programs 12 | #0 string /* C or REXX program text 13 | 0 string // C++ program text 14 | -------------------------------------------------------------------------------- /file/Magdir/rpm: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com) 4 | # 5 | 0 beshort 0xedab 6 | >2 beshort 0xeedb RPM 7 | >>4 byte x v%d 8 | >>6 beshort 0 bin 9 | >>6 beshort 1 src 10 | >>8 beshort 1 i386 11 | >>8 beshort 2 Alpha 12 | >>8 beshort 3 Sparc 13 | >>8 beshort 4 MIPS 14 | >>8 beshort 5 PowerPC 15 | >>8 beshort 6 68000 16 | >>8 beshort 7 SGI 17 | >>10 string x %s 18 | -------------------------------------------------------------------------------- /xsteg.h: -------------------------------------------------------------------------------- 1 | #ifndef _XSTEG_H_ 2 | #define _XSTEG_H_ 3 | 4 | TAILQ_HEAD(filequeue, filename); 5 | 6 | struct filename { 7 | TAILQ_ENTRY(filename) file_next; 8 | char *name; /* file name to be analysed */ 9 | int change; /* need restart stegdetect */ 10 | }; 11 | 12 | int filename_add(char *); 13 | void filename_flush(void); 14 | 15 | void stegdetect_stop(void); 16 | pid_t stegdetect_start(void); 17 | 18 | void add_gtk_timeout(void); 19 | 20 | void menu_activate(GtkWidget *); 21 | 22 | extern char *xsteg_xpm[]; 23 | #endif /* _XSTEG_H_ */ 24 | -------------------------------------------------------------------------------- /file/Magdir/news: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # news: file(1) magic for SunOS NeWS fonts (not "news" as in "netnews") 4 | # 5 | 0 string StartFontMetrics ASCII font metrics 6 | 0 string StartFont ASCII font bits 7 | 0 belong 0x137A2944 NeWS bitmap font 8 | 0 belong 0x137A2947 NeWS font family 9 | 0 belong 0x137A2950 scalable OpenFont binary 10 | 0 belong 0x137A2951 encrypted scalable OpenFont binary 11 | 8 belong 0x137A2B45 X11/NeWS bitmap font 12 | 8 belong 0x137A2B48 X11/NeWS font family 13 | -------------------------------------------------------------------------------- /file/Magdir/plus5: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # plus5: file(1) magic for Plus Five's UNIX MUMPS 4 | # 5 | # XXX - byte order? Paging Hokey.... 6 | # 7 | 0 short 0x259 mumps avl global 8 | >2 byte >0 (V%d) 9 | >6 byte >0 with %d byte name 10 | >7 byte >0 and %d byte data cells 11 | 0 short 0x25a mumps blt global 12 | >2 byte >0 (V%d) 13 | >8 short >0 - %d byte blocks 14 | >15 byte 0x00 - P/D format 15 | >15 byte 0x01 - P/K/D format 16 | >15 byte 0x02 - K/D format 17 | >15 byte >0x02 - Bad Flags 18 | -------------------------------------------------------------------------------- /file/Magdir/diff: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # diff: file(1) magic for diff(1) output 4 | # 5 | 0 string diff\ 'diff' output text 6 | 0 string ***\ 'diff' output text 7 | 0 string Only\ in\ 'diff' output text 8 | 0 string Common\ subdirectories:\ 'diff' output text 9 | 10 | # xdelta is like diff(1) for binary files (works for text, too). 11 | # Available from: ftp://ftp.xcf.berkeley.edu/pub/xdelta/ 12 | 0 string %XDZ xdelta diff file 13 | >4 string >% version %.3s 14 | -------------------------------------------------------------------------------- /file/Magdir/asterix: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # asterix: file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character 4 | # strings as "long" - we assume they're just strings: 5 | # From: guy@netapp.com (Guy Harris) 6 | # 7 | 0 string *STA Aster*x 8 | >7 string WORD Words Document 9 | >7 string GRAP Graphic 10 | >7 string SPRE Spreadsheet 11 | >7 string MACR Macro 12 | 0 string 2278 Aster*x Version 2 13 | >29 byte 0x36 Words Document 14 | >29 byte 0x35 Graphic 15 | >29 byte 0x32 Spreadsheet 16 | >29 byte 0x38 Macro 17 | 18 | -------------------------------------------------------------------------------- /file/Magdir/zyxel: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # zyxel: file(1) magic for ZyXEL modems 4 | # 5 | # From 6 | # These are the /etc/magic entries to decode datafiles as used for the 7 | # ZyXEL U-1496E DATA/FAX/VOICE modems. (This header conforms to a 8 | # ZyXEL-defined standard) 9 | 10 | 0 string ZyXEL\002 ZyXEL voice data 11 | >10 byte 0 - CELP encoding 12 | >10 byte&0x0B 1 - ADPCM2 encoding 13 | >10 byte&0x0B 2 - ADPCM3 encoding 14 | >10 byte&0x0B 3 - ADPCM4 encoding 15 | >10 byte&0x0B 8 - New ADPCM3 encoding 16 | >10 byte&0x04 4 with resync 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.app 17 | 18 | # binarues 19 | stegdetect 20 | stegdeimage 21 | stegcompare 22 | stegbreak 23 | 24 | # extra crap 25 | stamp-h 26 | config.h 27 | config.log 28 | config.status 29 | Makefile 30 | ./*/Makefile 31 | 32 | file/file.1 33 | file/magic 34 | file/magic.4 35 | file/magic.inc 36 | jpeg-6b/cjpeg 37 | jpeg-6b/djpeg 38 | jpeg-6b/jpegtran 39 | jpeg-6b/rdjpgcom 40 | jpeg-6b/wrjpgcom 41 | jpeg-6b/jconfig.h 42 | conftest* 43 | confdefs.h 44 | -------------------------------------------------------------------------------- /file/Magdir/palm: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks 4 | # 5 | # Brian Lalor 6 | 7 | # appl 8 | 60 belong 0x6170706c PalmOS application 9 | >0 string >\0 "%s" 10 | # TEXt 11 | 60 belong 0x54455874 AportisDoc file 12 | >0 string >\0 "%s" 13 | # HACK 14 | 60 belong 0x4841434b HackMaster hack 15 | >0 string >\0 "%s" 16 | -------------------------------------------------------------------------------- /file/Magdir/ibm6000: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # ibm6000: file(1) magic for RS/6000 and the RT PC. 4 | # 5 | 0 beshort 0x01df executable (RISC System/6000 V3.1) or obj module 6 | >12 belong >0 not stripped 7 | # Breaks sun4 statically linked execs. 8 | #0 beshort 0x0103 executable (RT Version 2) or obj module 9 | #>2 byte 0x50 pure 10 | #>28 belong >0 not stripped 11 | #>6 beshort >0 - version %ld 12 | 0 beshort 0x0104 shared library 13 | 0 beshort 0x0105 ctab data 14 | 0 beshort 0xfe04 structured file 15 | 0 string 0xabcdef AIX message catalog 16 | 0 belong 0x000001f9 AIX compiled message catalog 17 | 0 string \ archive 18 | -------------------------------------------------------------------------------- /file/Magdir/pgp: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # pgp: file(1) magic for Pretty Good Privacy 4 | # 5 | 0 beshort 0x9900 PGP key public ring 6 | 0 beshort 0x9501 PGP key security ring 7 | 0 beshort 0x9500 PGP key security ring 8 | 0 beshort 0xa600 PGP encrypted data 9 | 0 string -----BEGIN\040PGP PGP armored data 10 | >15 string PUBLIC\040KEY\040BLOCK- public key block 11 | >15 string MESSAGE- message 12 | >15 string SIGNED\040MESSAGE- signed message 13 | >15 string PGP\040SIGNATURE- signature 14 | -------------------------------------------------------------------------------- /file/Magdir/encore: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # encore: file(1) magic for Encore machines 4 | # 5 | # XXX - needs to have the byte order specified (NS32K was little-endian, 6 | # dunno whether they run the 88K in little-endian mode or not). 7 | # 8 | 0 short 0x154 Encore 9 | >20 short 0x107 executable 10 | >20 short 0x108 pure executable 11 | >20 short 0x10b demand-paged executable 12 | >20 short 0x10f unsupported executable 13 | >12 long >0 not stripped 14 | >22 short >0 - version %ld 15 | >22 short 0 - 16 | #>4 date x stamp %s 17 | 0 short 0x155 Encore unsupported executable 18 | >12 long >0 not stripped 19 | >22 short >0 - version %ld 20 | >22 short 0 - 21 | #>4 date x stamp %s 22 | -------------------------------------------------------------------------------- /file/Magdir/vicar: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # vicar: file(1) magic for VICAR files. 4 | # 5 | # From: Ossama Othman 32 string BYTE \b, 8 bits = VAX byte 10 | >32 string HALF \b, 16 bits = VAX word = Fortran INTEGER*2 11 | >32 string FULL \b, 32 bits = VAX longword = Fortran INTEGER*4 12 | >32 string REAL \b, 32 bits = VAX longword = Fortran REAL*4 13 | >32 string DOUB \b, 64 bits = VAX quadword = Fortran REAL*8 14 | >32 string COMPLEX \b, 64 bits = VAX quadword = Fortran COMPLEX*8 15 | # VICAR label file 16 | 43 string SFDU_LABEL VICAR label file 17 | -------------------------------------------------------------------------------- /file/Magdir/alliant: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # alliant: file(1) magic for Alliant FX series a.out files 4 | # 5 | # If the FX series is the one that had a processor with a 68K-derived 6 | # instruction set, the "short" should probably become "beshort" and the 7 | # "long" should probably become "belong". 8 | # If it's the i860-based one, they should probably become either the 9 | # big-endian or little-endian versions, depending on the mode they ran 10 | # the 860 in.... 11 | # 12 | 0 short 0420 0420 Alliant virtual executable 13 | >2 short &0x0020 common library 14 | >16 long >0 not stripped 15 | 0 short 0421 0421 Alliant compact executable 16 | >2 short &0x0020 common library 17 | >16 long >0 not stripped 18 | -------------------------------------------------------------------------------- /file/Magdir/blender: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # blender: file(1) magic for Blender 3D data files 3 | # 4 | # Coded by Guillermo S. Romero using the 5 | # data from Ton Roosendaal . Ton or his company do not 6 | # support the rule, so mail GSR if problems with it. Rule version: 1.1. 7 | # You can get latest version with comments and details about the format 8 | # at http://acd.asoc.euitt.upm.es/~gsromero/3d/blender/magic.blender 9 | 10 | 0 string =BLENDER Blender3D, 11 | >7 string =_ saved as 32-bits 12 | >7 string =- saved as 64-bits 13 | >8 string =v little endian 14 | >8 string =V big endian 15 | >9 byte x with version %c. 16 | >10 byte x \b%c 17 | >11 byte x \b%c 18 | -------------------------------------------------------------------------------- /file/Magdir/netscape: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # netscape: file(1) magic for Netscape files 4 | # "H. Nanosecond" 5 | # version 3 and 4 I think 6 | # 7 | 8 | # Netscape Address book .nab 9 | 0 string \000\017\102\104\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\002\000\000\004\000 Netscape Address book 10 | 11 | # .snm Caches 12 | 0 string #\ Netscape\ folder\ cache Netscape folder cache 13 | 0 string \000\036\204\220\000 Netscape folder cache 14 | # .n2p 15 | # Net 2 Phone 16 | #0 string 123\130\071\066\061\071\071\071\060\070\061\060\061\063\060 17 | 0 string SX961999 Net2phone 18 | 19 | # 20 | #This is files ending in .art, FIXME add more rules 21 | 0 string JG\004\016\0\0\0\0 ART 22 | -------------------------------------------------------------------------------- /file/Magdir/fsav: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # fsav: file(1) magic for datafellows fsav virus definition files 4 | # Anthon van der Neut (anthon@mnt.org) 5 | 0 beshort 0x1575 fsav (linux) macro virus 6 | >8 leshort >0 (%d- 7 | >11 byte >0 \b%02d- 8 | >10 byte >0 \b%02d) 9 | 10 | # comment this out for now because it regognizes every file where 11 | # the eighth character is \n 12 | #8 byte 0x0a 13 | #>12 byte 0x07 14 | #>11 leshort >0 fsav (linux) virus (%d- 15 | #>10 byte 0 \b01- 16 | #>10 byte 1 \b02- 17 | #>10 byte 2 \b03- 18 | #>10 byte 3 \b04- 19 | #>10 byte 4 \b05- 20 | #>10 byte 5 \b06- 21 | #>10 byte 6 \b07- 22 | #>10 byte 7 \b08- 23 | #>10 byte 8 \b08- 24 | #>10 byte 9 \b10- 25 | #>10 byte 10 \b11- 26 | #>10 byte 11 \b12- 27 | #>9 byte >0 \b%02d) 28 | -------------------------------------------------------------------------------- /file/Magdir/sccs: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # sccs: file(1) magic for SCCS archives 4 | # 5 | # SCCS archive structure: 6 | # \001h01207 7 | # \001s 00276/00000/00000 8 | # \001d D 1.1 87/09/23 08:09:20 ian 1 0 9 | # \001c date and time created 87/09/23 08:09:20 by ian 10 | # \001e 11 | # \001u 12 | # \001U 13 | # ... etc. 14 | # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550). 15 | # *Sigh*. And these both came from various parts of the USG. 16 | # Maybe we should just switch everybody from SCCS to RCS! 17 | # Further, you can't just say '\001h0', because the five-digit number 18 | # is a checksum that could (presumably) have any leading digit, 19 | # and we don't have regular expression matching yet. 20 | # Hence the following official kludge: 21 | 8 string \001s\ SCCS archive data 22 | -------------------------------------------------------------------------------- /file/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1.1.1 2001/10/16 18:05:29 provos Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | -------------------------------------------------------------------------------- /file/Magdir/timezone: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # timezone: file(1) magic for timezone data 4 | # 5 | # from Daniel Quinlan (quinlan@yggdrasil.com) 6 | # this should work on Linux, SunOS, and maybe others 7 | # Added new official magic number for recent versions of the Olson code 8 | 0 string TZif timezone data 9 | 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0 old timezone data 10 | 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0 old timezone data 11 | 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0 old timezone data 12 | 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0 old timezone data 13 | 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0 old timezone data 14 | 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0 old timezone data 15 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1 2002/08/14 20:01:44 provos Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /file/Magdir/blit: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # blit: file(1) magic for 68K Blit stuff as seen from 680x0 machine 4 | # 5 | # Note that this 0407 conflicts with several other a.out formats... 6 | # 7 | # XXX - should this be redone with "be" and "le", so that it works on 8 | # little-endian machines as well? If so, what's the deal with 9 | # "VAX-order" and "VAX-order2"? 10 | # 11 | #0 long 0407 68K Blit (standalone) executable 12 | #0 short 0407 VAX-order2 68K Blit (standalone) executable 13 | 0 short 03401 VAX-order 68K Blit (standalone) executable 14 | 0 long 0406 68k Blit mpx/mux executable 15 | 0 short 0406 VAX-order2 68k Blit mpx/mux executable 16 | 0 short 03001 VAX-order 68k Blit mpx/mux executable 17 | # Need more values for WE32 DMD executables. 18 | # Note that 0520 is the same as COFF 19 | #0 short 0520 tty630 layers executable 20 | -------------------------------------------------------------------------------- /file/Magdir/sgml: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # sgml: file(1) magic for Standard Generalized Markup Language 4 | # HyperText Markup Language (HTML) is an SGML document type, 5 | # from Daniel Quinlan (quinlan@yggdrasil.com) 6 | # adapted to string extenstions by Anthon van der Neut 39 byte >0 - version %c 8 | # ACE/gr ascii 9 | 0 string #\ xvgr\ parameter\ file ACE/gr ascii file 10 | 0 string #\ xmgr\ parameter\ file ACE/gr ascii file 11 | 0 string #\ ACE/gr\ parameter\ file ACE/gr ascii file 12 | # Grace projects 13 | 0 string #\ Grace\ project\ file Grace project file 14 | >23 string @version\ (version 15 | >>32 byte >0 %c 16 | >>33 string >\0 \b.%.2s 17 | >>35 string >\0 \b.%.2s) 18 | # ACE/gr fit description files 19 | 0 string #\ ACE/gr\ fit\ description\ ACE/gr fit description file 20 | # end of ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE 21 | -------------------------------------------------------------------------------- /file/Magdir/modem: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # modem: file(1) magic for modem programs 3 | # 4 | # From: Florian La Roche 5 | 4 string Research, Digifax-G3-File 6 | >29 byte 1 , fine resolution 7 | >29 byte 0 , normal resolution 8 | 9 | 0 short 0x0100 raw G3 data, byte-padded 10 | 0 short 0x1400 raw G3 data 11 | # 12 | # Magic data for vgetty voice formats 13 | # (Martin Seine & Marc Eberhard) 14 | 15 | # 16 | # raw modem data version 1 17 | # 18 | 0 string RMD1 raw modem data 19 | >4 string >\0 (%s / 20 | >20 short >0 compression type 0x%04x) 21 | 22 | # 23 | # portable voice format 1 24 | # 25 | 0 string PVF1\n portable voice format 26 | >5 string >\0 (binary %s) 27 | 28 | # 29 | # portable voice format 2 30 | # 31 | 0 string PVF2\n portable voice format 32 | >5 string >\0 (ascii %s) 33 | 34 | -------------------------------------------------------------------------------- /file/Magdir/lisp: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # lisp: file(1) magic for lisp programs 4 | # 5 | # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com) 6 | 0 string ;; Lisp/Scheme program text 7 | # Emacs 18 - this is always correct, but not very magical. 8 | 0 string \012( byte-compiled Emacs-Lisp program data 9 | # Emacs 19+ - ver. recognition added by Ian Springer 10 | 0 string ;ELC byte-compiled Emacs-Lisp program data, 11 | >4 byte >0 version %d 12 | # 13 | # Files produced by CLISP Common Lisp From: Bruno Haible 14 | 0 string (SYSTEM::VERSION\040' CLISP byte-compiled Lisp program text 15 | 0 long 0x70768BD2 CLISP memory image data 16 | 0 long 0xD28B7670 CLISP memory image data, other endian 17 | # Files produced by GNU gettext 18 | 0 long 0xDE120495 GNU-format message catalog data 19 | 0 long 0x950412DE GNU-format message catalog data 20 | 21 | #.com and .bin for MIT scheme 22 | 0 string \372\372\372\372 MIT scheme (library?) 23 | -------------------------------------------------------------------------------- /file/Magdir/troff: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # troff: file(1) magic for *roff 4 | # 5 | # updated by Daniel Quinlan (quinlan@yggdrasil.com) 6 | 7 | # troff input 8 | 0 string .\\" troff or preprocessor input text 9 | 0 string '\\" troff or preprocessor input text 10 | 0 string '.\\" troff or preprocessor input text 11 | 0 string \\" troff or preprocessor input text 12 | 0 string ''' troff or preprocessor input text 13 | 14 | # ditroff intermediate output text 15 | 0 string x\ T ditroff output text 16 | >4 string cat for the C/A/T phototypesetter 17 | >4 string ps for PostScript 18 | >4 string dvi for DVI 19 | >4 string ascii for ASCII 20 | >4 string lj4 for LaserJet 4 21 | >4 string latin1 for ISO 8859-1 (Latin 1) 22 | >4 string X75 for xditview at 75dpi 23 | >>7 string -12 (12pt) 24 | >4 string X100 for xditview at 100dpi 25 | >>8 string -12 (12pt) 26 | 27 | # output data formats 28 | 0 string \100\357 very old (C/A/T) troff output data 29 | -------------------------------------------------------------------------------- /file/Magdir/visx: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # visx: file(1) magic for Visx format files 4 | # 5 | 0 short 0x5555 VISX image file 6 | >2 byte 0 (zero) 7 | >2 byte 1 (unsigned char) 8 | >2 byte 2 (short integer) 9 | >2 byte 3 (float 32) 10 | >2 byte 4 (float 64) 11 | >2 byte 5 (signed char) 12 | >2 byte 6 (bit-plane) 13 | >2 byte 7 (classes) 14 | >2 byte 8 (statistics) 15 | >2 byte 10 (ascii text) 16 | >2 byte 15 (image segments) 17 | >2 byte 100 (image set) 18 | >2 byte 101 (unsigned char vector) 19 | >2 byte 102 (short integer vector) 20 | >2 byte 103 (float 32 vector) 21 | >2 byte 104 (float 64 vector) 22 | >2 byte 105 (signed char vector) 23 | >2 byte 106 (bit plane vector) 24 | >2 byte 121 (feature vector) 25 | >2 byte 122 (feature vector library) 26 | >2 byte 124 (chain code) 27 | >2 byte 126 (bit vector) 28 | >2 byte 130 (graph) 29 | >2 byte 131 (adjacency graph) 30 | >2 byte 132 (adjacency graph library) 31 | >2 string .VISIX (ascii text) 32 | -------------------------------------------------------------------------------- /compat/md5.h: -------------------------------------------------------------------------------- 1 | /* See md5.c for explanation and copyright information. */ 2 | 3 | #ifndef MD5_H 4 | #define MD5_H 5 | 6 | /* Unlike previous versions of this code, md5_uint32 need not be exactly 7 | 32 bits, merely 32 bits or more. Choosing a data type which is 32 8 | bits instead of 64 is not important; speed is considerably more 9 | important. ANSI guarantees that "unsigned long" will be big enough, 10 | and always using it seems to have few disadvantages. */ 11 | typedef unsigned long md5_uint32; 12 | 13 | struct MD5Context { 14 | md5_uint32 buf[4]; 15 | md5_uint32 bits[2]; 16 | unsigned char in[64]; 17 | }; 18 | 19 | void MD5Init(struct MD5Context *context); 20 | void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len); 21 | void MD5Final(unsigned char digest[16], struct MD5Context *context); 22 | void MD5Transform(md5_uint32 buf[4], const unsigned char in[64]); 23 | 24 | /* 25 | * This is needed to make RSAREF happy on some MS-DOS compilers. 26 | */ 27 | typedef struct MD5Context MD5_CTX; 28 | 29 | #endif /* !MD5_H */ 30 | -------------------------------------------------------------------------------- /file/Magdir/vax: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # vax: file(1) magic for VAX executable/object and APL workspace 4 | # 5 | 0 lelong 0101557 VAX single precision APL workspace 6 | 0 lelong 0101556 VAX double precision APL workspace 7 | 8 | # 9 | # VAX a.out (32V, BSD) 10 | # 11 | 0 lelong 0407 VAX executable 12 | >16 lelong >0 not stripped 13 | 14 | 0 lelong 0410 VAX pure executable 15 | >16 lelong >0 not stripped 16 | 17 | 0 lelong 0413 VAX demand paged pure executable 18 | >16 lelong >0 not stripped 19 | 20 | 0 lelong 0420 VAX demand paged (first page unmapped) pure executable 21 | >16 lelong >0 not stripped 22 | 23 | # 24 | # VAX COFF 25 | # 26 | # The `versions' should be un-commented if they work for you. 27 | # (Was the problem just one of endianness?) 28 | # 29 | 0 leshort 0570 VAX COFF executable 30 | >12 lelong >0 not stripped 31 | >22 leshort >0 - version %ld 32 | 0 leshort 0575 VAX COFF pure executable 33 | >12 lelong >0 not stripped 34 | >22 leshort >0 - version %ld 35 | -------------------------------------------------------------------------------- /file/Magdir/mail.news: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # mail.news: file(1) magic for mail and news 4 | # 5 | # Unfortunately, saved netnews also has From line added in some news software. 6 | #0 string From mail text 7 | # There are tests to ascmagic.c to cope with mail and news. 8 | 0 string Relay-Version: old news text 9 | 0 string #!\ rnews batched news text 10 | 0 string N#!\ rnews mailed, batched news text 11 | 0 string Forward\ to mail forwarding text 12 | 0 string Pipe\ to mail piping text 13 | 0 string Return-Path: smtp mail text 14 | 0 string Path: news text 15 | 0 string Xref: news text 16 | 0 string From: news or mail text 17 | 0 string Article saved news text 18 | 0 string BABYL Emacs RMAIL text 19 | 0 string Received: RFC 822 mail text 20 | 0 string MIME-Version: MIME entity text 21 | #0 string Content- MIME entity text 22 | 23 | # TNEF files... 24 | 0 lelong 0x223E9F78 Transport Neutral Encapsulation Format 25 | 26 | # From: Kevin Sullivan 27 | 0 string *mbx* MBX mail folder 28 | 29 | -------------------------------------------------------------------------------- /file/Magdir/softquad: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # softquad: file(1) magic for SoftQuad Publishing Software 4 | # 5 | # Author/Editor and RulesBuilder 6 | # 7 | # XXX - byte order? 8 | # 9 | 0 string \ Compiled SGML rules file 10 | >9 string >\0 Type %s 11 | 0 string \ A/E SGML Document binary 12 | >9 string >\0 Type %s 13 | 0 string \ A/E SGML binary styles file 14 | >9 string >\0 Type %s 15 | 0 short 0xc0de Compiled PSI (v1) data 16 | 0 short 0xc0da Compiled PSI (v2) data 17 | >3 string >\0 (%s) 18 | # Binary sqtroff font/desc files... 19 | 0 short 0125252 SoftQuad DESC or font file binary 20 | >2 short >0 - version %d 21 | # Bitmaps... 22 | 0 string SQ\ BITMAP1 SoftQuad Raster Format text 23 | #0 string SQ\ BITMAP2 SoftQuad Raster Format data 24 | # sqtroff intermediate language (replacement for ditroff int. lang.) 25 | 0 string X\ SoftQuad troff Context intermediate 26 | >2 string 495 for AT&T 495 laser printer 27 | >2 string hp for Hewlett-Packard LaserJet 28 | >2 string impr for IMAGEN imPRESS 29 | >2 string ps for PostScript 30 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.vms: -------------------------------------------------------------------------------- 1 | /* jconfig.vms --- jconfig.h for use on Digital VMS. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #define TWO_FILE_COMMANDLINE /* Needed on VMS */ 33 | #undef NEED_SIGNAL_CATCHER 34 | #undef DONT_USE_B_MODE 35 | #undef PROGRESS_REPORT /* optional */ 36 | 37 | #endif /* JPEG_CJPEG_DJPEG */ 38 | -------------------------------------------------------------------------------- /file/Magdir/pdp: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # pdp: file(1) magic for PDP-11 executable/object and APL workspace 4 | # 5 | 0 lelong 0101555 PDP-11 single precision APL workspace 6 | 0 lelong 0101554 PDP-11 double precision APL workspace 7 | # 8 | # PDP-11 a.out 9 | # 10 | #0 leshort 0407 PDP-11 executable 11 | #>8 leshort >0 not stripped 12 | #>15 byte >0 - version %ld 13 | 14 | #0 leshort 0401 PDP-11 UNIX/RT ldp 15 | #0 leshort 0405 PDP-11 old overlay 16 | 17 | #0 leshort 0410 PDP-11 pure executable 18 | #>8 leshort >0 not stripped 19 | #>15 byte >0 - version %ld 20 | 21 | #0 leshort 0411 PDP-11 separate I&D executable 22 | #>8 leshort >0 not stripped 23 | #>15 byte >0 - version %ld 24 | 25 | #0 leshort 0437 PDP-11 kernel overlay 26 | 27 | # These last three are derived from 2.11BSD file(1) 28 | #0 leshort 0413 PDP-11 demand-paged pure executable 29 | #>8 leshort >0 not stripped 30 | 31 | #0 leshort 0430 PDP-11 overlaid pure executable 32 | #>8 leshort >0 not stripped 33 | 34 | #0 leshort 0431 PDP-11 overlaid separate executable 35 | #>8 leshort >0 not stripped 36 | -------------------------------------------------------------------------------- /file/Magdir/alpha: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # alpha architecture description 3 | # 4 | 5 | 0 leshort 0603 COFF format alpha 6 | >22 leshort&030000 !020000 executable 7 | >24 leshort 0410 pure 8 | >24 leshort 0413 paged 9 | >22 leshort&020000 !0 dynamically linked 10 | >16 lelong !0 not stripped 11 | >16 lelong 0 stripped 12 | >22 leshort&030000 020000 shared library 13 | >24 leshort 0407 object 14 | >27 byte x - version %d 15 | >26 byte x .%d 16 | >28 byte x -%d 17 | 18 | # Basic recognition of Digital UNIX core dumps - Mike Bremford 19 | # 20 | # The actual magic number is just "Core", followed by a 2-byte version 21 | # number; however, treating any file that begins with "Core" as a Digital 22 | # UNIX core dump file may produce too many false hits, so we include one 23 | # byte of the version number as well; DU 5.0 appears only to be up to 24 | # version 2. 25 | # 26 | 0 string Core\001 Alpha COFF format core dump (Digital UNIX) 27 | >24 string >\0 \b, from '%s' 28 | 0 string Core\002 Alpha COFF format core dump (Digital UNIX) 29 | >24 string >\0 \b, from '%s' 30 | 31 | -------------------------------------------------------------------------------- /file/Magdir/iff: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # iff: file(1) magic for Interchange File Format (see also "audio" & "images") 4 | # 5 | # Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic 6 | # Arts for file interchange. It has also been used by Apple, SGI, and 7 | # especially Commodore-Amiga. 8 | # 9 | # IFF files begin with an 8 byte FORM header, followed by a 4 character 10 | # FORM type, which is followed by the first chunk in the FORM. 11 | 12 | 0 string FORM IFF data 13 | #>4 belong x \b, FORM is %d bytes long 14 | # audio formats 15 | >8 string AIFF \b, AIFF audio 16 | >8 string AIFC \b, AIFF-C compressed audio 17 | >8 string 8SVX \b, 8SVX 8-bit sampled sound voice 18 | >8 string SAMP \b, SAMP sampled audio 19 | # image formats 20 | >8 string ILBMBMHD \b, ILBM interleaved image 21 | >>20 beshort x \b, %d x 22 | >>22 beshort x %d 23 | >8 string RGBN \b, RGBN 12-bit RGB image 24 | >8 string RGB8 \b, RGB8 24-bit RGB image 25 | >8 string DR2D \b, DR2D 2-D object 26 | >8 string TDDD \b, TDDD 3-D rendering 27 | # other formats 28 | >8 string FTXT \b, FTXT formatted text 29 | -------------------------------------------------------------------------------- /file/Magdir/spectrum: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # spectrum: file(1) magic for Spectrum emulator files. 4 | # 5 | # John Elliott 6 | 7 | # 8 | # Spectrum +3DOS header 9 | # 10 | 0 string PLUS3DOS\032 Spectrum +3 data 11 | >15 byte 0 - BASIC program 12 | >15 byte 1 - number array 13 | >15 byte 2 - character array 14 | >15 byte 3 - memory block 15 | >>16 belong 0x001B0040 (screen) 16 | >15 byte 4 - Tasword document 17 | >15 string TAPEFILE - ZXT tapefile 18 | # 19 | # Tape file. This assumes the .TAP starts with a Spectrum-format header, 20 | # which nearly all will. 21 | # 22 | 0 string \023\000\000 Spectrum .TAP data 23 | >4 string x "%-10.10s" 24 | >3 byte 0 - BASIC program 25 | >3 byte 1 - number array 26 | >3 byte 2 - character array 27 | >3 byte 3 - memory block 28 | >>14 belong 0x001B0040 (screen) 29 | -------------------------------------------------------------------------------- /file/Magdir/mach: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # mach file description 3 | # 4 | 0 belong 0xcafebabe Mach-O fat file 5 | >4 belong 1 with 1 architecture 6 | >4 belong >1 7 | >>4 belong x with %ld architectures 8 | # 9 | 0 belong 0xfeedface Mach-O 10 | >12 belong 1 object 11 | >12 belong 2 executable 12 | >12 belong 3 shared library 13 | >12 belong 4 core 14 | >12 belong 5 preload executable 15 | >12 belong >5 16 | >>12 belong x filetype=%ld 17 | >4 belong <0 18 | >>4 belong x architecture=%ld 19 | >4 belong 1 vax 20 | >4 belong 2 romp 21 | >4 belong 3 architecture=3 22 | >4 belong 4 ns32032 23 | >4 belong 5 ns32332 24 | >4 belong 6 for m68k architecture 25 | # from NeXTstep 3.0 26 | # i.e. mc680x0_all, ignore 27 | # >>8 belong 1 (mc68030) 28 | >>8 belong 2 (mc68040) 29 | >>8 belong 3 (mc68030 only) 30 | >4 belong 7 i386 31 | >4 belong 8 mips 32 | >4 belong 9 ns32532 33 | >4 belong 10 architecture=10 34 | >4 belong 11 hp pa-risc 35 | >4 belong 12 acorn 36 | >4 belong 13 m88k 37 | >4 belong 14 sparc 38 | >4 belong 15 i860-big 39 | >4 belong 16 i860 40 | >4 belong 17 rs6000 41 | >4 belong 18 powerPC 42 | >4 belong >18 43 | >>4 belong x architecture=%ld 44 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.dj: -------------------------------------------------------------------------------- 1 | /* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #undef TWO_FILE_COMMANDLINE /* optional */ 33 | #define USE_SETMODE /* Needed to make one-file style work in DJGPP */ 34 | #undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ 35 | #undef DONT_USE_B_MODE 36 | #undef PROGRESS_REPORT /* optional */ 37 | 38 | #endif /* JPEG_CJPEG_DJPEG */ 39 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.wat: -------------------------------------------------------------------------------- 1 | /* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #define CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #undef TWO_FILE_COMMANDLINE /* optional */ 33 | #define USE_SETMODE /* Needed to make one-file style work in Watcom */ 34 | #undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ 35 | #undef DONT_USE_B_MODE 36 | #undef PROGRESS_REPORT /* optional */ 37 | 38 | #endif /* JPEG_CJPEG_DJPEG */ 39 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.sas: -------------------------------------------------------------------------------- 1 | /* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ 23 | 24 | #define NO_MKTEMP /* SAS C doesn't have mktemp() */ 25 | 26 | #define SHORTxSHORT_32 /* produces better DCT code with SAS C */ 27 | 28 | #endif /* JPEG_INTERNALS */ 29 | 30 | #ifdef JPEG_CJPEG_DJPEG 31 | 32 | #define BMP_SUPPORTED /* BMP image file format */ 33 | #define GIF_SUPPORTED /* GIF image file format */ 34 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 35 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 36 | #define TARGA_SUPPORTED /* Targa image file format */ 37 | 38 | #define TWO_FILE_COMMANDLINE 39 | #define NEED_SIGNAL_CATCHER 40 | #undef DONT_USE_B_MODE 41 | #undef PROGRESS_REPORT /* optional */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.cfg: -------------------------------------------------------------------------------- 1 | /* jconfig.cfg --- source file edited by configure script */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #undef HAVE_PROTOTYPES 5 | #undef HAVE_UNSIGNED_CHAR 6 | #undef HAVE_UNSIGNED_SHORT 7 | #undef void 8 | #undef const 9 | #undef CHAR_IS_UNSIGNED 10 | #undef HAVE_STDDEF_H 11 | #undef HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | /* Define this if you get warnings about undefined structures. */ 17 | #undef INCOMPLETE_TYPES_BROKEN 18 | 19 | #ifdef JPEG_INTERNALS 20 | 21 | #undef RIGHT_SHIFT_IS_UNSIGNED 22 | #undef INLINE 23 | /* These are for configuring the JPEG memory manager. */ 24 | #undef DEFAULT_MAX_MEM 25 | #undef NO_MKTEMP 26 | 27 | #endif /* JPEG_INTERNALS */ 28 | 29 | #ifdef JPEG_CJPEG_DJPEG 30 | 31 | #define BMP_SUPPORTED /* BMP image file format */ 32 | #define GIF_SUPPORTED /* GIF image file format */ 33 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 34 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 35 | #define TARGA_SUPPORTED /* Targa image file format */ 36 | 37 | #undef TWO_FILE_COMMANDLINE 38 | #undef NEED_SIGNAL_CATCHER 39 | #undef DONT_USE_B_MODE 40 | 41 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 42 | #undef PROGRESS_REPORT 43 | 44 | #endif /* JPEG_CJPEG_DJPEG */ 45 | -------------------------------------------------------------------------------- /file/Magdir/att3b: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # att3b: file(1) magic for AT&T 3B machines 4 | # 5 | # The `versions' should be un-commented if they work for you. 6 | # (Was the problem just one of endianness?) 7 | # 8 | # 3B20 9 | # 10 | # The 3B20 conflicts with SCCS. 11 | #0 beshort 0550 3b20 COFF executable 12 | #>12 belong >0 not stripped 13 | #>22 beshort >0 - version %ld 14 | #0 beshort 0551 3b20 COFF executable (TV) 15 | #>12 belong >0 not stripped 16 | #>22 beshort >0 - version %ld 17 | # 18 | # WE32K 19 | # 20 | 0 beshort 0560 WE32000 COFF 21 | >18 beshort ^00000020 object 22 | >18 beshort &00000020 executable 23 | >12 belong >0 not stripped 24 | >18 beshort ^00010000 N/A on 3b2/300 w/paging 25 | >18 beshort &00020000 32100 required 26 | >18 beshort &00040000 and MAU hardware required 27 | >20 beshort 0407 (impure) 28 | >20 beshort 0410 (pure) 29 | >20 beshort 0413 (demand paged) 30 | >20 beshort 0443 (target shared library) 31 | >22 beshort >0 - version %ld 32 | 0 beshort 0561 WE32000 COFF executable (TV) 33 | >12 belong >0 not stripped 34 | #>18 beshort &00020000 - 32100 required 35 | #>18 beshort &00040000 and MAU hardware required 36 | #>22 beshort >0 - version %ld 37 | # 38 | # core file for 3b2 39 | 0 string \000\004\036\212\200 3b2 core file 40 | >364 string >\0 of '%s' 41 | -------------------------------------------------------------------------------- /file/Magdir/frame: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # frame: file(1) magic for FrameMaker files 4 | # 5 | # This stuff came on a FrameMaker demo tape, most of which is 6 | # copyright, but this file is "published" as witness the following: 7 | # 8 | 0 string \11 string 5.5 (5.5 10 | >11 string 5.0 (5.0 11 | >11 string 4.0 (4.0 12 | >11 string 3.0 (3.0 13 | >11 string 2.0 (2.0 14 | >11 string 1.0 (1.0 15 | >14 byte x %c) 16 | 0 string \9 string 4.0 (4.0) 18 | >9 string 3.0 (3.0) 19 | >9 string 2.0 (2.0) 20 | >9 string 1.0 (1.x) 21 | 0 string \17 string 3.0 (3.0) 23 | >17 string 2.0 (2.0) 24 | >17 string 1.0 (1.x) 25 | 0 string \17 string 1.01 (%s) 27 | 0 string \10 string 3.0 (3.0 30 | >10 string 2.0 (2.0 31 | >10 string 1.0 (1.0 32 | >13 byte x %c) 33 | # XXX - this book entry should be verified, if you find one, uncomment this 34 | #0 string \6 string 3.0 (3.0) 36 | #>6 string 2.0 (2.0) 37 | #>6 string 1.0 (1.0) 38 | 0 string \44032 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption 16 | # 17 | # The AXP files all looked like this, except that the byte at offset 0x22 18 | # was 06 in some of them and 07 in others: 19 | # 20 | # 00000 03 00 00 00 00 00 00 00 ec 02 00 00 10 01 00 00 ................ 21 | # 00010 68 00 00 00 98 00 00 00 b8 00 00 00 00 00 00 00 h............... 22 | # 00020 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 23 | # 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ 24 | # 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................ 25 | # 26 | 0 belong 0x03000000 VMS Alpha executable 27 | >75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption 28 | -------------------------------------------------------------------------------- /file/Magdir/unknown: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # unknown: file(1) magic for unknown machines 4 | # 5 | # XXX - this probably should be pruned, as it'll match PDP-11 and 6 | # VAX image formats. 7 | # 8 | # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure, 9 | # respectively). 10 | # 11 | # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't 12 | # have the "version %ld", which may be a bogus COFFism (I don't think 13 | # there ever was COFF for the PDP-11). 14 | # 15 | # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a 16 | # long, as it would be on a VAX. 17 | # 18 | # 0x10C is 0414, 0x10D is 0415, and 0x10E is 416; those *are* unknown. 19 | # 20 | 0 short 0x107 unknown machine executable 21 | >8 short >0 not stripped 22 | >15 byte >0 - version %ld 23 | 0 short 0x108 unknown pure executable 24 | >8 short >0 not stripped 25 | >15 byte >0 - version %ld 26 | 0 short 0x109 PDP-11 separate I&D 27 | >8 short >0 not stripped 28 | >15 byte >0 - version %ld 29 | 0 short 0x10b unknown pure executable 30 | >8 short >0 not stripped 31 | >15 byte >0 - version %ld 32 | 0 long 0x10c unknown demand paged pure executable 33 | >16 long >0 not stripped 34 | 0 long 0x10d unknown demand paged pure executable 35 | >16 long >0 not stripped 36 | 0 long 0x10e unknown readable demand paged pure executable 37 | -------------------------------------------------------------------------------- /file/Magdir/uuencode: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # uuencode: file(1) magic for ASCII-encoded files 4 | # 5 | 6 | # GRR: the first line of xxencoded files is identical to that in uuencoded 7 | # files, but the first character in most subsequent lines is 'h' instead of 8 | # 'M'. (xxencoding uses lowercase letters in place of most of uuencode's 9 | # punctuation and survives BITNET gateways better.) If regular expressions 10 | # were supported, this entry could possibly be split into two with 11 | # "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs). 12 | 0 string begin\040 uuencoded or xxencoded text 13 | 14 | # btoa(1) is an alternative to uuencode that requires less space. 15 | 0 string xbtoa\ Begin btoa'd text 16 | 17 | # ship(1) is another, much cooler alternative to uuencode. 18 | # Greg Roelofs, newt@uchicago.edu 19 | 0 string $\012ship ship'd binary text 20 | 21 | # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?) 22 | # Greg Roelofs, newt@uchicago.edu 23 | 0 string Decode\ the\ following\ with\ bdeco bencoded News text 24 | 25 | # BinHex is the Macintosh ASCII-encoded file format (see also "apple") 26 | # Daniel Quinlan, quinlan@yggdrasil.com 27 | 11 string must\ be\ converted\ with\ BinHex BinHex binary text 28 | >41 string x \b, version %.3s 29 | 30 | # GRR: is MIME BASE64 encoding handled somewhere? 31 | -------------------------------------------------------------------------------- /file/acconfig.h: -------------------------------------------------------------------------------- 1 | /* Autoheader needs me */ 2 | #undef PACKAGE 3 | 4 | /* Autoheader needs me */ 5 | #undef VERSION 6 | 7 | /* Define if builtin ELF support is enabled. */ 8 | #undef BUILTIN_ELF 9 | 10 | /* Define if ELF core file support is enabled. */ 11 | #undef ELFCORE 12 | 13 | /* Define if the `long long' type works. */ 14 | #undef HAVE_LONG_LONG 15 | 16 | /* Define if we have "tm_isdst" in "struct tm". */ 17 | #undef HAVE_TM_ISDST 18 | 19 | /* Define if we have a global "int" variable "daylight". */ 20 | #undef HAVE_DAYLIGHT 21 | 22 | /* Define to `unsigned char' if standard headers don't define. */ 23 | #undef uint8_t 24 | 25 | /* Define to `unsigned short' if standard headers don't define. */ 26 | #undef uint16_t 27 | 28 | /* Define to `unsigned int' if standard headers don't define. */ 29 | #undef uint32_t 30 | 31 | /* Define to `unsigned long long', if available, or `unsigned long', if 32 | standard headers don't define. */ 33 | #undef uint64_t 34 | 35 | /* FIXME: These have to be added manually because autoheader doesn't know 36 | about AC_CHECK_SIZEOF_INCLUDES. */ 37 | 38 | /* The number of bytes in a uint8_t. */ 39 | #define SIZEOF_UINT8_T 0 40 | 41 | /* The number of bytes in a uint16_t. */ 42 | #define SIZEOF_UINT16_T 0 43 | 44 | /* The number of bytes in a uint32_t. */ 45 | #define SIZEOF_UINT32_T 0 46 | 47 | /* The number of bytes in a uint64_t. */ 48 | #define SIZEOF_UINT64_T 0 49 | -------------------------------------------------------------------------------- /jpeg-6b/rdgif.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdgif.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains routines to read input images in GIF format. 9 | * 10 | ***************************************************************************** 11 | * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * 12 | * the ability to read GIF files has been removed from the IJG distribution. * 13 | * Sorry about that. * 14 | ***************************************************************************** 15 | * 16 | * We are required to state that 17 | * "The Graphics Interchange Format(c) is the Copyright property of 18 | * CompuServe Incorporated. GIF(sm) is a Service Mark property of 19 | * CompuServe Incorporated." 20 | */ 21 | 22 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ 23 | 24 | #ifdef GIF_SUPPORTED 25 | 26 | /* 27 | * The module selection routine for GIF format input. 28 | */ 29 | 30 | GLOBAL(cjpeg_source_ptr) 31 | jinit_read_gif (j_compress_ptr cinfo) 32 | { 33 | fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n"); 34 | exit(EXIT_FAILURE); 35 | return NULL; /* keep compiler happy */ 36 | } 37 | 38 | #endif /* GIF_SUPPORTED */ 39 | -------------------------------------------------------------------------------- /file/Magdir/bsdi: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # bsdi: file(1) magic for BSD/OS (from BSDI) objects 3 | # 4 | 5 | 0 lelong 0314 386 compact demand paged pure executable 6 | >16 lelong >0 not stripped 7 | >32 byte 0x6a (uses shared libs) 8 | 9 | 0 lelong 0407 386 executable 10 | >16 lelong >0 not stripped 11 | >32 byte 0x6a (uses shared libs) 12 | 13 | 0 lelong 0410 386 pure executable 14 | >16 lelong >0 not stripped 15 | >32 byte 0x6a (uses shared libs) 16 | 17 | 0 lelong 0413 386 demand paged pure executable 18 | >16 lelong >0 not stripped 19 | >32 byte 0x6a (uses shared libs) 20 | 21 | # same as in SunOS 4.x, except for static shared libraries 22 | 0 belong&077777777 0600413 sparc demand paged 23 | >0 byte &0x80 24 | >>20 belong <4096 shared library 25 | >>20 belong =4096 dynamically linked executable 26 | >>20 belong >4096 dynamically linked executable 27 | >0 byte ^0x80 executable 28 | >16 belong >0 not stripped 29 | >36 belong 0xb4100001 (uses shared libs) 30 | 31 | 0 belong&077777777 0600410 sparc pure 32 | >0 byte &0x80 dynamically linked executable 33 | >0 byte ^0x80 executable 34 | >16 belong >0 not stripped 35 | >36 belong 0xb4100001 (uses shared libs) 36 | 37 | 0 belong&077777777 0600407 sparc 38 | >0 byte &0x80 dynamically linked executable 39 | >0 byte ^0x80 executable 40 | >16 belong >0 not stripped 41 | >36 belong 0xb4100001 (uses shared libs) 42 | -------------------------------------------------------------------------------- /file/Magdir/digital: -------------------------------------------------------------------------------- 1 | # Digital UNIX - Info 2 | # 3 | 0 string !\n________64E Alpha archive 4 | >22 string X -- out of date 5 | # 6 | # Alpha COFF Based Executables 7 | # The stripped stuff really needs to be an 8 byte (64 bit) compare, 8 | # but this works 9 | 0 leshort 0x183 COFF format alpha 10 | >22 leshort&020000 &010000 sharable library, 11 | >22 leshort&020000 ^010000 dynamically linked, 12 | >24 leshort 0410 pure 13 | >24 leshort 0413 demand paged 14 | >8 lelong >0 executable or object module, not stripped 15 | >8 lelong 0 16 | >>12 lelong 0 executable or object module, stripped 17 | >>12 lelong >0 executable or object module, not stripped 18 | >27 byte >0 - version %d. 19 | >26 byte >0 %d- 20 | >28 leshort >0 %d 21 | # 22 | # The next is incomplete, we could tell more about this format, 23 | # but its not worth it. 24 | 0 leshort 0x188 Alpha compressed COFF 25 | 0 leshort 0x18f Alpha u-code object 26 | # 27 | # 28 | # Some other interesting Digital formats, 29 | 0 string \377\377\177 ddis/ddif 30 | 0 string \377\377\174 ddis/dots archive 31 | 0 string \377\377\176 ddis/dtif table data 32 | 0 string \033c\033 LN03 output 33 | 0 long 04553207 X image 34 | # 35 | 0 string !!\n profiling data file 36 | # 37 | # Locale data tables (MIPS and Alpha). 38 | # 39 | 0 short 0x0501 locale data table 40 | >6 short 0x24 for MIPS 41 | >6 short 0x40 for Alpha 42 | -------------------------------------------------------------------------------- /file/Magdir/intel: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # intel: file(1) magic for x86 Unix 4 | # 5 | # Various flavors of x86 UNIX executable/object (other than Xenix, which 6 | # is in "microsoft"). DOS is in "msdos"; the ambitious soul can do 7 | # Windows as well. 8 | # 9 | # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and 10 | # whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere 11 | # as well, if, as, and when IBM makes it portable. 12 | # 13 | # The `versions' should be un-commented if they work for you. 14 | # (Was the problem just one of endianness?) 15 | # 16 | 0 leshort 0502 basic-16 executable 17 | >12 lelong >0 not stripped 18 | #>22 leshort >0 - version %ld 19 | 0 leshort 0503 basic-16 executable (TV) 20 | >12 lelong >0 not stripped 21 | #>22 leshort >0 - version %ld 22 | 0 leshort 0510 x86 executable 23 | >12 lelong >0 not stripped 24 | 0 leshort 0511 x86 executable (TV) 25 | >12 lelong >0 not stripped 26 | 0 leshort =0512 iAPX 286 executable small model (COFF) 27 | >12 lelong >0 not stripped 28 | #>22 leshort >0 - version %ld 29 | 0 leshort =0522 iAPX 286 executable large model (COFF) 30 | >12 lelong >0 not stripped 31 | #>22 leshort >0 - version %ld 32 | # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 33 | 0 leshort =0514 80386 COFF executable 34 | >12 lelong >0 not stripped 35 | >22 leshort >0 - version %ld 36 | -------------------------------------------------------------------------------- /jpeg-6b/maktjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de), 5 | ; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de), 6 | ; and Guido Vollbeding (guivol@esc.de). 7 | ; 8 | ; To use this file, rename it to jpegtran.prj. 9 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 10 | ; Read installation instructions before trying to make the program! 11 | ; 12 | ; 13 | ; * * * Output file * * * 14 | jpegtran.ttp 15 | ; 16 | ; * * * COMPILER OPTIONS * * * 17 | .C[-P] ; absolute calls 18 | .C[-M] ; and no string merging, folks 19 | .C[-w-cln] ; no "constant is long" warnings 20 | .C[-w-par] ; no "parameter xxxx unused" 21 | .C[-w-rch] ; no "unreachable code" 22 | .C[-wsig] ; warn if significant digits may be lost 23 | = 24 | ; * * * * List of modules * * * * 25 | pcstart.o 26 | jpegtran.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h) 27 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | transupp.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h) 30 | libjpeg.lib ; built by libjpeg.prj 31 | pcstdlib.lib ; standard library 32 | pcextlib.lib ; extended library 33 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.st: -------------------------------------------------------------------------------- 1 | /* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #define INCOMPLETE_TYPES_BROKEN /* suppress undefined-structure warnings */ 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define ALIGN_TYPE long /* apparently double is a weird size? */ 23 | 24 | #endif /* JPEG_INTERNALS */ 25 | 26 | #ifdef JPEG_CJPEG_DJPEG 27 | 28 | #define BMP_SUPPORTED /* BMP image file format */ 29 | #define GIF_SUPPORTED /* GIF image file format */ 30 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 31 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 32 | #define TARGA_SUPPORTED /* Targa image file format */ 33 | 34 | #define TWO_FILE_COMMANDLINE /* optional -- undef if you like Unix style */ 35 | /* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define 36 | * USE_SETMODE. Some Atari compilers require it, some do not. 37 | */ 38 | #define NEED_SIGNAL_CATCHER /* needed if you use jmemname.c */ 39 | #undef DONT_USE_B_MODE 40 | #undef PROGRESS_REPORT /* optional */ 41 | 42 | #endif /* JPEG_CJPEG_DJPEG */ 43 | -------------------------------------------------------------------------------- /file/Magdir/sequent: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # sequent: file(1) magic for Sequent machines 4 | # 5 | # Sequent information updated by Don Dwiggins . 6 | # For Sequent's multiprocessor systems (incomplete). 7 | 0 lelong 0x00ea BALANCE NS32000 .o 8 | >16 lelong >0 not stripped 9 | >124 lelong >0 version %ld 10 | 0 lelong 0x10ea BALANCE NS32000 executable (0 @ 0) 11 | >16 lelong >0 not stripped 12 | >124 lelong >0 version %ld 13 | 0 lelong 0x20ea BALANCE NS32000 executable (invalid @ 0) 14 | >16 lelong >0 not stripped 15 | >124 lelong >0 version %ld 16 | 0 lelong 0x30ea BALANCE NS32000 standalone executable 17 | >16 lelong >0 not stripped 18 | >124 lelong >0 version %ld 19 | # 20 | # Symmetry information added by Jason Merrill . 21 | # Symmetry magic nums will not be reached if DOS COM comes before them; 22 | # byte 0xeb is matched before these get a chance. 23 | 0 leshort 0x12eb SYMMETRY i386 .o 24 | >16 lelong >0 not stripped 25 | >124 lelong >0 version %ld 26 | 0 leshort 0x22eb SYMMETRY i386 executable (0 @ 0) 27 | >16 lelong >0 not stripped 28 | >124 lelong >0 version %ld 29 | 0 leshort 0x32eb SYMMETRY i386 executable (invalid @ 0) 30 | >16 lelong >0 not stripped 31 | >124 lelong >0 version %ld 32 | 0 leshort 0x42eb SYMMETRY i386 standalone executable 33 | >16 lelong >0 not stripped 34 | >124 lelong >0 version %ld 35 | -------------------------------------------------------------------------------- /file/Magdir/adventure: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # adventure: file(1) magic for Adventure game files 4 | # 5 | # from Allen Garvin 6 | # Edited by Dave Chapeskie Jun 28, 1998 7 | # 8 | # ALAN 9 | # I assume there are other, lower versions, but these are the only ones I 10 | # saw in the archive. 11 | 0 beshort 0x0206 ALAN text adventure code data 12 | >2 byte <10 version 2.6%d 13 | 14 | # Conflicts with too much other stuff! 15 | # Infocom 16 | # (Note: to avoid false matches Z-machine version 1 and 2 are not 17 | # recognized since only the oldest Zork I and II used them. Similarly 18 | # there are 4 Infocom games that use verion 4 that are not recognized.) 19 | #0 byte 3 Infocom game data (Z-machine 3, 20 | #>2 beshort <0x7fff Release %3d, 21 | #>26 beshort >0 Size %d*2 22 | #>18 string >\0 Serial %.6s) 23 | #0 byte 5 Infocom game data (Z-machine 5, 24 | #>2 beshort <0x7fff Release %3d, 25 | #>26 beshort >0 Size %d*4 26 | #>18 string >\0 Serial %.6s) 27 | #0 byte 6 Infocom game data (Z-machine 6, 28 | #>2 beshort <0x7fff Release %3d, 29 | #>26 beshort >0 Size %d*8 30 | #>18 string >\0 Serial %.6s) 31 | #0 byte 8 Infocom game data (Z-machine 8, 32 | #>2 beshort <0x7fff Release %3d, 33 | #>26 beshort >0 Size %d*8 34 | #>18 string >\0 Serial %.6s) 35 | 36 | # TADS (Text Adventure Development System) 37 | 0 string TADS TADS game data 38 | >13 string >\0 (ver. %.6s, 39 | >22 string >\0 date %s) 40 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.vc: -------------------------------------------------------------------------------- 1 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | /* Define "boolean" as unsigned char, not int, per Windows custom */ 19 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 20 | typedef unsigned char boolean; 21 | #endif 22 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 23 | 24 | 25 | #ifdef JPEG_INTERNALS 26 | 27 | #undef RIGHT_SHIFT_IS_UNSIGNED 28 | 29 | #endif /* JPEG_INTERNALS */ 30 | 31 | #ifdef JPEG_CJPEG_DJPEG 32 | 33 | #define BMP_SUPPORTED /* BMP image file format */ 34 | #define GIF_SUPPORTED /* GIF image file format */ 35 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 36 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 37 | #define TARGA_SUPPORTED /* Targa image file format */ 38 | 39 | #define TWO_FILE_COMMANDLINE /* optional */ 40 | #define USE_SETMODE /* Microsoft has setmode() */ 41 | #undef NEED_SIGNAL_CATCHER 42 | #undef DONT_USE_B_MODE 43 | #undef PROGRESS_REPORT /* optional */ 44 | 45 | #endif /* JPEG_CJPEG_DJPEG */ 46 | -------------------------------------------------------------------------------- /file/Magdir/msvc: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # msvc: file(1) magic for msvc 4 | # "H. Nanosecond" 5 | # Microsoft visual C 6 | # 7 | # I have version 1.0 8 | 9 | # .aps 10 | 0 string HWB\000\377\001\000\000\000 Microsoft Visual C .APS file 11 | 12 | # .ide 13 | #too long 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157\152\145\143\164\040\106\151\154\145\012\000\032\000\002\000\262\000\272\276\372\316 MSVC .ide 14 | 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157 MSVC .ide 15 | 16 | # .res 17 | 0 string \000\000\000\000\040\000\000\000\377 MSVC .res 18 | 0 string \377\003\000\377\001\000\020\020\350 MSVC .res 19 | 0 string \377\003\000\377\001\000\060\020\350 MSVC .res 20 | 21 | #.lib 22 | 0 string \360\015\000\000 Microsoft Visual C library 23 | 0 string \360\075\000\000 Microsoft Visual C library 24 | 0 string \360\175\000\000 Microsoft Visual C library 25 | 26 | #.pch 27 | 0 string DTJPCH0\000\022\103\006\200 Microsoft Visual C .pch 28 | 29 | # .pdb 30 | # too long 0 string Microsoft\ C/C++\ program\ database\ 31 | 0 string Microsoft\ C/C++\ MSVC program database 32 | >18 string program\ database\ 33 | >33 string >\0 ver %s 34 | 35 | #.sbr 36 | 0 string \000\002\000\007\000 MSVC .sbr 37 | >5 string >\0 %s 38 | 39 | #.bsc 40 | 0 string \002\000\002\001 MSVC .bsc 41 | 42 | #.wsp 43 | 0 string 1.00\ .0000.0000\000\003 MSVC .wsp version 1.0000.0000 44 | # these seem to start with the version and contain menus 45 | -------------------------------------------------------------------------------- /file/Magdir/gimp: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # GIMP Gradient: file(1) magic for the GIMP's gradient data files 3 | # by Federico Mena 4 | 5 | 0 string GIMP\ Gradient GIMP gradient data 6 | 7 | #------------------------------------------------------------------------------ 8 | # XCF: file(1) magic for the XCF image format used in the GIMP developed 9 | # by Spencer Kimball and Peter Mattis 10 | # ('Bucky' LaDieu, nega@vt.edu) 11 | 12 | 0 string gimp\ xcf GIMP XCF image data, 13 | >9 string file version 0, 14 | >9 string v version 15 | >>10 string >\0 %s, 16 | >14 belong x %lu x 17 | >18 belong x %lu, 18 | >22 belong 0 RGB Color 19 | >22 belong 1 Greyscale 20 | >22 belong 2 Indexed Color 21 | >22 belong >2 Unknown Image Type. 22 | 23 | #------------------------------------------------------------------------------ 24 | # XCF: file(1) magic for the patterns used in the GIMP, developed 25 | # by Spencer Kimball and Peter Mattis 26 | # ('Bucky' LaDieu, nega@vt.edu) 27 | 28 | 20 string GPAT GIMP pattern data, 29 | >24 string x %s 30 | 31 | #------------------------------------------------------------------------------ 32 | # XCF: file(1) magic for the brushes used in the GIMP, developed 33 | # by Spencer Kimball and Peter Mattis 34 | # ('Bucky' LaDieu, nega@vt.edu) 35 | 36 | 20 string GIMP GIMP brush data 37 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.bcc: -------------------------------------------------------------------------------- 1 | /* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #ifdef __MSDOS__ 15 | #define NEED_FAR_POINTERS /* for small or medium memory model */ 16 | #endif 17 | #undef NEED_SHORT_EXTERNAL_NAMES 18 | #undef INCOMPLETE_TYPES_BROKEN /* this assumes you have -w-stu in CFLAGS */ 19 | 20 | #ifdef JPEG_INTERNALS 21 | 22 | #undef RIGHT_SHIFT_IS_UNSIGNED 23 | 24 | #ifdef __MSDOS__ 25 | #define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ 26 | #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ 27 | #define USE_FMEM /* Borland has _fmemcpy() and _fmemset() */ 28 | #endif 29 | 30 | #endif /* JPEG_INTERNALS */ 31 | 32 | #ifdef JPEG_CJPEG_DJPEG 33 | 34 | #define BMP_SUPPORTED /* BMP image file format */ 35 | #define GIF_SUPPORTED /* GIF image file format */ 36 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 37 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 38 | #define TARGA_SUPPORTED /* Targa image file format */ 39 | 40 | #define TWO_FILE_COMMANDLINE 41 | #define USE_SETMODE /* Borland has setmode() */ 42 | #ifdef __MSDOS__ 43 | #define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ 44 | #endif 45 | #undef DONT_USE_B_MODE 46 | #undef PROGRESS_REPORT /* optional */ 47 | 48 | #endif /* JPEG_CJPEG_DJPEG */ 49 | -------------------------------------------------------------------------------- /jpeg-6b/ansi2knr.1: -------------------------------------------------------------------------------- 1 | .TH ANSI2KNR 1 "19 Jan 1996" 2 | .SH NAME 3 | ansi2knr \- convert ANSI C to Kernighan & Ritchie C 4 | .SH SYNOPSIS 5 | .I ansi2knr 6 | [--varargs] input_file [output_file] 7 | .SH DESCRIPTION 8 | If no output_file is supplied, output goes to stdout. 9 | .br 10 | There are no error messages. 11 | .sp 12 | .I ansi2knr 13 | recognizes function definitions by seeing a non-keyword identifier at the left 14 | margin, followed by a left parenthesis, with a right parenthesis as the last 15 | character on the line, and with a left brace as the first token on the 16 | following line (ignoring possible intervening comments). It will recognize a 17 | multi-line header provided that no intervening line ends with a left or right 18 | brace or a semicolon. These algorithms ignore whitespace and comments, except 19 | that the function name must be the first thing on the line. 20 | .sp 21 | The following constructs will confuse it: 22 | .br 23 | - Any other construct that starts at the left margin and follows the 24 | above syntax (such as a macro or function call). 25 | .br 26 | - Some macros that tinker with the syntax of the function header. 27 | .sp 28 | The --varargs switch is obsolete, and is recognized only for 29 | backwards compatibility. The present version of 30 | .I ansi2knr 31 | will always attempt to convert a ... argument to va_alist and va_dcl. 32 | .SH AUTHOR 33 | L. Peter Deutsch wrote the original ansi2knr and 34 | continues to maintain the current version; most of the code in the current 35 | version is his work. ansi2knr also includes contributions by Francois 36 | Pinard and Jim Avera . 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2002 Niels Provos 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. All advertising materials mentioning features or use of this software 13 | must display the following acknowledgement: 14 | This product includes software developed by Niels Provos. 15 | 4. The name of the author may not be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | 30 | -------------------------------------------------------------------------------- /file/Magdir/motorola: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # motorola: file(1) magic for Motorola 68K and 88K binaries 4 | # 5 | # 68K 6 | # 7 | 0 beshort 0520 mc68k COFF 8 | >18 beshort ^00000020 object 9 | >18 beshort &00000020 executable 10 | >12 belong >0 not stripped 11 | >168 string .lowmem Apple toolbox 12 | >20 beshort 0407 (impure) 13 | >20 beshort 0410 (pure) 14 | >20 beshort 0413 (demand paged) 15 | >20 beshort 0421 (standalone) 16 | 0 beshort 0521 mc68k executable (shared) 17 | >12 belong >0 not stripped 18 | 0 beshort 0522 mc68k executable (shared demand paged) 19 | >12 belong >0 not stripped 20 | # 21 | # Motorola/UniSoft 68K Binary Compatibility Standard (BCS) 22 | # 23 | 0 beshort 0554 68K BCS executable 24 | # 25 | # 88K 26 | # 27 | # Motorola/88Open BCS 28 | # 29 | 0 beshort 0555 88K BCS executable 30 | # 31 | # Motorola S-Records, from Gerd Truschinski 32 | 0 string S0 Motorola S-Record; binary data in text format 33 | 34 | # ATARI ST relocatable PRG 35 | # 36 | # from Oskar Schirmer Feb 3, 2001 37 | # (according to Roland Waldi, Oct 21, 1987) 38 | # besides the magic 0x601a, the text segment size is checked to be 39 | # not larger than 1 MB (which is a lot on ST). 40 | # The additional 0x601b distinction I took from Doug Lee's magic. 41 | 0 belong&0xFFFFFFF0 0x601A0000 Atari ST M68K contiguous executable 42 | >2 belong x (txt=%ld, 43 | >6 belong x dat=%ld, 44 | >10 belong x bss=%ld, 45 | >14 belong x sym=%ld) 46 | 0 belong&0xFFFFFFF0 0x601B0000 Atari ST M68K non-contig executable 47 | >2 belong x (txt=%ld, 48 | >6 belong x dat=%ld, 49 | >10 belong x bss=%ld, 50 | >14 belong x sym=%ld) 51 | -------------------------------------------------------------------------------- /jpeg-6b/jchuff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jchuff.h 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains declarations for Huffman entropy encoding routines 9 | * that are shared between the sequential encoder (jchuff.c) and the 10 | * progressive encoder (jcphuff.c). No other modules need to see these. 11 | */ 12 | 13 | /* The legal range of a DCT coefficient is 14 | * -1024 .. +1023 for 8-bit data; 15 | * -16384 .. +16383 for 12-bit data. 16 | * Hence the magnitude should always fit in 10 or 14 bits respectively. 17 | */ 18 | 19 | #if BITS_IN_JSAMPLE == 8 20 | #define MAX_COEF_BITS 10 21 | #else 22 | #define MAX_COEF_BITS 14 23 | #endif 24 | 25 | /* Derived data constructed for each Huffman table */ 26 | 27 | typedef struct { 28 | unsigned int ehufco[256]; /* code for each symbol */ 29 | char ehufsi[256]; /* length of code for each symbol */ 30 | /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ 31 | } c_derived_tbl; 32 | 33 | /* Short forms of external names for systems with brain-damaged linkers. */ 34 | 35 | #ifdef NEED_SHORT_EXTERNAL_NAMES 36 | #define jpeg_make_c_derived_tbl jMkCDerived 37 | #define jpeg_gen_optimal_table jGenOptTbl 38 | #endif /* NEED_SHORT_EXTERNAL_NAMES */ 39 | 40 | /* Expand a Huffman table definition into the derived format */ 41 | EXTERN(void) jpeg_make_c_derived_tbl 42 | JPP((j_compress_ptr cinfo, boolean isDC, int tblno, 43 | c_derived_tbl ** pdtbl)); 44 | 45 | /* Generate an optimal table definition given the specified counts */ 46 | EXTERN(void) jpeg_gen_optimal_table 47 | JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])); 48 | -------------------------------------------------------------------------------- /file/Magdir/ibm370: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # ibm370: file(1) magic for IBM 370 and compatibles. 4 | # 5 | # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable". 6 | # What the heck *is* "USS/370"? 7 | # AIX 4.1's "/etc/magic" has 8 | # 9 | # 0 short 0535 370 sysV executable 10 | # >12 long >0 not stripped 11 | # >22 short >0 - version %d 12 | # >30 long >0 - 5.2 format 13 | # 0 short 0530 370 sysV pure executable 14 | # >12 long >0 not stripped 15 | # >22 short >0 - version %d 16 | # >30 long >0 - 5.2 format 17 | # 18 | # instead of the "USS/370" versions of the same magic numbers. 19 | # 20 | 0 beshort 0537 370 XA sysV executable 21 | >12 belong >0 not stripped 22 | >22 beshort >0 - version %d 23 | >30 belong >0 - 5.2 format 24 | 0 beshort 0532 370 XA sysV pure executable 25 | >12 belong >0 not stripped 26 | >22 beshort >0 - version %d 27 | >30 belong >0 - 5.2 format 28 | 0 beshort 054001 370 sysV pure executable 29 | >12 belong >0 not stripped 30 | 0 beshort 055001 370 XA sysV pure executable 31 | >12 belong >0 not stripped 32 | 0 beshort 056401 370 sysV executable 33 | >12 belong >0 not stripped 34 | 0 beshort 057401 370 XA sysV executable 35 | >12 belong >0 not stripped 36 | 0 beshort 0531 SVR2 executable (Amdahl-UTS) 37 | >12 belong >0 not stripped 38 | >24 belong >0 - version %ld 39 | 0 beshort 0534 SVR2 pure executable (Amdahl-UTS) 40 | >12 belong >0 not stripped 41 | >24 belong >0 - version %ld 42 | 0 beshort 0530 SVR2 pure executable (USS/370) 43 | >12 belong >0 not stripped 44 | >24 belong >0 - version %ld 45 | 0 beshort 0535 SVR2 executable (USS/370) 46 | >12 belong >0 not stripped 47 | >24 belong >0 - version %ld 48 | -------------------------------------------------------------------------------- /jpeg-6b/rdjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH RDJPGCOM 1 "11 October 1997" 2 | .SH NAME 3 | rdjpgcom \- display text comments from a JPEG file 4 | .SH SYNOPSIS 5 | .B rdjpgcom 6 | [ 7 | .B \-verbose 8 | ] 9 | [ 10 | .I filename 11 | ] 12 | .LP 13 | .SH DESCRIPTION 14 | .LP 15 | .B rdjpgcom 16 | reads the named JPEG/JFIF file, or the standard input if no file is named, 17 | and prints any text comments found in the file on the standard output. 18 | .PP 19 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 20 | Although the standard doesn't actually define what COM blocks are for, they 21 | are widely used to hold user-supplied text strings. This lets you add 22 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 23 | them as text. COM blocks do not interfere with the image stored in the JPEG 24 | file. The maximum size of a COM block is 64K, but you can have as many of 25 | them as you like in one JPEG file. 26 | .SH OPTIONS 27 | .TP 28 | .B \-verbose 29 | Causes 30 | .B rdjpgcom 31 | to also display the JPEG image dimensions. 32 | .PP 33 | Switch names may be abbreviated, and are not case sensitive. 34 | .SH HINTS 35 | .B rdjpgcom 36 | does not depend on the IJG JPEG library. Its source code is intended as an 37 | illustration of the minimum amount of code required to parse a JPEG file 38 | header correctly. 39 | .PP 40 | In 41 | .B \-verbose 42 | mode, 43 | .B rdjpgcom 44 | will also attempt to print the contents of any "APP12" markers as text. 45 | Some digital cameras produce APP12 markers containing useful textual 46 | information. If you like, you can modify the source code to print 47 | other APPn marker types as well. 48 | .SH SEE ALSO 49 | .BR cjpeg (1), 50 | .BR djpeg (1), 51 | .BR jpegtran (1), 52 | .BR wrjpgcom (1) 53 | .SH AUTHOR 54 | Independent JPEG Group 55 | -------------------------------------------------------------------------------- /file/Magdir/ti-8x: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # ti-8x: file(1) magic for the TI-8x and TI-92 Graphing Calculators. 3 | # 4 | # From: Ryan McGuire (rmcguire@freenet.columbus.oh.us). 5 | # 6 | # NOTE: This list is not complete. 7 | # 8 | # Magic Numbers for the TI-82 9 | # 10 | 0 string **TI82** TI-82 Graphing Calculator 11 | >0x000037 byte 0x0B TI-BASIC Group/Program File. 12 | # 13 | # Magic Numbers for the TI-83 14 | # 15 | 0 string **TI83** TI-83 Graphing Calculator 16 | >0x000037 byte 0x0B TI-BASIC Group/Program File. 17 | # 18 | # Magic Numbers for the TI-85 19 | # 20 | 0 string **TI85** TI-85 Graphing Calculator 21 | >11 string Backup Backup File. 22 | >0x000032 string ZS4 - ZShell Version 4 File. 23 | >0x000032 string ZS3 - ZShell Version 3 File. 24 | >0x00000B string GDatabase Graphics Database. 25 | >0x00003B byte 0x12 TI-BASIC Group/Program File. 26 | # 27 | # Magic Numbers for the TI-92 28 | # 29 | 0 string **TI92** TI-92 Graphing Calculator 30 | >0x000058 byte 0x12 TI-BASIC Group File. 31 | >0x000012 string Function Function. 32 | >0x000048 byte 0x12 TI-BASIC Program. 33 | # Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the 34 | # program/group magic numbers in here because I cannot find any. 35 | 0 string **TI80** TI-80 Graphing Calculator File. 36 | 0 string **TI81** TI-81 Graphing Calculator File. 37 | -------------------------------------------------------------------------------- /file/Magdir/claris: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # claris: file(1) magic for claris 4 | # "H. Nanosecond" 5 | # Claris Works a word processor, etc. 6 | # Version 3.0 7 | 8 | # .pct claris works clip art files 9 | #0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 10 | #* 11 | #0001000 #010 250 377 377 377 377 000 213 000 230 000 021 002 377 014 000 12 | #null to byte 1000 octal 13 | 514 string \377\377\377\377\000 Claris clip art? 14 | >0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes. 15 | 514 string \377\377\377\377\001 Claris clip art? 16 | >0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes. 17 | 18 | # Claris works files 19 | # .cwk 20 | 0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document 21 | # .plt 22 | 0 string \020\341\000\000\010\010 Claris Works pallete files .plt 23 | 24 | # .msp a dictionary file I am not sure about this I have only one .msp file 25 | 0 string \002\271\262\000\040\002\000\164 Claris works dictionary 26 | 27 | # .usp are user dictionary bits 28 | # I am not sure about a magic header: 29 | #0000000 001 123 160 146 070 125 104 040 136 123 015 012 160 157 144 151 30 | # soh S p f 8 U D sp ^ S cr nl p o d i 31 | #0000020 141 164 162 151 163 164 040 136 123 015 012 144 151 166 040 043 32 | # a t r i s t sp ^ S cr nl d i v sp # 33 | 34 | # .mth Thesaurus 35 | # statrts with \0 but no magic header 36 | 37 | # .chy Hyphenation file 38 | # I am not sure: 000 210 034 000 000 39 | 40 | # other claris files 41 | #./windows/claris/useng.ndx: data 42 | #./windows/claris/xtndtran.l32: data 43 | #./windows/claris/xtndtran.lst: data 44 | #./windows/claris/clworks.lbl: data 45 | #./windows/claris/clworks.prf: data 46 | #./windows/claris/userd.spl: data 47 | -------------------------------------------------------------------------------- /file/Magdir/varied.out: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # $File: varied.out,v 1.22 2010/07/02 00:06:27 christos Exp $ 4 | # varied.out: file(1) magic for various USG systems 5 | # 6 | # Herewith many of the object file formats used by USG systems. 7 | # Most have been moved to files for a particular processor, 8 | # and deleted if they duplicate other entries. 9 | # 10 | 0 short 0610 Perkin-Elmer executable 11 | # AMD 29K 12 | 0 beshort 0572 amd 29k coff noprebar executable 13 | 0 beshort 01572 amd 29k coff prebar executable 14 | 0 beshort 0160007 amd 29k coff archive 15 | # Cray 16 | 6 beshort 0407 unicos (cray) executable 17 | # Ultrix 4.3 18 | 596 string \130\337\377\377 Ultrix core file 19 | >600 string >\0 from '%s' 20 | # BeOS and MAcOS PEF executables 21 | # From: hplus@zilker.net (Jon Watte) 22 | 0 string Joy!peffpwpc header for PowerPC PEF executable 23 | # 24 | # ava assembler/linker Uros Platise 25 | 0 string avaobj AVR assembler object code 26 | >7 string >\0 version '%s' 27 | # gnu gmon magic From: Eugen Dedu 28 | 0 string gmon GNU prof performance data 29 | >4 long x - version %d 30 | # From: Dave Pearson 31 | # Harbour HRB files. 32 | 0 string \xc0HRB Harbour HRB file 33 | >4 leshort x version %d 34 | # Harbour HBV files 35 | 0 string \xc0HBV Harbour variable dump file 36 | >4 leshort x version %d 37 | 38 | # From: Alex Beregszaszi 39 | # 0 string exec BugOS executable 40 | # 0 string pack BugOS archive 41 | 42 | # From: Jason Spence 43 | # Generated by the "examples" in STM's ST40 devkit, and derived code. 44 | 0 lelong 0x13a9f17e ST40 component image format 45 | >4 string >\0 \b, name '%s' 46 | 47 | -------------------------------------------------------------------------------- /file/Magdir/ncr: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # ncr: file(1) magic for NCR Tower objects 4 | # 5 | # contributed by 6 | # Michael R. Wayne *** TMC & Associates *** INTERNET: wayne@ford-vax.arpa 7 | # uucp: {philabs | pyramid} !fmsrl7!wayne OR wayne@fmsrl7.UUCP 8 | # 9 | 0 beshort 000610 Tower/XP rel 2 object 10 | >12 belong >0 not stripped 11 | >20 beshort 0407 executable 12 | >20 beshort 0410 pure executable 13 | >22 beshort >0 - version %ld 14 | 0 beshort 000615 Tower/XP rel 2 object 15 | >12 belong >0 not stripped 16 | >20 beshort 0407 executable 17 | >20 beshort 0410 pure executable 18 | >22 beshort >0 - version %ld 19 | 0 beshort 000620 Tower/XP rel 3 object 20 | >12 belong >0 not stripped 21 | >20 beshort 0407 executable 22 | >20 beshort 0410 pure executable 23 | >22 beshort >0 - version %ld 24 | 0 beshort 000625 Tower/XP rel 3 object 25 | >12 belong >0 not stripped 26 | >20 beshort 0407 executable 27 | >20 beshort 0410 pure executable 28 | >22 beshort >0 - version %ld 29 | 0 beshort 000630 Tower32/600/400 68020 object 30 | >12 belong >0 not stripped 31 | >20 beshort 0407 executable 32 | >20 beshort 0410 pure executable 33 | >22 beshort >0 - version %ld 34 | 0 beshort 000640 Tower32/800 68020 35 | >18 beshort &020000 w/68881 object 36 | >18 beshort &040000 compatible object 37 | >18 beshort &~060000 object 38 | >20 beshort 0407 executable 39 | >20 beshort 0413 pure executable 40 | >12 belong >0 not stripped 41 | >22 beshort >0 - version %ld 42 | 0 beshort 000645 Tower32/800 68010 43 | >18 beshort &040000 compatible object 44 | >18 beshort &~060000 object 45 | >20 beshort 0407 executable 46 | >20 beshort 0413 pure executable 47 | >12 belong >0 not stripped 48 | >22 beshort >0 - version %ld 49 | -------------------------------------------------------------------------------- /jpeg-6b/jconfig.mc6: -------------------------------------------------------------------------------- 1 | /* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #define NEED_FAR_POINTERS /* for small or medium memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ 23 | 24 | #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ 25 | 26 | #define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */ 27 | 28 | #define NEED_FHEAPMIN /* far heap management routines are broken */ 29 | 30 | #define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */ 31 | /* Note: the above define is known to improve the code with Microsoft C 6.00A. 32 | * I do not know whether it is good for later compiler versions. 33 | * Please report any info on this point to jpeg-info@uunet.uu.net. 34 | */ 35 | 36 | #endif /* JPEG_INTERNALS */ 37 | 38 | #ifdef JPEG_CJPEG_DJPEG 39 | 40 | #define BMP_SUPPORTED /* BMP image file format */ 41 | #define GIF_SUPPORTED /* GIF image file format */ 42 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 43 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 44 | #define TARGA_SUPPORTED /* Targa image file format */ 45 | 46 | #define TWO_FILE_COMMANDLINE 47 | #define USE_SETMODE /* Microsoft has setmode() */ 48 | #define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ 49 | #undef DONT_USE_B_MODE 50 | #undef PROGRESS_REPORT /* optional */ 51 | 52 | #endif /* JPEG_CJPEG_DJPEG */ 53 | -------------------------------------------------------------------------------- /file/Magdir/mcrypt: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # Mavroyanopoulos Nikos 3 | # mcrypt: file(1) magic for mcrypt 2.2.x; 4 | 0 string \0m\2 mcrypt 2.2 encrypted data, 5 | >3 byte 0 algorithm: blowfish-448, 6 | >3 byte 1 algorithm: DES, 7 | >3 byte 2 algorithm: 3DES, 8 | >3 byte 3 algorithm: 3-WAY, 9 | >3 byte 4 algorithm: GOST, 10 | >3 byte 6 algorithm: SAFER-SK64, 11 | >3 byte 7 algorithm: SAFER-SK128, 12 | >3 byte 8 algorithm: CAST-128, 13 | >3 byte 9 algorithm: xTEA, 14 | >3 byte 10 algorithm: TWOFISH-128, 15 | >3 byte 11 algorithm: RC2, 16 | >3 byte 12 algorithm: TWOFISH-192, 17 | >3 byte 13 algorithm: TWOFISH-256, 18 | >3 byte 14 algorithm: blowfish-128, 19 | >3 byte 15 algorithm: blowfish-192, 20 | >3 byte 16 algorithm: blowfish-256, 21 | >3 byte 100 algorithm: RC6, 22 | >3 byte 101 algorithm: IDEA, 23 | >4 byte 0 mode: CBC, 24 | >4 byte 1 mode: ECB, 25 | >4 byte 2 mode: CFB, 26 | >4 byte 3 mode: OFB, 27 | >4 byte 4 mode: nOFB, 28 | >5 byte 0 keymode: 8bit 29 | >5 byte 1 keymode: 4bit 30 | >5 byte 2 keymode: SHA-1 hash 31 | >5 byte 3 keymode: MD5 hash 32 | -------------------------------------------------------------------------------- /rpp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of John the Ripper password cracker, 3 | * Copyright (c) 1996-98 by Solar Designer 4 | */ 5 | 6 | /* 7 | * Rules preprocessor. 8 | */ 9 | 10 | #ifndef _JOHN_RPP_H 11 | #define _JOHN_RPP_H 12 | 13 | #include "cfg.h" 14 | 15 | #define RULE_BUFFER_SIZE 0x100 16 | #define RULE_RANGES_MAX 8 17 | #define RULE_WORD_SIZE 0x80 18 | 19 | #define SECTION_RULES "List.Rules:" 20 | #define SUBSECTION_SINGLE "Single" 21 | #define SUBSECTION_WORDLIST "Wordlist" 22 | 23 | #define ARCH_WORD u_int32_t 24 | #define ARCH_BITS 32 25 | #define ARCH_INDEX u_int32_t 26 | 27 | /* 28 | * Character range. 29 | */ 30 | struct rpp_range { 31 | /* Character position in output rule */ 32 | char *pos; 33 | 34 | /* Number of character values */ 35 | int count; 36 | 37 | /* Current character value index */ 38 | int index; 39 | 40 | /* Present characters bitmask for dupe checking */ 41 | ARCH_WORD mask[0x100 / ARCH_BITS]; 42 | 43 | /* Character values */ 44 | char chars[0x100]; 45 | }; 46 | 47 | /* 48 | * Preprocessor context. 49 | */ 50 | struct rpp_context { 51 | /* Current rule before preprocessing */ 52 | struct cfg_line *input; 53 | 54 | /* Current rule after preprocessing */ 55 | char output[RULE_BUFFER_SIZE]; 56 | 57 | /* Number of character ranges in this rule */ 58 | int count; 59 | 60 | /* Character ranges. I really hate to do it this way, but otherwise context 61 | * management would be far more complicated. */ 62 | struct rpp_range ranges[RULE_RANGES_MAX]; 63 | }; 64 | 65 | /* 66 | * Initializes the preprocessor's context for the supplied configuration file 67 | * rules subsection. Returns a non-zero value on error (no rules found). 68 | */ 69 | extern int rpp_init(struct rpp_context *ctx, char *subsection); 70 | 71 | /* 72 | * Returns a preprocessed rule and moves to the next one. 73 | */ 74 | extern char *rpp_next(struct rpp_context *ctx); 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /jpeg-6b/makcjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de), 5 | ; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de), 6 | ; and Guido Vollbeding (guivol@esc.de). 7 | ; 8 | ; To use this file, rename it to cjpeg.prj. 9 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 10 | ; Read installation instructions before trying to make the program! 11 | ; 12 | ; 13 | ; * * * Output file * * * 14 | cjpeg.ttp 15 | ; 16 | ; * * * COMPILER OPTIONS * * * 17 | .C[-P] ; absolute calls 18 | .C[-M] ; and no string merging, folks 19 | .C[-w-cln] ; no "constant is long" warnings 20 | .C[-w-par] ; no "parameter xxxx unused" 21 | .C[-w-rch] ; no "unreachable code" 22 | .C[-wsig] ; warn if significant digits may be lost 23 | = 24 | ; * * * * List of modules * * * * 25 | pcstart.o 26 | cjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) 27 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | rdppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 30 | rdgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 31 | rdtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 32 | rdbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 33 | rdrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 34 | libjpeg.lib ; built by libjpeg.prj 35 | pcfltlib.lib ; floating point library 36 | ; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED 37 | pcstdlib.lib ; standard library 38 | pcextlib.lib ; extended library 39 | -------------------------------------------------------------------------------- /jpeg-6b/makdjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle (Frank.Moehle@arbi.informatik.uni-oldenburg.de), 5 | ; Dr. B. Setzepfandt (bernd@gina.uni-muenster.de), 6 | ; and Guido Vollbeding (guivol@esc.de). 7 | ; 8 | ; To use this file, rename it to djpeg.prj. 9 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 10 | ; Read installation instructions before trying to make the program! 11 | ; 12 | ; 13 | ; * * * Output file * * * 14 | djpeg.ttp 15 | ; 16 | ; * * * COMPILER OPTIONS * * * 17 | .C[-P] ; absolute calls 18 | .C[-M] ; and no string merging, folks 19 | .C[-w-cln] ; no "constant is long" warnings 20 | .C[-w-par] ; no "parameter xxxx unused" 21 | .C[-w-rch] ; no "unreachable code" 22 | .C[-wsig] ; warn if significant digits may be lost 23 | = 24 | ; * * * * List of modules * * * * 25 | pcstart.o 26 | djpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) 27 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | rdcolmap.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | wrppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 30 | wrgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 31 | wrtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 32 | wrbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 33 | wrrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 34 | libjpeg.lib ; built by libjpeg.prj 35 | pcfltlib.lib ; floating point library 36 | ; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED 37 | pcstdlib.lib ; standard library 38 | pcextlib.lib ; extended library 39 | -------------------------------------------------------------------------------- /cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of John the Ripper password cracker, 3 | * Copyright (c) 1996-98 by Solar Designer 4 | */ 5 | 6 | /* 7 | * Configuration file loader. 8 | */ 9 | 10 | #ifndef _JOHN_CONFIG_H 11 | #define _JOHN_CONFIG_H 12 | 13 | #define LINE_BUFFER_SIZE 0x400 14 | 15 | /* 16 | * Parameter list entry. 17 | */ 18 | struct cfg_param { 19 | struct cfg_param *next; 20 | char *name, *value; 21 | }; 22 | 23 | /* 24 | * Line list entry. 25 | */ 26 | struct cfg_line { 27 | struct cfg_line *next; 28 | char *data; 29 | int number; 30 | }; 31 | 32 | /* 33 | * Main line list structure, head is used to start scanning the list, while 34 | * tail is used to add new entries. 35 | */ 36 | struct cfg_list { 37 | struct cfg_line *head, *tail; 38 | }; 39 | 40 | /* 41 | * Section list entry. 42 | */ 43 | struct cfg_section { 44 | struct cfg_section *next; 45 | char *name; 46 | struct cfg_param *params; 47 | struct cfg_list *list; 48 | }; 49 | 50 | /* 51 | * Loads a configuration file. 52 | */ 53 | extern void cfg_init(char *name); 54 | 55 | /* 56 | * Searches for a section with the supplied name, and returns its line list 57 | * structure, or NULL if the search fails. 58 | */ 59 | extern struct cfg_list *cfg_get_list(char *section, char *subsection); 60 | 61 | /* 62 | * Searches for a section with the supplied name and a parameter within the 63 | * section, and returns the parameter's value, or NULL if not found. 64 | */ 65 | extern char *cfg_get_param(char *section, char *subsection, char *param); 66 | 67 | /* 68 | * Similar to the above, but does an atoi(). Returns -1 if not found. 69 | */ 70 | extern int cfg_get_int(char *section, char *subsection, char *param); 71 | 72 | /* 73 | * Converts the value to boolean. Returns 0 (false) if not found. 74 | */ 75 | extern int cfg_get_bool(char *section, char *subsection, char *param); 76 | 77 | extern char *fgetl(char *s, int size, FILE *stream); 78 | #endif 79 | -------------------------------------------------------------------------------- /acconfig.h: -------------------------------------------------------------------------------- 1 | /* Define to the path where the rules.ini file can be found */ 2 | #undef _PATH_RULES 3 | 4 | /* Define to `unsigned long long' if doesn't define. */ 5 | #undef u_int64_t 6 | 7 | /* Define to `unsigned int' if doesn't define. */ 8 | #undef u_int32_t 9 | 10 | /* Define to `unsigned short' if doesn't define. */ 11 | #undef u_int16_t 12 | 13 | /* Define to `unsigned char' if doesn't define. */ 14 | #undef u_int8_t 15 | 16 | /* Define if timeradd is defined in */ 17 | #undef HAVE_TIMERADD 18 | #ifndef HAVE_TIMERADD 19 | #define timeradd(tvp, uvp, vvp) \ 20 | do { \ 21 | (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ 22 | (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ 23 | if ((vvp)->tv_usec >= 1000000) { \ 24 | (vvp)->tv_sec++; \ 25 | (vvp)->tv_usec -= 1000000; \ 26 | } \ 27 | } while (0) 28 | #define timersub(tvp, uvp, vvp) \ 29 | do { \ 30 | (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ 31 | (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ 32 | if ((vvp)->tv_usec < 0) { \ 33 | (vvp)->tv_sec--; \ 34 | (vvp)->tv_usec += 1000000; \ 35 | } \ 36 | } while (0) 37 | #endif /* !HAVE_TIMERADD */ 38 | @BOTTOM@ 39 | 40 | /* Prototypes for missing functions */ 41 | #ifndef HAVE_STRLCAT 42 | size_t strlcat(char *, const char *, size_t); 43 | #endif 44 | 45 | #ifndef HAVE_STRLCPY 46 | size_t strlcpy(char *, const char *, size_t); 47 | #endif 48 | 49 | #ifndef HAVE_BASENAME 50 | char *basename(const char *); 51 | char *dirname(const char *); 52 | #endif 53 | -------------------------------------------------------------------------------- /file/Magdir/os2: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # os2: file(1) magic for OS/2 files 4 | # 5 | 6 | # Provided 1998/08/22 by 7 | # David Mediavilla 8 | 1 string InternetShortcut MS Windows 95 Internet shortcut text 9 | >24 string >\ (URL=<%s>) 10 | 11 | # OS/2 URL objects 12 | # Provided 1998/08/22 by 13 | # David Mediavilla 14 | 0 string http: OS/2 URL object text 15 | >5 string >\ (WWW) 16 | 0 string mailto: OS/2 URL object text 17 | >7 string >\ (email) <%s> 18 | 0 string news: OS/2 URL object text 19 | >5 string >\ (Usenet) <%s> 20 | 0 string ftp: OS/2 URL object text 21 | >4 string >\ (FTP) 22 | 0 string file: OS/2 URL object text 23 | >5 string >\ (Local file) <%s> 24 | 25 | # >>>>> OS/2 INF/HLP <<<<< (source: Daniel Dissett ddissett@netcom.com) 26 | # Carl Hauser (chauser.parc@xerox.com) and 27 | # Marcus Groeber (marcusg@ph-cip.uni-koeln.de) 28 | # list the following header format in inf02a.doc: 29 | # 30 | # int16 ID; // ID magic word (5348h = "HS") 31 | # int8 unknown1; // unknown purpose, could be third letter of ID 32 | # int8 flags; // probably a flag word... 33 | # // bit 0: set if INF style file 34 | # // bit 4: set if HLP style file 35 | # // patching this byte allows reading HLP files 36 | # // using the VIEW command, while help files 37 | # // seem to work with INF settings here as well. 38 | # int16 hdrsize; // total size of header 39 | # int16 unknown2; // unknown purpose 40 | # 41 | 0 string HSP\x01\x9b\x00 OS/2 INF 42 | >107 string >0 (%s) 43 | 0 string HSP\x10\x9b\x00 OS/2 HLP 44 | >107 string >0 (%s) 45 | 46 | # OS/2 INI (this is a guess) 47 | 0 string \xff\xff\xff\xff\x14\0\0\0 OS/2 INI 48 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign no-dependencies 2 | 3 | JPEGDIR = ./jpeg-6b 4 | JPEGINC = -I$(JPEGDIR) 5 | JPEGLIB = -L$(JPEGDIR) -ljpeg 6 | JPEGDEP = $(JPEGDIR)/libjpeg.a 7 | 8 | FILEDIR = ./file 9 | FILEINC = -I$(FILEDIR) 10 | FILELIB = -L$(FILEDIR) -lfile 11 | FILEDEP = $(FILEDIR)/libfile.a 12 | 13 | GTKINC = @GTKINC@ 14 | GTKLIB = @GTKLIB@ 15 | EVENTINC = @EVENTINC@ 16 | EVENTLIB = @EVENTLIB@ 17 | 18 | LIBS = $(JPEGLIB) 19 | 20 | SUBDIRS = jpeg-6b file 21 | 22 | man_MANS = stegdetect.1 stegbreak.1 23 | 24 | EXTRA_DIST = $(man_MANS) acconfig.h jpeg-6b bf_locl.h bf_pi.h blowfish.h \ 25 | compat/err.h compat/md5.h compat/sys/queue.h 26 | 27 | #CFLAGS = @CFLAGS@ -Wall -g 28 | CFLAGS = -O2 -Wall -g 29 | 30 | INCLUDES = $(JPEGINC) $(FILEINC) -I$(srcdir)/compat $(EVENTINC) $(GTKINC) 31 | 32 | EXTRA_PROGRAMS = xsteg 33 | bin_PROGRAMS = stegdetect stegbreak stegcompare stegdeimage @XSTEG@ 34 | 35 | CSRCS= common.c common.h jphide_table.c util.c jphide_table.h 36 | 37 | stegdetect_SOURCES = $(CSRCS) stegdetect.c chi2cdf.c chi2cdf.h extraction.c \ 38 | extraction.h discrimination.c discrimination.h math.c dct.c \ 39 | dct.h jutil.c jutil.h f5.c 40 | stegdetect_LDADD = @LIBOBJS@ $(LIBS) $(FILELIB) -lm 41 | 42 | EXTRA_stegbreak_SOURCES = bf_enc.c bf-586.s 43 | stegbreak_SOURCES = $(CSRCS) stegbreak.c \ 44 | break_jphide.c break_jphide.h \ 45 | break_outguess.c break_outguess.h \ 46 | break_jsteg.c break_jsteg.h \ 47 | cfg.c cfg.h rpp.c rpp.h \ 48 | rules.c rules.h bf_skey.c db.c db.h \ 49 | arc4.c arc4.h 50 | stegbreak_LDADD = @LIBOBJS@ $(LIBS) $(FILELIB) @BFOBJ@ 51 | stegbreak_DEPENDENCIES = @BFOBJ@ 52 | 53 | stegcompare_SOURCES = $(CSRCS) stegcompare.c 54 | stegcompare_LDADD = @LIBOBJS@ $(LIBS) 55 | 56 | stegdeimage_SOURCES = $(CSRCS) stegdeimage.c 57 | stegdeimage_LDADD = @LIBOBJS@ $(LIBS) 58 | 59 | xsteg_SOURCES = xsteg.c xsteg.h xsteg_xpm.c 60 | xsteg_LDADD = @LIBOBJS@ $(GTKLIB) $(EVENTLIB) 61 | 62 | DISTCLEANFILES = *~ 63 | 64 | config.status: 65 | -------------------------------------------------------------------------------- /extraction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _EXTRACTION_ 32 | #define _EXTRACTION_ 33 | 34 | typedef double *(*transform_t)(short *, int, int *); 35 | transform_t transform_lookup(char *); 36 | 37 | #endif /* _EXTRACTION_ */ 38 | -------------------------------------------------------------------------------- /file/Magdir/tex: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # tex: file(1) magic for TeX files 4 | # 5 | # From 6 | 7 | # Although we may know the offset of certain text fields in TeX DVI 8 | # and font files, we can't use them reliably because they are not 9 | # zero terminated. [but we do anyway, christos] 10 | 0 string \367\002 TeX DVI file 11 | >16 string >\0 (%s) 12 | 0 string \367\203 TeX generic font data 13 | 0 string \367\131 TeX packed font data 14 | >3 string >\0 (%s) 15 | 0 string \367\312 TeX virtual font data 16 | 0 string This\ is\ TeX, TeX transcript text 17 | 0 string This\ is\ METAFONT, METAFONT transcript text 18 | 19 | # There is no way to detect TeX Font Metric (*.tfm) files without 20 | # breaking them apart and reading the data. The following patterns 21 | # match most *.tfm files generated by METAFONT or afm2tfm. 22 | 2 string \000\021 TeX font metric data 23 | >33 string >\0 (%s) 24 | 2 string \000\022 TeX font metric data 25 | >33 string >\0 (%s) 26 | 27 | # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com) 28 | 0 string \\input\ texinfo Texinfo source text 29 | 0 string This\ is\ Info\ file GNU Info text 30 | 31 | # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com) 32 | 0 string \\input TeX document text 33 | 0 string \\section LaTeX document text 34 | 0 string \\setlength LaTeX document text 35 | 0 string \\documentstyle LaTeX document text 36 | 0 string \\chapter LaTeX document text 37 | 0 string \\documentclass LaTeX 2e document text 38 | 0 string \\relax LaTeX auxiliary file 39 | 0 string \\contentsline LaTeX table of contents 40 | 41 | # Index and glossary files 42 | 0 string \\indexentry LaTeX raw index file 43 | 0 string \\begin{theindex} LaTeX sorted index 44 | 0 string \\glossaryentry LaTeX raw glossary 45 | 0 string \\begin{theglossary} LaTeX sorted glossary 46 | 0 string This\ is\ makeindex Makeindex log file 47 | # End of TeX 48 | -------------------------------------------------------------------------------- /dct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef _DCT_H_ 31 | #define _DCT_H_ 32 | 33 | void mat_transpose(double **out, double **in, int size); 34 | 35 | void dct_init(void); 36 | void idct(short *, short *); 37 | void dct(short *, short *); 38 | 39 | #endif; 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | stegdetect 2 | ========== 3 | 4 | **Note**: This repo is a code mirror of [the original source](http://www.outguess.org/detection.php) which is now dead. Here is a working [archive](https://web.archive.org/web/20150415213536/http://www.outguess.org/detection.php) of the page. 5 | 6 | Stegdetect and Stegbreak have been developed by [Niels Provos](http://niels.xtdnet.nl/). 7 | 8 | [Copyright 2002 Niels Provos ](LICENSE) 9 | 10 | **This repo is not maintained. Use at your own risk (there are known issues)** 11 | 12 | --- 13 | 14 | Stegdetect is an automated tool for detecting steganographic content in images. 15 | 16 | This repo has been updated to compile cleanly on Ubuntu since the original project appears to be abandoned and no longer accepts pull requests. 17 | 18 | Tested on Ubuntu 16.04 and 18.04 only(17.x likely works though) 19 | 20 | ### Building on 64-bit Systemgs 21 | 22 | ```bash 23 | $ linux32 ./configure 24 | $ linux32 make 25 | ``` 26 | 27 | You can now run stegdetect from the local directory: `./stegdetect` 28 | 29 | ### Build for Android 30 | 31 | This Android build is sort of fragile, there are many compile warnings. 32 | 33 | You must set the environment variable `NDK_BASE` to the root location of your 34 | Android NDK. 35 | 36 | ```bash 37 | $ make clean 38 | $ make -f Makefile.android 39 | ``` 40 | 41 | ### Usage 42 | 43 | Stegdetect does two types of F5 detection, simple and "slow". Simple merely 44 | looks for a comment in the header, which any savy coder has removed. This 45 | method is enabled with the "`-tf`" option. 46 | 47 | The "slow" F5 detection is enabled with "`-tF`" 48 | 49 | To run detection on a directory of JPEGs use: 50 | 51 | ```bash 52 | for img in `find /path/to/images/ -iname "*jpg"`; do 53 | ./stegdetect -tF $img; 54 | done 55 | ``` 56 | 57 | **Android** 58 | 59 | 60 | ```bash 61 | $ adb push stegdetect /data/local/tmp 62 | $ adb shell 63 | for img in `ls /sdcard/PixelKnot/*jpg`; do 64 | /data/local/tmp/stegdetect -tF $img 65 | done 66 | ``` 67 | -------------------------------------------------------------------------------- /file/Magdir/maple: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # maple: file(1) magic for maple files 4 | # "H. Nanosecond" 5 | # Maple V release 4, a multi-purpose math program 6 | # 7 | 8 | # maple library .lib 9 | 0 string \000MVR4\nI MapleVr4 library 10 | 11 | # .ind 12 | # no magic for these :-( 13 | # they are compiled indexes for maple files 14 | 15 | # .hdb 16 | 0 string \000\004\000\000 Maple help database 17 | 18 | # .mhp 19 | # this has the form 20 | 0 string \9 string >\0 version %.1s. 35 | >>10 string 36 | >>>11 string >\0 %.1s 37 | 38 | # .mps 39 | 0 string \0\0\001$ Maple something 40 | # from byte 4 it is either 'nul E' or 'soh R' 41 | # I think 'nul E' means a file that was saved as a different name 42 | # a sort of revision marking 43 | # 'soh R' means new 44 | >4 string \000\105 An old revision 45 | >4 string \001\122 The latest save 46 | 47 | # .mpl 48 | # some of these are the same as .mps above 49 | #0000000 000 000 001 044 000 105 same as .mps 50 | #0000000 000 000 001 044 001 122 same as .mps 51 | 52 | 0 string #\n##\ Maple something anomalous. 58 | -------------------------------------------------------------------------------- /break_jsteg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _BREAK_JSTEG_ 32 | #define _BREAK_JSTEG_ 33 | 34 | void *break_jsteg_prepare(char *, short *, int); 35 | void break_jsteg_destroy(void *); 36 | int crack_jsteg(char *, char *, void *); 37 | 38 | void *break_jsteg_read(char *); 39 | int break_jsteg_write(char *, void *); 40 | 41 | #endif /* _BREAK_JSTEG_ */ 42 | -------------------------------------------------------------------------------- /break_outguess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _BREAK_OUTGUESS_ 32 | #define _BREAK_OUTGUESS_ 33 | 34 | void *break_outguess_prepare(short *, int); 35 | void break_outguess_destroy(void *); 36 | int crack_outguess(char *, char *, void *); 37 | 38 | void *break_outguess_read(char *); 39 | int break_outguess_write(char *, void *); 40 | 41 | #endif /* _BREAK_OUTGUESS_ */ 42 | -------------------------------------------------------------------------------- /file/LEGAL.NOTICE: -------------------------------------------------------------------------------- 1 | $Id: LEGAL.NOTICE,v 1.1.1.1 2001/10/16 18:05:11 provos Exp $ 2 | Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995. 3 | Software written by Ian F. Darwin and others; 4 | maintained 1994-1999 Christos Zoulas. 5 | 6 | This software is not subject to any export provision of the United States 7 | Department of Commerce, and may be exported to any country or planet. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 1. Redistributions of source code must retain the above copyright 13 | notice immediately at the beginning of the file, without modification, 14 | this list of conditions, and the following disclaimer. 15 | 2. Redistributions in binary form must reproduce the above copyright 16 | notice, this list of conditions and the following disclaimer in the 17 | documentation and/or other materials provided with the distribution. 18 | 3. All advertising materials mentioning features or use of this software 19 | must display the following acknowledgement: 20 | This product includes software developed by Ian F. Darwin and others. 21 | 4. The name of the author may not be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 28 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | SUCH DAMAGE. 35 | -------------------------------------------------------------------------------- /break_jphide.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _BREAK_JPHIDE_ 32 | #define _BREAK_JPHIDE_ 33 | 34 | int break_jphide_compare(void *, void *); 35 | void *break_jphide_prepare(int); 36 | void break_jphide_destroy(void *); 37 | int crack_jphide(char *, char *, void *); 38 | 39 | void *break_jphide_read(char *); 40 | int break_jphide_write(char *, void *); 41 | 42 | #endif /* _BREAK_JPHIDE_ */ 43 | -------------------------------------------------------------------------------- /file/Magdir/fonts: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # fonts: file(1) magic for font data 4 | # 5 | 0 string FONT ASCII vfont text 6 | 0 short 0436 Berkeley vfont data 7 | 0 short 017001 byte-swapped Berkeley vfont data 8 | 9 | # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com 10 | 0 string %!PS-AdobeFont-1.0 PostScript Type 1 font text 11 | >20 string >\0 (%s) 12 | 6 string %!PS-AdobeFont-1.0 PostScript Type 1 font program data 13 | 14 | # X11 font files in SNF (Server Natural Format) format 15 | 0 belong 00000004 X11 SNF font data, MSB first 16 | 0 lelong 00000004 X11 SNF font data, LSB first 17 | 18 | # X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com) 19 | 0 string STARTFONT\040 X11 BDF font text 20 | 21 | # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com) 22 | # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides) 23 | 0 string \001fcp X11 Portable Compiled Font data 24 | >12 byte 0x02 \b, LSB first 25 | >12 byte 0x0a \b, MSB first 26 | 0 string D1.0\015 X11 Speedo font data 27 | 28 | #------------------------------------------------------------------------------ 29 | # FIGlet fonts and controlfiles 30 | # From figmagic supplied with Figlet version 2.2 31 | # "David E. O'Brien" 32 | 0 string flf FIGlet font 33 | >3 string >2a version %-2.2s 34 | 0 string flc FIGlet controlfile 35 | >3 string >2a version %-2.2s 36 | 37 | # libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu) 38 | # Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++ 39 | 0 belong 0x14025919 libGrx font data, 40 | >8 leshort x %dx 41 | >10 leshort x \b%d 42 | >40 string x %s 43 | # Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu) 44 | 0 belong 0xff464f4e DOS code page font data collection 45 | 7 belong 0x00454741 DOS code page font data 46 | 7 belong 0x00564944 DOS code page font data (from Linux?) 47 | 4098 string DOSFONT DOSFONT2 encrypted font data 48 | 49 | # downloadable fonts for browser (prints type) anthon@mnt.org 50 | 0 string PFR1 PFR1 font 51 | >102 string >0 \b: %s 52 | -------------------------------------------------------------------------------- /chi2cdf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | float chitable[256][1024] = { 34 | #include "chi2cdf.h" 35 | }; 36 | 37 | float 38 | chi2cdf(float chi, int dgf) 39 | { 40 | int y = chi * 2; 41 | 42 | if (dgf <= 0) 43 | return (1); 44 | 45 | if (y == 0) 46 | return (0); 47 | y--; 48 | 49 | if (y >= 1024) 50 | y = 1023; 51 | 52 | dgf--; 53 | 54 | if (dgf >= 256) 55 | dgf = 255; 56 | 57 | return (chitable[dgf][y]); 58 | } 59 | -------------------------------------------------------------------------------- /rules.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of John the Ripper password cracker, 3 | * Copyright (c) 1996-98 by Solar Designer 4 | */ 5 | 6 | /* 7 | * Rules support routines. 8 | */ 9 | 10 | #ifndef _JOHN_RULES_H 11 | #define _JOHN_RULES_H 12 | 13 | #include "rpp.h" 14 | 15 | #define RULES_NAME _PATH_RULES 16 | 17 | /* 18 | * Error codes. 19 | */ 20 | #define RULES_ERROR_NONE 0 21 | #define RULES_ERROR_END 1 22 | #define RULES_ERROR_UNKNOWN 2 23 | #define RULES_ERROR_POSITION 3 24 | #define RULES_ERROR_CLASS 4 25 | #define RULES_ERROR_REJECT 5 26 | 27 | /* 28 | * Error names. 29 | */ 30 | extern char *rules_errors[]; 31 | 32 | /* 33 | * Last error code. 34 | */ 35 | extern int rules_errno; 36 | 37 | /* 38 | * Configuration file line number, only set after a rules_check() call if 39 | * rules_errno indicates an error. 40 | */ 41 | extern int rules_line; 42 | 43 | /* 44 | * Initializes the rules support. 45 | */ 46 | extern void rules_init(int max_length); 47 | 48 | /* 49 | * Processes rule reject flags, based on information from the database. 50 | * Returns a pointer to the first command in the rule if it's accepted, 51 | * or NULL if rejected or an error occured. Also sets rules_errno on 52 | * error. If the database is NULL, all rules are accepted (to be used 53 | * for syntax checking). 54 | */ 55 | extern char *rules_reject(char *rule, void *db); 56 | 57 | /* 58 | * Applies rule to a word. Returns the updated word, or NULL if rejected or 59 | * an error occured. Also sets rules_errno on error. 60 | * 61 | * split > 0 "single crack" mode, split is the second word's position 62 | * split == 0 "single crack" mode, only one word 63 | * split < 0 other cracking modes, "single crack" mode rules are invalid 64 | */ 65 | extern char *rules_apply(char *word, char *rule, int split); 66 | 67 | /* 68 | * Checks if all the rules for context are valid. Returns the number of rules, 69 | * or returns zero and sets rules_errno on error. 70 | * 71 | * split == 0 "single crack" mode rules allowed 72 | * split < 0 "single crack" mode rules are invalid 73 | */ 74 | extern int rules_check(struct rpp_context *start, int split); 75 | 76 | /* 77 | * Similar to rules_check(), but displays a message and does not return on 78 | * error. 79 | */ 80 | extern int rules_count(struct rpp_context *start, int split); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /arc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _ARC4_ 32 | #define _ARC4_ 33 | 34 | struct arc4_stream { 35 | u_int8_t i; 36 | u_int8_t j; 37 | u_int8_t s[256]; 38 | }; 39 | 40 | void arc4_addrandom(struct arc4_stream *, u_char *, int); 41 | void arc4_initkey(struct arc4_stream *, u_char *, int); 42 | void arc4_fixedkey(struct arc4_stream *, u_char *, int); 43 | 44 | void arc4_skipbytes(struct arc4_stream *, int); 45 | 46 | u_int32_t arc4_getword(struct arc4_stream *); 47 | u_int8_t arc4_getbyte(struct arc4_stream *); 48 | void arc4_init(struct arc4_stream *); 49 | 50 | #endif /* _ARC4_ */ 51 | -------------------------------------------------------------------------------- /file/Magdir/clipper: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # clipper: file(1) magic for Intergraph (formerly Fairchild) Clipper. 4 | # 5 | # XXX - what byte order does the Clipper use? 6 | # 7 | # XXX - what's the "!" stuff: 8 | # 9 | # >18 short !074000,000000 C1 R1 10 | # >18 short !074000,004000 C2 R1 11 | # >18 short !074000,010000 C3 R1 12 | # >18 short !074000,074000 TEST 13 | # 14 | # I shall assume it's ANDing the field with the first value and 15 | # comparing it with the second, and rewrite it as: 16 | # 17 | # >18 short&074000 000000 C1 R1 18 | # >18 short&074000 004000 C2 R1 19 | # >18 short&074000 010000 C3 R1 20 | # >18 short&074000 074000 TEST 21 | # 22 | # as SVR3.1's "file" doesn't support anything of the "!074000,000000" 23 | # sort, nor does SunOS 4.x, so either it's something Intergraph added 24 | # in CLIX, or something AT&T added in SVR3.2 or later, or something 25 | # somebody else thought was a good idea; it's not documented in the 26 | # man page for this version of "magic", nor does it appear to be 27 | # implemented (at least not after I blew off the bogus code to turn 28 | # old-style "&"s into new-style "&"s, which just didn't work at all). 29 | # 30 | 0 short 0575 CLIPPER COFF executable (VAX #) 31 | >20 short 0407 (impure) 32 | >20 short 0410 (5.2 compatible) 33 | >20 short 0411 (pure) 34 | >20 short 0413 (demand paged) 35 | >20 short 0443 (target shared library) 36 | >12 long >0 not stripped 37 | >22 short >0 - version %ld 38 | 0 short 0577 CLIPPER COFF executable 39 | >18 short&074000 000000 C1 R1 40 | >18 short&074000 004000 C2 R1 41 | >18 short&074000 010000 C3 R1 42 | >18 short&074000 074000 TEST 43 | >20 short 0407 (impure) 44 | >20 short 0410 (pure) 45 | >20 short 0411 (separate I&D) 46 | >20 short 0413 (paged) 47 | >20 short 0443 (target shared library) 48 | >12 long >0 not stripped 49 | >22 short >0 - version %ld 50 | >48 long&01 01 alignment trap enabled 51 | >52 byte 1 -Ctnc 52 | >52 byte 2 -Ctsw 53 | >52 byte 3 -Ctpw 54 | >52 byte 4 -Ctcb 55 | >53 byte 1 -Cdnc 56 | >53 byte 2 -Cdsw 57 | >53 byte 3 -Cdpw 58 | >53 byte 4 -Cdcb 59 | >54 byte 1 -Csnc 60 | >54 byte 2 -Cssw 61 | >54 byte 3 -Cspw 62 | >54 byte 4 -Cscb 63 | 4 string pipe CLIPPER instruction trace 64 | 4 string prof CLIPPER instruction profile 65 | -------------------------------------------------------------------------------- /file/magic2mime: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl 2 | # -*- PERL -*- 3 | # $Id: magic2mime,v 1.1.1.1 2001/10/16 18:05:29 provos Exp $ 4 | # Copyright (c) 1996, 1997 vax@linkdead.paranoia.com (VaX#n8) 5 | # 6 | # Usage: echo 'your-file-output-here' | file_to_ctype.pl 7 | # file -b files... | file_to_ctype.pl 8 | # It acts like a filter, reading from STDIN and any files on the command 9 | # line, printing to STDOUT. 10 | 11 | ## refs 12 | # http://www.faqs.org/faqs/mail/mime-faq/part1/index.html 13 | # comp.mail.mime FAQ 14 | # ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types 15 | # assigned content-types 16 | # ftp://ftp.uu.net/inet/rfc/rfc-index 17 | # RFC index; search for MIME 18 | 19 | @mapping = 20 | ( 21 | # defaults 22 | 'data', 'application/octet-stream', 23 | 'text', 'text/plain', 24 | # more specific 25 | '^Rich Text Format data', 'text/richtext', 26 | '^HTML document text', 'text/html', 27 | '^exported SGML document text', 'text/sgml', 28 | 'mail text', 'message/rfc822', 29 | 'news text', 'message/news', 30 | '^PostScript document text', 'application/postscript', 31 | '^BinHex binary text', 'application/mac-binhex40', 32 | '^Zip archive data', 'application/zip', 33 | '^Microsoft Word', 'application/msword', 34 | '^PGP key', 'application/pgp-keys', 35 | '^PGP encrypted', 'application/pgp-encrypted', 36 | '^PGP armored data signature', 'application/pgp-signature', 37 | '^JPEG image', 'image/jpeg', 38 | '^GIF image', 'image/gif', 39 | '^PNG image', 'image/png', 40 | '^TIFF image', 'image/tiff', 41 | 'Computer Graphics Metafile', 'image/cgf', 42 | '^Sun/NeXT audio data', 'audio/basic', 43 | '^MPEG', 'video/mpeg', 44 | '^Apple QuickTime movie', 'video/quicktime', 45 | # made up by me 46 | '^bitmap', 'image/x-bitmap', 47 | '^PC bitmap data, Windows 3.x format', 'image/x-msw3bmp', 48 | '^FLI', 'video/x-fli', 49 | '^FLC', 'video/x-flc', 50 | 'AVI data', 'video/x-avi', 51 | 'WAVE', 'audio/x-wav', 52 | 'VOC', 'audio/x-voc', 53 | ); 54 | 55 | local($mimetype,$index,$regexp); 56 | while (<>) 57 | { 58 | chop; 59 | $index = $#mapping - 1; 60 | while ($index > -1 && !defined($mimetype)) 61 | { 62 | $mimetype = $mapping[$index + 1] if (/$mapping[$index]/); 63 | $index -= 2; 64 | } 65 | print "$mimetype\n"; 66 | undef $mimetype; # hack 67 | } 68 | 0; 69 | -------------------------------------------------------------------------------- /compat/err.h: -------------------------------------------------------------------------------- 1 | /* 2 | * err.h 3 | * 4 | * Adapted from OpenBSD libc *err* *warn* code. 5 | * 6 | * Copyright (c) 2000 Dug Song 7 | * 8 | * Copyright (c) 1993 9 | * The Regents of the University of California. All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 1. Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 3. All advertising materials mentioning features or use of this software 20 | * must display the following acknowledgement: 21 | * This product includes software developed by the University of 22 | * California, Berkeley and its contributors. 23 | * 4. Neither the name of the University nor the names of its contributors 24 | * may be used to endorse or promote products derived from this software 25 | * without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 | * SUCH DAMAGE. 38 | * 39 | * @(#)err.h 8.1 (Berkeley) 6/2/93 40 | */ 41 | 42 | #ifndef _ERR_H_ 43 | #define _ERR_H_ 44 | 45 | void err(int eval, const char *fmt, ...); 46 | void warn(const char *fmt, ...); 47 | void errx(int eval, const char *fmt, ...); 48 | void warnx(const char *fmt, ...); 49 | 50 | #endif /* !_ERR_H_ */ 51 | -------------------------------------------------------------------------------- /db.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _DB_H_ 32 | #define _DB_H_ 33 | 34 | TAILQ_HEAD(dbqueue, db); 35 | extern struct dbqueue dblist; 36 | 37 | struct db { 38 | TAILQ_ENTRY (db) next; 39 | 40 | int type; 41 | char *filename; 42 | void *obj; 43 | int (*crack)(char *, char *, void *); 44 | int (*compare)(void *, void *); 45 | void (*free)(void *); 46 | }; 47 | 48 | void db_init(void); 49 | void db_insert(char *filename, int type, void *obj, 50 | int (*crack)(char *, char *, void *), 51 | int (*compare)(void *, void *), 52 | void (*free)(void *)); 53 | int db_crack(char *); 54 | void db_remove(struct db *db); 55 | void db_flush(void); 56 | 57 | #endif /* _DB_H_ */ 58 | 59 | -------------------------------------------------------------------------------- /file/Magdir/xenix: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # xenix: file(1) magic for Microsoft Xenix 4 | # 5 | # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small 6 | # model" lifted from "magic.xenix", with comment "derived empirically; 7 | # treat as folklore until proven" 8 | # 9 | # "small model", "large model", "huge model" stuff lifted from XXX 10 | # 11 | # XXX - "x.out" collides with PDP-11 archives 12 | # 13 | 0 string core core file (Xenix) 14 | # XXX - stegbreak 15 | #0 byte 0x80 8086 relocatable (Microsoft) 16 | 0 leshort 0xff65 x.out 17 | >2 string __.SYMDEF randomized 18 | >0 byte x archive 19 | 0 leshort 0x206 Microsoft a.out 20 | >8 leshort 1 Middle model 21 | >0x1e leshort &0x10 overlay 22 | >0x1e leshort &0x2 separate 23 | >0x1e leshort &0x4 pure 24 | >0x1e leshort &0x800 segmented 25 | >0x1e leshort &0x400 standalone 26 | >0x1e leshort &0x8 fixed-stack 27 | >0x1c byte &0x80 byte-swapped 28 | >0x1c byte &0x40 word-swapped 29 | >0x10 lelong >0 not-stripped 30 | >0x1e leshort ^0xc000 pre-SysV 31 | >0x1e leshort &0x4000 V2.3 32 | >0x1e leshort &0x8000 V3.0 33 | >0x1c byte &0x4 86 34 | >0x1c byte &0xb 186 35 | >0x1c byte &0x9 286 36 | >0x1c byte &0xa 386 37 | >0x1f byte <0x040 small model 38 | >0x1f byte =0x048 large model 39 | >0x1f byte =0x049 huge model 40 | >0x1e leshort &0x1 executable 41 | >0x1e leshort ^0x1 object file 42 | >0x1e leshort &0x40 Large Text 43 | >0x1e leshort &0x20 Large Data 44 | >0x1e leshort &0x120 Huge Objects Enabled 45 | >0x10 lelong >0 not stripped 46 | 47 | 0 leshort 0x140 old Microsoft 8086 x.out 48 | >0x3 byte &0x4 separate 49 | >0x3 byte &0x2 pure 50 | >0 byte &0x1 executable 51 | >0 byte ^0x1 relocatable 52 | >0x14 lelong >0 not stripped 53 | 54 | 0 lelong 0x206 b.out 55 | >0x1e leshort &0x10 overlay 56 | >0x1e leshort &0x2 separate 57 | >0x1e leshort &0x4 pure 58 | >0x1e leshort &0x800 segmented 59 | >0x1e leshort &0x400 standalone 60 | >0x1e leshort &0x1 executable 61 | >0x1e leshort ^0x1 object file 62 | >0x1e leshort &0x4000 V2.3 63 | >0x1e leshort &0x8000 V3.0 64 | >0x1c byte &0x4 86 65 | >0x1c byte &0xb 186 66 | >0x1c byte &0x9 286 67 | >0x1c byte &0x29 286 68 | >0x1c byte &0xa 386 69 | >0x1e leshort &0x4 Large Text 70 | >0x1e leshort &0x2 Large Data 71 | >0x1e leshort &0x102 Huge Objects Enabled 72 | 73 | 0 leshort 0x580 XENIX 8086 relocatable or 80286 small model 74 | -------------------------------------------------------------------------------- /file/configure.in: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT(file.c) 3 | AM_INIT_AUTOMAKE(file, 3.37) 4 | AM_CONFIG_HEADER(config.h) 5 | 6 | AC_MSG_CHECKING(for builtin ELF support) 7 | AC_ARG_ENABLE(elf, 8 | [ --enable-elf disable builtin ELF support], 9 | [if test "${enableval}" = yes; then 10 | AC_MSG_RESULT(yes) 11 | AC_DEFINE(BUILTIN_ELF) 12 | else 13 | AC_MSG_RESULT(no) 14 | fi], [ 15 | # enable by default 16 | AC_MSG_RESULT(NO) 17 | ]) 18 | 19 | AC_MSG_CHECKING(for ELF core file support) 20 | AC_ARG_ENABLE(elf-core, 21 | [ --disable-elf-core disable ELF core file support], 22 | [if test "${enableval}" = yes; then 23 | AC_MSG_RESULT(yes) 24 | AC_DEFINE(ELFCORE) 25 | else 26 | AC_MSG_RESULT(no) 27 | fi], [ 28 | # enable by default 29 | AC_MSG_RESULT(yes) 30 | AC_DEFINE(ELFCORE) 31 | ]) 32 | 33 | AC_MSG_CHECKING(for file formats in man section 5) 34 | AC_ARG_ENABLE(fsect-man5, 35 | [ --enable-fsect-man5 enable file formats in man section 5], 36 | [if test "${enableval}" = yes; then 37 | AC_MSG_RESULT(yes) 38 | fsect=5 39 | else 40 | AC_MSG_RESULT(no) 41 | fsect=4 42 | fi], [ 43 | # disable by default 44 | AC_MSG_RESULT(no) 45 | fsect=4 46 | ]) 47 | AC_SUBST(fsect) 48 | AM_CONDITIONAL(FSECT5, test x$fsect = x5) 49 | 50 | dnl Checks for programs. 51 | AC_PROG_CC 52 | AC_PROG_INSTALL 53 | AC_PROG_LN_S 54 | AC_PROG_RANLIB 55 | 56 | dnl Checks for headers 57 | AC_HEADER_STDC 58 | AC_HEADER_MAJOR 59 | AC_HEADER_SYS_WAIT 60 | AC_CHECK_HEADERS(unistd.h) 61 | AC_CHECK_HEADERS(locale.h) 62 | AC_CHECK_HEADERS(sys/mman.h) 63 | 64 | dnl Checks for typedefs, structures, and compiler characteristics. 65 | AC_C_CONST 66 | AC_TYPE_OFF_T 67 | AC_TYPE_SIZE_T 68 | AC_STRUCT_ST_RDEV 69 | AC_STRUCT_TIMEZONE_DAYLIGHT 70 | 71 | dnl FIXME: only found in standard headers! 72 | AC_CHECK_TYPE(uint8_t, unsigned char) 73 | AC_CHECK_TYPE(uint16_t, unsigned short) 74 | AC_CHECK_TYPE(uint32_t, unsigned int) 75 | 76 | AC_C_LONG_LONG 77 | if test $ac_cv_c_long_long = yes; then 78 | long64='unsigned long long'; 79 | else 80 | long64='unsigned long'; 81 | fi 82 | dnl This needs a patch to autoconf 2.13 acgeneral.m4 83 | AC_CHECK_TYPE2(uint64_t, $long64) 84 | 85 | AC_CHECK_SIZEOF_STDC_HEADERS(uint8_t, 0) 86 | AC_CHECK_SIZEOF_STDC_HEADERS(uint16_t, 0) 87 | AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0) 88 | AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0) 89 | 90 | dnl Checks for functions 91 | AC_CHECK_FUNCS(mmap strerror strtoul) 92 | 93 | AC_OUTPUT(Makefile) 94 | -------------------------------------------------------------------------------- /Makefile.android: -------------------------------------------------------------------------------- 1 | # Please install the following prerequisites (instructions for each follows): 2 | # Android OS SDK: http://source.android.com/download 3 | # 4 | # Install and prepare the Android OS SDK ( http://source.android.com/download ) 5 | # on Debian or Ubuntu 6 | 7 | ### these modify the calling shell 8 | # point pkg-config to the .pc files generated from these builds 9 | export PKG_CONFIG_PATH=$(LOCAL)/lib/pkgconfig 10 | # workaround for cross-compiling bug in autoconf 11 | export ac_cv_func_malloc_0_nonnull=yes 12 | 13 | CWD = $(shell pwd) 14 | PROJECT_ROOT = $(CWD)/.. 15 | EXTERNAL_ROOT = $(PROJECT_ROOT) 16 | 17 | # Android NDK setup 18 | NDK_BASE ?= /opt/android-ndk 19 | NDK_PLATFORM_LEVEL ?= 8 20 | NDK_ABI=arm 21 | NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI) 22 | NDK_UNAME=`uname -s | tr '[A-Z]' '[a-z]'` 23 | #NDK_COMPILER_VERSION=4.4.3 24 | NDK_COMPILER_VERSION=4.6 25 | NDK_TOOLCHAIN=$(NDK_BASE)/toolchains/$(NDK_ABI)-linux-androideabi-$(NDK_COMPILER_VERSION)/prebuilt/$(NDK_UNAME)-x86 26 | 27 | # to use the real HOST tag, you need the latest libtool files: 28 | # http://stackoverflow.com/questions/4594736/configure-does-not-recognize-androideabi 29 | HOST := $(NDK_ABI)-linux-androideabi 30 | 31 | # install root for built files 32 | DESTDIR = $(EXTERNAL_ROOT) 33 | # TODO try adding the Android-style /data/app.name here 34 | prefix = 35 | LOCAL := $(DESTDIR)$(prefix) 36 | 37 | PATH := ${PATH}:$(NDK_TOOLCHAIN)/bin:$(LOCAL)/bin 38 | 39 | CC := '$(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-gcc --sysroot=$(NDK_SYSROOT)' 40 | CXX := $(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-g++ 41 | CPP := $(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-cpp 42 | LD := $(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-ld 43 | AR := $(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-ar 44 | RANLIB := $(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-ranlib 45 | STRIP := $(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-strip \ 46 | --strip-unneeded -R .note -R .comment 47 | 48 | CFLAGS = -DANDROID 49 | LDFLAGS = -L$(NDK_SYSROOT)/usr/lib -L$(LOCAL)/lib 50 | 51 | # turn off gcc optmization on the native builds for now, to aid debugging 52 | 53 | # build as small as possible, mostly useful for static binaries 54 | #CFLAGS += -fdata-sections -ffunction-sections -Os 55 | #LDFLAGS += -Wl,--gc-sections 56 | # unoptimized debug builds! 57 | CFLAGS += -g 58 | 59 | 60 | all: 61 | ./configure \ 62 | CFLAGS='$(CFLAGS)' \ 63 | SYSROOT=$(NDK_SYSROOT) \ 64 | --host=$(HOST) && \ 65 | $(MAKE) CC=$(CC) \ 66 | CXX=$(CXX) \ 67 | CFLAGS='$(CFLAGS)' 68 | 69 | 70 | -------------------------------------------------------------------------------- /file/Magdir/mathematica: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # mathematica: file(1) magic for mathematica files 4 | # "H. Nanosecond" 5 | # Mathematica a multi-purpose math program 6 | # versions 2.2 and 3.0 7 | 8 | #mathematica .mb 9 | 0 string \064\024\012\000\035\000\000\000 Mathematica version 2 notebook 10 | 0 string \064\024\011\000\035\000\000\000 Mathematica version 2 notebook 11 | 12 | # .ma 13 | # multiple possibilites: 14 | 15 | 0 string (*^\n\n::[\011frontEndVersion\ =\ Mathematica notebook 16 | #>41 string >\0 %s 17 | 18 | #0 string (*^\n\n::[\011palette Mathematica notebook version 2.x 19 | 20 | #0 string (*^\n\n::[\011Information Mathematica notebook version 2.x 21 | #>675 string >\0 %s #doesn't work well 22 | 23 | # there may be 'cr' instread of 'nl' in some does this matter? 24 | 25 | # generic: 26 | 0 string (*^\r\r::[\011 Mathematica notebook version 2.x 27 | 0 string \(\*\^\r\n\r\n\:\:\[\011 Mathematica notebook version 2.x 28 | 0 string (*^\015 Mathematica notebook version 2.x 29 | 0 string (*^\n\r\n\r::[\011 Mathematica notebook version 2.x 30 | 0 string (*^\r::[\011 Mathematica notebook version 2.x 31 | 0 string (*^\r\n::[\011 Mathematica notebook version 2.x 32 | 0 string (*^\n\n::[\011 Mathematica notebook version 2.x 33 | 0 string (*^\n::[\011 Mathematica notebook version 2.x 34 | 35 | 36 | # Mathematica .mx files 37 | 38 | #0 string (*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*) Mathematica binary file 39 | 0 string (*This\ is\ a\ Mathematica\ binary\ Mathematica binary file 40 | #>71 string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000 41 | # >71... is optional 42 | >88 string >\0 from %s 43 | 44 | 45 | # Mathematica files PBF: 46 | # 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000 47 | 0 string MMAPBF\000\001\000\000\000\203\000\001\000 Mathematica PBF (fonts I think) 48 | 49 | # .ml files These are menu resources I think 50 | # these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\ 51 | # how to put that into a magic rule? 52 | 4 string \ A~ MAthematica .ml file 53 | 54 | # .nb files 55 | #too long 0 string (***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook Mathematica 3.0 notebook 56 | 0 string (*********************** Mathematica 3.0 notebook 57 | 58 | # other (* matches it is a comment start in these langs 59 | 0 string (* Mathematica, or Pascal, Modula-2 or 3 code 60 | -------------------------------------------------------------------------------- /discrimination.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _DISCRIMINATION_ 32 | #define _DISCRIMINATION_ 33 | 34 | void cd_init(void); 35 | 36 | struct cd_decision; 37 | void cd_insert(struct cd_decision *); 38 | struct cd_decision *cd_iterate(struct cd_decision *); 39 | 40 | struct cd_decision *cd_new(void); 41 | int cd_process_file(struct cd_decision *, char *); 42 | void cd_compute(struct cd_decision *, char *name, int); 43 | void cd_test(struct cd_decision *); 44 | int cd_classify(struct cd_decision *, double *); 45 | void cd_setboundary(struct cd_decision *, double); 46 | 47 | char *cd_name(struct cd_decision *); 48 | 49 | void cd_dump(FILE *, struct cd_decision *); 50 | struct cd_decision *cd_read(FILE *); 51 | 52 | transform_t cd_transform(struct cd_decision *); 53 | 54 | void matrix_invert(double **, int); 55 | 56 | #endif /* _DISCRIMINATION_ */ 57 | -------------------------------------------------------------------------------- /strlcpy.c: -------------------------------------------------------------------------------- 1 | /* $Id: strlcpy.c,v 1.1 2002/08/14 20:01:45 provos Exp $ */ 2 | /* $OpenBSD: strlcpy.c,v 1.2 1998/11/06 04:33:16 wvdputte Exp $ */ 3 | 4 | /* 5 | * Copyright (c) 1998 Todd C. Miller 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 20 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 21 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if defined(LIBC_SCCS) && !defined(lint) 32 | static char *rcsid = "$OpenBSD: strlcpy.c,v 1.2 1998/11/06 04:33:16 wvdputte Exp $"; 33 | #endif /* LIBC_SCCS and not lint */ 34 | 35 | #include 36 | #include 37 | 38 | /* 39 | * Copy src to string dst of size siz. At most siz-1 characters 40 | * will be copied. Always NUL terminates (unless siz == 0). 41 | * Returns strlen(src); if retval >= siz, truncation occurred. 42 | */ 43 | size_t strlcpy(dst, src, siz) 44 | char *dst; 45 | const char *src; 46 | size_t siz; 47 | { 48 | register char *d = dst; 49 | register const char *s = src; 50 | register size_t n = siz; 51 | 52 | if (n == 0) 53 | return(strlen(s)); 54 | while (*s != '\0') { 55 | if (n != 1) { 56 | *d++ = *s; 57 | n--; 58 | } 59 | s++; 60 | } 61 | *d = '\0'; 62 | 63 | return(s - src); /* count does not include NUL */ 64 | } 65 | -------------------------------------------------------------------------------- /util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include "config.h" 39 | 40 | char * 41 | fgetl(char *s, int size, FILE *stream) 42 | { 43 | char *res, *pos; 44 | int c; 45 | 46 | if ((res = fgets(s, size, stream))) { 47 | if (!*res) return res; 48 | 49 | pos = res + strlen(res) - 1; 50 | if (*pos == '\n') { 51 | *pos = 0; 52 | if (pos > res) 53 | if (*--pos == '\r') *pos = 0; 54 | } else 55 | if ((c = getc(stream)) == '\n') { 56 | if (*pos == '\r') *pos = 0; 57 | } else 58 | while (c != EOF && c != '\n') 59 | c = getc(stream); 60 | } 61 | 62 | return (res); 63 | } 64 | -------------------------------------------------------------------------------- /jpeg-6b/jcinit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcinit.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains initialization logic for the JPEG compressor. 9 | * This routine is in charge of selecting the modules to be executed and 10 | * making an initialization call to each one. 11 | * 12 | * Logically, this code belongs in jcmaster.c. It's split out because 13 | * linking this routine implies linking the entire compression library. 14 | * For a transcoding-only application, we want to be able to use jcmaster.c 15 | * without linking in the whole library. 16 | */ 17 | 18 | #define JPEG_INTERNALS 19 | #include "jinclude.h" 20 | #include "jpeglib.h" 21 | 22 | 23 | /* 24 | * Master selection of compression modules. 25 | * This is done once at the start of processing an image. We determine 26 | * which modules will be used and give them appropriate initialization calls. 27 | */ 28 | 29 | GLOBAL(void) 30 | jinit_compress_master (j_compress_ptr cinfo) 31 | { 32 | /* Initialize master control (includes parameter checking/processing) */ 33 | jinit_c_master_control(cinfo, FALSE /* full compression */); 34 | 35 | /* Preprocessing */ 36 | if (! cinfo->raw_data_in) { 37 | jinit_color_converter(cinfo); 38 | jinit_downsampler(cinfo); 39 | jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); 40 | } 41 | /* Forward DCT */ 42 | jinit_forward_dct(cinfo); 43 | /* Entropy encoding: either Huffman or arithmetic coding. */ 44 | if (cinfo->arith_code) { 45 | ERREXIT(cinfo, JERR_ARITH_NOTIMPL); 46 | } else { 47 | if (cinfo->progressive_mode) { 48 | #ifdef C_PROGRESSIVE_SUPPORTED 49 | jinit_phuff_encoder(cinfo); 50 | #else 51 | ERREXIT(cinfo, JERR_NOT_COMPILED); 52 | #endif 53 | } else 54 | jinit_huff_encoder(cinfo); 55 | } 56 | 57 | /* Need a full-image coefficient buffer in any multi-pass mode. */ 58 | jinit_c_coef_controller(cinfo, 59 | (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); 60 | jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); 61 | 62 | jinit_marker_writer(cinfo); 63 | 64 | /* We can now tell the memory manager to allocate virtual arrays. */ 65 | (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); 66 | 67 | /* Write the datastream header (SOI) immediately. 68 | * Frame and scan headers are postponed till later. 69 | * This lets application insert special markers after the SOI. 70 | */ 71 | (*cinfo->marker->write_file_header) (cinfo); 72 | } 73 | -------------------------------------------------------------------------------- /file/Magdir/jpeg: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # JPEG images 4 | # SunOS 5.5.1 had 5 | # 6 | # 0 string \377\330\377\340 JPEG file 7 | # 0 string \377\330\377\356 JPG file 8 | # 9 | # both of which turn into "JPEG image data" here. 10 | # 11 | 0 beshort 0xffd8 JPEG image data 12 | >6 string JFIF \b, JFIF standard 13 | >6 string Exif \b, EXIF standard 14 | # The following added by Erik Rossen 1999-09-06 15 | # in a vain attempt to add image size reporting for JFIF. Note that these 16 | # tests are not fool-proof since some perfectly valid JPEGs are currently 17 | # impossible to specify in magic(4) format. 18 | # First, a little JFIF version info: 19 | >11 byte x \b %d. 20 | >12 byte x \b%02d 21 | # Next, the resolution or aspect ratio of the image: 22 | >13 byte 0 \b, aspect ratio 23 | >13 byte 1 \b, resolution (DPI) 24 | >13 byte 2 \b, resolution (DPCM) 25 | #>4 beshort x \b, segment length %d 26 | # Next, show thumbnail info, if it exists: 27 | >18 byte !0 \b, thumbnail %dx 28 | >>19 byte x \b%d 29 | # Here things get sticky. We can do ONE MORE marker segment with 30 | # indirect addressing, and that's all. It would be great if we could 31 | # do pointer arithemetic like in an assembler language. Christos? 32 | # And if there was some sort of looping construct to do searches, plus a few 33 | # named accumulators, it would be even more effective... 34 | # At least we can show a comment if no other segments got inserted before: 35 | >(4.S+5) byte 0xFE 36 | >>(4.S+8) string >\0 \b, "%s" 37 | #>(4.S+5) byte 0xFE \b, comment 38 | #>>(4.S+6) beshort x \b length=%d 39 | #>>(4.S+8) string >\0 \b, "%s" 40 | # Or, we can show the encoding type (I've included only the three most common) 41 | # and image dimensions if we are lucky and the SOFn (image segment) is here: 42 | >(4.S+5) byte 0xC0 \b, baseline 43 | >>(4.S+6) byte x \b, precision %d 44 | >>(4.S+7) beshort x \b, %dx 45 | >>(4.S+9) beshort x \b%d 46 | >(4.S+5) byte 0xC1 \b, extended sequential 47 | >>(4.S+6) byte x \b, precision %d 48 | >>(4.S+7) beshort x \b, %dx 49 | >>(4.S+9) beshort x \b%d 50 | >(4.S+5) byte 0xC2 \b, progressive 51 | >>(4.S+6) byte x \b, precision %d 52 | >>(4.S+7) beshort x \b, %dx 53 | >>(4.S+9) beshort x \b%d 54 | # I've commented-out quantisation table reporting. I doubt anyone cares yet. 55 | #>(4.S+5) byte 0xDB \b, quantisation table 56 | #>>(4.S+6) beshort x \b length=%d 57 | >14 beshort x \b, %d x 58 | >16 beshort x \b %d 59 | 60 | # HSI is Handmade Software's proprietary JPEG encoding scheme 61 | 0 string hsi1 JPEG image data, HSI proprietary 62 | -------------------------------------------------------------------------------- /file/Magdir/database: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # database: file(1) magic for various databases 4 | # 5 | # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) 6 | # 7 | # 8 | # GDBM magic numbers 9 | # Will be maintained as part of the GDBM distribution in the future. 10 | # 11 | 0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian 12 | 0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian 13 | 0 string GDBM GNU dbm 2.x database 14 | # 15 | # Berkeley DB 16 | # 17 | # Ian Darwin's file /etc/magic files: big/little-endian version. 18 | # 19 | # Hash 1.85/1.86 databases store metadata in network byte order. 20 | # Btree 1.85/1.86 databases store the metadata in host byte order. 21 | # Hash and Btree 2.X and later databases store the metadata in host byte order. 22 | 23 | 0 long 0x00061561 Berkeley DB 24 | >8 belong 4321 25 | >>4 belong >2 1.86 26 | >>4 belong <3 1.85 27 | >>4 belong >0 (Hash, version %d, native byte-order) 28 | >8 belong 1234 29 | >>4 belong >2 1.86 30 | >>4 belong <3 1.85 31 | >>4 belong >0 (Hash, version %d, little-endian) 32 | 33 | 0 belong 0x00061561 Berkeley DB 34 | >8 belong 4321 35 | >>4 belong >2 1.86 36 | >>4 belong <3 1.85 37 | >>4 belong >0 (Hash, version %d, big-endian) 38 | >8 belong 1234 39 | >>4 belong >2 1.86 40 | >>4 belong <3 1.85 41 | >>4 belong >0 (Hash, version %d, native byte-order) 42 | 43 | 0 long 0x00053162 Berkeley DB 1.85/1.86 44 | >4 long >0 (Btree, version %d, native byte-order) 45 | 0 belong 0x00053162 Berkeley DB 1.85/1.86 46 | >4 belong >0 (Btree, version %d, big-endian) 47 | 0 lelong 0x00053162 Berkeley DB 1.85/1.86 48 | >4 lelong >0 (Btree, version %d, little-endian) 49 | 50 | 12 long 0x00061561 Berkeley DB 51 | >16 long >0 (Hash, version %d, native byte-order) 52 | 12 belong 0x00061561 Berkeley DB 53 | >16 belong >0 (Hash, version %d, big-endian) 54 | 12 lelong 0x00061561 Berkeley DB 55 | >16 lelong >0 (Hash, version %d, little-endian) 56 | 57 | 12 long 0x00053162 Berkeley DB 58 | >16 long >0 (Btree, version %d, native byte-order) 59 | 12 belong 0x00053162 Berkeley DB 60 | >16 belong >0 (Btree, version %d, big-endian) 61 | 12 lelong 0x00053162 Berkeley DB 62 | >16 lelong >0 (Btree, version %d, little-endian) 63 | 64 | 12 long 0x00042253 Berkeley DB 65 | >16 long >0 (Queue, version %d, native byte-order) 66 | 12 belong 0x00042253 Berkeley DB 67 | >16 belong >0 (Queue, version %d, big-endian) 68 | 12 lelong 0x00042253 Berkeley DB 69 | >16 lelong >0 (Queue, version %d, little-endian) 70 | # 71 | # 72 | # Round Robin Database Tool by Tobias Oetiker 73 | 0 string RRD RRDTool DB 74 | >4 string x version %s 75 | -------------------------------------------------------------------------------- /file/is_tar.c: -------------------------------------------------------------------------------- 1 | /* 2 | * is_tar() -- figure out whether file is a tar archive. 3 | * 4 | * Stolen (by the author!) from the public domain tar program: 5 | * Public Domain version written 26 Aug 1985 John Gilmore (ihnp4!hoptoad!gnu). 6 | * 7 | * @(#)list.c 1.18 9/23/86 Public Domain - gnu 8 | * $Id: is_tar.c,v 1.1.1.1 2001/10/16 18:05:26 provos Exp $ 9 | * 10 | * Comments changed and some code/comments reformatted 11 | * for file command by Ian Darwin. 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | #include "tar.h" 18 | #include "file.h" 19 | 20 | #ifndef lint 21 | FILE_RCSID("@(#)$Id: is_tar.c,v 1.1.1.1 2001/10/16 18:05:26 provos Exp $") 22 | #endif 23 | 24 | #define isodigit(c) ( ((c) >= '0') && ((c) <= '7') ) 25 | 26 | static int from_oct __P((int, char *)); /* Decode octal number */ 27 | 28 | /* 29 | * Return 30 | * 0 if the checksum is bad (i.e., probably not a tar archive), 31 | * 1 for old UNIX tar file, 32 | * 2 for Unix Std (POSIX) tar file. 33 | */ 34 | int 35 | is_tar(buf, nbytes) 36 | unsigned char *buf; 37 | int nbytes; 38 | { 39 | union record *header = (union record *)buf; 40 | int i; 41 | int sum, recsum; 42 | char *p; 43 | 44 | if (nbytes < sizeof(union record)) 45 | return 0; 46 | 47 | recsum = from_oct(8, header->header.chksum); 48 | 49 | sum = 0; 50 | p = header->charptr; 51 | for (i = sizeof(union record); --i >= 0;) { 52 | /* 53 | * We can't use unsigned char here because of old compilers, 54 | * e.g. V7. 55 | */ 56 | sum += 0xFF & *p++; 57 | } 58 | 59 | /* Adjust checksum to count the "chksum" field as blanks. */ 60 | for (i = sizeof(header->header.chksum); --i >= 0;) 61 | sum -= 0xFF & header->header.chksum[i]; 62 | sum += ' '* sizeof header->header.chksum; 63 | 64 | if (sum != recsum) 65 | return 0; /* Not a tar archive */ 66 | 67 | if (0==strcmp(header->header.magic, TMAGIC)) 68 | return 2; /* Unix Standard tar archive */ 69 | 70 | return 1; /* Old fashioned tar archive */ 71 | } 72 | 73 | 74 | /* 75 | * Quick and dirty octal conversion. 76 | * 77 | * Result is -1 if the field is invalid (all blank, or nonoctal). 78 | */ 79 | static int 80 | from_oct(digs, where) 81 | int digs; 82 | char *where; 83 | { 84 | int value; 85 | 86 | while (isspace((unsigned char)*where)) { /* Skip spaces */ 87 | where++; 88 | if (--digs <= 0) 89 | return -1; /* All blank field */ 90 | } 91 | value = 0; 92 | while (digs > 0 && isodigit(*where)) { /* Scan til nonoctal */ 93 | value = (value << 3) | (*where++ - '0'); 94 | --digs; 95 | } 96 | 97 | if (digs > 0 && *where && !isspace((unsigned char)*where)) 98 | return -1; /* Ended on non-space/nul */ 99 | 100 | return value; 101 | } 102 | -------------------------------------------------------------------------------- /jutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef _UTIL_H_ 31 | #define _UTIL_H_ 32 | 33 | void print_block(short *); 34 | 35 | void dequant_block(short *, short *, JQUANT_TBL *); 36 | void quant_block(short *, short *, JQUANT_TBL *); 37 | 38 | void effective_change(short *, short *, short *, JQUANT_TBL *); 39 | void effective_result(short *, short *, short *, JQUANT_TBL *); 40 | 41 | int count_edge(short *); 42 | int count_all(short *); 43 | 44 | struct jeasy *jpeg_prepare_blocks(struct jpeg_decompress_struct *); 45 | void jpeg_return_blocks(struct jeasy *, struct jpeg_decompress_struct *); 46 | void jpeg_free_blocks(struct jeasy *); 47 | 48 | void statistic(struct jeasy *); 49 | 50 | double variance(short *); 51 | 52 | int diff_vertical(short *, short *); 53 | int diff_horizontal(short *, short *); 54 | 55 | struct jeasy { 56 | int comp; 57 | int height[MAX_COMPS_IN_SCAN]; 58 | int width[MAX_COMPS_IN_SCAN]; 59 | struct jpeg_decompress_struct *jinfo; 60 | JQUANT_TBL *table[MAX_COMPS_IN_SCAN]; 61 | short ***blocks; 62 | int needscale; 63 | double scale[MAX_COMPS_IN_SCAN]; 64 | }; 65 | 66 | #endif; 67 | -------------------------------------------------------------------------------- /strlcat.c: -------------------------------------------------------------------------------- 1 | /* $Id: strlcat.c,v 1.1 2002/08/14 20:01:45 provos Exp $ */ 2 | /* $OpenBSD: strlcat.c,v 1.1 1998/07/01 01:29:45 millert Exp $ */ 3 | 4 | /* 5 | * Copyright (c) 1998 Todd C. Miller 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 20 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 21 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #if defined(LIBC_SCCS) && !defined(lint) 32 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.1 1998/07/01 01:29:45 millert Exp $"; 33 | #endif /* LIBC_SCCS and not lint */ 34 | 35 | #include 36 | #include 37 | 38 | /* 39 | * Appends src to string dst of size siz (unlike strncat, siz is the 40 | * full size of dst, not space left). At most siz-1 characters 41 | * will be copied. Always NUL terminates (unless siz == 0). 42 | * Returns strlen(src); if retval >= siz, truncation occurred. 43 | */ 44 | size_t strlcat(dst, src, siz) 45 | char *dst; 46 | const char *src; 47 | size_t siz; 48 | { 49 | register char *d = dst; 50 | register const char *s = src; 51 | register size_t n = siz; 52 | size_t dlen; 53 | 54 | /* Find the end of dst and adjust bytes left */ 55 | while (*d != '\0' && n != 0) 56 | d++; 57 | dlen = d - dst; 58 | n -= dlen; 59 | 60 | if (n == 0) 61 | return(dlen + strlen(s)); 62 | while (*s != '\0') { 63 | if (n != 1) { 64 | *d++ = *s; 65 | n--; 66 | } 67 | s++; 68 | } 69 | *d = '\0'; 70 | 71 | return(dlen + (s - src)); /* count does not include NUL */ 72 | } 73 | -------------------------------------------------------------------------------- /file/Magdir/dump: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # dump: file(1) magic for dump file format--for new and old dump filesystems 4 | # 5 | # We specify both byte orders in order to recognize byte-swapped dumps. 6 | # 7 | 24 belong 60012 new-fs dump file (big endian), 8 | >4 bedate x Previous dump %s, 9 | >8 bedate x This dump %s, 10 | >12 belong >0 Volume %ld, 11 | >692 belong 0 Level zero, type: 12 | >692 belong >0 Level %d, type: 13 | >0 belong 1 tape header, 14 | >0 belong 2 beginning of file record, 15 | >0 belong 3 map of inodes on tape, 16 | >0 belong 4 continuation of file record, 17 | >0 belong 5 end of volume, 18 | >0 belong 6 map of inodes deleted, 19 | >0 belong 7 end of medium (for floppy), 20 | >676 string >\0 Label %s, 21 | >696 string >\0 Filesystem %s, 22 | >760 string >\0 Device %s, 23 | >824 string >\0 Host %s, 24 | >888 belong >0 Flags %x 25 | 26 | 24 belong 60011 old-fs dump file (big endian), 27 | #>4 bedate x Previous dump %s, 28 | #>8 bedate x This dump %s, 29 | >12 belong >0 Volume %ld, 30 | >692 belong 0 Level zero, type: 31 | >692 belong >0 Level %d, type: 32 | >0 belong 1 tape header, 33 | >0 belong 2 beginning of file record, 34 | >0 belong 3 map of inodes on tape, 35 | >0 belong 4 continuation of file record, 36 | >0 belong 5 end of volume, 37 | >0 belong 6 map of inodes deleted, 38 | >0 belong 7 end of medium (for floppy), 39 | >676 string >\0 Label %s, 40 | >696 string >\0 Filesystem %s, 41 | >760 string >\0 Device %s, 42 | >824 string >\0 Host %s, 43 | >888 belong >0 Flags %x 44 | 45 | 24 lelong 60012 new-fs dump file (little endian), 46 | >4 ledate x This dump %s, 47 | >8 ledate x Previous dump %s, 48 | >12 lelong >0 Volume %ld, 49 | >692 lelong 0 Level zero, type: 50 | >692 lelong >0 Level %d, type: 51 | >0 lelong 1 tape header, 52 | >0 lelong 2 beginning of file record, 53 | >0 lelong 3 map of inodes on tape, 54 | >0 lelong 4 continuation of file record, 55 | >0 lelong 5 end of volume, 56 | >0 lelong 6 map of inodes deleted, 57 | >0 lelong 7 end of medium (for floppy), 58 | >676 string >\0 Label %s, 59 | >696 string >\0 Filesystem %s, 60 | >760 string >\0 Device %s, 61 | >824 string >\0 Host %s, 62 | >888 lelong >0 Flags %x 63 | 64 | 24 lelong 60011 old-fs dump file (little endian), 65 | #>4 ledate x Previous dump %s, 66 | #>8 ledate x This dump %s, 67 | >12 lelong >0 Volume %ld, 68 | >692 lelong 0 Level zero, type: 69 | >692 lelong >0 Level %d, type: 70 | >0 lelong 1 tape header, 71 | >0 lelong 2 beginning of file record, 72 | >0 lelong 3 map of inodes on tape, 73 | >0 lelong 4 continuation of file record, 74 | >0 lelong 5 end of volume, 75 | >0 lelong 6 map of inodes deleted, 76 | >0 lelong 7 end of medium (for floppy), 77 | >676 string >\0 Label %s, 78 | >696 string >\0 Filesystem %s, 79 | >760 string >\0 Device %s, 80 | >824 string >\0 Host %s, 81 | >888 lelong >0 Flags %x 82 | -------------------------------------------------------------------------------- /dirname.c: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1997 Todd C. Miller 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 21 | * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef lint 31 | static char rcsid[] = "$OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $"; 32 | #endif /* not lint */ 33 | 34 | #include 35 | 36 | #include "config.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | char * 43 | dirname(path) 44 | const char *path; 45 | { 46 | static char bname[MAXPATHLEN]; 47 | register const char *endp; 48 | 49 | /* Empty or NULL string gets treated as "." */ 50 | if (path == NULL || *path == '\0') { 51 | (void)strcpy(bname, "."); 52 | return(bname); 53 | } 54 | 55 | /* Strip trailing slashes */ 56 | endp = path + strlen(path) - 1; 57 | while (endp > path && *endp == '/') 58 | endp--; 59 | 60 | /* Find the start of the dir */ 61 | while (endp > path && *endp != '/') 62 | endp--; 63 | 64 | /* Either the dir is "/" or there are no slashes */ 65 | if (endp == path) { 66 | (void)strcpy(bname, *endp == '/' ? "/" : "."); 67 | return(bname); 68 | } else { 69 | do { 70 | endp--; 71 | } while (endp > path && *endp == '/'); 72 | } 73 | 74 | if (endp - path + 1 > sizeof(bname)) { 75 | errno = ENAMETOOLONG; 76 | return(NULL); 77 | } 78 | (void)strncpy(bname, path, endp - path + 1); 79 | bname[endp - path + 1] = '\0'; 80 | return(bname); 81 | } 82 | -------------------------------------------------------------------------------- /common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001 Niels Provos 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Niels Provos. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _COMMON_ 32 | #define _COMMON_ 33 | 34 | struct image { 35 | int x, y, depth, max; 36 | u_char *img; 37 | }; 38 | 39 | void jpg_finish(void); 40 | void jpg_destroy(void); 41 | int jpg_open(char *); 42 | void jpg_version(int *, int *, u_int16_t *); 43 | 44 | int jpg_toimage(char *, struct image *); 45 | 46 | int prepare_all(short **, int *); 47 | int prepare_all_gradx(short **, int *); 48 | int prepare_normal(short **, int *); 49 | int prepare_jphide(short **, int *); 50 | int prepare_jsteg(short **, int *); 51 | int jsteg_size(short *, int, int *); 52 | int prepare_outguess(short **, int *); 53 | 54 | char *fgetl(char *, int, FILE *); 55 | int file_hasextension(char *, char *); 56 | 57 | int is_random(u_char *, int); 58 | 59 | #define TEST_BIT(x,y) ((x)[(y) / 32] & (1 << ((y) & 31))) 60 | #define WRITE_BIT(x,y,what) ((x)[(y) / 32] = ((x)[(y) / 32] & \ 61 | ~(1 << ((y) & 31))) | ((what) << ((y) & 31))) 62 | 63 | extern int hib[], wib[]; 64 | 65 | enum order { ORDER_MCU, ORDER_NATURAL }; 66 | 67 | void stego_set_callback(void (*)(int, short), enum order); 68 | void stego_set_eoi_callback(void (*cb)(void *)); 69 | 70 | #endif /* _COMMON_ */ 71 | -------------------------------------------------------------------------------- /file/Magdir/commands: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # commands: file(1) magic for various shells and interpreters 4 | # 5 | #0 string : shell archive or script for antique kernel text 6 | 0 string/b #!\ /bin/sh Bourne shell script text executable 7 | 0 string/b #!\ /bin/csh C shell script text executable 8 | # korn shell magic, sent by George Wu, gwu@clyde.att.com 9 | 0 string/b #!\ /bin/ksh Korn shell script text executable 10 | 0 string/b #!\ /bin/tcsh Tenex C shell script text executable 11 | 0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable 12 | 0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable 13 | 14 | # 15 | # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson) 16 | 0 string/b #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable 17 | 0 string/b #!\ /usr/local/bin/ash Neil Brown's ash script text executable 18 | 0 string/b #!\ /usr/local/bin/ae Neil Brown's ae script text executable 19 | 0 string/b #!\ /bin/nawk new awk script text executable 20 | 0 string/b #!\ /usr/bin/nawk new awk script text executable 21 | 0 string/b #!\ /usr/local/bin/nawk new awk script text executable 22 | 0 string/b #!\ /bin/gawk GNU awk script text executable 23 | 0 string/b #!\ /usr/bin/gawk GNU awk script text executable 24 | 0 string/b #!\ /usr/local/bin/gawk GNU awk script text executable 25 | # 26 | 0 string/b #!\ /bin/awk awk script text executable 27 | 0 string/b #!\ /usr/bin/awk awk script text executable 28 | 0 string BEGIN awk script text 29 | 30 | # For Larry Wall's perl language. The ``eval'' line recognizes an 31 | # outrageously clever hack for USG systems. 32 | # Keith Waclena 33 | 0 string/b #!\ /bin/perl perl script text executable 34 | 0 string eval\ "exec\ /bin/perl perl script text 35 | 0 string/b #!\ /usr/bin/perl perl script text executable 36 | 0 string eval\ "exec\ /usr/bin/perl perl script text 37 | 0 string/b #!\ /usr/local/bin/perl perl script text 38 | 0 string eval\ "exec\ /usr/local/bin/perl perl script text executable 39 | 40 | # AT&T Bell Labs' Plan 9 shell 41 | 0 string/b #!\ /bin/rc Plan 9 rc shell script text executable 42 | 43 | # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) 44 | 0 string/b #!\ /bin/bash Bourne-Again shell script text executable 45 | 0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable 46 | 47 | # using env 48 | 0 string #!/usr/bin/env a 49 | >15 string >\0 %s script text executable 50 | 0 string #!\ /usr/bin/env a 51 | >16 string >\0 %s script text executable 52 | 53 | 54 | # generic shell magic 55 | 0 string #!\ / a 56 | >3 string >\0 %s script text executable 57 | 0 string #!\ / a 58 | >3 string >\0 %s script text executable 59 | 0 string #!/ a 60 | >2 string >\0 %s script text executable 61 | 0 string #!\ script text executable 62 | >3 string >\0 for %s 63 | -------------------------------------------------------------------------------- /file/Magdir/convex: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # convex: file(1) magic for Convex boxes 3 | # 4 | # Convexes are big-endian. 5 | # 6 | # /*\ 7 | # * Below are the magic numbers and tests added for Convex. 8 | # * Added at beginning, because they are expected to be used most. 9 | # \*/ 10 | 0 belong 0507 Convex old-style object 11 | >16 belong >0 not stripped 12 | 0 belong 0513 Convex old-style demand paged executable 13 | >16 belong >0 not stripped 14 | 0 belong 0515 Convex old-style pre-paged executable 15 | >16 belong >0 not stripped 16 | 0 belong 0517 Convex old-style pre-paged, non-swapped executable 17 | >16 belong >0 not stripped 18 | 0 belong 0x011257 Core file 19 | # 20 | # The following are a series of dump format magic numbers. Each one 21 | # corresponds to a drastically different dump format. The first on is 22 | # the original dump format on a 4.1 BSD or earlier file system. The 23 | # second marks the change between the 4.1 file system and the 4.2 file 24 | # system. The Third marks the changing of the block size from 1K 25 | # to 2K to be compatible with an IDC file system. The fourth indicates 26 | # a dump that is dependent on Convex Storage Manager, because data in 27 | # secondary storage is not physically contained within the dump. 28 | # The restore program uses these number to determine how the data is 29 | # to be extracted. 30 | # 31 | 24 belong =60011 dump format, 4.1 BSD or earlier 32 | 24 belong =60012 dump format, 4.2 or 4.3 BSD without IDC 33 | 24 belong =60013 dump format, 4.2 or 4.3 BSD (IDC compatible) 34 | 24 belong =60014 dump format, Convex Storage Manager by-reference dump 35 | # 36 | # what follows is a bunch of bit-mask checks on the flags field of the opthdr. 37 | # If there is no `=' sign, assume just checking for whether the bit is set? 38 | # 39 | 0 belong 0601 Convex SOFF 40 | >88 belong&0x000f0000 =0x00000000 c1 41 | >88 belong &0x00010000 c2 42 | >88 belong &0x00020000 c2mp 43 | >88 belong &0x00040000 parallel 44 | >88 belong &0x00080000 intrinsic 45 | >88 belong &0x00000001 demand paged 46 | >88 belong &0x00000002 pre-paged 47 | >88 belong &0x00000004 non-swapped 48 | >88 belong &0x00000008 POSIX 49 | # 50 | >84 belong &0x80000000 executable 51 | >84 belong &0x40000000 object 52 | >84 belong&0x20000000 =0 not stripped 53 | >84 belong&0x18000000 =0x00000000 native fpmode 54 | >84 belong&0x18000000 =0x10000000 ieee fpmode 55 | >84 belong&0x18000000 =0x18000000 undefined fpmode 56 | # 57 | 0 belong 0605 Convex SOFF core 58 | # 59 | 0 belong 0607 Convex SOFF checkpoint 60 | >88 belong&0x000f0000 =0x00000000 c1 61 | >88 belong &0x00010000 c2 62 | >88 belong &0x00020000 c2mp 63 | >88 belong &0x00040000 parallel 64 | >88 belong &0x00080000 intrinsic 65 | >88 belong &0x00000008 POSIX 66 | # 67 | >84 belong&0x18000000 =0x00000000 native fpmode 68 | >84 belong&0x18000000 =0x10000000 ieee fpmode 69 | >84 belong&0x18000000 =0x18000000 undefined fpmode 70 | -------------------------------------------------------------------------------- /file/Magdir/ispell: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------ 3 | # ispell: file(1) magic for ispell 4 | # 5 | # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602. This magic 6 | # will match 0x9600 through 0x9603 in *both* little endian and big endian. 7 | # (No other current magic entries collide.) 8 | # 9 | # Updated by Daniel Quinlan (quinlan@yggdrasil.com) 10 | # 11 | 0 leshort&0xFFFC 0x9600 little endian ispell 12 | >0 byte 0 hash file (?), 13 | >0 byte 1 3.0 hash file, 14 | >0 byte 2 3.1 hash file, 15 | >0 byte 3 hash file (?), 16 | >2 leshort 0x00 8-bit, no capitalization, 26 flags 17 | >2 leshort 0x01 7-bit, no capitalization, 26 flags 18 | >2 leshort 0x02 8-bit, capitalization, 26 flags 19 | >2 leshort 0x03 7-bit, capitalization, 26 flags 20 | >2 leshort 0x04 8-bit, no capitalization, 52 flags 21 | >2 leshort 0x05 7-bit, no capitalization, 52 flags 22 | >2 leshort 0x06 8-bit, capitalization, 52 flags 23 | >2 leshort 0x07 7-bit, capitalization, 52 flags 24 | >2 leshort 0x08 8-bit, no capitalization, 128 flags 25 | >2 leshort 0x09 7-bit, no capitalization, 128 flags 26 | >2 leshort 0x0A 8-bit, capitalization, 128 flags 27 | >2 leshort 0x0B 7-bit, capitalization, 128 flags 28 | >2 leshort 0x0C 8-bit, no capitalization, 256 flags 29 | >2 leshort 0x0D 7-bit, no capitalization, 256 flags 30 | >2 leshort 0x0E 8-bit, capitalization, 256 flags 31 | >2 leshort 0x0F 7-bit, capitalization, 256 flags 32 | >4 leshort >0 and %d string characters 33 | 0 beshort&0xFFFC 0x9600 big endian ispell 34 | >1 byte 0 hash file (?), 35 | >1 byte 1 3.0 hash file, 36 | >1 byte 2 3.1 hash file, 37 | >1 byte 3 hash file (?), 38 | >2 beshort 0x00 8-bit, no capitalization, 26 flags 39 | >2 beshort 0x01 7-bit, no capitalization, 26 flags 40 | >2 beshort 0x02 8-bit, capitalization, 26 flags 41 | >2 beshort 0x03 7-bit, capitalization, 26 flags 42 | >2 beshort 0x04 8-bit, no capitalization, 52 flags 43 | >2 beshort 0x05 7-bit, no capitalization, 52 flags 44 | >2 beshort 0x06 8-bit, capitalization, 52 flags 45 | >2 beshort 0x07 7-bit, capitalization, 52 flags 46 | >2 beshort 0x08 8-bit, no capitalization, 128 flags 47 | >2 beshort 0x09 7-bit, no capitalization, 128 flags 48 | >2 beshort 0x0A 8-bit, capitalization, 128 flags 49 | >2 beshort 0x0B 7-bit, capitalization, 128 flags 50 | >2 beshort 0x0C 8-bit, no capitalization, 256 flags 51 | >2 beshort 0x0D 7-bit, no capitalization, 256 flags 52 | >2 beshort 0x0E 8-bit, capitalization, 256 flags 53 | >2 beshort 0x0F 7-bit, capitalization, 256 flags 54 | >4 beshort >0 and %d string characters 55 | # ispell 4.0 hash files kromJx 56 | # Ispell 4.0 57 | 0 string ISPL ispell 58 | >4 long x hash file version %d, 59 | >8 long x lexletters %d, 60 | >12 long x lexsize %d, 61 | >16 long x hashsize %d, 62 | >20 long x stblsize %d 63 | --------------------------------------------------------------------------------