nx_pe_compile_win_index.nx
buildroot/runtime/nx_pe_compile_win_index.nx
about
nx_pe_compile_win_index.nx -- keystone-linker for a MEDIUM organ (the sovereign inverted INDEX) -> native Windows PE.
Extends nx_pe_compile_win_organ (0x400 .text, mmap+write+exit HAL) to a 0x2000 (8KB) .text so a real index organ's
code fits; .idata shifts RVA 0x2000->0x3000 accordingly (all import RVAs +0x1000). Same 5 kernel32 imports
(GetProcessHeap/HeapAlloc/GetStdHandle/WriteFile/ExitProcess). Emits _offc/nx_win_search_index.exe. This is the
multi-target / platform-independence step: the SAME index .nx that runs on Linux ELF now compiles + runs as a native
Windows PE (and the bounded footprint -- nx_inv_new_bounded -- means HeapAlloc suffices). PIPELINE: index_src.nx ->
nx_compile_x86_native > /tmp/nxwin.s -> this -> _offc/nx_win_search_index.exe -> run native. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
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
structs
| none |
consts
| 13 | const NXORG_CODE_CAP: i64 = 1048576 |
| 14 | const NXORG_FILE_SIZE: i64 = 0x2400 // headers(0x200) + .text(0x2000) + .idata(0x200) |
| 15 | const NXORG_STUB_LEN: i64 = 18 |
| 16 | const NXORG_HLEN: i64 = 29 // halloc thunk |
| 17 | const NXORG_WLEN: i64 = 66 // write thunk |
| 18 | const NXORG_ELEN: i64 = 13 // exit thunk |
| 19 | const NXORG_TEXT_CAP: i64 = 0x2000 // .text raw region (file 0x200..0x2200) -- 8KB for a real index organ |
| 20 | const NXORG_RVA_TEXT: i64 = 0x1000 |
| 21 | const NXORG_RVA_IDATA: i64 = 0x3000 // .text raw 0x2000 -> virtual 0x2000 -> idata at 0x3000 |
| 22 | const NXORG_FOFF_TEXT: i64 = 0x200 |
| 23 | const NXORG_FOFF_IDATA:i64 = 0x2200 |
| 24 | const NXORG_IAT_GPH: i64 = 0x3058 |
| 25 | const NXORG_IAT_HA: i64 = 0x3060 |
| 26 | const NXORG_IAT_GSH: i64 = 0x3068 |
| 27 | const NXORG_IAT_WF: i64 = 0x3070 |
| 28 | const NXORG_IAT_EXIT: i64 = 0x3078 |
functions
| 30 | func nxorg_assemble(src: *u8, n: i64, out: *u8, out_cap: i64, p_main: *i64, p_mm: *i64, p_sw: *i64, p_se: *i64) -> i64 |
| 73 | func nxorg_emit_pe(buf: *u8, code: *u8, code_len: i64, main_off: i64, mm_off: i64, sw_off: i64, se_off: i64) -> i64 |
| 230 | func main() -> i64 |