--- python-pefile-1.2.9.1.orig/debian/README.Debian +++ python-pefile-1.2.9.1/debian/README.Debian @@ -0,0 +1,12 @@ +python-pefile for Debian +------------------------ + +You'll probably want to consult the online documentation for usage examples: + + http://code.google.com/p/pefile/w/list + +Some functions require a signature database, for example: + + http://www.peid.info/BobSoft/Downloads/UserDB.zip + + -- Robert S. Edmonds --- python-pefile-1.2.9.1.orig/debian/changelog +++ python-pefile-1.2.9.1/debian/changelog @@ -0,0 +1,6 @@ +python-pefile (1.2.9.1-1) unstable; urgency=low + + * Initial release; closes: #475493. + + -- Robert S. Edmonds Thu, 10 Apr 2008 16:59:47 -0400 + --- python-pefile-1.2.9.1.orig/debian/compat +++ python-pefile-1.2.9.1/debian/compat @@ -0,0 +1 @@ +5 --- python-pefile-1.2.9.1.orig/debian/control +++ python-pefile-1.2.9.1/debian/control @@ -0,0 +1,35 @@ +Source: python-pefile +Section: python +Priority: extra +Maintainer: Robert S. Edmonds +Build-Depends: debhelper (>= 5), python-dev (>= 2.3.5-11), python-central (>= 0.5.6) +Standards-Version: 3.7.3 +XS-Python-Version: all + +Package: python-pefile +Architecture: all +Depends: ${python:Depends} +XB-Python-Version: ${python:Versions} +Description: Portable Executable (PE) parsing module for Python + pefile is a Python module to read and work with Portable Executable (PE) + files. Most of the information in the PE header is accessible, as well as all + the sections, section information and data. + . + All the basic PE file structures are available with their default names as + attributes of the returned instance. + . + Processed elements such as the import table are made available with lowercase + names, to differentiate them from the upper case basic structure names. + . + pefile has been tested against the limits of valid PE headers; that is, + Windows malware. Lots of packed malware attempt to abuse the format beyond its + standard use. + . + Some of the tasks that pefile makes possible are: + * Modifying and writing back to the PE image + * Header inspection + * Section analysis + * Retrieving data + * Warnings for suspicious and malformed values + * Packer detection with PEiD signatures + * PEiD signature generation --- python-pefile-1.2.9.1.orig/debian/copyright +++ python-pefile-1.2.9.1/debian/copyright @@ -0,0 +1,40 @@ +This package was debianized by Robert S. Edmonds on +Thu, 10 Apr 2008 16:59:47 -0400. + +It was downloaded from + http://code.google.com/p/pefile/ + +Upstream Authors: + Ero Carrera + +Copyright: + Copyright (C) 2004, 2005, 2006, 2007, 2008 Ero Carrera + +License: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +The Debian packaging is (C) 2008, Robert S. Edmonds and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- python-pefile-1.2.9.1.orig/debian/docs +++ python-pefile-1.2.9.1/debian/docs @@ -0,0 +1 @@ +README --- python-pefile-1.2.9.1.orig/debian/pefile-match +++ python-pefile-1.2.9.1/debian/pefile-match @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +import os +import pefile +import peutils +import sys + +def dirwalk(path): + for f in os.listdir(path): + fullpath = os.path.join(path, f) + if os.path.isdir(fullpath) and not os.path.islink(fullpath): + for x in dirwalk(fullpath): + yield x + else: + yield fullpath + +def main(sigfile, path): + sigs = peutils.SignatureDatabase(sigfile) + + def print_match(f): + try: + res = sigs.match_all(pefile.PE(f, fast_load=True), ep_only=True) + if not res: + res = 'no match' + print '%s: %s' % (f, res) + except pefile.PEFormatError, e: + print '%s: %s' % (f, str(e).strip("'")) + except KeyboardInterrupt: + sys.exit(1) + + if os.path.isfile(path): + print_match(path) + elif os.path.isdir(path): + for f in dirwalk(path): + if os.path.isfile(f): + print_match(f) + +if __name__ == '__main__': + if len(sys.argv) != 3: + print >>sys.stderr, 'usage: %s ' % sys.argv[0] + sys.exit(1) + main(sys.argv[1], sys.argv[2]) --- python-pefile-1.2.9.1.orig/debian/python-pefile.examples +++ python-pefile-1.2.9.1/debian/python-pefile.examples @@ -0,0 +1 @@ +debian/pefile-match --- python-pefile-1.2.9.1.orig/debian/rules +++ python-pefile-1.2.9.1/debian/rules @@ -0,0 +1,43 @@ +#!/usr/bin/make -f +#export DH_VERBOSE=1 + +PYTHON = $(shell pyversions -d) +PKG = python-pefile + +build: build-stamp +build-stamp: + dh_testdir + $(PYTHON) setup.py config build + touch $@ + +clean: + dh_testdir + dh_testroot + rm -rf *.pyc build build-stamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + $(PYTHON) setup.py install --no-compile --root=debian/$(PKG) + +binary-indep: build install + dh_testdir + dh_testroot + dh_pycentral + dh_installchangelogs CHANGES_up_to_1.2.6 + dh_installdocs + dh_installexamples + dh_fixperms + chmod 0755 debian/python-pefile/usr/share/doc/python-pefile/examples/pefile-match + dh_compress -Xexamples + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- python-pefile-1.2.9.1.orig/debian/watch +++ python-pefile-1.2.9.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://code.google.com/p/pefile/downloads/list .*/pefile-(.*)\.tar\.gz