So here are a couple of tidbits about integrity that are not shared at the moment or known at all:

* The C side of the code (websocket/integrity/lookup table handling) are obsfucated with https://tigress.wtf/ with a bunch of transformations to bloat the original source file to around 40MB, producing a giant .wasm file to deter reverse engineering attempts, this also works as a anti abuse measure because if you wanted to simulate a full browser and use proxies to get around integrity you'd have to redownload the binary every single time (I'm not sure if the tables change between servings of integrity or the hash remains the same, I know Karma probably rotated the tables though and commands possibly) which wastes proxy bandwidth
* The JS side of integrity is also obsfucated (I believe) and this is mainly because while the EM_JS macro could do it, the fingerprinting code would be exposed to an attacker itself, I believe the way it works is

Socket recieves fingerprint command -> Calls the JS for the fingerprinting through EM_JS -> Sends the results back to be hashed/computed/verified by integrity to prevent spoofing (?)

The JS side is pretty easy to documentate and decompile, but as far as the inner workings of the actual integrity go and lookup table checks, we only have tidbits and the old unobsfucated wasm binary that was leaked a while ago on KF, but I do have notes and a similar implementation that I could share that comes very close to what Karma's integrity is doing, so I'll compile that soon and share it.

Heres an example of a tigress command that would result in obsfucated code similar to what karma's fingerprinting looks like

tigress --Verbosity=1 \
	--Compiler=emcc \
	--Environment=wasm:Linux:Emcc:4.6 \
	--Seed=0 \
	-I "$EMSDKPATH" \
	--Inputs="+1:int:42" \
	--Transform=InitEntropy --InitEntropyKinds=vars \
	--Transform=InitOpaque --Functions=handleMessage --InitOpaqueStructs=list,array,env,input \
	--Transform=Flatten --Functions=handleMessage,karma_challenge --FlattenDispatch=switch --FlattenRandomizeBlocks=true --FlattenConditionalKinds=branch,compute --FlattenImplicitFlowNext=true \
	--Transform=EncodeArithmetic --Functions=handleMessage,karma_challenge \
	--Transform=CleanUp --CleanUpKinds=annotations \
	--out=obs/main.c src/main.c

The obs folder has been left for seeing the actual output code.

This does not contain the websocket implementation.