jasonwhite / syscalls

Raw Linux system calls for Rust.
Other
109 stars 14 forks source link

Support for multiple architectures #16

Closed ItsShadowCone closed 2 years ago

ItsShadowCone commented 2 years ago

I'd like to use this module for parsing syscall numbers returned by ptrace. This is great work, however under x64_64, it is possible to call 64 bit style syscalls using the syscall instruction as well as 32 bit style syscalls using int 0x80 on many plattforms, so the ability to decode other plattforms would be good too.

The simplest way would be to simply expose the plattform specific enums seperately on every plattform, however a helper From(u64, arch) function would probably be cool too.

jasonwhite commented 2 years ago

This seems pretty reasonable. I actually had all platforms exposed via syscalls::{x86,x86_64,arm,...}::Sysno at one point, but removed it because it increased the compile time. It should be easy to expose again, but have it behind a feature flag.

BTW, if you're looking into using ptrace from Rust, check out Reverie, or more specifically the safe ptrace API that I implemented for it. I've been meaning to yank that part out into a separate crate for a while.

ItsShadowCone commented 2 years ago

Awesome, thanks!

jasonwhite commented 2 years ago

This should now be possible in the latest release (v0.6.3). See the changelog for more details.