Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit

Closed Thread
 
LinkBack (1) Thread Tools Display Modes
Old 30-10-2005, 07:51 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
Alpha Geek
 
Join Date: May 2005
Posts: 687
Default Do not download large corrupted files again, Fix them with

Do not download large corrupted files again, Fix them with WinHex & Curl:



Bug in the download manager.
Bad proxy server.
Bad web server.
Problems with your own computer.

Re-downloading corrupted files, specially those sized over 500 MB are really painful for most of us. And there is no guarantee that the re-downloaded file will be free of corruption as far as you are using the same configuration.

In such cases, its best to fix them manually instead of downloading again. The whole process is very simple, but requries enough concentration. Once you have mastered it, you will never have to worry about corrupted files.

Tools Required:

WinHex _http://www.winhex.com/winhex.zip
CURL _http://curl.haxx.se/latest.cgi?curl=win32-nossl-sspi
CommonSenseâ„¢ (I don't have any link for this one)

Steps required in brief:

Make a backup copy of the corrupted file and open it with WinHex.

Identify corrupted segments. Large sequences of zeros are all we have to search for in most cases.

Re-download the corrupted segments with CURL.

Write the retrieved data on appropiate offsets.

Step-by-step example:

Let us assume that we have a corrupted file named corrupted.rar. We open it WinHex, and do the following things:

Switch the offset representation from hex to decimal by clicking once on the offset area.






Now we search for corrupted segments. Most of the time they will be sequences of zeros. As we can see from the first bytes of the opened file, it's a rar file. Files we download over the Internet are mostly compressed formats. By design, a fresh file should not contain sequences of zeros or other repeating bytes after the header part. So, we scroll a few pages down.





Now we start searching for such sequences with CTRL+ALT+F.





The search takes us to a place where we can see some zeros and repeating bytes. Surely this is one of the corrupted segments.





So, now we have to download the missing data using CURL. It's always a good idea to retrieve the data with some margin. In our case, we get the bytes from 01094304 to 01094512 in order to cover the screenshot size. In real case it should be even higher. So, we start command prompt and issue the command "curl -r 1094304-1094512 _http://badserver.com/mygoodfile.rar -o 01094304.bin" to download the mentioned segment of the original file, and save it to a file named 01094304.bin. For details, curl manual can help. After it's done, curl will terminate and we will have our file 01094304.bin right inside CURL's folder.





Now we open the downloaded segment 01094304.bin with WinHex.
Copy the whole file with CTRL+A -> CTRL+C.





Switch back to our corrupted file and go to the starting offset of our retrieved segment. CTRL+G -> 01094304




Now press CTRL+B to write the copied data over this offset. It is very important to determine correct offset. One offset left or right can ruin everything. Our retrieved segment starts with 18 1E BD 3D, and the offset we are going to write here also starts with 18 1E BD 3D.




After we are done, we save the file using CTRL+S. For larger files, it is better to switch the edit mode to in-place mode. F6 -> In-place mode.
Now we can see that the corrupted part has been filled with original data, and it's fixed. In this example we had only of such segment. But in real cases, there might be several segments like this. In that case the whole procedure is to be repeated for each corrupted segment. Also note that, the length of zero sequences to find for can be chosen to be smaller or larger than the length used here.



TRY IT....
__________________
Any use of the collective descriptions and shared knowledge from any of my posts are at the sole discretion of the reader.I am not responsible for what you do with it.
rajas700 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 30-10-2005, 08:07 PM   #2 (permalink)
Broken In
 
Join Date: Nov 2004
Location: Latitude:13.083 Longitude:80.283
Posts: 137
Default

Great tut man!... thanks ! I got frustrated many times due to this. That will really help out many.

P.S. : A small software can be made for the steps you mentioned using vb or any such. It will be much more easier to fix them. I too willl try on it.
[lokesh] is offline  
Old 31-10-2005, 04:40 PM   #3 (permalink)
In The Zone
 
sms_solver's Avatar
 
Join Date: Jan 2004
Location: somewhere
Posts: 420
Default

i would like to try your tutorial but I don't have any corrupted zip or rar files
__________________
[ॐ एसएमएस॰सोल्भर ॐ]
sms_solver is offline  
Old 24-11-2005, 03:53 PM   #4 (permalink)
In The Zone
 
Join Date: May 2005
Posts: 415
Default

if we can fix them with this tools then why cant we just get its all data with curl and create the file?
upendra_gp is offline  
Old 16-12-2005, 12:08 PM   #5 (permalink)
ax3
Cool as a CUCUMBAR ! ! !
 
ax3's Avatar
 
Join Date: Dec 2003
Posts: 5,002
Default

CURL _http://curl.haxx.se/latest.cgi?curl=win32-nossl-sspi


hey rajas this link not opening ...


as i have a couple of bad or corrupted zip files ...
__________________
... W H O T ...
ax3 is offline  
Old 16-12-2005, 02:20 PM   #6 (permalink)
Distinguished Member
 
anandk's Avatar
 
Join Date: Mar 2005
Location: Pune
Posts: 3,783
Default

useful tut, thnx man !
__________________
> www.TheWindowsClub.com <
= www.WinVistaClub.com =
Microsoft® MVP
anandk is offline  
Old 17-12-2005, 11:19 AM   #7 (permalink)
Neil is Here...
 
coolendra's Avatar
 
Join Date: Jun 2005
Location: LALA LAND
Posts: 392
Default

happened to me ao many times
is it legal to fix it urself ?
thanx lot dude
__________________
If ELECTRICITY comes from ELECTRONS .. then i am sure MORALITY comes from MORONS
coolendra is offline  
Old 17-12-2005, 06:59 PM   #8 (permalink)
Alpha Geek
 
__Virus__'s Avatar
 
Join Date: Sep 2005
Location: Hyderabad
Posts: 560
Default

OMG best thing i have ever gotten accross
__Virus__ is offline  
Old 18-12-2005, 08:26 PM   #9 (permalink)
Alpha Geek
 
Join Date: Jan 2005
Location: earth
Posts: 801
Default

thnx rajas700
this is da best tut i have ever seen

here is da workin link 4 CURL

http://curl.haxx.se/download/curl-7.15.1.zip
__________________
signature??? Let Me Think About It!!!
paul_007 is offline  
Old 19-12-2005, 02:41 PM   #10 (permalink)
Apprentice
 
Join Date: Oct 2005
Location: chandigarh
Posts: 50
Default

if this thing works it should be made sticky or entered in the sticky post for further reference.
allmighty is offline  
Old 19-12-2005, 02:58 PM   #11 (permalink)
U2
Right Off the Assembly Line
 
Join Date: Dec 2005
Location: Dilli
Posts: 41
Default

hey this thing is copied from devil board
__________________
hey my previous id was readermaniax
U2 is offline  
Old 22-03-2006, 11:56 PM   #12 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2006
Location: INDIA
Posts: 3
Default Thanks

Buddy Thanks For Ur Grest Post
catch_maxi is offline  
Old 23-03-2006, 10:20 PM   #13 (permalink)
GUNNING DOWN TEAMS
 
wizrulz's Avatar
 
Join Date: Mar 2005
Location: MUMBAI
Posts: 1,724
Default

Quote:
Originally Posted by U2
hey this thing is copied from devil board
I thought this dude rajas700 has great brain to work this out and explain to us members, but if its copied then please do give the credit in ur post



PS- this rajas700 has 600 od posts to his name means had been member for long time and also knows the rule sof forum......he has a banned tagged.....may be broken rules.....but y do old members do break the rules? :roll:
__________________
The moment U stop learning ......u stop improving
wizrulz is offline  
Old 27-03-2006, 10:45 PM   #14 (permalink)
Back From Deathstar
 
Darthvader's Avatar
 
Join Date: Jan 2005
Location: Rome 233 B.C
Posts: 761
Default

@wiz rulz : dont u see that he has joined the same time as u and me and has 600 posts when we .....
DOesnt thiz tell u somethnn.....

Srry if i am rude or strayed off the topic
Darthvader is offline  
Old 03-04-2006, 10:23 PM   #15 (permalink)
GaurishSharma.com
 
gary4gar's Avatar
 
Join Date: May 2005
Location: Jaipur
Posts: 4,097
Default

hey,
inst it a bit techical.no easy way to do it.
gary4gar is offline  
Old 09-04-2006, 06:34 PM   #16 (permalink)
saiaspire
Guest
 
Posts: n/a
Default

Nice tut!
 
Old 30-04-2006, 02:25 PM   #17 (permalink)
In The Zone
 
mario_pant's Avatar
 
Join Date: Jan 2005
Location: Mushroom KiNGDOME!
Posts: 425
Default Re: Do not download large corrupted files again, Fix them with

this TUT rox!
thanks
m_p
:mann.. i hate this limit
__________________
The name is Mario, "Mario Pant"!
mario = avatar; pant = पतलून
and i'm NOT some mountain KiD!
mario_pant is offline  
Old 01-05-2006, 01:55 AM   #18 (permalink)
Alpha Geek
 
mariner's Avatar
 
Join Date: Dec 2003
Location: mumbai
Posts: 522
Default Re: Do not download large corrupted files again, Fix them with

goos post buddy. very informative.its a must try.
mariner is offline  
Old 09-07-2006, 10:09 PM   #19 (permalink)
Right Off the Assembly Line
 
Join Date: Jan 2006
Posts: 8
Thumbs up Re: Do not download large corrupted files again, Fix them with

Works great for my 100 mb download file
Just some instructions :
After you have downloaded curl from the link extract it to windows\system32 and in start=> run=> curl -r 1094304-1094512 http://badserver.com/mygoodfile.rar -o 01094304.bin . In orginial post there is underscore (_) here : 1094512 _http but it works without underscore

Last edited by Dharmil; 09-07-2006 at 10:12 PM.
Dharmil is offline  
Old 09-07-2006, 11:19 PM   #20 (permalink)
In The Zone
 
TechGuru#1's Avatar
 
Join Date: Aug 2005
Posts: 338
Default Re: Do not download large corrupted files again, Fix them with

what happens when the source u r dlodng from is itself corrupted ?
TechGuru#1 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/tutorials/17841-do-not-download-large-corrupted-files-again-fix-them.html
Posted By For Type Date
Can we repair corrupt .exe file This thread Refback 07-02-2011 03:27 PM


All times are GMT +5.5. The time now is 05:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2