-
Notifications
You must be signed in to change notification settings - Fork 234
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
How to correctly close an emulation #139
Comments
Hello, thanks for the feedback and sorry for the late reply. That "should" work as you have it. I would expect that once the emulator object is garbage collected, everything should just work again. This makes me think it's related to the native unicorn instance. Since it seems it's related to PEB access here, I wonder if it's related to how we setup the segment registers. I will also investigate a bit and reply here if I can get to bottom of this. |
Thanks for the reply! I did some more work. It looks like the issue is somewhere in This is a well-known sequence in a 'good' run:
Then the execution proceed.
Then, when an access to I don't have very clear why this is happening, trying to figure it out. If you have any idea... ;-) |
May be I found something interesting. In
I noticed that at the first run, this method is called several time (one for each module I guess). The very first one, having the In the second run, the method is entered again, but now the So, it looks that the |
I tried to move the it works fine, the two shellcodes are running fine, no matter the order. Also, all the unit tests are running fine. I'm not sure why the initialization of the Thanks |
Hey,
first of all let me say a huge thank you for this awesome tool!
My question:
I'm trying to run two emulations in the same script:
With this sequence of instructions, I can run shell1, but shell2 is failing with a
invalid read
at the very beginning. If I try to invert the order (so I run shell2 before shell1), now the first runs fine, the second fails with the sameinvalid read
error.So, I think I need to "clean up" things after the first emulation, but I don't have very clear how. I tried to use the
se.emu.mem_purge()
but no luck. I did an initial investigation and I saw that the
invalid read
comes after the access to the allocated PEB. Let me know if you want I go deeper with this. But may be I'm just closing the emulation in the wrong way (actually I'm not closing it at all :-)).Thanks in the meantime.
The text was updated successfully, but these errors were encountered: