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 sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close fr_assemble sys_mmap ↻ axc_pass axc_is_space axc_is_ident axc_apply_section axc_tok_is axc_cstr_len axc_is_space ↻ axc_is_ident ↻ axc_tok_is ↻ axc_emit_bytes axc_is_digit axc_parse_int axc_is_digit ↻ axc_parse_operand axc_is_space ↻ axc_is_ident ↻ axc_reg_num axc_tok_is ↻ axc_parse_int ↻ axc_is_digit ↻ axc_tok_is ↻ axc_emit axc_tok_is ↻ axc_alu x86_alu_imm x86_rex_w x86_modrm x86_put_u32le x86_alu_rr x86_rex_w ↻

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 calls 1: axc_tok_is
34func fr_assemble(src: *u8, n: i64, out: *u8, out_cap: i64, off: *i64) -> i64
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