mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
23 lines
432 B
C
23 lines
432 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <sys/syscall.h>
|
|
|
|
int root(char *buffer, size_t size) {
|
|
int result;
|
|
|
|
#ifdef TARGET_mips
|
|
__asm__("li $v0,0xfb8\n\tsyscall\n\tmove %0, $v0" : "=r"(result) : : "%v0");
|
|
#else
|
|
result = syscall(SYS_getuid);
|
|
#endif
|
|
|
|
return result;
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
printf("%d\n", root(argv[1], strlen(argv[1])));
|
|
return EXIT_SUCCESS;
|
|
}
|