Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start = 0x17e1b0 #Starting position
- size = 0x2cb0 #How much to read
- outputfilename = hex(start) + '.compressed' #Compute output filename
- with open('shared.bin','rb') as f: #Open file for binary reading
- #Will automatically close when loop exits
- with open(outputfilename,'wb') as g: #Open output file for writing
- f.seek(start) #Move file position cursor to start position
- g.write(f.read(size)) #Copy SIZE bytes from the input to output file
- #At this point both files close because of the WITH statement
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement