Article View: news.software.nntp
Article #62130UUdecoding question
From: MrMxyzptlk
Date: Wed, 27 Nov 2002 02:31
Date: Wed, 27 Nov 2002 02:31
47 lines
2536 bytes
2536 bytes
Ok I have used the code below and passed in a line at time from a uuencoded
message. (stripped of blank lines, begin and end lines and, the leading M
removed)
Now what? I tried writing the lines out in a binary format and a text format
but the files are unusable.
For example say I decode a jpg, when I open the file there is no image.
Can anyone guide me a little more?
Thank you for your time, Anthony.
*****************************************************************
public string uuDecode(string sBuffer)
{
string str1=String.Empty;
int j = sBuffer.Length ;
for (int i = 1; i <= j; i += 4)
{
str1 = String.Concat(str1, Convert.ToString((char)(((int)Convert.ToChar(
sBuffer.Substring ( i-1, 1)) - 32) * 4 + ((int)Convert.ToChar(
sBuffer.Substring( i , 1)) - 32) / 16)));
str1 = String.Concat(str1, Convert.ToString((char)(((int)Convert.ToChar(
sBuffer.Substring( i , 1)) % 16 * 16) +
((int)Convert.ToChar(sBuffer.Substring( i + 1, 1)) - 32) / 4)));
str1 = String.Concat(str1,
Convert.ToString((char)(((int)Convert.ToChar(sBuffer.Substring ( i + 1, 1))
% 4 * 64) + (int)Convert.ToChar( sBuffer.Substring( i + 2, 1)) - 32)));
}
return str1;
}
Technical Details
Message-ID:
<PcycndP5r-WJsnmgXTWcoA@giganews.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!ngpeer.news.aol.com!feed3.newsreader.com!newsreader.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!news.giganews.com.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <PcycndP5r-WJsnmgXTWcoA@giganews.com> Subject: UUdecoding question Date: Tue, 26 Nov 2002 21:31:24 -0500 From: "MrMxyzptlk" <yaya@hotmail.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!ngpeer.news.aol.com!feed3.newsreader.com!newsreader.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 26 Nov 2002 20:33:56 -0600 Newsgroups: news.software.nntp X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Lines: 46 X-Trace: sv3-yk04NiPMS9QbON0vOgugP2QACIGBfeW+zPKSp/qeEd+VfWsbfmCF1pxc4hia8w5JcOqDQJSevv2UFut!R8xcuCnzmFrYiZNnm045Zd7toLfbwnPKTglElHWSRRHY7jDK9sqNGalPmdc= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1