packing-box / docker-packing-box

Docker image gathering packers and tools for making datasets of packed executables and training machine learning models for packing detection
GNU General Public License v3.0
44 stars 10 forks source link

`KeyError` in feature parsing #126

Closed AlexVanMechelen closed 4 months ago

AlexVanMechelen commented 4 months ago

Issue

exe.data results in a KeyError

Reproduce

exe = Executable("/mnt/share/dataset-packed-pe/packed/ASPack/aspack_ntfsinfo.exe")
Features.source = "research-yaml-confs/features.yml"
exe.features
exe.data

Traceback

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/pbox/core/executable/__init__.py", line 254, in data
    return Features(self)
           ^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/pbox/core/executable/features.py", line 135, in __init__
    d.update({c: globals()[c] for c in FEATURE_CONSTANTS})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/pbox/core/executable/features.py", line 135, in <dictcomp>
    d.update({c: globals()[c] for c in FEATURE_CONSTANTS})
                 ~~~~~~~~~^^^
KeyError: 'IMPORT_SUFFIXES'
dhondta commented 4 months ago

Fixed with commit 3e9ad1c23e492c8be842727978d19059dada5e87.