code wiki / _hdl_build / nx_web_harden.nx

nx_web_harden.nx

buildroot/runtime/_hdl_build/nx_web_harden.nx

6812 B91 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic web
docsdependenciesstructsconstsfunctions

about

nx_web_harden.nx -- "90s-NEUTRAL" attack-vector neutralizer. The balance current tools miss: ad blockers STRIP ads (site loses revenue + hostile sites detect the block and wall you); sandboxes BLOCK the page (dead). We do neither -- we RENDER the site and its ads intact (display impressions still fire, the operator still gets paid) and remove ONLY the weaponization: * forced downloads -- programmatic <a download>.click() and clicks/navigations to a binary payload * popunders/popups -- window.open() -> inert decoy (site believes it opened one) * navigate-to-binary -- location.assign/replace to .exe/.apk/... no-op * beforeunload hijack -- the "are you sure you want to leave" nav-trap, silenced * meta-refresh-to-payload + meta-CSP -- http-equiv neutralized so the parser ignores it Injected as the FIRST <script> in <head> so it wins before the page's own scripts run, in the user's REAL browser (Chrome/Firefox) -- so this is ordinary, fully-supported browser JS. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_web_harden.nx nx_archive_daemon.nx nx_web_harden_gate.nx

imports: nx_syscalls.nx

imported by: nx_archive_daemon.nxnx_web_harden_gate.nx

structs

none

consts

none

functions

14func wh_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
15func wh_put(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off }
16func wh_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
called by 1: wh_ci_at
18func wh_ci_at(src: *u8, slen: i64, pos: i64, lit: *u8, litlen: i64) -> i64
called by 2: wh_ci_findwh_copy_scrub calls 1: wh_lc
25func wh_ci_find(src: *u8, slen: i64, lit: *u8, litlen: i64, from: i64) -> i64
called by 1: wh_neutralize calls 1: wh_ci_at
32func wh_build_preamble(out: *u8, cap: i64) -> i64
called by 2: ad_homemain calls 1: wh_put
59func wh_copy_scrub(out: *u8, off: i64, cap: i64, src: *u8, s: i64, e: i64) -> i64
called by 1: wh_neutralize calls 2: wh_ci_atwh_put
75func wh_neutralize(out: *u8, cap: i64, body: *u8, blen: i64, pre: *u8, prelen: i64) -> i64
called by 1: ad_home calls 2: wh_ci_findwh_copy_scrub