We solved this issue by, in our ftp client (filezilla) transfering the files as binary. Once we did this and run the sh command it all worked fine.
I will chime in here too. I was using WinSCP to upload, and I told it to set binary/ascii transfer using automatic conditions. Upon examining those conditions, *.sh files were being transferred using ASCII mode. Changing to binary allowed patch to be executed successfully.
I met the same problem in swf in 18.104.22.168,there is problem with swf.
Fox Fixed - Please follow below steps.
Step 1. Download security patch 8788 SSH file to this Link
Step 2. After download security patch 8788 SSH file Please put into one folder and make same folder Zip file.
Step 3. Please upload Zip folder to root magento folder and Unzip through SSH Putty.
Step 4. Run the patch :-
$ bash PATCH_SUPEE-8788_CE_22.214.171.124_v1-2016-10-11-07-03-46.sh
Note : he patch file contains entire binary files in text format.That's why when you upload security patch 8788 SSH file without zip file, the same file will be corrupt.
This worked for me too, although I used gzip in Ubuntu then transferred the zipped file to the server via ftp (Filezilla).
Then unzipped with gzip via SSH and it patched fine!
FYI, I have Magento v126.96.36.199 and every other patch installed. Was just getting stuck on the SWF files when patching with 8788.