skelsec / pypykatz

Mimikatz implementation in pure Python
MIT License
2.77k stars 367 forks source link

Error C2065: 'FFI_STDCALL': undeclared identifier #158

Open harrynorthover opened 1 month ago

harrynorthover commented 1 month ago

I'm trying to install Pypykatz using pip install pypykatz.

I'm getting this error when building wheel cffi.


  Using cached pypykatz-0.6.9-py3-none-any.whl.metadata (750 bytes)
Collecting unicrypto<=0.1.0,>=0.0.10 (from pypykatz)
  Using cached unicrypto-0.0.10-py3-none-any.whl.metadata (386 bytes)
Collecting minidump<=0.1.0,>=0.0.21 (from pypykatz)
  Using cached minidump-0.0.23-py3-none-any.whl.metadata (467 bytes)
Collecting minikerberos<=0.5.0,>=0.4.1 (from pypykatz)
  Using cached minikerberos-0.4.4-py3-none-any.whl.metadata (575 bytes)
Collecting aiowinreg<=0.1.0,>=0.0.10 (from pypykatz)
  Using cached aiowinreg-0.0.12-py3-none-any.whl.metadata (507 bytes)
Collecting msldap<=0.6.0,>=0.5.7 (from pypykatz)
  Using cached msldap-0.5.10-py3-none-any.whl.metadata (758 bytes)
Collecting winacl<=0.2.0,>=0.1.7 (from pypykatz)
  Using cached winacl-0.1.9-py3-none-any.whl.metadata (458 bytes)
Collecting aiosmb<=0.5.0,>=0.4.8 (from pypykatz)
  Using cached aiosmb-0.4.10-py3-none-any.whl.metadata (691 bytes)
Collecting aesedb<=0.2.0,>=0.1.4 (from pypykatz)
  Using cached aesedb-0.1.6-py3-none-any.whl.metadata (511 bytes)
Collecting tqdm (from pypykatz)
  Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Collecting colorama (from aesedb<=0.2.0,>=0.1.4->pypykatz)
  Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting asyauth>=0.0.16 (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached asyauth-0.0.20-py3-none-any.whl.metadata (615 bytes)
Collecting asysocks>=0.2.9 (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached asysocks-0.2.12-py3-none-any.whl.metadata (435 bytes)
Collecting prompt-toolkit>=3.0.2 (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached prompt_toolkit-3.0.47-py3-none-any.whl.metadata (6.4 kB)
Collecting six (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting asn1crypto (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached asn1crypto-1.5.1-py2.py3-none-any.whl.metadata (13 kB)
Collecting wcwidth (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB)
Collecting cryptography (from aiosmb<=0.5.0,>=0.4.8->pypykatz)
  Using cached cryptography-42.0.8.tar.gz (671 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [81 lines of output]
      Collecting setuptools>=61.0.0
        Using cached setuptools-70.1.0-py3-none-any.whl.metadata (6.0 kB)
      Collecting wheel
        Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting cffi>=1.12
        Using cached cffi-1.16.0.tar.gz (512 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting setuptools-rust>=1.7.0
        Using cached setuptools_rust-1.9.0-py3-none-any.whl.metadata (9.3 kB)
      Collecting pycparser (from cffi>=1.12)
        Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
      Collecting semantic-version<3,>=2.8.2 (from setuptools-rust>=1.7.0)
        Using cached semantic_version-2.10.0-py2.py3-none-any.whl.metadata (9.7 kB)
      Using cached setuptools-70.1.0-py3-none-any.whl (882 kB)
      Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
      Using cached setuptools_rust-1.9.0-py3-none-any.whl (26 kB)
      Using cached semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
      Using cached pycparser-2.22-py3-none-any.whl (117 kB)
      Building wheels for collected packages: cffi
        Building wheel for cffi (pyproject.toml): started
        Building wheel for cffi (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        Building wheel for cffi (pyproject.toml) did not run successfully.
        exit code: 1

        [43 lines of output]
        _configtest.c
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build\lib.win-arm64-cpython-312
        creating build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\api.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\backend_ctypes.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\cffi_opcode.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\commontypes.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\cparser.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\error.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\ffiplatform.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\lock.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\model.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\pkgconfig.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\recompiler.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\setuptools_ext.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\vengine_cpy.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\vengine_gen.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\verifier.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\_imp_emulation.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\_shimmed_dist_utils.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\__init__.py -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\_cffi_include.h -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\parse_c_type.h -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\_embedding.h -> build\lib.win-arm64-cpython-312\cffi
        copying src\cffi\_cffi_errors.h -> build\lib.win-arm64-cpython-312\cffi
        running build_ext
        building '_cffi_backend' extension
        creating build\temp.win-arm64-cpython-312
        creating build\temp.win-arm64-cpython-312\Release
        creating build\temp.win-arm64-cpython-312\Release\src
        creating build\temp.win-arm64-cpython-312\Release\src\c
        "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DFFI_BUILDING=1 -I/usr/include/ffi -I/usr/include/libffi -Isrc/c/libffi_arm64/include -IC:\Users\harrynorthover\AppData\Local\Programs\Python\Python312-arm64\include -IC:\Users\harrynorthover\AppData\Local\Programs\Python\Python312-arm64\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcsrc/c/_cffi_backend.c /Fobuild\temp.win-arm64-cpython-312\Release\src/c/_cffi_backend.obj
        _cffi_backend.c
        src/c/_cffi_backend.c(4521): warning C4133: 'function': incompatible types - from 'PyUnicodeObject *' to 'PyObject *'
        src/c/_cffi_backend.c(4532): warning C4996: 'Py_FileSystemDefaultEncoding': deprecated in 3.12
        src/c/_cffi_backend.c(5843): error C2065: 'FFI_STDCALL': undeclared identifier
        C:\Users\harrynorthover\AppData\Local\Temp\pip-install-cs_ztv12\cffi_f1ff9947b9d844d9b7e828396da47afc\src\c\realize_c_type.c(581): error C2065: 'FFI_STDCALL': undeclared identifier
        src/c/_cffi_backend.c(8084): error C2065: 'FFI_STDCALL': undeclared identifier
        error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for cffi
      Failed to build cffi
      ERROR: Could not build wheels for cffi, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.```

This is on a fresh Windows 11 VM, running in Parallels on a MacBook Pro M1. 
skelsec commented 2 weeks ago

This seems to be an issue with the cryptography module which is a 3rd party package, not written by me.