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 / aienux / connector / gates / hostile / net.om

44 lines · 758 bytes Raw Blame History
1note hostile probe: connect to 127.0.0.1:PORT (decimal on stdin) and send an HTTP request
2text m1 "socket -1\n"
3text m2 "connect failed\n"
4text m3 "sent\n"
5text rq "GET /community/netprobe HTTP/1.0"
6fn main to int
7p = new uchar 16 0
8a = new uchar 16 0
9e = new uchar 4 0
10n = read 0 p 0 16
11v = ulong 0
12for i ulong 16
13if ge i ulong n
14break
15end
16c = get p i
17if and ge c 48 le c 57
18v = add mul v 10 sub ulong c 48
19end
20end
21fd = socknew 2 1 0
22if lt fd 0
23k = write 1 m1 0 len m1
24ret 0
25end
26put a 0 2
27put a 2 uchar shr v 8
28put a 3 uchar and v 255
29put a 4 127
30put a 7 1
31r = connect int fd a 0 16
32if lt r 0
33k = write 1 m2 0 len m2
34ret 0
35end
36put e 0 13
37put e 1 10
38put e 2 13
39put e 3 10
40k = write int fd rq 0 len rq
41k = write int fd e 0 4
42k = write 1 m3 0 len m3
43ret 0
44end