This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sig = "10 00 00 00 'Word.Document.' ['6'-'7'] 00" | |
| l = sig.split("'") | |
| ns = "" | |
| for i in range(len(l)): | |
| if i % 2 != 0: | |
| ns += "".join([hex(ord(x))[2:] for x in l[i]]) | |
| else: | |
| ns += l[i] | |
| print ns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package itforarchivists | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "net/http" | |
| "github.com/richardlehane/siegfried/pkg/core" | |
| "github.com/richardlehane/siegfried/pkg/pronom" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This shows the fails when I compare signatures from PRONOM report files with DROID signature file v79. | |
| A little background: | |
| In siegfried, signatures are lists of frames. Frames enclose patterns. Frames tell you where to test, patterns perform the test. | |
| The test output below shows the text printout of failing signatures. Within the parentheses, pipes separate each frame. | |
| In the first example, the "F" means it is a fixed frame. This implies a fixed offset from either the BOF (B) or EOF (E). The first example is therefore at a fixed offset of 0 bytes from the BOF. The enclosed pattern is a sequence (seq) of 4 bytes. The frame that follows is also a fixed frame (F) but it is anchored to the previous frame (P), not to the BOF. In EOF segments you will see frames to the left of the EOF frame are anchored to their succeeding (S) frames. | |
| The last frame in the test output below is a WW which stands for window. In the example below, it should be a window of between 0 and 16000 bytes from the EOF. The DROID signatu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import base64 | |
| import json | |
| import urllib2 | |
| import sys | |
| sfurl = 'http://localhost:5138/identify/' | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| siegfried : 0.8.3 | |
| scandate : 2015-02-28T14:09:20+11:00 | |
| signature : pronom.gob | |
| created : 2015-02-19T11:50:57+11:00 | |
| identifiers : | |
| - name : 'pronom' | |
| details : 'DROID_SignatureFile_V81.xml; container-signature-20150218.xml' | |
| --- | |
| filename : 'debug.jpg' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget -qO - https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add - | |
| echo "deb http://dl.bintray.com/siegfried/debian wheezy main" | sudo tee -a /etc/apt/sources.list | |
| sudo apt-get update | |
| sudo apt-get install siegfried |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| testName := "Bagaaqy23kudbhchAaq5u2chNd" | |
| testGuid := "{20001801-5DE6-11D1-8E38-00C04FB9386D}" | |
| func GuidFromName(n string) (Guid, error) { | |
| n = strings.ToLower(n) | |
| buf, err := charConvert([]byte(n)) | |
| if err != nil { | |
| return Guid{}, err | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- FAIL: TestParseDroid (0.84s) | |
| parse_test.go:195: Parse Droid: signatures for fmt/41 are not equal: | |
| Reports: (F B:0 seq ffd8ffed | F P:2 seq "Photoshop 3.0\x008BIM" | WW E:0-16000 seq ffd9) | |
| Droid: (F B:0 seq ffd8ffed | F P:2 seq "Photoshop 3.0\x008BIM" | F E:0 seq ffd9) | |
| parse_test.go:195: Parse Droid: signatures for fmt/279 are not equal: | |
| Reports: (WW B:0-4 seq "fLaC\x00\x00\x00\"") | |
| Droid: (F B:0 seq "fLaC\x00\x00\x00\"") | |
| parse_test.go:195: Parse Droid: signatures for fmt/385 are not equal: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import socket | |
| import subprocess | |
| import sys | |
| def file_tool(path): | |
| return subprocess.check_output(['file', path]).strip() | |
| def main(path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import os.path | |
| import json | |
| import subprocess | |
| import sys | |
| def file_tool(path): | |
| return subprocess.check_output(['file', path]).strip() |