diff --git a/compile-crasher.sh b/compile-crasher.sh new file mode 100644 index 0000000..10ef6cb --- /dev/null +++ b/compile-crasher.sh @@ -0,0 +1 @@ +clang++ crasher-src.cpp -ObjC++ --compile --target=wasm32-unknown-unknown-wasm --optimize=3 --output crasher.wasm diff --git a/crasher-src.cpp b/crasher-src.cpp new file mode 100644 index 0000000..374e050 --- /dev/null +++ b/crasher-src.cpp @@ -0,0 +1,6 @@ +int main() { + int NULL; + volatile int* a = reinterpret_cast(NULL); + *a = 1; + return 0; +} \ No newline at end of file diff --git a/crasher.html b/crasher.html new file mode 100644 index 0000000..f7d24e1 --- /dev/null +++ b/crasher.html @@ -0,0 +1,13 @@ + + +pwnd + +fetch("crasher.wasm") + .then((response) => response.arrayBuffer()) + .then((bytes) => WebAssembly.instantiate(bytes, importObject)) + .then((results) => { + results.instance.exports.exported_func(); + }); + + + diff --git a/crasher.wasm b/crasher.wasm new file mode 100644 index 0000000..489d857 Binary files /dev/null and b/crasher.wasm differ