code wiki / _hdl_build / nx_pe_dll_com_gate.nx

nx_pe_dll_com_gate.nx

buildroot/runtime/_hdl_build/nx_pe_dll_com_gate.nx

8379 B133 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic pe
docsdependenciesstructsconstsfunctions

about

nx_pe_dll_com_gate.nx -- de-risk the ENTIRE D3D11 shim surface: a sovereign DLL that returns a COM-STYLE OBJECT (pointer whose first field is a vtable of function pointers) that a foreign Windows process dispatches methods through. This is EXACTLY the shape of D3D11: D3D11CreateDevice returns ID3D11Device* and the game calls dev->lpVtbl->Method(dev,..). If a foreign C process can create our object and call methods via its vtable + read object state through `this`, the d3d11.dll shim is clearly buildable -- only API breadth remains. The export `nishi_create_device` builds the object + vtable at RUNTIME with RIP-relative LEA (position-independent: no absolute data pointers, works at ANY base, needs no .reloc). Object: {vtbl*, magic=1000}. Methods: get_magic(this)->*this.magic ; add(this,a,b)->magic+a+b. 100% NishiLang PE bytes; C harness = external oracle (Windows' own loader + call). license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_pe_dll_com_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main hw sys_write sys_mmap w16 w32 w8 wstr sys_openat_wr sys_exit sys_write ↻ sys_close pn sys_mmap ↻ sys_write ↻ px2 sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

11func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
12func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 1: main calls 2: sys_mmapsys_write
13func px2(v: i64) -> i64 { let d: *u8="0123456789abcdef" as *u8; let b: *u8=sys_mmap(4) as *u8; b[0]=d[(v>>4)&15]; b[1]=d[v&15]; sys_write(1,b,2); return 0 }
called by 1: main calls 2: sys_mmapsys_write
15func w8(buf: *u8, off: i64, v: i64) -> i64 { buf[off] = (v & 255) as u8; return 0 }
called by 1: main
16func w16(buf: *u8, off: i64, v: i64) -> i64 { buf[off]=(v&255) as u8; buf[off+1]=((v>>8)&255) as u8; return 0 }
called by 1: main
17func w32(buf: *u8, off: i64, v: i64) -> i64 { buf[off]=(v&255) as u8; buf[off+1]=((v>>8)&255) as u8; buf[off+2]=((v>>16)&255) as u8; buf[off+3]=((v>>24)&255) as u8; return 0 }
called by 1: main
18func wstr(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ buf[off+i]=s[i]; i=i+1 } buf[off+i]=0 as u8; return i+1 }
called by 1: main
20func main() -> i64