コード例 #1
0
ファイル: settings.py プロジェクト: yuede/binwalk
    def __init__(self):
        '''
        Class constructor. Enumerates file paths and populates self.paths.
        '''
        # Path to the user binwalk directory
        self.user_dir = self._get_user_config_dir()
        # Path to the system wide binwalk directory
        self.system_dir = common.get_module_path()

        # Build the paths to all user-specific files
        self.user = common.GenericContainer(
            binarch=self._user_path(self.BINWALK_MAGIC_DIR,
                                    self.BINARCH_MAGIC_FILE),
            magic=self._magic_signature_files(user_only=True),
            extract=self._user_path(self.BINWALK_CONFIG_DIR,
                                    self.EXTRACT_FILE),
            modules=self._user_path(self.BINWALK_MODULES_DIR),
            plugins=self._user_path(self.BINWALK_PLUGINS_DIR))

        # Build the paths to all system-wide files
        self.system = common.GenericContainer(
            binarch=self._system_path(self.BINWALK_MAGIC_DIR,
                                      self.BINARCH_MAGIC_FILE),
            magic=self._magic_signature_files(system_only=True),
            extract=self._system_path(self.BINWALK_CONFIG_DIR,
                                      self.EXTRACT_FILE),
            plugins=self._system_path(self.BINWALK_PLUGINS_DIR))
コード例 #2
0
ファイル: settings.py プロジェクト: purevtsooj/binwalk
    def __init__(self):
        '''
        Class constructor. Enumerates file paths and populates self.paths.
        '''
        # Path to the user binwalk directory
        self.user_dir = self._get_user_dir()
        # Path to the system wide binwalk directory
        self.system_dir = common.get_module_path()

        # Build the paths to all user-specific files
        self.user = common.GenericContainer(
            binwalk=self._user_path(self.BINWALK_MAGIC_DIR,
                                    self.BINWALK_MAGIC_FILE),
            binarch=self._user_path(self.BINWALK_MAGIC_DIR,
                                    self.BINARCH_MAGIC_FILE),
            bincast=self._user_path(self.BINWALK_MAGIC_DIR,
                                    self.BINCAST_MAGIC_FILE),
            extract=self._user_path(self.BINWALK_CONFIG_DIR,
                                    self.EXTRACT_FILE),
            plugins=self._user_path(self.BINWALK_PLUGINS_DIR))

        # Build the paths to all system-wide files
        self.system = common.GenericContainer(
            binwalk=self._system_path(self.BINWALK_MAGIC_DIR,
                                      self.BINWALK_MAGIC_FILE),
            binarch=self._system_path(self.BINWALK_MAGIC_DIR,
                                      self.BINARCH_MAGIC_FILE),
            bincast=self._system_path(self.BINWALK_MAGIC_DIR,
                                      self.BINCAST_MAGIC_FILE),
            extract=self._system_path(self.BINWALK_CONFIG_DIR,
                                      self.EXTRACT_FILE),
            prefix=self._system_path(self.BINWALK_CONFIG_DIR,
                                     self.PREFIX_FILE),
            plugins=self._system_path(self.BINWALK_PLUGINS_DIR))