Advertisement
C_Volume2 Registry #81271

Windows Screen Saver Password Decoder

Tells you the Windows screen saver password

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned char matrix[256+2];
unsigned char matgut[256+2];
unsigned char mystery[4]={ 0xb2, 0xdc, 0x90, 0x8f };
unsigned char h1;
unsigned char pa[79], passwd[80];
unsigned char tofind[30];
int h2=4;
unsigned int lentofind;
int len;
void fixmatrix()
{
	 unsigned char orig, mys, help1, last;
  int i,j, help2;
	 for(i=0; i<256; i++)
		 matrix[i]=i;
	 matrix[256]=0; matrix[256+1]=0;
	 h1=0; last=0;
	 for(j=0;j<256;j++) {
		 orig=matrix[j];
		 mys=mystery[h1];
		 help2=(mys+last+matrix[j]) & 0xff;
		 help1=matrix[help2];
		 matrix[j]=help1;
		 matrix[help2]=orig;
		 last=help2;
		 h1++; h1=h1%4;
	 }
	 memcpy(matgut, matrix, sizeof(matrix));
}
void check(char *test)
{
	 unsigned char help1, oldh2;
	 int i;
	 strcpy(passwd, test);
	 strcpy(pa, passwd);
	 len=strlen(pa);
	 memcpy(matrix, matgut, sizeof(matrix));
	 h1=0; h2=0;
	 for(i=0;i<len;i++)
	 {
		 h1++; h1=h1&0xff;
		 oldh2=matrix[h1];
		 h2=(h2+matrix[h1]) & 0xff;
		 help1=matrix[h1];
		 matrix[h1]=matrix[h2];
		 matrix[h2]=help1;
		 help1=(matrix[h1]+oldh2) & 0xff;
		 help1=matrix[help1];
		 pa[i]^=help1;
	 }
}
int is_ok(char a)
{
	 if ((a<='9') && (a>='0'))
		 return 1;
	 else if ((a<='F') && (a>='A'))
		 return 1;
	 else
		 return 0;
}
int nibble(char c)
{
	 if((c>='A') && (c<='F'))
		 return (10+c-'A');
	 else if((c>='0') && (c<='9'))
		 return (c-'0');
}
void parse(char *inpt)
{
	 char *tok;
	 char num[2];
	 lentofind=0;
	 tok=strtok(inpt, "\t ,\n");
	 while(tok!=NULL) {
		 num[0]=tok[0]; num[1]=tok[1];
		 if ((!is_ok(num[0])) || (!is_ok(num[1])))
		 {
				puts("Please input strings like: b2,a1,03");
				exit(0);
		 }
		 tofind[lentofind++]=16*nibble(num[0])+nibble(num[1]);
		 tok=strtok(NULL, "\t ,\n");
	 }
	 tofind[lentofind]=0;
}
int hex(char *str)
{
	return (str[0]-'0')*16+(str[1]-'0');
}
void main()
{
	 unsigned int i;
	 int j,n=0,odd=0;
	 unsigned char tst[80];
	 char inpt[120];
	 char ascii[120];
	 char temp[3];
	 char ans;
	 fixmatrix();
	 printf("All ascii codes are from der RegEdit and hex codes are from ein text editor\n\n");
	 do
	 {
		 printf("Are der codes hex or ascii [h/a]?");
		 ans = getchar();
		 getchar();
	 } while(tolower(ans) != 'h' && tolower(ans) != 'a');
	 tolower(ans) == 'a';
	 if(tolower(ans) == 'a')
	 {
		 printf("Give me the codes, separated by commas (in ascii):\n >");
		 gets(ascii);
    i=0;
    do
    {
			 temp[0]=ascii[i];
     temp[1]=ascii[i+1];
     temp[2]=NULL;
     inpt[n]=hex(temp);
			 n++;
     odd++;
     if(odd % 2 == 0 && i+3<=strlen(ascii))
     {
				 inpt[n]=',';
       n++;
     }
     i+=3;
		 }while(i<=strlen(ascii));
    inpt[n]=NULL;
		 printf("Der hex codes fur der password are: %s\n", inpt);
	 }
	 else
	 {
		 printf("What are der codes, separated by commas, in hex?:\n >");
		 gets(inpt);
	 }
	 for(i=0;i<strlen(inpt);i++)
		 inpt[i]=toupper(inpt[i]);
	 parse(inpt);
	 for(i=0; i<lentofind; i++)
		 tst[i]='A';
	 tst[lentofind]=0;
	 for(i=0; i<lentofind; i++)
	 {
		 for(j=' '; j<='Z'; j++)
		 {
				tst[i]=j;
				check(tst);
				if(pa[i]==tofind[i])
					 break;
		 }
	 }
	 printf("Password is: %s\n", tst);
	 exit(0);
	 }
Upload

<p><br><br>
<p>Web Controls are server-side elements used to create 
&quot;smart forms&quot; in ASP.NET.&nbsp; These Web controls actually turn into 
html elements when they are processed on the server.&nbsp; In this article, I am 
going to explain how to use the label control.&nbsp; My goal is to teach you 
step-by-step by keeping it simple.&nbsp; Instead of throwing all web controls together in one 
article, I am going to break it down so you don't get too much at one time.&nbsp; 
Ready? Let's begin!</p>
<p><b>The &quot;label&quot; Control</b></p>
<p>Adding static content to your page has always been easy.&nbsp; 
But what if you want to dynamically change what will be displayed?&nbsp; You 
could use the &quot;label&quot; control.&nbsp; Here is the code:</p>
<p><font color="#0000FF">&lt;asp:Label id=&quot;lblexample&quot; runat=&quot;server&quot; 
/&gt;</font></p>
<p>This is the minimal amount of code you need to create a 
label.&nbsp; If you wanted to set a default text value in the label, you would 
do something like this:</p>
<p><font color="#0000FF">&lt;asp:Label id=&quot;lblexample&quot; text=&quot;This is my first label&quot; 
runat=&quot;server&quot; /&gt;</font></p>
<p>Lets break some of this down for a minute.&nbsp; The &quot;<font color="#0000FF">asp:Label</font>&quot; 
part is the start of the control.&nbsp; The &quot;id&quot; parameter is going to be the 
name of your label control.&nbsp; You can name yours whatever you want. In the 
text parameter, it set a default text value to &quot;This is my first label.&quot;&nbsp; 
Do not forget the &quot;runat=server&quot; part. When you execute your page, it 
will display &quot;This is my first label.&quot; </p>
<p>If you wanted to change the text dynamically in a subroutine, you would 
call the following:</p>
<p><font color="#0000FF">lblexample.text = &quot;New text would go here!&quot;</font></p>
<p>Remember, if you did not call your label &quot;lblexample&quot; then 
you would have to change the tag to the appropriate name. </p>
<p>Are you ready for your first example? Of course you are!&nbsp;
</p>
<p><font color="#0000FF">&lt;script runat=&quot;server&quot;&gt;</font></p>
<p><font color="#0000FF">Sub page_load<br>
lblexample.text = &quot;Welcome to my site!&quot;<br>
End Sub</font></p>
<p><font color="#0000FF">&lt;/script&gt;</font></p>
<p><font color="#0000FF">&lt;html&gt;<br>
&lt;head&gt;<br>
&lt;title&gt;My first label&lt;/title&gt;<br>
&lt;/head&gt;<br>
&lt;body&gt;<br>
&lt;asp:Label id=&quot;lblexample&quot; runat=&quot;server&quot; /&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;</font></p>
<p>Let me explain this now.&nbsp; We started off the script 
by using &quot;<font color="#0000FF">&lt;script runat=&quot;server&quot;&gt;</font>.&quot; This starts are 
server-side scripting section.&nbsp; We will hide our subroutines in there. In 
the next line, we declare our first (and only) subroutine.&nbsp; This subroutine 
is called &quot;page_load.&quot; This subroutine will always be executed when the page 
begins to load.&nbsp; For your own reference, you can always use the &quot;page_load&quot; 
sub in any of your pages. It will always execute first. The &quot;page_load&quot; 
subroutine is a good place to declare and store variables which you will use 
throughout the script.</p>
<p>In the next line, we called &quot;lblexample.text.&quot; This will 
change the text value in the control named &quot;lblexample&quot; to &quot;Welcome to my 
site!&quot;.</p>
<p>After that, we just clean up by ending the &quot;page_load&quot; sub 
and closing the script tag.&nbsp; This allows us to start developing what the 
user will see when he/she comes to the page.&nbsp; Notice, the rest is all HTML 
tags except for the one label control entitled &quot;lblexample.&quot; This is the spot 
where the &quot;Welcome to my site!&quot; text will be placed.&nbsp; Simple isn't it?</p>
<p>I hope you found that somewhat helpful.&nbsp; I tried to 
keep it as simple as possible but still not making it boring.&nbsp; Please vote 
and leave your comments! If you have any problems or you get stuck, please email 
me at <a href="mailto:webmaster@sourcecode-central.com">
webmaster@sourcecode-central.com</a>. I will be glad to help you!</p>
<p>&nbsp;</p>
Original Comments (3)
Recovered from Wayback Machine