
Base64 Dll
#2
Posted 19 April 2009 - 07:18 AM
It almost seems like Encryption
#5
Posted 19 April 2009 - 04:18 PM
I found it after checking through my script collection, actually, I found two. One of them doesn't work (I dont think)...
var out, char, ref, len, i, j; ref = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst uvwxyz0123456789+/"; len = string_length(argument0); i = 0; out = ""; while (i < (len div 3)*3) { j = 0; while (j < 3) { char[j] = ord(string_copy(argument0,i+1,1)); // string_char_at works too, string_copy is just less typing i += 1; j += 1; } out += string_copy(ref,(char[0] >> 2) + 1,1); out += string_copy(ref,(((char[0] & 3) << 4) | (char[1] >> 4)) + 1,1); out += string_copy(ref,(((char[1] & 15) << 2) | (char[2] >> 6)) + 1,1); out += string_copy(ref,(char[2] & 63) + 1,1); } if (len mod 3 == 2) { char[0] = ord(string_copy(argument0,i+1,1)); char[1] = ord(string_copy(argument0,i+2,1)); out += string_copy(ref,(char[0] >> 2) + 1,1); out += string_copy(ref,(((char[0] & 3) << 4) | (char[1] >> 4)) + 1,1); out += string_copy(ref,((char[1] & 15) << 2) + 1,1) + '='; } else if (len mod 3 == 1) { char[0] = ord(string_copy(argument0,i+1,1)); out += string_copy(ref,(char[0] >> 2) + 1,1) + string_copy(ref,((char[0] & 3) << 4) + 1,1) + '=='; } return out;
OR
var len; len=argument0; var base64_table; base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst uvwxyz0123456789+/"; var X,Y,i,flag,m,n; Y=0; flag=0; m=0; n = 3; var triple,quad,c; triple[3]=""; quad[4]=""; c=""; var encode; encode[1024]=0; var dst,src; for(X = 0; X < len; X = X + 3) { if((len - X) / 3 == 0) n = (len - X) mod 3; for(i=0; i < 3; i+=1) triple[i] = '0'; for(i=0; i < n; i+=1) triple[i] = src[X + i]; quad[0] = base64_table[(triple[0] & $FC) >> 2]; // FC = 11111100 quad[1] = base64_table[((triple[0] & $03) << 4) | ((triple[1] & $F0) >> 4)]; // 03 = 11 quad[2] = base64_table[((triple[1] & $0F) << 2) | ((triple[2] & $C0) >> 6)]; // 0F = 1111, C0=11110 quad[3] = base64_table[triple[2] & $3F]; // 3F = 111111 if(n < 3) quad[3] = '='; if(n < 2) quad[2] = '='; for(i=0; i < 4; i+=1) dst[X + i] = quad[i]; Y = Y + 4; m = m + 4; if((m != 0)&&((m mod MAXLINE) == 0)) { dst[Y] = '\r'; dst[Y+1] = '\n'; flag+=1; Y += 2; m = 0; } } dst[Y] = '\0'; return encode;
Please note I didn't write the above two scripts, I forget who originally wrote them.
Also, I made an escape script:
argument0=string_replace_all(argument0,"%","|%%&^%$&^}{:)(**_**%(^#"); if argument1==true { argument0=string_replace_all(argument0,"1","\A||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"2","\B||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"3","\C||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"4","\D||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"5","\E||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"6","\F||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"7","\G||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"8","\H||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"9","\I||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"0","\J||%%&^%$&^}{:)(**_**%(^#"); argument0=string_replace_all(argument0,"\A||%%&^%$&^}{:)(**_**%(^#","%31"); argument0=string_replace_all(argument0,"\B||%%&^%$&^}{:)(**_**%(^#","%32"); argument0=string_replace_all(argument0,"\C||%%&^%$&^}{:)(**_**%(^#","%33"); argument0=string_replace_all(argument0,"\D||%%&^%$&^}{:)(**_**%(^#","%34"); argument0=string_replace_all(argument0,"\E||%%&^%$&^}{:)(**_**%(^#","%35"); argument0=string_replace_all(argument0,"\F||%%&^%$&^}{:)(**_**%(^#","%36"); argument0=string_replace_all(argument0,"\G||%%&^%$&^}{:)(**_**%(^#","%37"); argument0=string_replace_all(argument0,"\H||%%&^%$&^}{:)(**_**%(^#","%38"); argument0=string_replace_all(argument0,"\I||%%&^%$&^}{:)(**_**%(^#","%39"); argument0=string_replace_all(argument0,"\J||%%&^%$&^}{:)(**_**%(^#","%30"); argument0=string_replace_all(argument0,"A","%41"); argument0=string_replace_all(argument0,"B","%42"); argument0=string_replace_all(argument0,"C","%43"); argument0=string_replace_all(argument0,"D","%44"); argument0=string_replace_all(argument0,"E","%45"); argument0=string_replace_all(argument0,"F","%46"); argument0=string_replace_all(argument0,"G","%47"); argument0=string_replace_all(argument0,"H","%48"); argument0=string_replace_all(argument0,"I","%49"); argument0=string_replace_all(argument0,"J","%4A"); argument0=string_replace_all(argument0,"K","%4B"); argument0=string_replace_all(argument0,"L","%4C"); argument0=string_replace_all(argument0,"M","%4D"); argument0=string_replace_all(argument0,"N","%4E"); argument0=string_replace_all(argument0,"O","%4F"); argument0=string_replace_all(argument0,"P","%50"); argument0=string_replace_all(argument0,"Q","%51"); argument0=string_replace_all(argument0,"R","%52"); argument0=string_replace_all(argument0,"S","%53"); argument0=string_replace_all(argument0,"T","%54"); argument0=string_replace_all(argument0,"U","%55"); argument0=string_replace_all(argument0,"V","%56"); argument0=string_replace_all(argument0,"W","%57"); argument0=string_replace_all(argument0,"X","%58"); argument0=string_replace_all(argument0,"Y","%59"); argument0=string_replace_all(argument0,"Z","%5A"); argument0=string_replace_all(argument0,"a","%61"); argument0=string_replace_all(argument0,"b","%62"); argument0=string_replace_all(argument0,"c","%63"); argument0=string_replace_all(argument0,"d","%64"); argument0=string_replace_all(argument0,"e","%65"); argument0=string_replace_all(argument0,"f","%66"); argument0=string_replace_all(argument0,"g","%67"); argument0=string_replace_all(argument0,"h","%68"); argument0=string_replace_all(argument0,"i","%69"); argument0=string_replace_all(argument0,"j","%6A"); argument0=string_replace_all(argument0,"k","%6B"); argument0=string_replace_all(argument0,"l","%6C"); argument0=string_replace_all(argument0,"m","%6D"); argument0=string_replace_all(argument0,"n","%6E"); argument0=string_replace_all(argument0,"o","%6F"); argument0=string_replace_all(argument0,"p","%70"); argument0=string_replace_all(argument0,"q","%71"); argument0=string_replace_all(argument0,"r","%72"); argument0=string_replace_all(argument0,"s","%73"); argument0=string_replace_all(argument0,"t","%74"); argument0=string_replace_all(argument0,"u","%75"); argument0=string_replace_all(argument0,"v","%76"); argument0=string_replace_all(argument0,"w","%77"); argument0=string_replace_all(argument0,"x","%78"); argument0=string_replace_all(argument0,"y","%79"); argument0=string_replace_all(argument0,"z","%7A"); argument0=string_replace_all(argument0,"-","%2D"); argument0=string_replace_all(argument0,"_","%5F"); argument0=string_replace_all(argument0,".","%2E"); argument0=string_replace_all(argument0,"~","%7E"); } argument0=string_replace_all(argument0,"|%%&^%$&^}{:)(**_**%(^#","%25"); argument0=string_replace_all(argument0," ","%20"); argument0=string_replace_all(argument0,"!","%21"); argument0=string_replace_all(argument0,"'","%27"); argument0=string_replace_all(argument0,"(","%28"); argument0=string_replace_all(argument0,")","%29"); argument0=string_replace_all(argument0,";","%3B"); argument0=string_replace_all(argument0,":","%3A"); argument0=string_replace_all(argument0,"@","%40"); argument0=string_replace_all(argument0,"&","%26"); argument0=string_replace_all(argument0,"$","%24"); argument0=string_replace_all(argument0,"/","%2F"); argument0=string_replace_all(argument0,"?","%3F"); argument0=string_replace_all(argument0,"#","%23"); argument0=string_replace_all(argument0,"[","%5B"); argument0=string_replace_all(argument0,"]","%5D"); argument0=string_replace_all(argument0,"=","%3D"); argument0=string_replace_all(argument0,"+","%2B"); argument0=string_replace_all(argument0,"*","%2A"); argument0=string_replace_all(argument0,"{","%7B"); argument0=string_replace_all(argument0,"}","%7D"); argument0=string_replace_all(argument0,"|","%7C"); argument0=string_replace_all(argument0,"\","%5C"); argument0=string_replace_all(argument0,'"',"%22"); argument0=string_replace_all(argument0,",","%2C"); argument0=string_replace_all(argument0,"<","%3C"); argument0=string_replace_all(argument0,">","%3E"); argument0=string_replace_all(argument0,"~","%7E"); argument0=string_replace_all(argument0,"`","%60"); return argument0;
#7
Posted 19 April 2009 - 09:33 PM
argument0=string_replace_all(argument0," ","%20");argument0=string_replace_all(argument0,"!","%21");argument0=string_replace_all(argument0,"'","%27");argument0=string_replace_all(argument0,"(","%28");argument0=string_replace_all(argument0,")","%29");argument0=string_replace_all(argument0,";","%3B");argument0=string_replace_all(argument0,":","%3A");argument0=string_replace_all(argument0,"@","%40");argument0=string_replace_all(argument0,"&","%26");argument0=string_replace_all(argument0,"$","%24");argument0=string_replace_all(argument0,"/","%2F");argument0=string_replace_all(argument0,"?","%3F");...
Edited by IsmAvatar, 19 April 2009 - 09:33 PM.

We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered
#9
Posted 20 April 2009 - 04:07 AM
What does this doI saw a request for a Base64 DLL, and I thought, "I'll make one!" (and I needed one for my current project).
So I made one.
This zip contains the example and the dll. Post your comments and suggestions here.
TEH LINK
Please give credit!!
PS: This is my FIRST DLL!
If the post that you are reading was created prior to 2011. For the safety of the general public, It is not to be regarded under any circumstances.
Please don't ask me to join your group at anything.
#11
Posted 20 April 2009 - 04:43 AM
Does this encode and decode files? Or strings?
If the post that you are reading was created prior to 2011. For the safety of the general public, It is not to be regarded under any circumstances.
Please don't ask me to join your group at anything.
#13
Posted 21 April 2009 - 03:58 AM
Oh...Still usefullStrings, but eventually files.
If the post that you are reading was created prior to 2011. For the safety of the general public, It is not to be regarded under any circumstances.
Please don't ask me to join your group at anything.
#15
Posted 22 April 2009 - 08:04 PM
Encoding is not encryption.Oh...looks like something usefull for paranoid people
Encoding is something used to make data more easy to transfer, for example, in XML tags, or to a MySQL database.
It is occasionally used for light obfuscation of text to avoid google from finding pages it shouldn't.
It is, by design, easy to reverse.
Encryption, on the other hand, is NOT meant to be reversed. It is made to keep data from being read or (in the case of signing a message) altered.
Digest algorithms are a completely different kettle of fish - they purposely lose enough data as to make the result almost impossible to get the original text from - it's sometimes used to check pairs of sensitive data against each other.
Anti-Decompiler for GM6.1 to GM8.1.91! [Main skin by Sindarin]
Discontinued.
^ Signature image because it's been sorta empty since the old host died
If you need to contact me, I still get notification emails from PMs.
#18
Posted 12 December 2010 - 08:33 PM