Add additional docstrings and refactor/rearrange the entire codebase.

This commit is contained in:
Mike Auty
2014-06-11 01:35:50 +01:00
parent a97bd19988
commit 39c0b38f09
13 changed files with 6049 additions and 5450 deletions
-3
View File
@@ -10,9 +10,6 @@
<component name="PackageRequirementsSettings">
<option name="requirementsPath" value="" />
</component>
<component name="PyDocumentationSettings">
<option name="myDocStringFormat" value="reStructuredText" />
</component>
<component name="ReSTService">
<option name="workdir" value="$MODULE_DIR$/doc" />
<option name="DOC_DIR" value="$MODULE_DIR$/doc" />
+12 -12
View File
@@ -23,7 +23,7 @@ sys.path.insert(0, os.path.abspath('../../volatility'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -189,22 +189,22 @@ htmlhelp_basename = 'Volatilitydoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Volatility.tex', u'Volatility Documentation',
u'Volatility Foundation', 'manual'),
('index', 'Volatility.tex', u'Volatility Documentation',
u'Volatility Foundation', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -247,9 +247,9 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Volatility', u'Volatility Documentation',
u'Volatility Foundation', 'Volatility', 'One line description of project.',
'Miscellaneous'),
('index', 'Volatility', u'Volatility Documentation',
u'Volatility Foundation', 'Volatility', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
+5 -5
View File
@@ -1,7 +1,7 @@
.. Volatility documentation master file, created by
sphinx-quickstart on Wed Apr 2 01:48:22 2014.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
sphinx-quickstart on Wed Apr 2 01:48:22 2014.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Volatility's documentation!
======================================
@@ -9,9 +9,9 @@ Welcome to Volatility's documentation!
Contents:
.. toctree::
:maxdepth: 2
:maxdepth: 2
modules.rst
modules.rst
Indices and tables
==================
+2 -2
View File
@@ -2,6 +2,6 @@ volatility
==========
.. toctree::
:maxdepth: 4
:maxdepth: 4
volatility
volatility
+1 -2
View File
@@ -1,4 +1,3 @@
from volatility.framework import renderers
from volatility.framework.renderers import basic
@@ -13,4 +12,4 @@ if __name__ == '__main__':
row3.add_child(renderers.TreeRow(grid, [40, 'child']))
tr = basic.TextRenderer(None)
tr.render(grid)
tr.render(grid)
+9 -2
View File
@@ -5,10 +5,12 @@ Created on 10 Mar 2013
"""
import pdb
from volatility import framework
from volatility.framework import xp_sp2_x86_vtypes, layers
from volatility.framework.symbols import vtypes, native
def test_symbols():
native_list = native.x86NativeTable
@@ -27,6 +29,7 @@ def test_symbols():
_ = symbol(ctx, layer_name = '', offset = 0)
symbol = ctx.symbol_space.get_structure('ntkrnlmp!_EPROCESS')
def utils_load_as():
nativelst = native.x86NativeTable
@@ -39,6 +42,7 @@ def utils_load_as():
ctx.symbol_space.append(ntkrnlmp)
return ctx
def test_memory():
nativelst = native.x86NativeTable
virtual_types = xp_sp2_x86_vtypes.ntkrnlmp_types
@@ -54,6 +58,7 @@ def test_memory():
val = ctx.object('ntkrnlmp!TEST_POINTER', 'data', 0)
print(hex(val.point1.test1), val.point1.test2)
def test_kdbgfind(ctx):
ctx = utils_load_as()
base = layers.physical.FileLayer(ctx, 'data', filename = '/home/mike/memory/xp-laptop-2005-06-25.img')
@@ -74,6 +79,7 @@ def intel32(ctx):
0x822148f0, 0x81ed84e8]
return intel, x
def intelpae(ctx):
base = layers.physical.FileLayer(ctx, 'data', filename = '/home/mike/memory/private/jon-fres.dmp')
ctx.memory.add_layer(base)
@@ -83,6 +89,7 @@ def intelpae(ctx):
0x817ff460, 0x817eb020, 0x817e9020, 0x817a62a8, 0x817a4b28, 0x81865020, 0x817972c0]
return intel, x
def intel32e(ctx):
base = layers.physical.FileLayer(ctx, 'data', filename = '/home/mike/memory/private/ikelos-winxpsp2-x64.dmp')
ctx.memory.add_layer(base)
@@ -104,8 +111,8 @@ def test_translation():
for val in x:
a, b = intel._translate(val)
print(hex(val), hex(a), hex(b))
#print(bin(0x39000), bin(0xffab8020))
#print(hex(intel.translate(0xffab8020)))
# print(bin(0x39000), bin(0xffab8020))
#print(hex(intel.translate(0xffab8020)))
# TODO:
+2
View File
@@ -1,3 +1,5 @@
"""Volatility 3 framework"""
# ##
#
# Libtool version scheme
+4 -1
View File
@@ -1,4 +1,7 @@
__author__ = 'mike'
"""Volatility 3 Constants
Stores all the constant values that are generally fixed throughout volatiltiy
This includes default scanning block sizes, etc."""
import os.path
+5
View File
@@ -4,17 +4,22 @@ Created on 1 Dec 2012
@author: mike
"""
class VolatilityException(Exception):
"""Class to allow filtering of all VolatilityExceptions"""
class SymbolError(VolatilityException):
"""Thrown when a symbol lookup has failed"""
class InvalidAddressException(VolatilityException):
"""Thrown when an address is not valid in the space it was requested"""
class SymbolSpaceError(VolatilityException):
"""Thrown when an error occurs dealing with Symbols and Symbolspaces"""
class LayerException(VolatilityException):
"""Thrown when an error occurs dealing with memory and layers"""
+4 -2
View File
@@ -1,15 +1,17 @@
from abc import abstractmethod, ABCMeta
from volatility.framework import validity
__author__ = 'mike'
class Renderer(validity.ValidityRoutines):
class Renderer(validity.ValidityRoutines):
__metaclass__ = ABCMeta
def __init__(self, options):
"""Accepts an options object to configure the renderers"""
#FIXME: Once the config option objects are in place, put the type_check in place
# FIXME: Once the config option objects are in place, put the type_check in place
@abstractmethod
def get_render_options(self):
+2 -2
View File
@@ -52,7 +52,7 @@ class SymbolTableInterface(validity.ValidityRoutines):
"""Returns None or a symbol_space for handling space specific native types"""
return self._native_structures
### Functions for overriding classes
# ## Functions for overriding classes
def set_structure_class(self, name, clazz):
"""Overrides the object class for a specific structure symbol
@@ -74,7 +74,7 @@ class SymbolTableInterface(validity.ValidityRoutines):
#
# def __len__(self):
# """Returns the number of items in the symbol list"""
# return len(self.structures)
# return len(self.structures)
#
# def __getitem__(self, key):
# """Resolves a symbol name into an object template
+5 -3
View File
@@ -1,7 +1,8 @@
"""Renderers
Renderers display the unified output format in some manner (be it text or file or graphical output"""
import collections
__author__ = 'mike'
import re
from volatility.framework import validity
@@ -38,6 +39,7 @@ class TreeRow(validity.ValidityRoutines):
@property
def values(self):
"""The individual cell values of the row"""
return self._values
@property
File diff suppressed because it is too large Load Diff