Skip to content

Commit

Permalink
Linux - update linux_find_file
Browse files Browse the repository at this point in the history
  • Loading branch information
atcuno committed May 27, 2014
1 parent 7d8f349 commit 3a18e6b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions volatility/plugins/linux/find_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,19 @@ def get_file_contents(self, inode):
extra = file_size % 4096
idxs = file_size / 4096

if extra != 0:
if extra > 0:
extra = 4096 - extra
idxs = idxs + 1

for idx in range(0, idxs):
data = data + self.get_page_contents(inode, idx)

# this is chop off any extra data on the last page

if extra != 0:
extra = extra * -1
data = data[:extra]

return data

data = self.get_page_contents(inode, idx)

# this is to chop off any extra data on the last page
if idx == idxs - 1:
if extra > 0:
extra = extra * -1
data = data[:extra]

yield data


0 comments on commit 3a18e6b

Please sign in to comment.