Prog 5: fixing the corrupt file

Put your programming skills to the test in these challenges.

Re: Prog 5: fixing the corrupt file

Post by dwmead03 on Mon Mar 23, 2009 10:34 am
([msg=20378]see Re: Prog 5: fixing the corrupt file[/msg])

damage_case wrote: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?


Well, it's a bz2 compressed file. So if the bz2 compression actually produces a Ronald and Nancy pair then you wouldn't want to remove Ronald now would you? I encountered this problem because my test files were too small. Try using test files larger in size.
User avatar
dwmead03
New User
New User
 
Posts: 30
Joined: Mon Apr 14, 2008 11:34 pm
Location: KY
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by damage_case on Mon Mar 23, 2009 3:04 pm
([msg=20398]see Re: Prog 5: fixing the corrupt file[/msg])

If the bz2 compression actually produces a Ronald and Nancy pair, then after the "corruption" there will be 2 Ronalds and 1 Nancy. At least it happens so in my tests. So we should remove one Ronald and there will be a Ronald and Nancy pair again. Isn't it so?
damage_case
New User
New User
 
Posts: 7
Joined: Wed Mar 18, 2009 3:41 am
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by dwmead03 on Mon Mar 23, 2009 5:25 pm
([msg=20401]see Re: Prog 5: fixing the corrupt file[/msg])

damage_case wrote:If the bz2 compression actually produces a Ronald and Nancy pair, then after the "corruption" there will be 2 Ronalds and 1 Nancy. At least it happens so in my tests. So we should remove one Ronald and there will be a Ronald and Nancy pair again. Isn't it so?


I believe you are mistaken. I ran another test just to be sure and it didn't add another Ronald with the Ronald and Nancy pair that you want to keep. Maybe you should retry your tests to be sure. I am using the FTP client that comes with Windows, btw.
User avatar
dwmead03
New User
New User
 
Posts: 30
Joined: Mon Apr 14, 2008 11:34 pm
Location: KY
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by damage_case on Sun Apr 05, 2009 4:12 am
([msg=21170]see Re: Prog 5: fixing the corrupt file[/msg])

dwmead03 wrote:
damage_case wrote:If the bz2 compression actually produces a Ronald and Nancy pair, then after the "corruption" there will be 2 Ronalds and 1 Nancy. At least it happens so in my tests. So we should remove one Ronald and there will be a Ronald and Nancy pair again. Isn't it so?


I believe you are mistaken. I ran another test just to be sure and it didn't add another Ronald with the Ronald and Nancy pair that you want to keep. Maybe you should retry your tests to be sure. I am using the FTP client that comes with Windows, btw.


I tried to corrupt a large bz2 compressed png file and all Nancys (including Nancys who had one Ronald already) got an additional Ronald. Then I tried a simple text file and the transfer added another Ronald to every Ronald and Nancy pair too.
I'm using FTP client from windows xp and pure-ftpd server on Fedora. Maybe the problem is in server configuration. I suppose I should try it on a real server.
damage_case
New User
New User
 
Posts: 7
Joined: Wed Mar 18, 2009 3:41 am
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by dwmead03 on Mon Apr 06, 2009 9:48 pm
([msg=21336]see Re: Prog 5: fixing the corrupt file[/msg])

damage_case wrote:I tried to corrupt a large bz2 compressed png file and all Nancys (including Nancys who had one Ronald already) got an additional Ronald. Then I tried a simple text file and the transfer added another Ronald to every Ronald and Nancy pair too.
I'm using FTP client from windows xp and pure-ftpd server on Fedora. Maybe the problem is in server configuration. I suppose I should try it on a real server.


I don't know what your problem is. I used Window's FTP client as well and used 100webspace.net as my server. Maybe making a webspace account will work for you.
User avatar
dwmead03
New User
New User
 
Posts: 30
Joined: Mon Apr 14, 2008 11:34 pm
Location: KY
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by damage_case on Wed Apr 08, 2009 12:54 am
([msg=21391]see Re: Prog 5: fixing the corrupt file[/msg])

dwmead03 wrote:I don't know what your problem is. I used Window's FTP client as well and used 100webspace.net as my server. Maybe making a webspace account will work for you.

Thanks, I'll try something like this.
damage_case
New User
New User
 
Posts: 7
Joined: Wed Mar 18, 2009 3:41 am
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by kijibwa on Tue Aug 25, 2009 7:55 am
([msg=28397]see Re: Prog 5: fixing the corrupt file[/msg])

Apologies for this noob question.

But I am using Python and don't know how to access the corrupt file, so that i can make the changes. I have tried read("corrupt file", "rb") and all I get is about 30 chars.
Using the native BZ2module just throws an IO error. I don't know how to proceed, any help would be greatly appreciated.
User avatar
kijibwa
New User
New User
 
Posts: 18
Joined: Tue Apr 14, 2009 5:02 pm
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by Defience on Tue Aug 25, 2009 4:23 pm
([msg=28411]see Re: Prog 5: fixing the corrupt file[/msg])

kijibwa wrote:Apologies for this noob question.

But I am using Python and don't know how to access the corrupt file, so that i can make the changes. I have tried read("corrupt file", "rb") and all I get is about 30 chars.
Using the native BZ2module just throws an IO error. I don't know how to proceed, any help would be greatly appreciated.


Code: Select all
>>>f = open("corrupted.png.bz2","rb")
>>>f.read()
User avatar
Defience
Addict
Addict
 
Posts: 1277
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by kijibwa on Tue Aug 25, 2009 5:21 pm
([msg=28415]see Re: Prog 5: fixing the corrupt file[/msg])

Lovely. Now onto Ronald and Nancy.
Thanks Defience :D
User avatar
kijibwa
New User
New User
 
Posts: 18
Joined: Tue Apr 14, 2009 5:02 pm
Blog: View Blog (0)


Re: Prog 5: fixing the corrupt file

Post by MicroPirate on Tue Dec 14, 2010 10:48 am
([msg=50437]see Re: Prog 5: fixing the corrupt file[/msg])

I honestly have no idea where to start with this. I've researched a bit what bz2 format is, but I don't know exactly how to fix it, or even really decompress it manually. I see everyone talking about these Robert and Nancy pairs but I haven't been able to find anything on what exactly these are either. Can anyone point me to some good materials that would help me understand what exactly to do here? So far my method of reading in the byte streams through Java has been less than successful.
MicroPirate
New User
New User
 
Posts: 1
Joined: Mon Dec 13, 2010 3:43 pm
Blog: View Blog (0)


Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests