OK, then it's most likely your problem with accessing recovery is a result of a failed attempt to modify the software, rather than from the ransomware itself (unless whatever package you tried to use to root the device happened to contain the malware itself. That's not generally a risk if you work through sites like XDA, but as I don't know what tool you used or where you got it from I can't exclude the possibility).
So if you can't access recovery then it sounds like you need to fix that. I'm not familiar with modifying Samsungs, but the page that JFalls63 linked to sounds like it might help. All I could suggest myself would be to try reflashing the phone using firmware from Sammobile.com (make sure you get the right firmware for your device, including the carrier as well as model) and a tool called Odin, but I can't tell you more than that as I've never used either.
Did you actually manage to root the ROM? If you did then that increases the possibility that malware could install in a way that would survive a factory reset (i.e. install as a system app). A complete reflash would still remove it in this case. Please note that I don't know that this has happened, just considering the possibility.
Android apps need to be installed by the user (they can't install themselves), so the ransomware was probably hidden inside something else you installed. If you installed any apps from a third-party download site around that time I suggest avoiding that place in future.