Page 1 of 3

Prog 5: fixing the corrupt file

PostPosted: Mon Jul 28, 2008 4:55 am
by thejasper
Hello

First i read some theory about the difference about uploading in ascii and binary. I understand now what's wrong with the file but that's all :p I made a corrupt file myself and compared it with the original in a hex viewer but that didn't help me. It's pretty difficult... i think i have to program something that 'bruteforces' every 8 bit from all the bytes till the file isn't corrupt anymore... Can anyone give me some advice please, or a good hint?

thx
Jasper

Re: Prog 5: fixing the corrupt file

PostPosted: Mon Jul 28, 2008 11:14 am
by BhaaL
thejasper wrote:First i read some theory about the difference about uploading in ascii and binary. I understand now what's wrong with the file but that's all :p


You should be able to tell what is broken. Theres a good amount of them in the challenge file, you just dont have to fix each and every of them.

Re: Prog 5: fixing the corrupt file

PostPosted: Sun Aug 03, 2008 2:41 pm
by aalpie
BhaaL wrote:
thejasper wrote:First i read some theory about the difference about uploading in ascii and binary. I understand now what's wrong with the file but that's all :p


You should be able to tell what is broken. Theres a good amount of them in the challenge file, you just dont have to fix each and every of them.


I understand why not all of them should be changed. How do I however find which ones need to be changed and which not? can anyone please give me a hint?

Re: Prog 5: fixing the corrupt file

PostPosted: Mon Aug 04, 2008 6:03 am
by BhaaL
aalpie wrote:I understand why not all of them should be changed. How do I however find which ones need to be changed and which not? can anyone please give me a hint?

Theres no general rule of thumb, "change this one but leave that". You have to go and brute-force it. Knowing that, you should be able to make a "smart" brute-forcing algorithm tho, because all possibilities are far too many.

Re: Prog 5: fixing the corrupt file

PostPosted: Sun Aug 31, 2008 7:43 am
by dummy_user
I'm stuck on this one.

I guess the basic problem is: There's this guy \ronald who is very protective about his girl \nancy. Whenever she wants to go out, he comes with her. Now, when I see them together, I have to guess if Nancy rather wants to go out alone (which she usually does), and, if so, get her rid of Ronald.

I've got a program to solve the Ronald problem. It works great with my test data, but it can't solve the mission.

Am I missing something?

Re: Prog 5: fixing the corrupt file

PostPosted: Sun Oct 05, 2008 7:37 pm
by darilma2
I uploaded some files to an ftp server and dowladed them back, which in result produced currupt files. I could fix this files very easy but when I tryed the same method on given files it did not work. And now I am stuck and do not have any hints what am I missing.

thanks for any help

Re: Prog 5: fixing the corrupt file

PostPosted: Mon Nov 10, 2008 7:13 pm
by dummy_user
I finally got it. Accidently removing a line had caused my program to keep at most one Ronald-Nancy pair and remove Ronald from all the other pairs.

Re: Prog 5: fixing the corrupt file

PostPosted: Mon Mar 16, 2009 5:42 pm
by dwmead03
darilma2 wrote:I uploaded some files to an ftp server and dowladed them back, which in result produced currupt files. I could fix this files very easy but when I tryed the same method on given files it did not work. And now I am stuck and do not have any hints what am I missing.

thanks for any help


I was having the same problem to begin with. For an example file try zipping a larger PNG file and sending that. My problem was that my files only required one ronald and nancy pair which is not the case for this mission.

BhaaL wrote:Theres no general rule of thumb, "change this one but leave that". You have to go and brute-force it. Knowing that, you should be able to make a "smart" brute-forcing algorithm tho, because all possibilities are far too many.


Ok. I understand that I have to brute force it, but the way I'm doing seems like it may be impossible to complete within the time limit. My actual algorithm runs plenty fast, but I check each brute attempt by trying to extract the PNG file. This takes a long time when trying to process many different files. I also have done a little research on the orientation of bz2 files; more importantly, the location of the checksum's for the file. I haven't exactly figured out which bytes make up the data for the checksum so I can't thoroughly test this technique with about a bit more work. My question is whether or not I should stick with the checksum route or look for an alternative way to check if the file is still corrupt?

Currently, the code is in C# and I just create a new bz2.exe process which tries to unzip the newly created bz2 file and on success my program stops and the mission is completed. The part that is disabling me from completing the mission within the time frame is the lengthy time it takes to create and complete the bz2.exe process.

Re: Prog 5: fixing the corrupt file

PostPosted: Tue Mar 17, 2009 1:19 pm
by BhaaL
You might want to download a few of those files and do some tests to narrow down possibilities.

I also used C# and called bunzip for the generated files, and my runtime is about 11 seconds. Plenty of time to submit the answer.

Re: Prog 5: fixing the corrupt file

PostPosted: Mon Mar 23, 2009 4:14 am
by damage_case
All my experiments show that the conversion can be just reversed. However just removing Ronald from all the pairs doesn't help and you guys talking about bruteforcing. So I guess actually Ronald shouldn't be removed always. But I can't understand why (as soon as he's always added to Nancy when I do test downloads). Any hints?
Maybe E**D*C is used on the server side?