certfuzz icon indicating copy to clipboard operation
certfuzz copied to clipboard

Run BFF on win11 arm64

Open yuhui518 opened this issue 1 year ago • 2 comments

I download BFF and install it on my win11 arm64 virtual machine.But it report a error:

Edit configs\bff.yaml and run bff.py to start fuzzing
See readme.txt for documentation
Traceback (most recent call last):
  File "C:\BFF\bff.py", line 48, in <module>
    from certfuzz.bff.windows import main
  File "C:\BFF\certfuzz\bff\windows.py", line 52, in <module>
    from certfuzz.campaign.campaign_windows import WindowsCampaign
  File "C:\BFF\certfuzz\campaign\campaign_windows.py", line 58, in <module>
    from certfuzz.iteration.iteration_windows import WindowsIteration
  File "C:\BFF\certfuzz\iteration\iteration_windows.py", line 52, in <module>
    from certfuzz.testcase.testcase_windows import WindowsTestcase
  File "C:\BFF\certfuzz\testcase\testcase_windows.py", line 56, in <module>
    from certfuzz.debuggers.msec import MsecDebugger
  File "C:\BFF\certfuzz\debuggers\msec.py", line 59, in <module>
    import wmi
  File "C:\Python27\lib\site-packages\wmi.py", line 88, in <module>
    from win32com.client import GetObject, Dispatch
  File "C:\Python27\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: DLL load failed: %1 is not a valid Win32 application.

Win11 arm64 also can run x64 applications,and why it can't load win32 dll?

yuhui518 avatar May 11 '24 08:05 yuhui518

It seems that Win11-ARM64 does not support the python2.7-Win32com library

yuhui518 avatar May 11 '24 11:05 yuhui518

Yeah,I solve this problem.I replace the two prerequisites:

double click pywin32-228.win-amd64-py2.7.exe
pip install numpy-1.13.0-cp27-none-win_amd64.whl

download pywin32-228.win-amd64-py2.7.exe from "https://github.com/mhammond/pywin32/releases/download/b228/pywin32-228.win-amd64-py2.7.exe"; download numpy-1.13.0-cp27-none-win_amd64.whl from "https://pypi.org/project/numpy/1.13.0/#files".

yuhui518 avatar May 11 '24 12:05 yuhui518

I will encounter many crashes when running BFF on Windows x64,but I did not encounter any crashes when running BFF on Windows arm64.Is there any problem on Windows arm64?

yuhui518 avatar May 13 '24 04:05 yuhui518

We never tested BFF for Windows on ARM, so unfortunately I can't say what you should expect.

BFF was primarily built to run on Intel 32-bit & 64-bit systems. While the python code itself should be fine on any architecture that can run python 2.7, some of that python is parsing debugger outputs, and so there could be architecture dependencies there.

ahouseholder avatar May 13 '24 14:05 ahouseholder

We never tested BFF for Windows on ARM, so unfortunately I can't say what you should expect.

BFF was primarily built to run on Intel 32-bit & 64-bit systems. While the python code itself should be fine on any architecture that can run python 2.7, some of that python is parsing debugger outputs, and so there could be architecture dependencies there.

Thank you very much for your reply.Windows arm64 can run x64 applicatio,If there is code that relies on the CPU architecture, some problems may arise.

yuhui518 avatar May 14 '24 02:05 yuhui518

So I don't think we are going to do anything about arm64 support in the near term, but just to leave a breadcrumb for posterity, I did find at least one place where a potential improvement could be made to call attention to the fact that arm64 is not supported.

https://github.com/CERTCC/certfuzz/blob/3162f91cf45c491e79cabe40b3ae64756fb4d187/src/certfuzz/analyzers/cdbanalyze.py#L10-L11

in cdbanalyzer.py there is a platform check that just checks to see that platform.system() returns "Windows". This could be replaced with a more robust check that, for example, platform.machine() or platform.processor() returns the expected strings.s

For example, I expect we might run into similar problems with macOS on Apple M* hardware since BFF was written in the age of Intel Macs. A check there could look for machine=x86_64 or processor=i386 etc.


Addressing the larger question of actually supporting Windows on arm64, certfuzz.debuggers.output_parsers.msec_file is probably the place to start, specifically focusing on

https://github.com/CERTCC/certfuzz/blob/3162f91cf45c491e79cabe40b3ae64756fb4d187/src/certfuzz/debuggers/output_parsers/msec_file.py#L58-L89

ahouseholder avatar May 14 '24 19:05 ahouseholder