code
stringlengths
1
1.72M
language
stringclasses
1 value
# # DSA.py : Digital Signature Algorithm # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitness for use...
Python
# # pubkey.py : Internal functions for public key operations # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty...
Python
# # qNEW.py : The q-NEW signature algorithm. # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitness fo...
Python
"""Public-key encryption and signature algorithms. Public-key encryption uses two different keys, one for encryption and one for decryption. The encryption key can be made public, and the decryption key is kept private. Many public-key algorithms can also be used to sign messages, and some can *only* be used for sig...
Python
"""This file implements all-or-nothing package transformations. An all-or-nothing package transformation is one in which some text is transformed into message blocks, such that all blocks must be obtained before the reverse transformation can be applied. Thus, if any blocks are corrupted or lost, the original message...
Python
"""This file implements the chaffing algorithm. Winnowing and chaffing is a technique for enhancing privacy without requiring strong encryption. In short, the technique takes a set of authenticated message blocks (the wheat) and adds a number of chaff blocks which have randomly chosen data and MAC fields. This means...
Python
"""Cryptographic protocols Implements various cryptographic protocols. (Don't expect to find network protocols here.) Crypto.Protocol.AllOrNothing Transforms a message into a set of message blocks, such that the blocks can be recombined to get the mess...
Python
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
import io import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-length', str(int(len(string.ascii_lowercase)/2)))] start_response(status, response_headers) filelike = io.StringIO(string.ascii_low...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w') filelike.write(string.ascii_lowercase) filelike.close() filelike = op...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike1 = open('/tmp/filetest-a.txt', 'w+') filelike1.write(string.ascii_lowercase) filelike1.flush() ...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-length', str(int(len(string.ascii_lowercase)/2)))] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w...
Python
import io import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) filelike = io.StringIO(string.ascii_lowercase) return environ['wsgi.file_wrapper'](filelike)
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w+') filelike.write(string.ascii_lowercase) filelike.flush() ...
Python
import io import os def application(environ, start_response): headers = [] headers.append(('Content-Type', 'text/plain')) write = start_response('200 OK', headers) input = environ['wsgi.input'] output = io.StringIO() print("PID: %s" % os.getpid(), file=output) print("UID: %s" % os.getuid(...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike1 = open('/tmp/filetest-a.txt', 'w+') filelike1.write(string.ascii_lowercase) filelike1.flush() ...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-length', str(int(len(string.ascii_lowercase)/4)))] start_response(status, response_headers) filelike = open('/tmp/filetest...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w+') filelike.write(string.ascii_lowercase) filelike.flush() file...
Python
def application(environ, start_response): status = '200 OK' output = b'Hello World!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output]
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike = open('/tmp/filetest-a.txt', 'w+') filelike.write(string.ascii_lowercase) filelike.flush() fi...
Python
import StringIO import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-length', str(len(string.ascii_lowercase)/2))] start_response(status, response_headers) filelike = StringIO.StringIO(string.as...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w') filelike.write(string.ascii_lowercase) filelike.close() filelike = op...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/content_length-1b.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 >>> response.getheader('Content-Length') '24' >>> response.read...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike1 = open('/tmp/filetest-a.txt', 'w+') filelike1.write(string.ascii_lowercase) filelike1.flush() ...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-length', str(len(string.ascii_lowercase)/2))] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w+') ...
Python
import StringIO import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) filelike = StringIO.StringIO(string.ascii_lowercase) return environ['wsgi.file_wrapper'](filelike)
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w+') filelike.write(string.ascii_lowercase) filelike.flush() ...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1g.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-5] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1c.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-2] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/content_length-1c.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 >>> response.getheader('Content-Length') '24' >>> response.read...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> connection.putrequest('GET', '/dump_environ.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 """ import cStringIO import os def application(environ, start_response): headers = [] headers....
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1b.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] ValueError: status code is not a 3 di...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1a.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] ValueError: status code is not a 3 di...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/content_length-1a.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 >>> response.getheader('Content-Length') '12' >>> response.read...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1d.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] ValueError: no space following status...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1d.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-2] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1b.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-2] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1a.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-5] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike1 = open('/tmp/filetest-a.txt', 'w+') filelike1.write(string.ascii_lowercase) filelike1.flush() ...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-length', str(len(string.ascii_lowercase)/4))] start_response(status, response_headers) filelike = open('/tmp/filetest.txt'...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike = open('/tmp/filetest.txt', 'w+') filelike.write(string.ascii_lowercase) filelike.flush() file...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1h.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-2] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1h.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] TypeError: expected byte string objec...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1g.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] ValueError: status code is not a 3 di...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> connection.putrequest('GET', '/hello_world.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 >>> response.getheader('Content-Length') '12' >>> response.read() 'Hello World!' """ def application(env...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1f.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-2] # doctest: +ELLIPSIS "[error] ... Exception occurr...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> connection.putrequest('GET', '/start_response-1e.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 >>> response.getheader('Content-Length') '12' >>> response.read() 'Hello World!' """ def applicati...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1f.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] ValueError: control character present...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/start_response-1c.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 500 >>> messages[-1] '[error] ValueError: status code is not a 3 di...
Python
""" >>> import _testfuncs >>> connection = _testfuncs.connection() >>> messages = _testfuncs.messages() >>> connection.putrequest('GET', '/exceptions-1e.wsgi') >>> connection.endheaders() >>> response = connection.getresponse() >>> response.status 200 >>> response.getheader('Content-Length') '12' >>> response.read() '...
Python
import os import httplib import re import time host = 'wsgi-tests.example.com' port = '11111' host = os.environ.get('WSGI_TESTS_HOST', host) port = int(os.environ.get('WSGI_TESTS_PORT', port)) log_file = '/var/log/apache2/%s-error_log' % host log_delay = '0.1' log_file = os.environ.get('WSGI_TEST_LOG_FILE', log_fil...
Python
import os import string def application(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain'),] start_response(status, response_headers) filelike = open('/tmp/filetest-a.txt', 'w+') filelike.write(string.ascii_lowercase) filelike.flush() fi...
Python
#!/usr/bin/python """Test the mutex behavior of a circuit. To test the basic wait/acquire/release functionality, simply run this script: $ ./testmutex.py This will hold the mutex with a thread that sleeps for a few seconds, and simultaneously start another thread that blocks until the first is complete. To test th...
Python
#!/usr/bin/python """Tests the functionality of the proc ripple.""" from __future__ import division, print_function import argparse from lib import circuit from lib import ripple def main(): parser = argparse.ArgumentParser() args = parser.parse_args() langdir = circuit.local_lang() proc = ripple.Proc(lan...
Python
#!/usr/bin/python """Tests the functionality of the select ripple.""" from __future__ import division, print_function import argparse import random import sys import threading import time from lib import circuit from lib import ripple def main(): parser = argparse.ArgumentParser() parser.add_argument("-d", "--...
Python
"""Tools for manipulating processes, mutexes, channels, and selects in CIRCUIT. """ # TODO(chris): flesh out description above. from __future__ import division, print_function import errno import json import multiprocessing import os import os.path import re import sys import threading import time import Queue cla...
Python
#!/usr/bin/python """Utilities for working with local running circuit processes.""" from __future__ import division, print_function import os import os.path import subprocess class Error(Exception): """Module-level error.""" class NoCircuitRunning(Error): """Failed to find a local circuit process.""" class No...
Python
#!/usr/bin/env python import os, sys, re, json, requests, base64 from subprocess import call from fabric import api from fabric.api import cd, run, put, sudo from os import environ as env from datetime import datetime from time import sleep # Remove SSH private key as it needs more processing CONFIG = json.loads(re.s...
Python
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
Python
#!/usr/bin/python '''CONFIG_JSON is a json encoded string base64 environment variable. It is used to clone docker-ci database, generate docker-ci report and submit it by email. CONFIG_JSON data comes from the file /report/credentials.json inserted in this container by deployment.py: { "DOCKER_CI_PUB": "$(cat do...
Python
#!/usr/bin/env python '''Deploy docker-ci report container on Digital Ocean. Usage: export CONFIG_JSON=' { "DROPLET_NAME": "Digital_Ocean_dropplet_name", "DO_CLIENT_ID": "Digital_Ocean_client_id", "DO_API_KEY": "Digital_Ocean_api_key", "DOCKER_KEY_ID": ...
Python
# coding=utf-8 # (The line above is necessary so that I can use 世界 in the # *comment* below without Python getting all bent out of shape.) # Copyright 2007-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
Python
#!/usr/bin/python2.6 # # Simple http server to emulate api.playfoursquare.com import logging import shutil import sys import urlparse import SimpleHTTPServer import BaseHTTPServer class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Handle playfoursquare.com requests, for testing.""" def do_GET(self...
Python
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
Python
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
Python
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basena...
Python
#!/usr/bin/python import logging from xml.dom import minidom from xml.dom import pulldom BOOLEAN = "boolean" STRING = "String" GROUP = "Group" # Interfaces that all FoursquareTypes implement. DEFAULT_INTERFACES = ['FoursquareType'] # Interfaces that specific FoursqureTypes implement. INTERFACES = { } DEFAULT_CLA...
Python
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
Python
#!/usr/bin/python # # Script to generate distorted text images for a captcha system. # # Copyright (C) 2005 Neil Harris # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the ...
Python
#!/usr/bin/python # # Copyright 2007 Google Inc. All Rights Reserved. """CSS Lexical Grammar rules. CSS lexical grammar from http://www.w3.org/TR/CSS21/grammar.html """ __author__ = ['elsigh@google.com (Lindsey Simon)', 'msamuel@google.com (Mike Samuel)'] # public symbols __all__ = [ "NEWLINE", "HEX",...
Python
#!/usr/bin/python # # Copyright 2008 Google Inc. All Rights Reserved. """Converts a LeftToRight Cascading Style Sheet into a RightToLeft one. This is a utility script for replacing "left" oriented things in a CSS file like float, padding, margin with "right" oriented values. It also does the opposite. The...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # @author Philip import tarfile as tf import zipfile as zf import os, re, shutil, sys, platform pyversion = platform.python_version() islinux = platform.system().lower() == 'linux' if pyversion[:3] in ['2.6', '2.7']: import urllib as urllib_request import codecs ...
Python
#!/usr/bin/env pypy import os, sys, logging, re import argparse import fnmatch configurations = {'lite', 'pro'} package_dirs = { 'lite': ('src/cx/hell/android/pdfview',), 'pro': ('src/cx/hell/android/pdfviewpro',) } file_replaces = { 'lite': ( 'cx.hell.android.pdfview.', '"cx.hell.an...
Python
#!/usr/bin/env python import codecs import re import jinja2 import markdown def process_slides(): with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile: md = codecs.open('slides.md', encoding='utf8').read() md_slides = md.split('\n---\n') print 'Compiled %s slides.' % len(m...
Python
#!/usr/bin/python import glob, os,sys #return list of (ipsw,kernel,ramdisk) def list_bootable(): res = [] for ipsw in glob.glob("data/ipsw/*.ipsw"): ipsw_id = os.path.basename(ipsw).replace("_Restore.ipsw", "") kernel = os.path.join("data", "boot", "kernel_%s.patched" % ipsw_id) ramdis...
Python
#!/usr/bin/env python import os,sys REDSNOW_URL="https://sites.google.com/a/iphone-dev.com/files/home/redsn0w_mac_0.9.15b3.zip" IPSWs = { #"iphone2g": "http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7481.20100202.4orot/iPhone1,1_3.1.3_7E18_Restore.ipsw", #"iphone3g": "http://appldn...
Python
import os import plistlib from keystore.keybag import Keybag from util.ramdiskclient import RamdiskToolClient """ this wont work on iOS 5 unless the passcode was already bruteforced """ def escrow(): client = RamdiskToolClient() di = client.getDeviceInfos() key835 = di.get("key835").decode("hex"...
Python
import plistlib import os from keystore.keybag import Keybag from keychain.keychain4 import Keychain4 from keychain.managedconfiguration import bruteforce_old_pass from util.ramdiskclient import RamdiskToolClient from util import write_file def bf_system(): curdir = os.path.dirname(os.path.abspath(__file_...
Python
#!/usr/bin/python from cmd import Cmd from firmware.img3 import Img3 from hfs.emf import cprotect_xattr, PROTECTION_CLASSES from hfs.hfs import hfs_date from keystore.keybag import Keybag, PROTECTION_CLASSES from nand.carver import NANDCarver from nand.nand import NAND from optparse import OptionParser from util import...
Python
#!/usr/bin/python from backups.backup3 import decrypt_backup3 from backups.backup4 import MBDB from icloud.backup import download_backup from keystore.keybag import Keybag from util import readPlist, makedirs import os import sys import plistlib showinfo = ["Device Name", "Display Name", "Last Backup Date", "IMEI", ...
Python
#!/usr/bin/python import os import plistlib import zipfile import struct import sys from optparse import OptionParser from crypto import aes_ctypes as AES from util.lzss import decompress_lzss devices = {"n82ap": "iPhone1,2", "n88ap": "iPhone2,1", "n90ap": "iPhone3,1", "n90bap": "iPho...
Python
from crypto.aes import AESencryptCBC, AESdecryptCBC from emf import cprotect_xattr, EMFFile from structs import * from util import write_file, sizeof_fmt import hashlib """ Implementation of the following paper : Using the HFS+ Journal For Deleted File Recovery. Aaron Burghardt, Adam Feldman. DFRWS 2008 http:...
Python
from construct import * from construct.macros import UBInt64 """ http://developer.apple.com/library/mac/#technotes/tn/tn1150.html """ def getString(obj): return obj.HFSUniStr255.unicode S_IFLNK = 0120000 kSymLinkFileType = 0x736C6E6B kSymLinkCreator = 0x72686170 kHardLinkFileType = 0x686C6E6B kHF...
Python
from structs import * """ Probably buggy HAX, only works on case SENSITIVE """ class BTree(object): def __init__(self, file, keyStruct, dataStruct): self.file = file self.keyStruct = keyStruct self.dataStruct = dataStruct block0 = self.file.readBlock(0) btnode ...
Python
from construct import Struct, ULInt16, ULInt32, String from construct.macros import ULInt64, Padding, If from crypto.aes import AESencryptCBC, AESdecryptCBC from hfs import HFSVolume, HFSFile from keystore.keybag import Keybag from structs import HFSPlusVolumeHeader, kHFSPlusFileRecord, getString, \ kHFSRootP...
Python
from btree import AttributesTree, CatalogTree, ExtentsOverflowTree from structs import * from util import write_file from util.bdev import FileBlockDevice import datetime import hashlib import os import struct import sys import zlib def hfs_date(t): return datetime.datetime(1904,1,1) + datetime.timedelta(seconds=t...
Python
from progressbar import ProgressBar from usbmux import usbmux from util import hexdump, sizeof_fmt import datetime import hashlib import struct import os CMD_DUMP = 0 CMD_PROXY = 1 kIOFlashStorageOptionRawPageIO = 0x002 kIOFlashStorageOptionBootPageIO = 0x100 class IOFlashStorageKitClient(object): ...
Python
from construct import * from structs import next_power_of_two, PAGETYPE_VFL, CEIL_DIVIDE from vfl import vfl_check_checksum, _vfl_vsvfl_spare_data """ https://github.com/iDroid-Project/openiBoot/blob/master/vfl-vsvfl/vsvfl.c https://github.com/iDroid-Project/openiBoot/blob/master/vfl-vsvfl/includes/vfl/vsvfl.h ...
Python
from carver import NANDCarver from construct.core import Struct from construct.macros import ULInt32, ULInt16, Array, ULInt8, Padding from pprint import pprint from structs import SpareData from util import hexdump from vfl import VFL import plistlib """ openiboot/plat-s5l8900/ftl.c openiboot/plat-s5l8900/i...
Python
from construct.core import Struct, Union from construct.macros import * #hardcoded iOS keys META_KEY = "92a742ab08c969bf006c9412d3cc79a5".decode("hex") FILESYSTEM_KEY = "f65dae950e906c42b254cc58fc78eece".decode("hex") def next_power_of_two(z): i = 1 while i < z: i <<= 1 return i def ...
Python
from construct import * from zipfile import crc32 GPT_HFS = "005346480000aa11aa1100306543ecac".decode("hex") GPT_EMF = "00464d450000aa11aa1100306543ecac".decode("hex") LWVM_partitionRecord = Struct("LWVM_partitionRecord", String("type", 16), String("...
Python
from crypto.aes import AESdecryptCBC from firmware.img2 import IMG2 from firmware.img3 import Img3, extract_img3s from firmware.scfg import parse_SCFG from hfs.emf import EMFVolume from hfs.hfs import HFSVolume from image import NANDImageSplitCEs, NANDImageFlat from keystore.effaceable import check_effaceable_he...
Python
from array import array from construct.core import Struct, Union from construct.macros import * from structs import next_power_of_two, CEIL_DIVIDE, PAGETYPE_VFL import struct """ https://github.com/iDroid-Project/openiBoot/blob/master/plat-s5l8900/includes/s5l8900/ftl.h https://github.com/iDroid-Project/openiB...
Python
import os import struct import sys """ row-by-row dump page = data + spare metadata + iokit return code + iokit return code 2 """ class NANDImageFlat(object): def __init__(self, filename, geometry): flags = os.O_RDONLY if sys.platform == "win32": flags |= os.O_BINARY ...
Python
from array import array from construct.core import Struct, Union from construct.macros import * from progressbar import ProgressBar from structs import * import struct #https://github.com/iDroid-Project/openiBoot/blob/master/openiboot/ftl-yaftl/yaftl.c YAFTL_CXT = Struct("YAFTL_CXT", String("version", 4...
Python
from crypto.aes import AESdecryptCBC, AESencryptCBC from hfs.emf import cprotect_xattr, EMFVolume from hfs.hfs import HFSVolume, hfs_date, HFSFile from hfs.journal import carveBtreeNode, isDecryptedCorrectly from hfs.structs import * from util import sizeof_fmt, makedirs, hexdump import hashlib import os import...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- # # usbmux.py - usbmux client library for Python # # Copyright (C) 2009 Hector Martin "marcan" <hector@marcansoft.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
Python