Skip to content

Commit

Permalink
Merge pull request #1684 from volatilityfoundation/fix_truecrypt_back…
Browse files Browse the repository at this point in the history
…traces

Prevent truecrypt from throwing a backtrace when the module isn't fou…
  • Loading branch information
ikelos authored Mar 8, 2025
2 parents 0b6203c + 24a53b4 commit 237ff92
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions volatility3/framework/plugins/windows/truecrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#

import logging

from typing import Iterable, Generator, List, Tuple

from volatility3.framework import constants, interfaces, renderers
Expand All @@ -17,6 +19,8 @@

from volatility3.plugins.windows import modules

vollog = logging.getLogger(__name__)


class Passphrase(interfaces.plugins.PluginInterface):
"""TrueCrypt Cached Passphrase Finder"""
Expand Down Expand Up @@ -123,11 +127,18 @@ def _generator(self):
mods: Iterable[ObjectInterface] = modules.Modules.list_modules(
self.context, self.config["kernel"]
)
truecrypt_module_base = next(
mod.DllBase
for mod in mods
if mod.BaseDllName.get_string().lower() == "truecrypt.sys"
)
try:
truecrypt_module_base = next(
mod.DllBase
for mod in mods
if mod.BaseDllName.get_string().lower() == "truecrypt.sys"
)
except StopIteration:
vollog.warning(
"Truecrypt module not found in the modules list. Unable to proceed."
)
return

for offset, password in self.scan_module(
truecrypt_module_base, kernel.layer_name
):
Expand Down

0 comments on commit 237ff92

Please sign in to comment.