Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Fr0z3N on June 07, 2003, 01:41 PM

Title: Decoding Base64
Post by: Fr0z3N on June 07, 2003, 01:41 PM
Can anyone give me an easy script to decode Base64? I also never learned how to deocde hex.  :-*

VisualBasic6
Title: Re:Decoding Base64
Post by: Yoni on June 07, 2003, 01:42 PM
www.pscode.com has lots of stuff

(You never specified language)
Title: Re:Decoding Base64
Post by: UserLoser on June 07, 2003, 03:29 PM
So many non bot development related posts in this forum......
Title: Re:Decoding Base64
Post by: Fr0z3N on June 07, 2003, 03:41 PM
I thought this would go here since I am putting this in a bot.
Title: Re:Decoding Base64
Post by: Banana fanna fo fanna on June 11, 2003, 07:33 PM
its not hex
second you havent heard of pscode.com?
Title: Re:Decoding Base64
Post by: Fr0z3N on June 11, 2003, 09:42 PM
I do but most of the time I can't find what I'm looking for, in this case, Base64.
Title: Re:Decoding Base64
Post by: Banana fanna fo fanna on June 12, 2003, 06:04 AM
google as well
Title: Re:Decoding Base64
Post by: Fr0z3N on June 12, 2003, 06:37 AM
Google is the worst VisualBasic 6 search engin.
Title: Re:Decoding Base64
Post by: dxoigmn on June 12, 2003, 03:05 PM
Quote from: Fr0z3N on June 12, 2003, 06:37 AM
Google is the worst VisualBasic 6 search engin.

Perhaps you should learn to search properly?  I've found atleast 10 examples of how to do Base 64 encoding/decoding (in Visual Basic) on PlanetSourceCode alone.  As for google, I'm sure I could find many more examples floating around.
Title: Re:Decoding Base64
Post by: Zakath on June 16, 2003, 05:52 PM
Incidentally, I seem to remember Adron creating a library specificly for dealing with encryption and decryption in several formats. It's hosted on this web site, as I recall. You didn't even need to leave the domain to find stuff that could help you.
Title: Re:Decoding Base64
Post by: Adron on June 19, 2003, 11:01 AM
Quote from: Zakath on June 16, 2003, 05:52 PM
Incidentally, I seem to remember Adron creating a library specificly for dealing with encryption and decryption in several formats. It's hosted on this web site, as I recall. You didn't even need to leave the domain to find stuff that could help you.

Yes, that can decode base64, but if the only thing he wants is to decode base64, it's overkill to try to use the library.
Title: Re:Decoding Base64
Post by: c0ol on June 19, 2003, 03:55 PM
whats the big deal? this is a simple numeric base conversion, its less programming, more math.  You shoud try something like this (i know no VB):

#include <math.h>
char encoded[256];
int character_offset = 48, places = 2, base = 64;

for (;*string;string++) {
   char ch = string[0];
   for(i = places-1;i >= 0;i--) {
       int x = pow(base, i);
       if (ch > x)
           int a = ch / x;  // i think putting this in int context removes the decimal
           ch -= a * x;
           encoded++ = a + characterset_offset;
       }else {
           encoded++ = characterset_offset;
       }
   }
}      // note i didnt really test this, i just kinda made it up but i think it captures the idea.
Title: Re:Decoding Base64
Post by: Banana fanna fo fanna on June 19, 2003, 04:08 PM
Quote
~~ The stupidity of others prevents me from doing my task ~~

Nice sig, btw.
Title: Re:Decoding Base64
Post by: Arta on June 19, 2003, 05:26 PM
Yes, i just noticed that fun little irony too  ::)