strcpy(end+32, argv[1]); 为什么是偏移 32 呢,run 应该占用了一个 64 字节 的指针才对啊,有点儿疑惑
https://pdos.csail.mit.edu/6.828/2024/labs/syscall.html
struct run { struct run *next; }; int main(int argc, char *argv[]) { if(argc != 2){ printf("Usage: secret the-secret\n"); exit(1); } char *end = sbrk(PGSIZE*32); end = end + 9 * PGSIZE; strcpy(end, "my very very very secret pw is: "); strcpy(end+32, argv[1]); printf("secret pointer: %p\n", end); exit(0); } 