code wiki / (root) / nx_pe_compile_win_httpd.nx

nx_pe_compile_win_httpd.nx

buildroot/runtime/nx_pe_compile_win_httpd.nx

17945 B292 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic pe
docsdependenciesstructsconstsfunctions

about

nx_pe_compile_win_httpd.nx -- W-NET-1/2/3: a sovereign Nishi-native Windows HTTP server. nxc2-compiled NishiLang -> native PE that listens on a TCP port via raw Winsock and serves HTTP. No Docker, no VM, no WSL, no libc: kernel32 { ExitProcess } + ws2_32 { WSAStartup, socket, bind, listen, accept, send, closesocket }. The keystone-linker resolves each socket shim to a Winsock thunk (SysV->MS-x64 + sockaddr/htons built in-thunk). The 1:1 Elder-UI-on-:5173 migration vehicle. Tolerant: only redirects shims that the source actually defines (so a socket+bind+listen probe and the full serve loop both build from the same organ). lineage_id: substrate_pe_compile_win_httpd_v1

dependencies 3 imports · 0 importers

nx_syscalls.nx nxasm_x86.nx nx_pe_writer.nx nx_pe_compile_win_httpd.nx

imports: nx_syscalls.nxnxasm_x86.nxnx_pe_writer.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close hd_assemble sys_mmap ↻ hd_lbloff hd_emit_pe _w16 _w32 _w8 _w64 _w32 ↻ _emit_section_header _w8 ↻ _w32 ↻ _w16 ↻ hd_redirect _w8 ↻ _w32 ↻ nx_pe_write_to_file

structs

none

consts

12const HD_CODE_CAP: i64 = 1048576
13const HD_FILE_SIZE: i64 = 0x1400 // headers(0x200)+.text(0x1000)+.idata(0x200)
14const HD_STUB_LEN: i64 = 18
15const HD_TEXT_CAP: i64 = 0x1000
16const HD_RVA_TEXT: i64 = 0x1000
17const HD_RVA_IDATA: i64 = 0x2000
18const HD_FOFF_TEXT: i64 = 0x200
19const HD_FOFF_IDATA:i64 = 0x1200
21const HD_IAT_EXIT: i64 = 0x2094
22const HD_IAT_WSA: i64 = 0x20A4
23const HD_IAT_SOCK: i64 = 0x20AC
24const HD_IAT_BIND: i64 = 0x20B4
25const HD_IAT_LISTEN:i64 = 0x20BC
26const HD_IAT_ACCEPT:i64 = 0x20C4
27const HD_IAT_SEND: i64 = 0x20CC
28const HD_IAT_CLOSE: i64 = 0x20D4
29const HD_IAT_RECV: i64 = 0x20DC
32const HD_L_WSA: i64 = 31
33const HD_L_SOCK: i64 = 28
34const HD_L_BIND: i64 = 65
35const HD_L_LISTEN: i64 = 23
36const HD_L_ACCEPT: i64 = 23
37const HD_L_SEND: i64 = 27
38const HD_L_CLOSE: i64 = 18
39const HD_L_RECV: i64 = 38

functions

41func hd_lbloff(src: *u8, n: i64, out: *u8, lab_off: *i64, lab_len: *i64, lab_addr: *i64, lab_sec: *i64, n_lab: i64, nm: *u8) -> i64
called by 1: hd_assemble
51func hd_assemble(src: *u8, n: i64, out: *u8, out_cap: i64, off: *i64) -> i64
called by 1: main calls 2: sys_mmaphd_lbloff
88func hd_redirect(buf: *u8, shim_off: i64, thunk_off: i64) -> i64
called by 1: hd_emit_pe calls 2: _w8_w32
97func hd_emit_pe(buf: *u8, code: *u8, code_len: i64, off: *i64) -> i64
271func main() -> i64