Skip to content

Commit a9698e4

Browse files
committed
Documentation: minor fixes/updates
1 parent 5aa0a64 commit a9698e4

File tree

4 files changed

+121
-68
lines changed

4 files changed

+121
-68
lines changed

doc/source/conf.py

Lines changed: 99 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,72 @@
2121

2222

2323
def setup(app):
24-
volatility_directory = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'volatility3'))
24+
volatility_directory = os.path.abspath(
25+
os.path.join(os.path.dirname(__file__), "..", "..", "volatility3")
26+
)
2527

2628
source_dir = os.path.abspath(os.path.dirname(__file__))
27-
sphinx.ext.apidoc.main(argv = ['-e', '-M', '-f', '-T', '-o', source_dir, volatility_directory])
29+
sphinx.ext.apidoc.main(
30+
argv=["-e", "-M", "-f", "-T", "-o", source_dir, volatility_directory]
31+
)
2832

2933
# Go through the volatility3.framework.plugins files and change them to volatility3.plugins
3034
for dir, _, files in os.walk(os.path.dirname(__file__)):
3135
for filename in files:
32-
if filename.startswith('volatility3.framework.plugins') and filename != 'volatility3.framework.plugins.rst':
36+
if (
37+
filename.startswith("volatility3.framework.plugins")
38+
and filename != "volatility3.framework.plugins.rst"
39+
):
3340
# Change all volatility3.framework.plugins to volatility3.plugins in the file
3441
# Rename the file
35-
new_filename = filename.replace('volatility3.framework.plugins', 'volatility3.plugins')
42+
new_filename = filename.replace(
43+
"volatility3.framework.plugins", "volatility3.plugins"
44+
)
3645

3746
replace_string = b"Submodules\n----------\n\n.. toctree::\n\n"
3847
submodules = replace_string
3948

4049
# If file already exists, read out the subpackages entries from it add them to the new list
4150
if os.path.exists(os.path.join(dir, new_filename)):
42-
with open(os.path.join(dir, new_filename), 'rb') as newfile:
51+
with open(os.path.join(dir, new_filename), "rb") as newfile:
4352
data = newfile.read()
4453
index = data.find(replace_string)
4554
if index > -1:
4655
submodules = data[index:]
4756

48-
with open(os.path.join(dir, new_filename), 'wb') as newfile:
57+
with open(os.path.join(dir, new_filename), "wb") as newfile:
4958
with open(os.path.join(dir, filename), "rb") as oldfile:
5059
line = oldfile.read()
51-
correct_plugins = line.replace(b'volatility3.framework.plugins', b'volatility3.plugins')
52-
correct_submodules = correct_plugins.replace(replace_string, submodules)
60+
correct_plugins = line.replace(
61+
b"volatility3.framework.plugins", b"volatility3.plugins"
62+
)
63+
correct_submodules = correct_plugins.replace(
64+
replace_string, submodules
65+
)
5366
newfile.write(correct_submodules)
5467
os.remove(os.path.join(dir, filename))
55-
elif filename == 'volatility3.framework.rst':
68+
elif filename == "volatility3.framework.rst":
5669
with open(os.path.join(dir, filename), "rb") as contents:
5770
lines = contents.readlines()
5871
plugins_seen = False
5972
with open(os.path.join(dir, filename), "wb") as contents:
6073
for line in lines:
61-
if b'volatility3.framework.plugins' in line:
74+
if b"volatility3.framework.plugins" in line:
6275
plugins_seen = True
63-
if plugins_seen and line == b'':
64-
contents.write(b' volatility3.plugins')
76+
if plugins_seen and line == b"":
77+
contents.write(b" volatility3.plugins")
6578
contents.write(line)
66-
elif filename == 'volatility3.plugins.rst':
79+
elif filename == "volatility3.plugins.rst":
6780
with open(os.path.join(dir, filename), "rb") as contents:
6881
lines = contents.readlines()
69-
with open(os.path.join(dir, 'volatility3.framework.plugins.rst'), "rb") as contents:
82+
with open(
83+
os.path.join(dir, "volatility3.framework.plugins.rst"), "rb"
84+
) as contents:
7085
real_lines = contents.readlines()
7186

7287
# Process real_lines
7388
for line_index in range(len(real_lines)):
74-
if b'Submodules' in real_lines[line_index]:
89+
if b"Submodules" in real_lines[line_index]:
7590
break
7691
else:
7792
line_index = len(real_lines)
@@ -82,44 +97,60 @@ def setup(app):
8297
for line in lines:
8398
contents.write(line)
8499
for line in submodule_lines:
85-
contents.write(line.replace(b'volatility3.framework.plugins', b'volatility3.plugins'))
100+
contents.write(
101+
line.replace(
102+
b"volatility3.framework.plugins", b"volatility3.plugins"
103+
)
104+
)
86105

87106
# Clear up the framework.plugins page
88-
with open(os.path.join(os.path.dirname(__file__), 'volatility3.framework.plugins.rst'), "rb") as contents:
107+
with open(
108+
os.path.join(os.path.dirname(__file__), "volatility3.framework.plugins.rst"),
109+
"rb",
110+
) as contents:
89111
real_lines = contents.readlines()
90112

91-
with open(os.path.join(os.path.dirname(__file__), 'volatility3.framework.plugins.rst'), "wb") as contents:
113+
with open(
114+
os.path.join(os.path.dirname(__file__), "volatility3.framework.plugins.rst"),
115+
"wb",
116+
) as contents:
92117
for line in real_lines:
93-
if b'volatility3.framework.plugins.' not in line:
118+
if b"volatility3.framework.plugins." not in line:
94119
contents.write(line)
95120

96121

97122
# If extensions (or modules to document with autodoc) are in another directory,
98123
# add these directories to sys.path here. If the directory is relative to the
99124
# documentation root, use os.path.abspath to make it absolute, like shown here.
100-
sys.path.insert(0, os.path.abspath('../..'))
125+
sys.path.insert(0, os.path.abspath("../.."))
101126

102127
from volatility3.framework import constants
103128

104129
# -- General configuration ------------------------------------------------
105130

106131
# If your documentation needs a minimal Sphinx version, state it here.
107-
needs_sphinx = '2.0'
132+
needs_sphinx = "2.0"
108133

109134
# Add any Sphinx extension module names here, as strings. They can be
110135
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
111136
# ones.
112137
extensions = [
113-
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
114-
'sphinx.ext.coverage', 'sphinx.ext.viewcode', 'sphinx.ext.autosectionlabel'
138+
"sphinx.ext.autodoc",
139+
"sphinx.ext.doctest",
140+
"sphinx.ext.napoleon",
141+
"sphinx.ext.intersphinx",
142+
"sphinx.ext.todo",
143+
"sphinx.ext.coverage",
144+
"sphinx.ext.viewcode",
145+
"sphinx.ext.autosectionlabel",
115146
]
116147

117148
autosectionlabel_prefix_document = True
118149

119150
try:
120151
import sphinx_autodoc_typehints
121152

122-
extensions.append('sphinx_autodoc_typehints')
153+
extensions.append("sphinx_autodoc_typehints")
123154
except ImportError:
124155
# If the autodoc typehints extension isn't available, carry on regardless
125156
pass
@@ -128,17 +159,17 @@ def setup(app):
128159
# templates_path = ['tools/templates']
129160

130161
# The suffix of source filenames.
131-
source_suffix = '.rst'
162+
source_suffix = ".rst"
132163

133164
# The encoding of source files.
134165
# source_encoding = 'utf-8-sig'
135166

136167
# The master toctree document.
137-
master_doc = 'index'
168+
master_doc = "index"
138169

139170
# General information about the project.
140-
project = 'Volatility 3'
141-
copyright = '2012-2022, Volatility Foundation'
171+
project = "Volatility 3"
172+
copyright = "2012-2022, Volatility Foundation"
142173

143174
# The version info for the project you're documenting, acts as replacement for
144175
# |version| and |release|, also used in various other places throughout the
@@ -147,7 +178,7 @@ def setup(app):
147178
# The full version, including alpha/beta/rc tags.
148179
release = constants.PACKAGE_VERSION
149180
# The short X.Y version.
150-
version = ".".join(release.split('.')[0:2])
181+
version = ".".join(release.split(".")[0:2])
151182

152183
# The language for content autogenerated by Sphinx. Refer to documentation
153184
# for a list of supported languages.
@@ -180,7 +211,7 @@ def setup(app):
180211
# show_authors = False
181212

182213
# The name of the Pygments (syntax highlighting) style to use.
183-
pygments_style = 'sphinx'
214+
pygments_style = "sphinx"
184215

185216
# A list of ignored prefixes for module index sorting.
186217
# modindex_common_prefix = []
@@ -196,8 +227,8 @@ def setup(app):
196227
# html_theme = 'pydoctheme'
197228
# html_theme_options = {'collapsiblesidebar': True}
198229
# html_theme_path = ['tools']
199-
html_theme = 'sphinx_rtd_theme'
200-
html_theme_options = {'logo_only': True}
230+
html_theme = "sphinx_rtd_theme"
231+
html_theme_options = {"logo_only": True}
201232

202233
# Theme options are theme-specific and customize the look and feel of a theme
203234
# further. For a list of options available for each theme, see the
@@ -216,17 +247,17 @@ def setup(app):
216247

217248
# The name of an image file (relative to this directory) to place at the top
218249
# of the sidebar.
219-
html_logo = '_static/vol.png'
250+
html_logo = "_static/vol.png"
220251

221252
# The name of an image file (within the static path) to use as favicon of the
222253
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
223254
# pixels large.
224-
html_favicon = '_static/favicon.ico'
255+
html_favicon = "_static/favicon.ico"
225256

226257
# Add any paths that contain custom static files (such as style sheets) here,
227258
# relative to this directory. They are copied after the builtin static files,
228259
# so a file named "default.css" will overwrite the builtin "default.css".
229-
html_static_path = ['_static']
260+
html_static_path = ["_static"]
230261

231262
# Add any extra paths that contain custom files (such as robots.txt or
232263
# .htaccess) here, relative to this directory. These files are copied
@@ -275,17 +306,15 @@ def setup(app):
275306
# html_file_suffix = None
276307

277308
# Output file base name for HTML help builder.
278-
htmlhelp_basename = 'Volatilitydoc'
309+
htmlhelp_basename = "Volatilitydoc"
279310

280311
# -- Options for LaTeX output ---------------------------------------------
281312

282313
latex_elements = {
283314
# The paper size ('letterpaper' or 'a4paper').
284315
# 'papersize': 'letterpaper',
285-
286316
# The font size ('10pt', '11pt' or '12pt').
287317
# 'pointsize': '10pt',
288-
289318
# Additional stuff for the LaTeX preamble.
290319
# 'preamble': '',
291320
}
@@ -294,7 +323,13 @@ def setup(app):
294323
# (source start file, target name, title,
295324
# author, documentclass [howto, manual, or own class]).
296325
latex_documents = [
297-
('index', 'Volatility.tex', 'Volatility 3 Documentation', 'Volatility Foundation', 'manual'),
326+
(
327+
"index",
328+
"Volatility.tex",
329+
"Volatility 3 Documentation",
330+
"Volatility Foundation",
331+
"manual",
332+
),
298333
]
299334

300335
# The name of an image file (relative to this directory) to place at the top of
@@ -321,7 +356,15 @@ def setup(app):
321356

322357
# One entry per manual page. List of tuples
323358
# (source start file, name, description, authors, manual section).
324-
man_pages = [('vol-cli', 'volatility', 'Volatility 3 Documentation', ['Volatility Foundation'], 1)]
359+
man_pages = [
360+
(
361+
"vol-cli",
362+
"volatility",
363+
"Volatility 3 Documentation",
364+
["Volatility Foundation"],
365+
1,
366+
)
367+
]
325368

326369
# If true, show URL addresses after external links.
327370
# man_show_urls = False
@@ -332,8 +375,15 @@ def setup(app):
332375
# (source start file, target name, title, author,
333376
# dir menu entry, description, category)
334377
texinfo_documents = [
335-
('index', 'Volatility', 'Volatility 3 Documentation', 'Volatility Foundation', 'Volatility',
336-
'Memory forensics framework.', 'Miscellaneous'),
378+
(
379+
"index",
380+
"Volatility",
381+
"Volatility 3 Documentation",
382+
"Volatility Foundation",
383+
"Volatility",
384+
"Memory forensics framework.",
385+
"Miscellaneous",
386+
),
337387
]
338388

339389
# Documents to append as an appendix to all manuals.
@@ -349,10 +399,14 @@ def setup(app):
349399
# texinfo_no_detailmenu = False
350400

351401
# Example configuration for intersphinx: refer to the Python standard library.
352-
intersphinx_mapping = {'http://docs.python.org/': None}
402+
intersphinx_mapping = {"python": ("http://docs.python.org/", None)}
353403

354404
# -- Autodoc options -------------------------------------------------------
355405

356406
# autodoc_member_order = 'groupwise'
357-
autodoc_default_options = {'members': True, 'inherited-members': True, 'show-inheritance': True}
358-
autoclass_content = 'both'
407+
autodoc_default_options = {
408+
"members": True,
409+
"inherited-members": True,
410+
"show-inheritance": True,
411+
}
412+
autoclass_content = "both"

doc/source/getting-started-mac-tutorial.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ Thanks go to `stuxnet <https://github.com/stuxnet999/>`_ for providing this memo
7878
7979
8080
The above command helps us to find the memory dump's Darwin kernel version. Now using the above banner we can search for the needed ISF file.
81-
If ISF file cannot be found then, follow the instructions on :ref:`getting-started-macos-tutorial:Procedure to create symbol tables for macOS`. After that, place the ISF file under the ``volatility3/symbols`` directory.
81+
If ISF file cannot be found then, follow the instructions on :ref:`getting-started-mac-tutorial:Procedure to create symbol tables for macOS`. After that, place the ISF file under the ``volatility3/symbols`` directory.
8282

8383
mac.pslist
84-
~~~~~~~~~~~~
84+
~~~~~~~~~~
8585

8686
.. code-block:: shell-session
8787
@@ -107,7 +107,7 @@ mac.pslist
107107
``mac.pslist`` helps us to list the processes which are running, their PIDs and PPIDs.
108108

109109
mac.pstree
110-
~~~~~~~~~~~~
110+
~~~~~~~~~~
111111

112112
.. code-block:: shell-session
113113
@@ -128,7 +128,7 @@ mac.pstree
128128
``mac.pstree`` helps us to display the parent child relationships between processes.
129129

130130
mac.ifconfig
131-
~~~~~~~~~~
131+
~~~~~~~~~~~~
132132

133133
.. code-block:: shell-session
134134

volatility3/framework/plugins/linux/sockstat.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def process_sock(
8383
sock: Kernel generic `sock` object
8484
8585
Returns a tuple with:
86-
sock: The respective kernel's *_sock object for that socket family
86+
sock: The respective kernel's \*_sock object for that socket family
8787
sock_stat: A tuple with the source and destination (address and port) along with its state string
8888
socket_filter: A dictionary with information about the socket filter
8989
"""
@@ -501,8 +501,7 @@ def list_sockets(
501501
family: Socket family string (AF_UNIX, AF_INET, etc)
502502
sock_type: Socket type string (STREAM, DGRAM, etc)
503503
protocol: Protocol string (UDP, TCP, etc)
504-
sock_fields: A tuple with the *_sock object, the sock stats and the
505-
extended info dictionary
504+
sock_fields: A tuple with the \*_sock object, the sock stats and the extended info dictionary
506505
"""
507506
vmlinux = context.modules[symbol_table]
508507

0 commit comments

Comments
 (0)