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
omega-mv / aienux / connector / gates / hostile / passwd.om
| 1 | note hostile probe: read /etc/passwd; prints its first 64 bytes, or "open -1" |
| 2 | text pw "/etc/passwd" |
| 3 | text m1 "open -1\n" |
| 4 | fn main to int |
| 5 | b = new uchar 64 0 |
| 6 | fd = fopen pw 0 len pw 0 0 |
| 7 | if lt fd 0 |
| 8 | k = write 1 m1 0 len m1 |
| 9 | ret 0 |
| 10 | end |
| 11 | n = read int fd b 0 64 |
| 12 | if gt n 0 |
| 13 | k = write 1 b 0 ulong n |
| 14 | end |
| 15 | ret 0 |
| 16 | end |