Skip to content

Commit

Permalink
Revert "Update main.py"
Browse files Browse the repository at this point in the history
This reverts commit d649897.
  • Loading branch information
aaronatp committed Nov 13, 2023
1 parent 88d725f commit f537838
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions capa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ def get_workspace(path: Path, format_: str, sigpaths: List[Path]):


<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> parent of d46fa26c (Incremental PR improvements)
def check_supported_format(path, os_):
if not is_supported_format(path):
raise UnsupportedFormatError()
Expand Down Expand Up @@ -592,6 +595,7 @@ def handle_viv_backend(path, format_, sigpaths, os_):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
@catch_log_return_errors
=======
def handle_pefile_backend(path: Path) -> FeatureExtractor:
Expand All @@ -600,6 +604,10 @@ def handle_pefile_backend(path: Path) -> PefileFeatureExtractor:
>>>>>>> parent of 222cd6c4 (Update main.py)
=======

def handle_pefile_backend(path):
>>>>>>> parent of d46fa26c (Incremental PR improvements)
=======

def handle_pefile_backend(path):
>>>>>>> parent of d46fa26c (Incremental PR improvements)
import capa.features.extractors.pefile
Expand All @@ -611,13 +619,17 @@ def handle_dotnet_format(format):
return capa.features.extractors.dnfile.extractor.DnfileFeatureExtractor(path)


<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> parent of 0aab7206 (Update main.py)
=======

>>>>>>> parent of d46fa26c (Incremental PR improvements)
=======
>>>>>>> parent of d061e0c5 (Update main.py)
=======

>>>>>>> parent of d46fa26c (Incremental PR improvements)
def get_extractor(
path: Path,
format_: str,
Expand All @@ -644,6 +656,7 @@ def get_extractor(
raise UnsupportedOSError()

if format_ == FORMAT_DOTNET:
<<<<<<< HEAD
import capa.features.extractors.dnfile.extractor

return capa.features.extractors.dnfile.extractor.DnfileFeatureExtractor(path)
Expand Down Expand Up @@ -675,13 +688,20 @@ def get_extractor(
raise RuntimeError(f"Binary Ninja cannot open file {path}")

return capa.features.extractors.binja.extractor.BinjaFeatureExtractor(bv)
=======
return handle_dotnet_format(format)

elif backend == BACKEND_BINJA:
return handle_binja_backend(path)
>>>>>>> parent of d46fa26c (Incremental PR improvements)

elif backend == BACKEND_PEFILE:
import capa.features.extractors.pefile

return capa.features.extractors.pefile.PefileFeatureExtractor(path)

elif backend == BACKEND_VIV:
<<<<<<< HEAD
import capa.features.extractors.viv.extractor

with halo.Halo(text="analyzing program", spinner="simpleDots", stream=sys.stderr, enabled=not disable_progress):
Expand All @@ -698,11 +718,15 @@ def get_extractor(
logger.debug("CAPA_SAVE_WORKSPACE unset, not saving workspace")

return capa.features.extractors.viv.extractor.VivisectFeatureExtractor(vw, path, os_)
=======
return handle_viv_backend(path, format, sigpaths, os_)
>>>>>>> parent of d46fa26c (Incremental PR improvements)

else:
raise ValueError("unexpected backend: " + backend)



def get_file_extractors(sample: Path, format_: str) -> List[FeatureExtractor]:
file_extractors: List[FeatureExtractor] = []

Expand Down

0 comments on commit f537838

Please sign in to comment.