File files/asm/user_steam.S changed (mode: 100644) (index 324c5fd..f818ab5) |
1 |
1 |
/* |
/* |
|
2 |
|
* Must switch to fasm |
|
3 |
|
* |
2 |
4 |
* This assembly source code is intended to be preprocessed: |
* This assembly source code is intended to be preprocessed: |
3 |
5 |
* - don't use # comments |
* - don't use # comments |
4 |
6 |
* - do use your C compiler front-end with proper specific options or do |
* - do use your C compiler front-end with proper specific options or do |
|
... |
... |
ldpath: .asciz "LD_LIBRARY_PATH=/nyan/dbus/current/lib" |
23 |
25 |
|
|
24 |
26 |
argv: .quad dbus, shell, shell_arg0, shell_arg1, shell_arg2, 0 |
argv: .quad dbus, shell, shell_arg0, shell_arg1, shell_arg2, 0 |
25 |
27 |
envp: .quad home, path, ldpath, 0 |
envp: .quad home, path, ldpath, 0 |
|
28 |
|
/* alsa audio group is 116 */ |
|
29 |
|
groups: .quad 116 |
26 |
30 |
|
|
27 |
31 |
.text |
.text |
28 |
32 |
/* _start is the ELF symbol which defines the program entry point */ |
/* _start is the ELF symbol which defines the program entry point */ |
29 |
33 |
.global _start |
.global _start |
30 |
34 |
_start: |
_start: |
|
35 |
|
mov $116, %eax /* setgroups */ |
|
36 |
|
mov $1, %rdi /* 1 group */ |
|
37 |
|
mov $groups, %rsi /* audio */ |
|
38 |
|
syscall |
31 |
39 |
mov $106, %eax /* setgid */ |
mov $106, %eax /* setgid */ |
32 |
40 |
mov $1000, %rdi /* GID=1000 */ |
mov $1000, %rdi /* GID=1000 */ |
33 |
41 |
syscall |
syscall |
File files/asm/user_steam_nodbus.S copied from file files/asm/user_steam.S (similarity 71%) (mode: 100644) (index 324c5fd..a89935c) |
1 |
1 |
/* |
/* |
|
2 |
|
* Must switch to fasm |
|
3 |
|
* |
2 |
4 |
* This assembly source code is intended to be preprocessed: |
* This assembly source code is intended to be preprocessed: |
3 |
5 |
* - don't use # comments |
* - don't use # comments |
4 |
6 |
* - do use your C compiler front-end with proper specific options or do |
* - do use your C compiler front-end with proper specific options or do |
5 |
7 |
* pipe cpp output to as (don't forget to link as an executable then) |
* pipe cpp output to as (don't forget to link as an executable then) |
6 |
8 |
* |
* |
7 |
9 |
* cpp user.S | as -o user.o; ld -o user user.o |
* cpp user.S | as -o user.o; ld -o user user.o |
8 |
|
* |
|
9 |
|
* dbus will want an entry in /etc/passwd for user |
|
10 |
10 |
*/ |
*/ |
11 |
11 |
|
|
12 |
12 |
.data |
.data |
13 |
|
dbus: .asciz "/nyan/dbus/current/bin/dbus-run-session" |
|
14 |
13 |
shell: .asciz "/bin/sh" |
shell: .asciz "/bin/sh" |
15 |
14 |
shell_arg0: .asciz "-l" |
shell_arg0: .asciz "-l" |
16 |
15 |
shell_arg1: .asciz "-c" |
shell_arg1: .asciz "-c" |
17 |
16 |
shell_arg2: .asciz "exec /home/user/steam/steam" |
shell_arg2: .asciz "exec /home/user/steam/steam" |
18 |
17 |
|
|
19 |
|
|
|
20 |
18 |
home: .asciz "HOME=/home/user" |
home: .asciz "HOME=/home/user" |
21 |
|
path: .asciz "PATH=/nyan/dbus/current/bin" |
|
22 |
|
ldpath: .asciz "LD_LIBRARY_PATH=/nyan/dbus/current/lib" |
|
23 |
19 |
|
|
24 |
|
argv: .quad dbus, shell, shell_arg0, shell_arg1, shell_arg2, 0 |
|
25 |
|
envp: .quad home, path, ldpath, 0 |
|
|
20 |
|
argv: .quad shell, shell_arg0, shell_arg1, shell_arg2, 0 |
|
21 |
|
envp: .quad home, 0 |
|
22 |
|
/* alsa audio group is 116 */ |
|
23 |
|
groups: .quad 116 |
26 |
24 |
|
|
27 |
25 |
.text |
.text |
28 |
26 |
/* _start is the ELF symbol which defines the program entry point */ |
/* _start is the ELF symbol which defines the program entry point */ |
29 |
27 |
.global _start |
.global _start |
30 |
28 |
_start: |
_start: |
|
29 |
|
mov $116, %eax /* setgroups */ |
|
30 |
|
mov $1, %rdi /* 1 group */ |
|
31 |
|
mov $groups, %rsi /* audio */ |
|
32 |
|
syscall |
31 |
33 |
mov $106, %eax /* setgid */ |
mov $106, %eax /* setgid */ |
32 |
34 |
mov $1000, %rdi /* GID=1000 */ |
mov $1000, %rdi /* GID=1000 */ |
33 |
35 |
syscall |
syscall |
|
... |
... |
_start: |
35 |
37 |
mov $1000, %rdi /* UID=1000 */ |
mov $1000, %rdi /* UID=1000 */ |
36 |
38 |
syscall |
syscall |
37 |
39 |
mov $59, %eax /* execve */ |
mov $59, %eax /* execve */ |
38 |
|
mov $dbus, %rdi |
|
|
40 |
|
mov $shell, %rdi |
39 |
41 |
mov $argv, %rsi |
mov $argv, %rsi |
40 |
42 |
mov $envp, %rdx |
mov $envp, %rdx |
41 |
43 |
/* never returning syscall */ |
/* never returning syscall */ |