diff options
author | Pwn20wnd <pwn20wndstuff@gmail.com> | 2019-03-09 23:30:26 +0300 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2019-03-20 23:27:12 -1000 |
commit | 7bca6ad19e54e2edc4ec9cfa10da20a26e294334 (patch) | |
tree | 9805a17e7d5ecdedc2aeb0a0328c6b2df1b26828 /kernel_call/kernel_call.c | |
parent | 4abbd1f554d3f1a185fd7079ee84944f1b0a355b (diff) |
Merge pwn's changes to support arm64e via rebase
Diffstat (limited to 'kernel_call/kernel_call.c')
-rwxr-xr-x | kernel_call/kernel_call.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/kernel_call/kernel_call.c b/kernel_call/kernel_call.c new file mode 100755 index 0000000..f3bfad5 --- /dev/null +++ b/kernel_call/kernel_call.c @@ -0,0 +1,44 @@ +/* + * kernel_call.c + * Brandon Azad + */ +#include "kernel_call.h" + +#include <assert.h> + +#include "pac.h" +#include "user_client.h" +#include "log.h" + +// ---- Public API -------------------------------------------------------------------------------- + +bool +kernel_call_init() { + bool ok = stage1_kernel_call_init() + && stage2_kernel_call_init() + && stage3_kernel_call_init(); + if (!ok) { + kernel_call_deinit(); + } + return ok; +} + +void +kernel_call_deinit() { + stage3_kernel_call_deinit(); + stage2_kernel_call_deinit(); + stage1_kernel_call_deinit(); +} + +uint32_t +kernel_call_7(uint64_t function, size_t argument_count, ...) { + assert(argument_count <= 7); + uint64_t arguments[7]; + va_list ap; + va_start(ap, argument_count); + for (size_t i = 0; i < argument_count && i < 7; i++) { + arguments[i] = va_arg(ap, uint64_t); + } + va_end(ap); + return kernel_call_7v(function, argument_count, arguments); +} |