https://github.com/akkartik/mu/blob/main/linux/312copy.subx
1 == code
2
3 copy-array-object:
4
5 55/push-ebp
6 89/<- %ebp 4/r32/esp
7
8 (copy-array Heap *(ebp+8) *(ebp+0xc))
9 $copy-array-object:end:
10
11 89/<- %esp 5/r32/ebp
12 5d/pop-to-ebp
13 c3/return
14
15
16
17 copy-file:
18
19 55/push-ebp
20 89/<- %ebp 4/r32/esp
21
22 50/push-eax
23 51/push-ecx
24 52/push-edx
25 53/push-ebx
26 56/push-esi
27 57/push-edi
28
29 8b/-> *(ebp+8) 6/r32/esi
30
31 8b/-> *(esi+0xc) 0/r32/eax
32 05/add-to-eax 0x10/imm32
33 89/<- %ecx 0/r32/eax
34
35 (allocate Heap %ecx *(ebp+0xc))
36
37 8b/-> *(ebp+0xc) 0/r32/eax
38 (lookup *eax *(eax+4))
39 89/<- %edi 0/r32/eax
40
41 (copy-bytes %esi %edi %ecx)
42
43 8b/-> *esi 3/r32/ebx
44 b9/copy-to-ecx 0/imm32/offset
45 ba/copy-to-edx 1/imm32/whence:SEEK_CUR
46 (syscall_lseek)
47 89/<- %ecx 0/r32/eax
48
49
50 (open-fd *(ebp+0x10) 0)
51 89/<- *edi 0/r32/eax
52
53 89/<- %ebx 0/r32/eax
54 51/push-ecx
55 ba/copy-to-edx 0/imm32/whence:SEEK_SET
56 (syscall_lseek)
57 $copy-file:end:
58
59 5f/pop-to-edi
60 5e/pop-to-esi
61 5b/pop-to-ebx
62 5a/pop-to-edx
63 59/pop-to-ecx
64 58/pop-to-eax
65
66 89/<- %esp 5/r32/ebp
67 5d/pop-to-ebp
68 c3/return