[unicorn-engine] Re: IP wonky after UC_ERR_READ_UNMAPPED

  • From: Nguyen Anh Quynh <aquynh@xxxxxxxxx>
  • To: unicorn-engine@xxxxxxxxxxxxx
  • Date: Wed, 24 Jan 2018 17:18:00 +0800

can you post your full code (but minimized, so easier to debug)?

Thanks,
Quynh

http://www.keystone-engine.org
http://www.capstone-engine.org
http://www.unicorn-engine.org



On Tue, Jan 23, 2018 at 6:33 PM, Manduca <manduca@xxxxxxxxxxx> wrote:

Hi guys,

I use unicorn to emulate x86 code.

It encounters problematic instruction

mov eax, dword ptr fs:[0]

and throws UC_ERR_READ_UNMAPPED.

Not surprising, that selector probably points nowhere.

But when I do reg_read(EIP), it gives me the address of a harmless
instruction 0xF bytes back.

When I do UC_HOOK_CODE I get correct IPs until the end.

But once the exception hits, I'm 0xF bytes back, why?


Thanks!

M.



Other related posts: