https://github.com/akkartik/mu/blob/master/subx/examples/ex7.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14 == code
15
16
17
18
19
20 bb/copy-to-EBX Filename/imm32
21 b9/copy-to-ECX 0x180/imm32/fixed-perms
22 b8/copy-to-EAX 8/imm32/creat
23 cd/syscall 0x80/imm8
24
25
26 bb/copy-to-EBX Filename/imm32
27 b9/copy-to-ECX 1/imm32/wronly
28 ba/copy-to-EDX 0x180/imm32/fixed-perms
29 b8/copy-to-EAX 5/imm32/open
30 cd/syscall 0x80/imm8
31
32 bb/copy-to-EBX Stream/imm32
33 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . .
34
35
36
37 bb/copy-to-EBX Stream/imm32
38 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . .
39
40 b9/copy-to-ECX A/imm32
41 ba/copy-to-EDX 1/imm32/size
42 b8/copy-to-EAX 4/imm32/write
43 cd/syscall 0x80/imm8
44
45
46
47 bb/copy-to-EBX Stream/imm32
48 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . .
49
50 b8/copy-to-EAX 6/imm32/close
51 cd/syscall 0x80/imm8
52
53
54 bb/copy-to-EBX Filename/imm32
55 b9/copy-to-ECX 0/imm32/rdonly
56 ba/copy-to-EDX 0x180/imm32/fixed-perms
57 b8/copy-to-EAX 5/imm32/open
58 cd/syscall 0x80/imm8
59
60 bb/copy-to-EBX Stream/imm32
61 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . .
62
63
64
65 bb/copy-to-EBX Stream/imm32
66 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . .
67
68 b9/copy-to-ECX B/imm32
69 ba/copy-to-EDX 1/imm32/size
70 b8/copy-to-EAX 3/imm32/read
71 cd/syscall 0x80/imm8
72
73
74
75 bb/copy-to-EBX Stream/imm32
76 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . .
77
78 b8/copy-to-EAX 6/imm32/close
79 cd/syscall 0x80/imm8
80
81
82 bb/copy-to-EBX Filename/imm32
83 b8/copy-to-EAX 0xa/imm32/unlink
84 cd/syscall 0x80/imm8
85
86
87
88 bb/copy-to-EBX B/imm32
89 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . .
90
91 b8/copy-to-EAX 1/imm32/exit
92 cd/syscall 0x80/imm8
93
94 == data
95
96 Stream:
97 00 00 00 00
98 A:
99 61 00 00 00
100 B:
101 00 00 00 00
102 Filename:
103 2e 66 6f 6f 00 00 00 00
104
105