context/rnd: paging/stack/heap/virtualization
This commit is contained in:
parent
12b71b3744
commit
83c5540a42
8 changed files with 972 additions and 382 deletions
|
@ -39,10 +39,27 @@ static void caller(void) {
|
|||
printer(&a, &b);
|
||||
}
|
||||
|
||||
static void shell() {
|
||||
char *argv[] = {};
|
||||
execve("/bin/sh", argv, NULL);
|
||||
}
|
||||
|
||||
static void simple_printer(void) { fprintf(stderr, "I wonder who called me?"); }
|
||||
|
||||
static void modifier(void) {
|
||||
uint64_t *p;
|
||||
// without frame-pointer
|
||||
*(&p + 1) = (uint64_t *)simple_printer;
|
||||
|
||||
// with frame-pointer
|
||||
*(&p + 2) = (uint64_t *)simple_printer;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
caller();
|
||||
many_args(0xfffffffffffffff0, 0xfffffffffffffff1, 0xfffffffffffffff3,
|
||||
0xfffffffffffffff4, 0xfffffffffffffff5, 0xfffffffffffffff6,
|
||||
0xfffffffffffffff7);
|
||||
// caller();
|
||||
// many_args(0xfffffffffffffff0, 0xfffffffffffffff1, 0xfffffffffffffff3,
|
||||
// 0xfffffffffffffff4, 0xfffffffffffffff5, 0xfffffffffffffff6,
|
||||
// 0xfffffffffffffff7);
|
||||
modifier();
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue