bazad / memctl

An iOS kernel introspection tool.
https://bazad.github.io/2017/09/live-kernel-introspection-ios/
MIT License
226 stars 29 forks source link

kernel call from cli #2

Closed stek29 closed 6 years ago

stek29 commented 6 years ago

I'm not sure if I just missed it, but is there any way to perform kernel_call from cli?

bazad commented 6 years ago

Not yet. I'm still considering how best to expose such an interface.

stek29 commented 6 years ago

The best I can think of is just kc address args where args are kword_t's in hex

However, from what I see current arg parsing system doesn't support variadic-like args, so maybe args can be string separated by some other char than space.

bazad commented 6 years ago

I've implemented a partial solution in 10ce1775, although it's currently limited to 5 arguments. I'll eventually implement true variadic arguments, at which point you should be able to call arbitrary kernel functions from the CLI.

bazad commented 6 years ago

Alright, memctl's CLI now offers better support for kernel call arguments. It doesn't support true repeated/variadic arguments, but it should expose the full power of kernel_call (including stack-based arguments, which must be specified with a width) to the CLI.

stek29 commented 6 years ago

Awesome!