Skip to content

Conversation

@lunixbochs
Copy link
Contributor

If there's an interrupt callback registered, this forces the x86_64 syscall instruction to simulate an int $80 callback and advance PC.

@aquynh
Copy link
Member

aquynh commented Aug 22, 2015

this looks good. can you please add a sample with SYSCALL instruction to sample_x86.c or sample_x86.py?

thanks.

@lunixbochs
Copy link
Contributor Author

Added SYSCALL test in sample_x86.py

aquynh added a commit that referenced this pull request Aug 22, 2015
call int80 callback from x86_64 syscall instruction
@aquynh aquynh merged commit 5826f30 into unicorn-engine:master Aug 22, 2015
@aquynh
Copy link
Member

aquynh commented Aug 22, 2015

merged, thanks.

do you think that we should do something so the callback knows that this comes from SYSCALL rather than INT 0x80?

@lunixbochs
Copy link
Contributor Author

It's better to be explicit, but this method does work for me right now. The ABI doesn't change in the handler either way afaik. I'm not sure what the alternative would look like. Maybe a non-interrupt handler that's just for SYSCALL-like instructions?

@aquynh
Copy link
Member

aquynh commented Aug 22, 2015

i just committed a change to handle SYSCALL/SYSENTER instructions separately, so we do not share the callback with interrupts: e1baf2f.

@lunixbochs: with this you will need to modify your usercorn code accordingly.

thanks.

@farmdve farmdve mentioned this pull request Nov 11, 2015
aquynh pushed a commit that referenced this pull request Mar 17, 2016
Pulling in from unicorn-engine to my private  repo
@ZakDanger ZakDanger mentioned this pull request Jan 30, 2017
daeken referenced this pull request in reswitched/unicorn Aug 22, 2017
daeken referenced this pull request in reswitched/unicorn Aug 22, 2017
Merge pull request #2 from unicorn-engine/master
domenukk added a commit to domenukk/unicornafl that referenced this pull request Jan 13, 2020
[afl++] fix segfault (using input buf after unmap)
chfl4gs added a commit to chfl4gs/unicorn that referenced this pull request Mar 4, 2020
chfl4gs added a commit to chfl4gs/unicorn that referenced this pull request Mar 4, 2020
simigo79 added a commit to simigo79/unicorn-ppc that referenced this pull request May 10, 2020
mrexodia pushed a commit to mrexodia/unicorn that referenced this pull request Sep 28, 2022
wtdcode added a commit that referenced this pull request Jul 28, 2025
wtdcode added a commit that referenced this pull request Aug 30, 2025
K4ddate pushed a commit to K4ddate/unicorn that referenced this pull request Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants