Skip to content

Commit 13e6208

Browse files
committed
Update workflows for lief
Signed-off-by: Beat Buesser <[email protected]>
1 parent 3f0f000 commit 13e6208

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/ci-lingvo.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
sudo apt-get update
5151
sudo apt-get -y -q install ffmpeg libavcodec-extra
5252
python -m pip install --upgrade pip setuptools wheel
53-
pip install -q -r <(sed '/^scipy/d;/^matplotlib/d;/^pandas/d;/^statsmodels/d;/^numba/d;/^jax/d;/^h5py/d;/^Pillow/d;/^pytest/d;/^pytest-mock/d;/^torch/d;/^torchaudio/d;/^torchvision/d;/^xgboost/d;/^requests/d;/^tensorflow/d;/^keras/d;/^kornia/d;/^librosa/d;/^tqdm/d;/^timm/d;/^catboost/d;/^scikit-learn/d;/^GPy/d' requirements_test.txt)
53+
pip install -q -r <(sed '/^scipy/d;/^matplotlib/d;/^pandas/d;/^statsmodels/d;/^numba/d;/^jax/d;/^h5py/d;/^Pillow/d;/^pytest/d;/^pytest-mock/d;/^torch/d;/^torchaudio/d;/^torchvision/d;/^xgboost/d;/^requests/d;/^tensorflow/d;/^keras/d;/^kornia/d;/^librosa/d;/^tqdm/d;/^timm/d;/^catboost/d;/^scikit-learn/d;/^GPy/d;/^lief/d' requirements_test.txt)
5454
pip install scipy==1.5.4
5555
pip install matplotlib==3.3.4
5656
pip install pandas==1.1.5
@@ -77,6 +77,7 @@ jobs:
7777
pip install catboost==1.1.1
7878
pip install scikit-learn==0.24.2
7979
pip install GPy==1.10.0
80+
pip install lief==0.12.3
8081
pip list
8182
- name: Run ${{ matrix.name }} Tests
8283
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/speech_recognition/test_tensorflow_lingvo.py --framework=${{ matrix.framework }} --durations=0

.github/workflows/ci-tensorflow-v1.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
sudo apt-get update
4949
sudo apt-get -y -q install ffmpeg libavcodec-extra
5050
python -m pip install --upgrade pip setuptools wheel
51-
pip install -q -r <(sed '/^pandas/d;/^scipy/d;/^matplotlib/d;/^xgboost/d;/^tensorflow/d;/^keras/d;/^jax/d;/^torch/d;/^Pillow/d;/^h5py/d;/^kornia/d;/^scikit-learn/d;/^pytest-mock/d;/^GPy/d' requirements_test.txt)
51+
pip install -q -r <(sed '/^pandas/d;/^scipy/d;/^matplotlib/d;/^xgboost/d;/^tensorflow/d;/^keras/d;/^jax/d;/^torch/d;/^Pillow/d;/^h5py/d;/^kornia/d;/^scikit-learn/d;/^pytest-mock/d;/^GPy/d;/^lief/d' requirements_test.txt)
5252
pip install pandas==1.3.5
5353
pip install scipy==1.7.2
5454
pip install matplotlib==3.5.3
@@ -66,6 +66,7 @@ jobs:
6666
pip install scikit-learn==1.0.2
6767
pip install pytest-mock~=3.11.1
6868
pip install GPy~=1.10.0
69+
pip install lief==0.12.3
6970
pip list
7071
- name: Run Tests
7172
run: ./run_tests.sh ${{ matrix.framework }}

art/attacks/evasion/pe_malware_attack.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,10 +627,11 @@ def get_peinfo(
627627
cleaned_dump = {}
628628

629629
binary_load = lief.parse(filepath) # pylint: disable=I1101
630-
if binary_load is None:
631-
raise ValueError("Failed to load binary.")
632-
else:
630+
if binary_load is not None:
633631
binary = binary_load
632+
else:
633+
raise ValueError("Failed to load binary.")
634+
634635
for section in binary.sections:
635636
section_info = {}
636637
slack = section.sizeof_raw_data - section.virtual_size # type: ignore
@@ -695,10 +696,10 @@ def insert_section(
695696
lief.logging.disable()
696697

697698
binary_parse = lief.PE.parse(datapoint)
698-
if binary_parse is None:
699-
raise ValueError("Failed to load binary.")
700-
else:
699+
if binary_parse is not None:
701700
binary = binary_parse
701+
else:
702+
raise ValueError("Failed to load binary.")
702703

703704
name_in_use = True
704705
while name_in_use:

0 commit comments

Comments
 (0)