If you suspect or should reasonably suspect that the customer will violate the license agreement to do something illegal, then the license will not protect you.
Use common sense. If Walmart hires you to write software to check the security of their 100,000 cash registers, you can do that, and if one rogue employee uses the software to commit a crime, that's not something you would have expected.
If I hire you write the same software, you should think "why is he paying all that money to test 100,000 cash registers that are none of his business?" It's obvious that I'm up to no good, and no license agreement will protect you.
Tikko: You asked "What about an electronically signed agreement stating the developer is not responsible?" Think about it: If you write software that a criminal then uses to steal my money, do you think I care one bit that the criminal said you are not responsible? Do you think a judge will care one bit that the criminal said you are not responsible?
In the end, the only thing that will protect you is checking out the potential buyer to make sure that they are legitimate, and walking away from sales where you are not sure they are. Since nobody is allowed to use any software to commit a crime, because people are just not allowed to commit crimes, a EULA stating this will not protect you.