@manawyrm the ARC firmware API isn't that large, only about 30 functions or so
...the biggest problem is everything it has to do to get NT running in big endian mode. (the memory controller of Flipper derivatives is big endian only, so MSR[LE] is useless on Gekko derivatives that use Flipper derivatives, which basically means all of them in practise)
first, it implements an exception handler to emulate a few instructions, namely all 16/32-bit loads and stores;
it patches osloader when loading it, then hooks functions in it to patch everything it loads; so it can then patch the kernel to ensure everything works and hook various kernel functions to patch all PEs on load...
I need to refactor the last one, because every process currently gets its own copy of every DLL .text section, so memory runs out pretty fast...