Eternity - megainformatic - 5
1 2 3 4 5 6
* * *
,
.
c:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple
.
:
- .
-
- ,
- . :)
, :
, - -,
. ..
, , .
- .
.
, .
.
. . -
, ,
( ).
- -
: -
- .
( )
" ".
-
" " " ".
:
- .
- .
, ,
-,
.
. -
, , / -
.
- .
. :
, - ,
.
, -
, .
,
.
, ,
, - .
- .
,
, .
, - .
, -
. ,
"" . ,
" ?".
, .
, . .
"-" - .
.
: ,
, .
- - , ,
, - ,
,
- : ?
,
.
- -, -
,
. :
,
.
:
,
.
- , -
- , , -,
.
?
: ;
; ; ;
?
- .
. - - --
.
.
.
,
.
- -
.
, , , ,
.
? , , .
- .
.
, , , .
, .
: ,
?
- , -
. .
.
, .
, :
- ,
.
?
, . ,
- .
!
- ,
.
- . -
, .
- - , ,
.
.
-.
, , -
- ,
.
, ,
.
,
.
, . -
, .
, ,
.
.
, , , .
. ,
.
, .
.
, " ".
"" " ".
.
.
.
, ,
, .
, - .
. ,
.
.
.
"" "" .
.
.
. .
, ,
. ,
, ,
.
. .
, ,
, ,
. .
.
.
, .
, - ?
.
.
.
.
.
.
.
, .
,
, !
.
- .
, .
.
.
c:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple
2 :
simples - . . simple Server
simplec - . . simple Client
. MSVS 2005
Windows,
.
-
simples -
simplec -
.
cd C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\
netds\winsock\simple\server\Debug
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple\server
\Debug>simples -
Usage
simples -p [protocol] -e [endpoint] -i [interface] [-4] [-6]
Where:
-p protocol - is one of "TCP" or "UDP"
-e endpoint - is the port to listen on
-i interface - is the string local address to bind to
-4 - force IPv4
-6 - force IPv6
Defaults are TCP,5001 and INADDR_ANY and IN6ADDR_ANY (if IPv6 present)
, ,
, ,
.
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple\server
\Debug>simples -p TCP -e 80 -i 127.0.0.2
socket 0x7c bound to address 127.0.0.2 and port 80
. . TCP, 80
ip - 127.0.0.2
[Ctrl] + [C].
.
, simplec.
-
simplec -p -n -e -l
, simples,
.
simplec -p TCP -n 127.0.0.2 -e 80 -l 10
simplec
Windows.
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple\client
\Debug>simplec -p TCP -n 127.0.0.2 -e 80 -l 10
Client attempting connection to: 127.0.0.2 port: 80
Connection established...
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 0]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 1]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 2]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 3]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 4]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 5]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 6]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 7]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 8]] from server
wrote 40 bytes
read 40 bytes, data [This is a small test message [number 9]] from server
/ 10 (),
simplec -l 10.
simples , . .
.
c++, php.
, ,
simples Windows SDK 7.0.
, .
simplec.
,
, .
simplec char.
Windows - unicode.
unicode, ,
generic - _T
CString cs_str = _T("Simple string sample");
L
CString cs_str = L"Simple string sample";
unicode, ,
.
_T - ANSI
, unicode.
Windows unicode. ,
Windows Sockets 2 .
,
Windows Sockets 2 API, -
.
- - memory Leaks Access Violation.
- ,
, ,
.
?
Debug, -
. .
, ,
. , -
-
-
.
-
, .
, ,
, .
.
,
.
- ,
.
char -
char hoststr[NI_MAXHOST],
NI_MAXHOST 1025.
-
SecureZeroMemory(&hoststr, sizeof(hoststr));
2 :
&hoststr, hoststr ?
. . -
SecureZeroMemory(hoststr, sizeof(hoststr));
sizeof(hoststr), strlen(hoststr) ?
. . -
SecureZeroMemory(hoststr, strlen(hoststr));
-
SecureZeroMemory(&hoststr, sizeof(hoststr));
,
char -
char hoststr[NI_MAXHOST],
-
char *hoststr = "localhost";
char *hoststr;
.
- char *hoststr - ,
-
SecureZeroMemory(&hoststr, strlen(hoststr));
-
SecureZeroMemory(hoststr, strlen(hoststr));
&hoststr - , . .
, - 0 NULL.
, .
2 :
1) Memory Leaks - - NULL ,
delete [] hoststr; //
-
char *hoststr = new char[ request_str_symbols_count ];
request_str_symbols_count - , .
2) hoststr ,
Access Violation - hoststr.
- sizeof strlen -
SecureZeroMemory(&hoststr, sizeof(hoststr));
SecureZeroMemory(&hoststr, strlen(hoststr));
, sizeof -
hoststr , strlen hoststr -
\0.
, hoststr , ,
- , . . .
\0 - . - -
.
SecureZeroMemory(&hoststr, sizeof(hoststr));
hoststr ( - - - ,
- ,
- ,
- ),
.
-
SecureZeroMemory(&hoststr, strlen(hoststr));
, . .
0 . ,
, hoststr
.
-
, .
,
- (. . \0 ).
-
,
,
- .
, , :
, C++ ,
.
- Access violation memory leaks.
- php - -
! ,
php - , ,
.
, , php !!!
, c++ ,
.
, ,
.
-
c:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple\
client\simplec.cpp
-
int __cdecl main
-
Windows - - -
Windows -
cd C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple\
server\Debug
simples -p TCP -e 80 -i 127.0.0.2
.
- simplec
simplec -p TCP -n 127.0.0.2 -e 80 -l 10
MSVS ,
-
Command Arguments 4
-p TCP -n 127.0.0.2 -e 80 -l 10
c:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\netds\winsock\simple\
client\simplec.cpp
(
4)
-
// Parse the command line
if (argc >1)
{
for (i=1; i < argc; i++)
-
address_family = 0
socket_type = 1
server_name = 0x007f4d6d "127.0.0.2"
//. . server_name url
// ,
megainformatic.ru
port = 0x007f4d7a "80"
// megainformatic.ru
maxloop = 10
// .
.
& * c++ ?
* - , ,
-
-
SearchCRLF(const char * strData, size_t data_length, size_t * found_at)
strData found_at
SearchCRLF - -
( ).
strData char
char * strData
const ,
-
. . ( ).
, strData
=.
const ,
-
, strData .
. . - strData strData
,
, - .
char , ,
char * strData
char strData[100];
- -
, ,
.
- - -
100 ( ), char - 1
.
-
size_t * found_at
, , -
size_t search_result = -1;
//...
// -
SearchCRLF(strData, strDataSize, &search_result);
search_result &
, search_result,
(), .
-
void SearchCRLF(const char * strData, size_t data_length, size_t * found_at)
{
//...
// found_at
//
*fount_at = 0; // found_at
//( )
}
void SearchCRLF(const char * strData, size_t data_length, size_t found_at)
{
?
, found_at -,
.
, ,
-
void SearchCRLF(const char * strData, size_t data_length, size_t found_at)
{
//...
size_t some_var = found_at; //
// -
found_at = 1;
}
const
char.
, size_t - ,
* ,
-, .
* - .
-
, ,
.
const -
const char * strData
, "-"
.
const - .
.
simplec.
1 .
- -
.
Win Sock 2
(
Windows Sockets 2, ping, Windows SDK 7, hxs - 4) -
// Load Winsock
if ((retval = WSAStartup(MAKEWORD(2,2), &wsaData)) != 0)
{
//...
// Make sure the wildcard port wasn't specified
// - - 0
if (_strnicmp(port, "0", 1) == 0)
Usage(argv[0]);
80 . . simples 80
megainformatic.ru - 80 .
retval = getaddrinfo(
server_name,
port,
&hints,
&results
);
//? ip .
// megainformatic.ru
-
-
while (addrptr)
{
conn_socket = socket(addrptr->ai_family, addrptr->ai_socktype,
addrptr->ai_protocol);
//...
retval = getnameinfo(
addrptr->ai_addr,
(socklen_t)addrptr->ai_addrlen,
hoststr,
NI_MAXHOST,
servstr,
NI_MAXSERV,
NI_NUMERICHOST | NI_NUMERICSERV
);
//, !
//
//...
// Make sure we got a connection established
if (conn_socket == INVALID_SOCKET)
{
printf("Unable to establish connection...\n");
goto cleanup;
}
else
{
printf("Connection established...\n");
}
- Connection established...
. . .
, -
//
// cook up a string to send
//
loopcount = 0;
for (;;)
{
// ,
// - :
// :
GET /?page=474 HTTP/1.1\r\n
Host: megainformatic.ru\r\n
Connection: Close\r\n
, simple Windows SDK 7
Windows Sockets 2,
php fsockopen -
-
fsockopen php
, . .
simple - Windows SDK 7.
1 2 3 4 5 6
:
0

0

|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
, , 2020 - ,
|
|
|
|
|
|
|
|
|
|
, , , .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3), (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3), (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
 anova
|
 A Knots Story |
 sabotage |
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
, ,
|
|
|
|
|
|
|
, ,
|
|
|
|
|
|
|
, , cms,
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
, , ria xxl , fly snow 3d , . -
|
|
|
|
|
|
fle game engine -
|
|
|
|
|
|
- / megainformatic cms express files -
|
|
|
|
|
|
Flash, Flash - .
|
|
|
|
|
|
(multi lang), , . - (megainformatic cms social), megainformatic cms groupon, keywords gen + , .
megainformatic.ru/webjob/ -
- |
|
|
megainformatic.ru/webjob/
megainformatic.ru/webjob/ -
- |
|
|
|
|
|
,
megainformatic cms admin -
|
|
|
|
|
|
350 . |
5800 . |
3000 . |
500 . |
|
|
|
|
|
|
|
|
|
|
|
|
megainformatic cms free - Photoshop
,
Adobe Photoshop. ,
- GIMP, Corel Photo Paint .
|
|
|
|
|
|
2d 3d, , !
. ,
,
!!! ( , ! ). |
|
|
|
|
|
|
|
|
|
|
|
,
: -
350 . |
510 . |
fle game engine |
|
- , ,
, .
- - :
- |
|
|
|
|
|
|
|
|
|
|
|
, 3ds max, photoshop, c++,
directx, delphi php.
,
.
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Photoshop free,
delphi directx - , !,
mp3 - ,
megainformatic cms express -
php + my sql. |
|
|
|
|
|
|
|
|
|
|
|
,
, delphi directx 8.1 (
3d ), 3d studio max, -
Fruity Loops Studio |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|