I am doing some forensics learning, and got a .str file that has an entire .xsl file:
I need to extract all that .xsl file from the .str file. I have used something like:
cat pc1.str | grep "<From>" > talk.txt
The problem is that I get almost all text, but not in a readable format. I think I am only getting all that has From inside.
Can you help me to get the text from <?xml version="1.0"?>
to </log>
?
Edit for clarity: I want to get all text, beginning from the xml until the /log.
The .str file is created by strings
.
Here is the actual file I am using: https://www.dropbox.com/s/j02elywhkhpbqvg/pc1.str?dl=0
From line 20893696
to 20919817
.
I'd probably use perl:
This makes use of the 'range' operator that returns true if a file is between two markers. By default, it uses the record separators
$/
which is newline. If your data has newlines it's easy, but you can iterate based on bytes instead. (Just bear in mind that you may have to worry about overlapping a boundary).E.g.
Will read 80 bytes at a time.