/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
winreg__examples/get_command_processor.py
34 строки
733 B
gil9red
Refactoring. Using black code style
28 июн 2023, 16:45
28 июн 2023, 16:45
307c0a2
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" # SOURCE: https://www.saule-spb.ru/library/autorun.html # SOURCE: http://datadump.ru/virus-detection/ from common import RegistryKey PATHS = [ (r"HKLM\Software\Microsoft\Command Processor", "AutoRun"), (r"HKCU\Software\Microsoft\Command Processor", "AutoRun"), ] def get_command_processor() -> dict[str, str]: path_by_value = dict() for path, name in PATHS: key = RegistryKey.get_or_none(path) if not key: continue if value := key.get_str_value(name): path_by_value[rf"{key.path}, {name}"] = value return path_by_value if __name__ == "__main__": print(get_command_processor())