9 argp
= argparse
.ArgumentParser()
10 argp
.add_argument("infile", type=argparse
.FileType("rb"), help="Input vmcore file")
12 "outfile", type=argparse
.FileType("wb"), help="Output vmcore file"
14 args
= argp
.parse_args()
18 line_re
= re
.compile(r
"^% RD: (\d+) (\d+)")
20 # copy the first chunk that usually includes ELF headers
21 # (not output by patched libfbsdvmcore since libelf reads this)
22 outf
.write(inf
.read(1024))
28 offset
, size
= [int(x
) for x
in m
.groups()]
32 outf
.write(inf
.read(size
))
35 if __name__
== "__main__":