Is there a software to reset/flash your iphone to factory without itunes? i have two "broken" iphones. One of them, is a 3gs. I've changed is battery yesterday and it was ok for 30 min/1hour and then it just started rebooting. I searched online and i saw it was a common problem for the 3gs, nobody knows why but i would only need the battery to be charged and then it would be ok. I've tried to restore it itunes, sucessfully, but the phone wouldn't boot to the menu... Then itunes logo "of death".

I tried restoring in DFU, normal, i've tried softwares like tiny umbrela to exit the reboot loop, but no success. In itunes it never ends recovering, and it allways pops out some error. I had probably 6 diferent errors until now. I've used a "fixreboot" file, that i think uses greenpoison code... I only know that maybe 90% of the lines it reports, are errors, and then it says "no sucessfull firmware download after 60000ms, giving up" and then it justs reboots to itunes logo again...

This phone was just upgraded, and hadn't have any jailbreak. 

The other one is a iphone 4, and has the same problem... It's stuck on the Itunes logo but this one, i allways get Code 2 error on it when restoring.

I guess the only way is to make it reinstall the firmware outside itunes. Is there any software to reinstall the firmwares other than itunes?
There is a reset button that lets you reset several different properties to factory settings. If you open 'Settings' on the phone (if you are able) and goto 'General'. At bottom of 'General' is a reset button. Tapping that brings up options for reset.