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

Function make_aliased_rthdrs

g2all/700/lapse.js:516–544  ·  view source on GitHub ↗
(sds)

Source from the content-addressed store, hash-verified

514// FUNCTIONS FOR STAGE: 0x80 MALLOC ZONE DOUBLE FREE
515
516function make_aliased_rthdrs(sds) {
517 const marker_offset = 4;
518 const size = 0x80;
519 const buf = new Buffer(size);
520 const rsize = build_rthdr(buf, size);
521
522 for (let loop = 0; loop < num_alias; loop++) {
523 for (let i = 0; i < num_sds; i++) {
524 buf.write32(marker_offset, i);
525 set_rthdr(sds[i], buf, rsize);
526 }
527
528 for (let i = 0; i < sds.length; i++) {
529 get_rthdr(sds[i], buf);
530 const marker = buf.read32(marker_offset);
531 if (marker !== i) {
532 log(`aliased rthdrs at attempt: ${loop}`);
533 const pair = [sds[i], sds[marker]];
534 log(`found pair: ${pair}`);
535 sds.splice(marker, 1);
536 sds.splice(i, 1);
537 free_rthdrs(sds);
538 sds.push(new_socket(), new_socket());
539 return pair;
540 }
541 }
542 }
543 die(`failed to make aliased rthdrs. size: ${hex(size)}`);
544}
545
546// summary of the bug at aio_multi_delete():
547//

Callers 1

race_oneFunction · 0.70

Calls 10

logFunction · 0.90
dieFunction · 0.90
hexFunction · 0.90
build_rthdrFunction · 0.70
set_rthdrFunction · 0.70
get_rthdrFunction · 0.70
free_rthdrsFunction · 0.70
new_socketFunction · 0.70
write32Method · 0.45
read32Method · 0.45

Tested by

no test coverage detected