lifting-bits / remill

Library for lifting machine code to LLVM bitcode
Apache License 2.0
1.22k stars 142 forks source link

Emit IR for `syscall` in addition to a `__remill_async_hyper_call` #625

Closed tetsuo-cpp closed 1 year ago

tetsuo-cpp commented 1 year ago

At the moment, we simply add a call to __remill_async_hyper_call to indicate a control flow change. We should also emit IR for the actual instruction.

I used these for reference: https://www.cs.uaf.edu/2017/fall/cs301/lecture/11_17_syscall.html https://www.felixcloutier.com/x86/syscall.html https://www.felixcloutier.com/x86/sysenter https://www.felixcloutier.com/x86/sysexit

tetsuo-cpp commented 1 year ago

Whoops, I didn't get the inline asm syntax right. Fixing now...

tetsuo-cpp commented 1 year ago

@pgoodman Ok, I think this should do the trick.