Witam, odpewnego czasu mecze sie z uzupelnieniem struktury gadu gadu p.7

//.. biblioteki etc

#pragma pack(push, 1)

struct gg_header{
	int type;
	int length;
}typedef GGP_HEADER;


struct gg_welcome{
	int seed;
}typedef GGP_WELCOME;

#define GG_WELCOME 0x0001


struct gg_login70{
        int uin;              /* numer Gadu-Gadu */
        char hash_type;       /* rodzaj funkcji skrótu hasła */
        char hash[64];        /* skrót hasła dopełniony \0 */
        int status;           /* początkowy status połączenia */
        int version;		  /* moja wersja klienta       */
        char unkown1;		  /* 0x00*/
		int local_ip;         /* lokalny adres połączeń bezpośrednich (nieużywany) */
		short local_port;     /* lokalny port połączeń bezpośrednich (nieużywany) */
        int external_ip;      /* zewnętrzny adres (nieużywany) */
        short external_port;  /* zewnętrzny port (nieużywany) */
        char image_size;      /* maksymalny rozmiar grafiki w KB */
        char unknown2;        /* 0x64 */
        char description[20];   /* opis (nie musi wystąpić, bez \0) */
		int time;
}typedef GGP_LOGIN70;

#define GG_LOGIN70 0x0019

#define GG_LOGIN_HASH_GG32 0x01
#define GG_LOGIN_HASH_SHA1 0x02
#define GG_LOGIN_OK 0x0003
#define GG_LOGIN_FAILED 0x0009

int gg_login_hash(unsigned char *password, unsigned int seed)
{
	unsigned int x, y, z;

	y = seed;

	for(x = 0; *password; password++)
	{
		x = (x & 0xffffff00) | *password;
		y ^= x;
		y += x;
		x <<= 8;
		y ^= x;
		x <<= 8;
		y -=x;
		x <<= 8;
		y ^= x;

		z = y & 0x1f;
		y = (y << z) | (y >> (32 - z));
	}

return y;
}
#pragma pack(pop)



int main(void)
{

 // tworzenie gniazda, polaczylo sie
				
				GGP_LOGIN70 gg_login;
				GGP_HEADER gg_client;

				recv(sock, (char *)&gg_client,sizeof(gg_header),0);

			   GGP_WELCOME welcome;

			   if(gg_client.type==GG_WELCOME)
			   {
			      recv(sock,(char *)&welcome,gg_client.length,0);
			   }

			   int num = 7841361;
			   char haslo[] = "hack12";
			   int hasz = gg_login_hash((unsigned char*)haslo,(unsigned int)welcome.seed);
			   
			   gg_login.uin = num;
			   gg_login.hash_type = GG_LOGIN_HASH_GG32;
			      //gg_login.hash = gg_login_hash((unsigned char*)haslo,(unsigned int)welcome.seed);
			   memset(gg_login.hash, 0, 64);
			   memcpy((void*)gg_login.hash,(void *)&hasz,sizeof(int));
			   gg_login.status = 0x0003;
			   gg_login.version = 0x2a;
			   gg_login.unkown1 = 0x00;
			   gg_login.local_ip = 0;
			   gg_login.local_port = 0;
			   gg_login.external_ip = 0;
			   gg_login.external_port = 0;
			   gg_login.image_size = 0x01;
			   gg_login.unknown2 = 0xbe;


			   gg_client.type=GG_LOGIN70;  // logowanie
			   gg_client.length=sizeof(GGP_LOGIN70); // dlugosc bloku logujacego

			   send(sock,(char*)&gg_client,sizeof(gg_client),0);
			   send(sock,(char*)&gg_login,sizeof(gg_login),0);
int f;
			 f =  recv(sock,(char *)&gg_client,sizeof(gg_header),0);
			if(f == 8)
			{
					if(gg_client.type==GG_LOGIN_OK)
						   cout << "ok";
					   
						if(gg_client.type==GG_LOGIN_FAILED)
							cout << "zle";
			}