cea-sec / miasm

Reverse engineering framework in Python
https://miasm.re/
GNU General Public License v2.0
3.4k stars 466 forks source link

jit error #1484

Open qq415338269 opened 2 months ago

qq415338269 commented 2 months ago

I am trying to use miasm's simulation and symbolic execution on Windows, but I am encountering errors. I have already installed the required dependencies and compiled LLVM. What should I do? I have tried installing miasm 0.1.3 and 0.1.5 using pip, but both failed. I also attempted to download 0.1.5 and compile it myself, but during compilation, I received a warning that the miasm jit extensions were not compiled. Could you please help me resolve this issue? Here is the error message I am receiving: Using c:\users\41533\appdata\roaming\python\python39\site-packages Finished processing dependencies for miasm==0.1.5.dev41 build all build WARNING: miasm jit extensions were not compiled, details: Could not find a suitable Clang/LLVM installation. You can download LLVM from https://releases.llvm.org Alternatively you can select the 'C++ Clang-cl build tools' in the Visual Studio Installer Could not find cl.exe and/or link.exe in the PATH, try building miasm from a Visual Studio command prompt More information at: https://wiki.python.org/moin/WindowsCompilers

Traceback (most recent call last): File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\miasm\jitter\jitload.py", line 219, in init from miasm.jitter.arch import JitCore_x86 as jcore ImportError: cannot import name 'JitCore_x86' from 'miasm.jitter.arch' (C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\miasm\jitter\arch__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\Code\TestProject\MiasmTestProject\AssemblingDisassembling.py", line 25, in jitter = machine.jitter(loc_db) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\miasm\arch\x86\jit.py", line 76, in init Jitter.init(self, Lifter_X86_32(loc_db), *args, **kwargs) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site-packages\miasm\jitter\jitload.py", line 238, in init raise RuntimeError('Unsupported jit arch: %s' % arch_name) RuntimeError: Unsupported jit arch: x86

qq415338269 commented 2 months ago

I am using debug versions of LLVM 18.1 and 13.0.And I can check the versions of LLVM and Clang in the CMD window. I have already set the LLVM environment variables.

W0ni commented 2 months ago

Hello,

It seems miasm could find LLVM in the PATH. Is your PATH envvar correct?

Alternatively, you can still use the python jitter, which doesn't require LLVM.