# Copyright 2008 The Johns Hopkins University/Applied Physics Laboratory # This software was developed at The Johns Hopkins University/Applied Physics # Laboratory ("JHU/APL") that is the author thereof under the "work made for # hire" provisions of the copyright law. Permission is hereby granted, free # of charge, to any person obtaining a copy of this software and associated # documentation (the "Software"), to use the Software without restriction, # including without limitation the rights to copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # others to do so, subject to the following conditions: # 1. This LICENSE AND DISCLAIMER, including the copyright notice, shall be # included in all copies of the Software, including copies of substantial # portions of the Software; # 2. JHU/APL assumes no obligation to provide support of any kind with # regard to the Software. This includes no obligation to provide assistance # in using the Software nor to provide updated versions of the Software; and # 3. THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY # EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. ALL WARRANTIES INCLUDING, BUT # NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR # PURPOSE, AND NONINFRINGEMENT ARE HEREBY DISCLAIMED. USERS ASSUME THE # ENTIRE RISK AND LIABILITY OF USING THE SOFTWARE. USERS ARE ADVISED TO TEST # THE SOFTWARE THOROUGHLY BEFORE RELYING ON IT. IN NO EVENT SHALL THE JOHNS # HOPKINS UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, WITHOUT # LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR # CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE # SOFTWARE. import sys # Load command line arguements if len(sys.argv) < 4: print "Usage: " + sys.argv[0] + " [memory image] [start page] [number of pages]" sys.exit() start = int(sys.argv[2]) number = int(sys.argv[3]) # Page size in bytes page = 4096 f = open(sys.argv[1]) try: f.seek(start * page) data = f.read(page * number) print data finally: f.close()