Skip to content

Instantly share code, notes, and snippets.

@eddiez9
Created December 28, 2022 04:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddiez9/2b143adaeaff9f8e003b0e8b088c549b to your computer and use it in GitHub Desktop.
Save eddiez9/2b143adaeaff9f8e003b0e8b088c549b to your computer and use it in GitHub Desktop.
Parses putty NAND dump log for information we care about
with open('dump.log') as file:
save = False
for line in file:
# Do we save this line?
if line.isspace():
continue
elif ("------------------ block: 1117" in line):
save = False
continue
elif ("------------------ block:" in line):
save = True
continue
elif ("----------- spare area for block" in line):
save = False
continue
elif ("*** command status = 1" in line):
break
# Checking if we should save this line
if save == True:
print(line, end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment