Worth mentioning how simple the implementation could be if we're limited to COM, which is just a blob with machine code. Simple enough that being a 8 y.o. kid I encountered a book that explained the concept (something like JMP on entry, patch to original and JMP back). The entire thing was assembled over a few hours and deployed to a park of 80286's at school the next day, with consequences imprinted as a bright traumatic experience. This part was not explained in the book.