code wiki / (root) / nx_https_get_spoof.nx

nx_https_get_spoof.nx

buildroot/runtime/nx_https_get_spoof.nx

9517 B149 linesdepth 21pulls 129 transitivereach 92 importersview sourcekind tooltopic https
docsdependenciesstructsconstsfunctions

about

nx_https_get_spoof.nx -- validated-TLS HTTPS GET that SPOOFS a real browser (X-TORRENT-SPOOF R2): real Firefox UA + browser Accept headers + a Cookie header (the operator's cf_clearance/session read from Waterfox by nx_ff_cookies). This is what gets past a Cloudflare 403 -- the cf_clearance cookie is UA-bound, so we present a Firefox UA to match Waterfox. Reuses nx_https_get's connect+handshake (steps 1-3) verbatim and copies the get_complete round-trip with a spoofed request builder. argv[1]=url argv[2]=cookie ("a=b; c=d", optional) argv[3]=outpath -> writes raw response, prints size+status. license_tier: ORIGINAL module: nishi-core.browser.https_get_spoof

dependencies 11 imports · 4 importers

nx_codec_caps.nx nx_https_get.nx nx_tls13_record.nx nx_tls13_read_record_from_fd.nx nx_tls13_client_session.nx nx_http_client.nx nx_x509_trust_store.nx nx_pem_loader.nx nx_csprng.nx nx_url.nx nx_https_get_spoof.nx nx_browser_fetch.nx nx_browser_fetch_probe.nx nx_fetch_any.nx nx_yt_innertube.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_codec_caps.nxnx_https_get.nxnx_tls13_record.nxnx_tls13_read_record_from_fd.nxnx_tls13_client_session.nxnx_http_client.nxnx_x509_trust_store.nxnx_pem_loader.nxnx_csprng.nxnx_url.nxnx_syscalls.nx

imported by: nx_browser_fetch.nxnx_browser_fetch_probe.nxnx_fetch_any.nxnx_yt_innertube.nx

structs

none

consts

none

functions

20func sp_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
calls 1: sys_write
21func sp_wn(fd: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0 {t[0]=48 as u8;k=1} while m>0 {t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k {b[i]=t[k-1-i];i=i+1} sys_write(fd,b,k); return 0 }
22func sp_puts(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i }
called by 1: sp_build
24func _sp_write_n(fd: i64, buf: *u8, n: i64) -> i64
called by 1: sp_get_complete calls 1: sys_write
31func sp_build(path: *u8, plen: i64, host: *u8, hlen: i64, cookie: *u8, clen: i64, out: *u8) -> i64
55func sp_get_complete(s: *Tls13ClientSession, fd: i64, path: *u8, path_len: i64, host: *u8, host_len: i64, cookie: *u8, clen: i64, out_buf: *u8, out_cap: i64) -> i64
100func nx_https_get_spoof(url_str: *u8, client_random: *u8, x25519_priv: *u8, store: *TrustStore, now_epoch_secs: i64, cookie: *u8, clen: i64, out_buf: *u8, out_cap: i64) -> i64
130func sp_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
132func main(argc: i64, argv: *i64) -> i64