Before you go through a lot of effort, take a look at your footer.php file in the theme. There may be malicious code in there. Could be as simple as a 1-line link to a bad website, or lots of encrypted code. Nothing in the footer of a theme should be encrypted; if it is, don't use the theme.
Then make sure your folder have the proper permissions set. I had some site hacked because I was working on the footer file and left the permissions too loose. Of course a hacker got in.
Here's a link about WP permissions:
http://codex.wordpress.org/Hardening_WordPressBasically, all folders should be 755, except image folders, which are 644.
Also, the Gold Vault contains WordPress Lockdown, which is a pretty good survey of security precautions you can take.
Just my $.02.
gary