interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / omc / sites / found-xelem-2.om

68 lines · 1675 bytes Raw Blame History
1target x86efi
2note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in xelem (code 7)
3note efi 11 with two FAT volumes: the boot stick and a second stick whose \EFI\BOOT\BOOTX64.EFI
4note holds the 4 bytes "junk". Count the volumes, read the other volume's file (4 bytes), read
5note this image from the boot volume, write it over the other volume's file, read it back and
6note compare, then ask for volume 9 (error 19). One character per result: the count, the boot
7note index, then 1 for each check that held (0 if not), then the low 6 bits of the volume 9
8note status + 48 (C = 19) and 1 if that status has bit 63 set.
9global ms uchar 32
10global Img uchar 2097152
11global Back uchar 2097152
12
13fn pr n ulong to void
14r = efi 13 0 ms 0 n
15end
16
17fn bit b bool to uchar
18if b
19ret uchar 49
20end
21ret uchar 48
22end
23
24fn main to ulong
25put ms false 61
26put ms 1 61
27put ms 2 66
28put ms 3 10
29pr 4
30r = efi 11 0 Img 0 0
31n = and r 255
32boot = and shr r 8 255
33tgt = ulong 0
34if eq boot 0
35tgt = 1
36end
37junk = efi 11 or 1 shl tgt 8 Back 0 len Back
38rd = efi 11 or 1 shl boot 8 Img 0 len Img
39wr = efi 11 or 2 shl tgt 8 Img 0 rd
40rb = efi 11 or 1 shl tgt 8 Back 0 len Back
41same = eq rb rd
42if same
43j = ulong 0
44while lt j rd
45if ne get Img j get Back j
46same = false
47break
48end
49j = add j 1
50end
51end
52e = efi 11 ulong 2305 Back 0 len Back
53put ms 0 uchar add 48 and n 63
54put ms 1 uchar add 48 and boot 63
55put ms 2 bit and eq shr r 63 0 eq junk 4
56put ms 3 bit and eq shr rd 63 0 gt rd 4096
57put ms 4 bit eq wr rd
58put ms 5 bit same
59put ms 6 uchar add 48 and e 63
60put ms 7 bit eq shr e 63 1
61put ms 8 10
62put ms 9 61
63put ms 10 61
64put ms 11 69
65put ms 12 10
66pr 13
67ret 0
68end