There is a difference between mods and mocking server for a game. It would be very hard for Rockstar to prove some code is a voliation of their intellectual property just because it listen on the same port and transfer same/similar datagram on wire.
I took interest in this mostly like OP as I...
I'm not sure if GTA online source code is really leaked or if I can ever get to see it but from my experience it would be possible to mock a server at least partially in functionality if there is enough client code to reference of what data it send to and expected from a server.
It's possible...