Skip to content

Commit

Permalink
proxy lol
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Mar 9, 2021
1 parent 64a5d69 commit c04886d
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions read_type_data.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
const fs = require("fs/promises");

function justSatisfyAllImportsLol() {
return new Proxy(
{},
{
get(_, name) {
return new Proxy(
{},
{
get(_, name) {
return () => {};
}
}
);
}
}
);
}

async function main() {
const b = await fs.readFile(process.argv[2]);
const { instance } = await WebAssembly.instantiate(b, {
env: { abort() {} }
});
const { instance } = await WebAssembly.instantiate(
b,
justSatisfyAllImportsLol()
);
const ptr = instance.exports.__asbind_type_data.value;
const dv = new DataView(instance.exports.memory.buffer);
const strLen = dv.getUint32(ptr - 4, true);
Expand Down

0 comments on commit c04886d

Please sign in to comment.