CARVIEW |
Select Language
HTTP/2 200
date: Thu, 31 Jul 2025 02:51:28 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"b5167065ee381d2428e71b7e8d5109ce"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=7ymPpVEAxrZj1ZIvFo9rJ2pbrvBWthTrbLLPdVaaQFe6rlU4tzJ2JLEGhCwCvPDvxxzM1APaoRw2rIOMLy8pbnaWWRiVrooOUGbPhAyJrW6pR129nK8c%2FX403HmD6kTj1ocGtKhU335pD7A7DIRJcitPPuwX8k8GD5MZpKnmhDfoVdSt5sSBcGU70XQpVpBUftDPV0o5MiNULWWZUn9BE01UUDTOQsTMKeCLHP9drD3ztJRAy2R0OxfSUoV6T0HNhGs1Wj0M3%2B5X2qs%2FgSlfBw%3D%3D--WQL4RsMEpc%2BikGUU--VYq1UTJJ8iVokGdAxWOoiw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.670258137.1753930287; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 02:51:27 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 02:51:27 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: D958:DB217:18FD10:255952:688ADA2F
Style Guide · volatilityfoundation/volatility Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
This repository was archived by the owner on May 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Style Guide
gleeda edited this page Jun 11, 2014
·
6 revisions
Here's a brief guide to coding styles for adding to volatility. They mostly follow PEP 8, and also pylint (although with certain rules ignored including C0111, C0103, C0301, W0511, R0201, R0903 and W0142). The reasoning behind each decision should be given after the guideline.
Please note, this is just a guideline, and if anyone feels like changing any of these, please do. If everyone's happy, then someone can remove this paragraph. If you have any additions you'd like to make, again please make them.
Volatility currently requires python-2.6 or greater.
- Spacing: 4 space indents, no tabs.
- Consistency, PEP8
- Multiple statements on one line are discouraged.
- PEP8
- Always try to use
if x == None
rather thanif x is None
- The New Object model overrides equivalence, allowing NoneObjects to be equal to
None
- Note that if you want to test for validity you should use
if x: ....
This is because x might be an actual real object (i.e. not equivalent to None) but actually invalid. For example it might be an invalid pointer. - Importing specific objects or functions is discouraged.
- It pollutes the namespace and causes confusion. Previous versions of volatility allowed people to import functions from files they weren't defined in.
- "
from blah import *
" is strongly discouraged. - Again, namespace pollution and inappropriate imports.
- Module names should be lower case, Class names should be CamelCase, function names should be lower_case_with_underscores).
- PEP8 using most historically common style (hence function names aren't mixedCase).
- Whitespace on either side of all operators, and a space after all commas.
- This includes the
=
in method(arg = default
). - PEP8, clarity.
- No whitespace at the end of a line
- clarity, easier diffs.
- No need for docstrings on
__init__
, since they're implicit. - Pylint, obvious.
- Use
"{0:spec}".format(blah)
over"%spec" % blah
. - In preparation for python-3,
%
is evil. - Use lowercase format specifier when outputting hex offsets (
"{0:08x}"
or"{0:#010x}"
). - Consistency, ease of reading (particularly
0x123
vs0X123
). - Avoid using super, call the superclass's function by name instead.
- This is primarily in regards to
__init__
, because you need to pass the underlying__init__
function's arguments, and you don't know which__init__
you'll end up calling in the case of multiple inheritance. As such, that requires the entire codebase to ensure that all__init__
s take**kwargs
, and are co-operative to this coding style. Super's only really useful for multiple-inheritance, and even then it's easy to get wrong. - See https://fuhm.net/super-harmful/
- This is primarily in regards to
- Always try to catch the most specific exception you can.
- Never use "
except:
" (see idioms and anti-idioms in Python) - Makes debugging far easier if you only catch what you're expecting.
- Never use "
Volatility Foundation
Getting Started
- FAQ
- Installation
- Linux
- Mac
- Android
- Basic Usage
- 2.6 Win Profiles
- Encrypted KDBG
- Pyinstaller Builds
- Unified Output
Command References
Development
Miscellaneous
Physical Address Spaces
Clone this wiki locally
You can’t perform that action at this time.