code wiki / _hdl_build / nx_roku_install.nx

nx_roku_install.nx

buildroot/runtime/_hdl_build/nx_roku_install.nx

10627 B155 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic roku
docsdependenciesstructsconstsfunctions

about

nx_roku_install.nx -- SOVEREIGN Roku sideloader (R0b): pushes a channel zip onto a Roku in Developer Mode via the device's Development Application Installer (HTTP Digest auth + multipart/form-data POST to /plugin_install). This is the sovereign, third-party-free replacement for `curl --digest -F` and for the manual browser upload -- it gives us the emit -> PUSH -> verify loop on the device (the live-testable-publish-loop standard). Flow: TCP connect -> GET / to fetch the 401 Digest challenge -> parse realm+nonce -> compute response via the KAT-proven nx_digest_auth (HA1=MD5(user:realm:pass), HA2=MD5(POST:/plugin_install), qop=auth) -> POST the zip as multipart -> success iff the response carries "Install Success" / "Received" / "Identical". Proven WITHOUT the device against a python HTTP-Digest mock (the 3rd-party oracle for this standard protocol). nx_roku_install <ip> <port> <zippath> <user> <passfile> e.g. nx_roku_install 192.168.8.50 80 /mnt/c/Users/elder/nishi_roku.zip rokudev /tmp/roku_pass.txt license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_digest_auth.nx nx_roku_install.nx

imports: nx_syscalls.nxnx_connect.nxnx_digest_auth.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ri_puts sys_write sys_exit sys_mmap ri_parse_ip ri_atoi ri_strlen ri_read_file sys_openat_rd sys_read sys_close ri_cat ri_http sys_socket sys_set_socket_timeout sys_mmap ↻ sys_setsockopt sys_munmap sys_mmap ↻ ri_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close ↻ sys_munmap ↻ sys_write ↻ sys_read ↻ ri_num sys_mmap ↻ sys_write ↻ ri_extract_q ri_find ri_strlen ↻ ri_dump sys_write ↻ digest_auth_ha1 sys_mmap ↻

structs

none

consts

15const K_MAGIC_8388608: i64 = 8388608
16const K_MAGIC_1024: i64 = 1024
17const K_MAGIC_131072: i64 = 131072

functions

19func ri_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
20func ri_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); 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}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
21func ri_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: ri_findmain
22func ri_cat(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: main
23func ri_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[off+i]=src[i]; i=i+1 } return off+n }
called by 1: main
24func ri_catn(dst: *u8, off: i64, v: i64) -> i64 { var m: i64=v; let t: *u8=sys_mmap(28); 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}; var o: i64=off; var i: i64=0; while i<k{dst[o]=t[k-1-i];o=o+1;i=i+1} return o }
called by 1: main calls 1: sys_mmap
25func ri_dump(buf: *u8, n: i64) -> i64 { var m: i64=n; if m>600 { m=600 } sys_write(1, buf, m); sys_write(1,"\n" as *u8,1); return 0 }
called by 1: main calls 1: sys_write
27func ri_read_file(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
34func ri_parse_ip(s: *u8, oct: *i64) -> i64
called by 1: main
45func ri_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v }
called by 1: main
47func ri_sockaddr(buf: *u8, port: i64, a: i64, b: i64, c: i64, d: i64) -> i64
called by 1: ri_http
55func ri_find(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: ri_containsri_extract_q calls 1: ri_strlen
61func ri_contains(hay: *u8, n: i64, needle: *u8) -> i64 { if ri_find(hay,n,needle)>=0 { return 1 } return 0 }
called by 1: main calls 1: ri_find
63func ri_extract_q(hay: *u8, n: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 1: main calls 1: ri_find
70func ri_http(a: i64, b: i64, c: i64, d: i64, port: i64, req: *u8, reqlen: i64, resp: *u8, cap: i64) -> i64
81func main(argc: i64, argv: *i64) -> i64