code wiki / (root) / nx_pe_compile_win_fread.nx

nx_pe_compile_win_fread.nx

buildroot/runtime/nx_pe_compile_win_fread.nx

12145 B194 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic pe
docsdependenciesstructsconstsfunctions

about

nx_pe_compile_win_fread.nx -- W-NET-5a: native file reading (CreateFileA + ReadFile), the capability needed to serve the REAL Elder ui/dist from disk on :5173. De-risk standalone before integrating into the HTTP server. Reads C:/Users/elder/elder-ai-platform/ui/dist/index.html and returns its byte count. kernel32 only { ExitProcess, GetProcessHeap, HeapAlloc, CreateFileA, ReadFile } -- 1 DLL, 5 funcs. CreateFileA takes the ASCII path directly (Windows accepts forward slashes), no UTF-16 needed. lineage_id: substrate_pe_compile_win_fread_v1

dependencies 3 imports · 0 importers

nx_syscalls.nx nxasm_x86.nx nx_pe_writer.nx nx_pe_compile_win_fread.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 fr_assemble sys_mmap ↻ fr_lbloff fr_emit_pe _w16 _w32 _w8 _w64 _w32 ↻ _emit_section_header _w8 ↻ _w32 ↻ _w16 ↻ fr_redirect _w8 ↻ _w32 ↻ nx_pe_write_to_file

structs

none

consts

11const FR_CODE_CAP: i64 = 1048576
12const FR_FILE_SIZE: i64 = 0x800
13const FR_STUB_LEN: i64 = 18
14const FR_TEXT_CAP: i64 = 0x400
15const FR_RVA_TEXT: i64 = 0x1000
16const FR_RVA_IDATA: i64 = 0x2000
17const FR_FOFF_TEXT: i64 = 0x200
18const FR_FOFF_IDATA:i64 = 0x600
19const FR_IAT_EXIT: i64 = 0x2058
20const FR_IAT_GPH: i64 = 0x2060
21const FR_IAT_HA: i64 = 0x2068
22const FR_IAT_CFA: i64 = 0x2070
23const FR_IAT_RF: i64 = 0x2078
24const FR_L_HALLOC: i64 = 29
25const FR_L_FOPEN: i64 = 57
26const FR_L_FREAD: i64 = 42

functions

28func fr_lbloff(src: *u8, lab_off: *i64, lab_len: *i64, lab_addr: *i64, n_lab: i64, nm: *u8) -> i64
called by 1: fr_assemble
34func fr_assemble(src: *u8, n: i64, out: *u8, out_cap: i64, off: *i64) -> i64
called by 1: main calls 2: sys_mmapfr_lbloff
63func fr_redirect(buf: *u8, shim_off: i64, thunk_off: i64) -> i64
called by 1: fr_emit_pe calls 2: _w8_w32
72func fr_emit_pe(buf: *u8, code: *u8, code_len: i64, off: *i64) -> i64
173func main() -> i64