If it's true and you have been hacked then you can't clean up the code you should simply replace the complete Moodle code with that freshly downloaded from this site. You can take this opportunity to upgrade to the latest 1.9 as yours is very old.
Other than that I/someone would probably need to get a quick look at the site as an admin.