VirusTotal / yara-python

The Python interface for YARA
http://virustotal.github.io/yara/
Apache License 2.0
646 stars 179 forks source link

python3.9: has_function not working for Visual Studio 2017 build #165

Open joachimmetz opened 3 years ago

joachimmetz commented 3 years ago

Mainly informational

Tested with yara-python 4.0.4 and Python 3.9 on Windows 10 with Visual Studio 2017

Running: python.exe setup.py build fails with error: [WinError 1] Incorrect function

Unfortunately this appears to be a very generic error. Seeing the previous line reference memmem%RANDOM%.c this is likely related to the use of memmem. The same applies to strlcpy.

Removing memmem and strlcpy detection from setup.py https://github.com/VirusTotal/yara-python/blob/924c8161d419725a36a5f0f021d9a47521b104e2/setup.py#L224 resolves the issue.

joachimmetz commented 3 years ago

This also applies to more functions it looks like has_function is not working for this build environment. I've removed with muted from has_function which allowed the module to build.