If you really want to replace the file you either need to use libiosuhax or the MCPCopyFile Command(eShop games only). Alternativly You can just write the file to the sd and open It everywhere with libiosuhax.
None of them are the "real" ones. Right before the Game starts you have to allocate some memory for the Threads and their stacks. I think I changed up the alignment by cleaning up the code for the release on GitHub. Best opinion would be using the current layout.
It's not that easy to implement in the web version since it is based of loadiine_gx2. But it is possible to get the "old" memory layout back by making TCPGecko's buffer smaller.
Turns out that KernelcopyData is actually working. I Just had to do it the same way as the codehandler.
The attached version should let you poke in any valid memory range.