Reverse-engineered CarrierIQ code (Forth)
git.eff.org
git.eff.org
edit: for example, ('cause who doesn't like seeing more Forth code on HN?)
create table 66 , 271 , 3 , 40 , 101 ,
4 constant table-size-1
\ ...
false table-size-1 for
over i table + @ = or
next swap drop
Would've made that bug harder to miss, too.Their code starts with a value on the stack, primes the unrolled loop and then goes into a series of nested constructs like:
DUP X1 =
SWAP DUP X2 =
SWAP DUP X3 =
SWAP DUP X4 =
...
SWAP DROP
OR
OR
OR
This builds up a growing mound of flags on the stack and then collapses them down at the end. As the mound is built, the value is constantly flipped up to the top of the stack and then covered with a flag. A better way to do this would be to collapse the flags as you go: DUP X1 =
OVER X2 = OR
OVER X3 = OR
...
SWAP XN = ORhttps://www.eff.org/deeplinks/2011/12/analyzing-carrier-iq-p...