I'm not the best person to give you pointers mate, my understandment of C is still very low, i'm just familiar with the terms. There is a github with some malware sources and pos malwares put together, in one of them, Alina i think, there is a rootkit. No idea how advanced it is, but it could put you in the right direction.