Exemplo n.º 1
0
 public FileTypeDescriptor(string tag, string description, int signature_offset, string ascii_signature)
 {
     this.Tag             = tag;
     this.Description     = description;
     this.SignatureOffset = signature_offset;
     this.signature       = ToolsBinary.RegularStringToByteArrayASCII(ascii_signature);
     this.ascii_signature = ascii_signature;
     this.IsHeaderType    = true;
 }
Exemplo n.º 2
0
 public FileTypeDescriptor(string tag, string description, int signature_offset, byte[] signature, string default_extension)
 {
     this.Tag             = tag;
     this.Description     = description;
     this.SignatureOffset = signature_offset;
     this.signature       = ToolsCollection.Copy(signature);
     this.ascii_signature = ToolsBinary.ByteArrayToRegularString(signature);
     this.IsHeaderType    = true;
 }
Exemplo n.º 3
0
 public FileTypeDescriptor(string tag, string description, int signature_offset, string ascii_signature, string default_extension)
 {
     this.Tag                   = tag;
     this.Description           = description;
     this.SignatureOffset       = signature_offset;
     this.signature             = ToolsBinary.RegularStringToByteArrayASCII(ascii_signature);
     this.ascii_signature       = ascii_signature;
     this.IsHeaderType          = true;
     this.DefaultExtension      = default_extension;
     this.posible_extensions    = new string[1];
     this.posible_extensions[0] = default_extension;
 }
Exemplo n.º 4
0
        private static IList <FileTypeDescriptor> GetDefaultDescriptors()
        {
            List <FileTypeDescriptor> file_type_descriptors = new List <FileTypeDescriptor>();

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "DICOM",
                                          "Dicom file",
                                          128,
                                          "DICM"));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "PNGIM",
                                          "Portable Network Graphics image",
                                          0,
                                          ToolsBinary.HexStringToByteArray("89504E470D0A1A0A")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "TIFFL",
                                          "Tagged Image File Format encoded in little endian format image",
                                          0,
                                          ToolsBinary.HexStringToByteArray("49492A00")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "TIFFB",
                                          "Tagged Image File Format encoded in little big format image",
                                          0,
                                          ToolsBinary.HexStringToByteArray("4D4D002A")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "JPGIM",
                                          "Joint Photographic Experts Group image",
                                          0,
                                          ToolsBinary.HexStringToByteArray("FFD8FFE0")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "PDFDO",
                                          "Portable Document Format",
                                          0,
                                          ToolsBinary.HexStringToByteArray("25504446")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "GIF7A",
                                          "Graphics Interchange Format 87a image",
                                          0,
                                          ToolsBinary.HexStringToByteArray("474946383761")));


            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "GIF9A",
                                          "Graphics Interchange Format 89a image",
                                          0,
                                          ToolsBinary.HexStringToByteArray("474946383961")));


            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "MSODO",
                                          "Microsoft Office document",
                                          0,
                                          ToolsBinary.HexStringToByteArray("D0CF11E0A1B11AE1")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "MSOEX",
                                          "Excel spreadsheet subheader (MS Office)",
                                          512,
                                          ToolsBinary.HexStringToByteArray("0908100000060500")));

            file_type_descriptors.Add(new FileTypeDescriptor(
                                          "MSOXF",
                                          "Microsoft Office Open XML Format ",
                                          0,
                                          ToolsBinary.HexStringToByteArray("504B030414000600")));
            //Trailer: Look for 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.

            return(file_type_descriptors);
        }