Your iPhone isn't bricked. Yesterday I was upgrading my jailbroken iPhone 4 on 4.2.1 to 4.3.1 so that I could apply the new jailbreak to it. But during the process of restoring it, while the iPhone displayed the Apple logo with the progress bar beneath it, it would keep stopping 3/4ths of the way through, and I would get that 1013 error message in iTunes saying that the iPhone couldn't be restored. My iPhone would show the USB cord saying that I needed to plug it into iTunes, but it would be stuck in recovery mode and I couldn't do anything unless I restored it, which I couldn't do.
But I looked online at an Apple Discussion forum post and found this:
Quote:
On Mac:
* Open Finder
* Hold down COMMAND + SHIFT keys and press 'G'
* Enter "/private/etc/" in the field and press "Go"
* Find "hosts" file in the directory
* Drag the file to your desktop
* Open it in text editor
* Remove the line that has gs.apple.com entirely or put a # at the beginning of it to comment it out
* Save the file
* Drag it back to the /private/etc/ folder.
* You'd need to enter your username and password to authenticate the move
On Windows:
Locate the hosts file in one of the following directories:
Windows 95/98/Me c:\windows\hosts
Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
Windows XP, Vista, 7 c:\windows\system32\drivers\etc\hosts
Right click and click on "Open With..." and then click on "Notepad" on the list.
* Remove the line that has gs.apple.com completely and save the file.
I used the Mac method, and it worked perfectly for me.