Well, Aegis is stolen software that is officially used. AFAIK the only way to obtain it is by hacking into the official RO servers. So yes, Aegis is illegal.
eAthena is an opensource emulator, which is...well, illegal as well. However, Gravity did sue eAthena, but they lost the case.