cea-sec / miasm

Reverse engineering framework in Python

Home Page:https://miasm.re/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: cannot import name 'JitCore_x86' from 'miasm.jitter.arch'

guillaume75110 opened this issue · comments

Hello,

I'm running miasm under Windows WSL.
I installed miasm as show in README, and I successfully ran all tests (except for LLVM because I didn't install it). Jitter tests pass, however I'm not able to import the following module:
image

I tested the following simple code:

parser = ArgumentParser("test")
parser.add_argument("target_binary", help="Target binary path")
options = parser.parse_args()

fdesc = open(options.target_binary, 'rb')
loc_db = LocationDB()
cont = Container.from_stream(fdesc, loc_db)
machine = Machine(cont.arch)
mdis = machine.dis_engine(cont.bin_stream, loc_db=cont.loc_db)

jitter = machine.jitter(loc_db)

And I got the following error:

image

What did I miss ?
I just want to do symbolic execution and my ultimate goal is to use jitter to read memory from loaded binary (global vars content).
Thanks

Hi @guillaume75110
As far as I can see, you run your test.py from the miasm directory itselft (/tools/miasm/test.py)
And when you do this, when python imports a module, it first tries to import from the current directory. This starts to work, as you have miasm/arch/x86/jit.py.
But when you compile the miasm C modules, they are put elsewhere. So the module itself is not found.

The solution is to move your test.py everywhere else.

Can you confirm this fixes the problem?

You right, it fixed the problem, thanks !