code wiki / (root) / nx_exefmt_research.nx

nx_exefmt_research.nx source

↩ module page · 27 lines · 1776 B

1// nx_exefmt_research.nx -- THIN structured EXECUTABLE-FORMAT research source organ (ground the sovereign NXE format 2// vs ELF/Mach-O/PE). COMPOSES nx_research_engine; sources under SECTIONS, NO copy-pasted loop. Supersedes 3// nx_exefmt_research_fetch. expect_exit: 0 license_tier: ORIGINAL 4import "nx_research_engine.nx" 5const K_MAGIC_8388608: i64 = 8388608 6 7func main() -> i64 { 8 let store: *TrustStore = rf_init() 9 if (store as i64) == 0 { rf_puts("exefmt: trust store load failed\n" as *u8); return 1 } 10 rf_puts("CA roots="); rf_putn(trust_store_count(store)); rf_puts(" -- EXECUTABLE-FORMAT research -> Library\n" as *u8) 11 let cap: i64 = K_MAGIC_8388608 12 let out: *u8 = sys_mmap(cap) 13 var ok: i64 = 0 14 15 rf_section("the incumbent executable formats (the benchmark, NOT the template)" as *u8) 16 ok = ok + rf_fetch_bank("https://en.wikipedia.org/wiki/Executable_and_Linkable_Format" as *u8, "ef_elf" as *u8, store, out, cap) 17 ok = ok + rf_fetch_bank("https://en.wikipedia.org/wiki/Mach-O" as *u8, "ef_macho" as *u8, store, out, cap) 18 ok = ok + rf_fetch_bank("https://en.wikipedia.org/wiki/Portable_Executable" as *u8, "ef_pe" as *u8, store, out, cap) 19 ok = ok + rf_fetch_bank("https://en.wikipedia.org/wiki/Object_file" as *u8, "ef_objfile" as *u8, store, out, cap) 20 ok = ok + rf_fetch_bank("https://en.wikipedia.org/wiki/Comparison_of_executable_file_formats" as *u8, "ef_compare" as *u8, store, out, cap) 21 22 rf_section("the NOVEL angle (our capability-manifest exceed)" as *u8) 23 ok = ok + rf_fetch_bank("https://en.wikipedia.org/wiki/Capability-based_security" as *u8, "ef_capsec" as *u8, store, out, cap) 24 25 rf_puts("EXEFMT BANKED: "); rf_putn(ok); rf_puts(" / 6 (run nx_library_harvest_v2 to index)\n" as *u8) 26 return 0 27}