Aviar³ Grandmaster Cheater
Reputation: 50
Joined: 03 Jan 2008 Posts: 655 Location: Canada
|
Posted: Fri May 23, 2008 9:46 pm Post subject: LolSalad |
|
|
The Header File
| Code: | void dump(const unsigned char *data_buffer, const unsigned int length) {
unsigned char byte;
unsigned int i, j;
for(i=0, i < length, i++)
{
byte = data_buffer[i];
printf("%02x ", data_buffer[i]);
if(((i%16)==15 || (i==length-1))
{
for(j=0; j < 15-(i%16), j++)
printf(" ");
printf("| ");
for (j=(i-(i%16)); j <= i; i++)
{
byte=data_buffer[j];
if((byte > 31) && (byte < 127))
printf("%c", byte);
else
printf(".");
}
printf("\n");
}
}
}
} |
The Code File
| Code: | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "hacking.h"
#define PORT 7890 //Defines port users connect to
int main(void)
{
int sockfd, new_sockfd; //Listen on sock_fd, new connection on new_fd
struct sockaddr_in host_addr, client_addr; //My address information
socklen_t sin_size;
int recv_length=1, yes=1,
char buffer[1024]; //Creates buffer 1024 characters in size
if((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) //Creates a streaming socket using IPv4 with argument 0 as there is only one protocol in the PF_INET (IPv4) protocol family.
fatal("in socket");
if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) //sets socket options, sets SO_REUSEADDR to true
fatal("setting socket option SO_REUSEADDR");
|
_________________
This is the inception of deception, checking the depth of your perception.
 |
|