mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 20:44:26 +01:00
rand_check pid
This commit is contained in:
@@ -11,7 +11,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int bss = 0;
|
int bss = 0;
|
||||||
int data = 1;
|
int data = 1;
|
||||||
@@ -21,13 +23,17 @@ int main(__attribute__((unused)) int argc, char **argv) {
|
|||||||
uint64_t uint64;
|
uint64_t uint64;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
printf("time(NULL) = %ju\n", (uintmax_t)time(NULL));
|
/* Loaded addresses. */
|
||||||
printf("&i = %p\n", (void *)&i);
|
printf("&i = %p\n", (void *)&i);
|
||||||
printf("&argv[0] = %p\n", (void *)&argv[0]);
|
printf("&argv[0] = %p\n", (void *)&argv[0]);
|
||||||
printf("&main = %p\n", (void *)(intptr_t)main);
|
printf("&main = %p\n", (void *)(intptr_t)main);
|
||||||
printf("&bss = %p\n", (void *)&bss);
|
printf("&bss = %p\n", (void *)&bss);
|
||||||
printf("&data = %p\n", (void *)&data);
|
printf("&data = %p\n", (void *)&data);
|
||||||
|
|
||||||
|
/* Misc syscalls. */
|
||||||
|
printf("time(NULL) = %ju\n", (uintmax_t)time(NULL));
|
||||||
|
printf("pid = %ju\n", (uintmax_t)getpid());
|
||||||
|
|
||||||
/* malloc */
|
/* malloc */
|
||||||
ip = malloc(sizeof(*ip));
|
ip = malloc(sizeof(*ip));
|
||||||
printf("&malloc = %p\n", (void *)ip);
|
printf("&malloc = %p\n", (void *)ip);
|
||||||
|
|||||||
Reference in New Issue
Block a user