Skip to content

Instantly share code, notes, and snippets.

@anantshri
Created May 16, 2014 04:37
Show Gist options
  • Save anantshri/0e67136831c3e43f65f1 to your computer and use it in GitHub Desktop.
Save anantshri/0e67136831c3e43f65f1 to your computer and use it in GitHub Desktop.
Heartbleed pacemaker patch for ascii only output
29c29
< MAX_PLAIN_LENGTH = 0x4000
---
> MAX_PLAIN_LENGTH = 0xffff
114,116c114,116
<
< for i in range(0, len(data), 16):
< line = data[i:i+16]
---
> repout = ""
> for i in range(0, len(data), 80):
> line = data[i:i+80]
124,126c124,125
< print("{0:04x}: {1:47} {2}".format(i,
< ' '.join('{0:02x}'.format(c) for c in line),
< ''.join(chr(c) if c >= 32 and c < 127 else '.' for c in line)))
---
> repout= repout + ((''.join(chr(c) if c >= 32 and c < 127 else '' for c in line)))
> return repout
337c336,338
< hexdump(memory)
---
> outp = hexdump(memory)
> #print type(outp)
> print outp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment