コード例 #1
0
 def setUp(self):
     self.encoder = json_serialization.create_encoder()
     self.decoder = json_serialization.create_decoder()
     json_serialization.DataContainerObjectRenderer.set_safe_constructors(
         data_container.DataContainer,
         self.MockSubclass,
         self.MockEnum,
     )
コード例 #2
0
 def setUp(self):
   self.encoder = json_serialization.create_encoder()
   self.decoder = json_serialization.create_decoder()
   json_serialization.DataContainerObjectRenderer.set_safe_constructors(
       data_container.DataContainer,
       self.MockSubclass,
       self.MockEnum,
   )
コード例 #3
0
ファイル: _sample_usage.py プロジェクト: tklengyel/rekall
def _build_pre_ast(args):
    result_paths = _get_result_paths(args.results_directory_path)
    include_directories = _get_include_directories(args.linux_repository_path)

    encoder = json_serialization.create_encoder()
    _set_safe_constructors_for_pre_ast_json_serialization()

    # From source to Pre-AST.
    _parse_encode_and_dump_pre_ast(
        args.source_file_path,
        include_directories,
        result_paths,
        encoder,
    )
コード例 #4
0
ファイル: _sample_usage.py プロジェクト: atwong589/rekall
def _build_pre_ast(args):
  result_paths = _get_result_paths(args.results_directory_path)
  include_directories = _get_include_directories(args.linux_repository_path)

  encoder = json_serialization.create_encoder()
  _set_safe_constructors_for_pre_ast_json_serialization()

  # From source to Pre-AST.
  _parse_encode_and_dump_pre_ast(
      args.source_file_path,
      include_directories,
      result_paths,
      encoder,
  )
コード例 #5
0
ファイル: _sample_usage.py プロジェクト: tklengyel/rekall
def _make_profile(args):
    """A procedure that loads Pre-AST, computes a profile and stores it."""
    result_paths = _get_result_paths(args.results_directory_path)
    encoder = json_serialization.create_encoder()
    decoder = json_serialization.create_decoder()
    _set_safe_constructors_for_pre_ast_json_serialization()

    # From Pre-AST to preprocessed Pre-AST.
    _load_preprocess_and_dump_preprocessed_pre_ast(
        args.source_file_path,
        args.config_file_path,
        result_paths,
        encoder,
        decoder,
    )

    # From preprocessed Pre-AST to preprocessed source.
    _load_preprocessed_pre_ast_and_write_preprocessed_source_file(
        result_paths,
        decoder,
    )

    # From preprocessed source to AST.
    _parse_encode_and_dump_ast(
        result_paths,
        encoder,
    )

    # From AST to profile
    _set_safe_constructors_for_ast_json_serialization()
    _load_ast_compute_and_dump_profile(
        result_paths,
        args.config_file_path,
        args.system_map_file_path,
        args.layouts_to_compute,
        decoder,
    )
コード例 #6
0
ファイル: _sample_usage.py プロジェクト: atwong589/rekall
def _make_profile(args):
  """A procedure that loads Pre-AST, computes a profile and stores it."""
  result_paths = _get_result_paths(args.results_directory_path)
  encoder = json_serialization.create_encoder()
  decoder = json_serialization.create_decoder()
  _set_safe_constructors_for_pre_ast_json_serialization()

  # From Pre-AST to preprocessed Pre-AST.
  _load_preprocess_and_dump_preprocessed_pre_ast(
      args.source_file_path,
      args.config_file_path,
      result_paths,
      encoder,
      decoder,
  )

  # From preprocessed Pre-AST to preprocessed source.
  _load_preprocessed_pre_ast_and_write_preprocessed_source_file(
      result_paths,
      decoder,
  )

  # From preprocessed source to AST.
  _parse_encode_and_dump_ast(
      result_paths,
      encoder,
  )

  # From AST to profile
  _set_safe_constructors_for_ast_json_serialization()
  _load_ast_compute_and_dump_profile(
      result_paths,
      args.config_file_path,
      args.system_map_file_path,
      args.layouts_to_compute,
      decoder,
  )