-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cl.exe is unable to import/read .pyd dependencies (Win_x86_64) #1507
Comments
Hi @unexondev You can also use the 'python' jitter, which is really slow, but doesn't depend on llvm nor cl. I hope it helps! |
Hello @serpilliere . It's important to mention that LLVM backend jitter works only and only if your LLVM version is 15.x.x It's because your dependency - llvmlite library - is not getting any updates since LLVM 15 was released. The latest version of llvmlite (which users install with I think mentioning it'd help people working on Windows. It was really nightmare for me to build a single Sandbox. Maybe can you add a few lines on README to let people notice that? Thanks for help. Edit: Oh, I thought my problem was about that but actually it isn't. Yeah that's also a considerable thing but not the problem itself, the actual problem is libLLVM-X.X.dll doesn't exist in my LLVM binaries installed. That's because I have shared libs instead, I need to recompile LLVM again with setting dynamic libs = ON. Also, to do that you need a custom build; so the prebuild binaries will not do the job. That will cause a small issue which is that no registry entries will be created. Check this: # setup.py:46
def win_get_llvm_reg():
REG_PATH = "SOFTWARE\\LLVM\\LLVM"
try:
return winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH, 0, winreg.KEY_READ | winreg.KEY_WOW64_32KEY)
except FileNotFoundError:
pass
return winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH, 0, winreg.KEY_READ) This code actually has no job. For a proper installation (which satisfies other conditions to create a LLVM jitter properly) there will be no registry changes. You can consider that and go on a little change on And of course, you need to mention people to build LLVM with dynamic build option = on, instead of creating shared libs; to avoid errors occured in for ex. LLVM-based jitter codes. https://github.com/cea-sec/miasm/blob/master/miasm/jitter/llvmconvert.py#L239 For those people who is interested, during LLVM installation you need to set: |
Hi @unexondev |
I am trying to create a sandbox and perform some tests for the module which I'm reverse engineering, but I'm stuck at allocating a Sandbox; trying to solve issues for a few days but I'm still not able to solve it.
Error is here:
Also CL.exe logs why the error is occured:
CL.exe is tried to be run with following arguments by Miasm:
I think problem is about cl.exe to identify .pyd files. When I use GHidra and open up those .pyd modules, I can successfully analyze them. Somehow cl.exe is not able to access them. Consider that I'm running all the commands as administrator. Error is not previliege related.
cl.exe version: 19.42.34436
Python version: 3.13.1
Used Visual Studio Installer to install Clang.
clang version 18.1.8
clang target: x86_64-pc-windows-msvc
Also I installed miasm with pulling latest version from Miasm Git repository.
Miasm version: miasm-0.1.5-py3.13-win-amd64
The text was updated successfully, but these errors were encountered: