mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-28 12:34:53 +02:00
Add type annotations to most of the automagic files.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import logging
|
||||
import os
|
||||
import pickle
|
||||
import typing
|
||||
from urllib import parse
|
||||
|
||||
from volatility.framework import constants, exceptions, interfaces
|
||||
@@ -8,6 +9,8 @@ from volatility.framework.symbols import intermed
|
||||
|
||||
vollog = logging.getLogger(__name__)
|
||||
|
||||
LinuxBanners = typing.Dict[bytes, typing.List[str]]
|
||||
|
||||
|
||||
class LinuxSymbolCache(interfaces.automagic.AutomagicInterface):
|
||||
"""Runs through all Linux symbols tables and caches their banners"""
|
||||
@@ -17,8 +20,8 @@ class LinuxSymbolCache(interfaces.automagic.AutomagicInterface):
|
||||
priority = 0
|
||||
|
||||
@classmethod
|
||||
def load_linux_banners(cls):
|
||||
linuxbanners = {}
|
||||
def load_linux_banners(cls) -> LinuxBanners:
|
||||
linuxbanners: LinuxBanners = {}
|
||||
if os.path.exists(constants.LINUX_BANNERS_PATH):
|
||||
with open(constants.LINUX_BANNERS_PATH, "rb") as f:
|
||||
# We use pickle over JSON because we're dealing with bytes objects
|
||||
|
||||
Reference in New Issue
Block a user