PDA

Просмотр полной версии : [Delphi]Приглашение в группы вконтакте


f0rward
17.01.2010, 22:35
Вопрос по приглагению в группы. Авторизация проходит успешно кукис получаю.
Отсылаю вот это:
POST /friends_ajax.php HTTP/1.1
Accept: */*
Accept-Language: ru
Referer: http://vkontakte.ru/club1363
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14,52; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: vkontakte.ru
Content-Length: 20
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: remixchk=5; remixsid=XXX

from=groups&gid=1363
Откуда получаю список друзей с их ID.
А вот дальше сложнее:POST /groups_ajax.php?act=a_invite_friends HTTP/1.1
Accept: */*
Accept-Language: ru
Referer: http://vkontakte.ru/club1363
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14,52; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: vkontakte.ru
Content-Length: 60
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: remixchk=5; remixsid=XXX

friends=55482684%2C18858581&gid=1363&hash=ff4f53ae9498bf9a66
Переменную hash я ни на странице группы, ни в ответе первого запроса не обнаружил.

Помогите plz.

AquaKlaster
17.01.2010, 22:43
хеш есть на странице группы, но его нужно декодировать

Ratt1e
27.02.2010, 19:48
хэш генерируется ява-скриптом на странице, пытаться расшифровать бессмысленно, т.к. скрипт постоянно меняется, проще выполнять этот js и подставлять полученный хэш

Spy2ex
27.02.2010, 21:05
Недавно работал.
С++ Builder

String decodeHash (String sHash)
{
String sFirst = sHash.SubString(5,13);
String sNextPart = sHash.SubString(21,5);

String sSecond;
int iLength = sFirst.Length();
int i;

for (int i=0; i < sFirst.Length(); i++)
{
sSecond += sFirst[iLength--];
}

String sThird;
int iLength2 = sNextPart.Length();
int a;

for (a = 0; a < sNextPart.Length(); a++)
{
sThird += sNextPart[iLength2--];
}

String sDecodehash;
sDecodehash = sSecond+sThird;

return sDecodehash;
}

RedFern.89
27.02.2010, 22:20
вот на на Delphi писал когда то)))


function DecChas(chas: string): string;
var
Decchas : string;
str : string;
I : Integer;
Len : integer;
begin

str := Copy(chas, 6, 12);
Len := Length(str);

For I := 0 To Length(str) -1 do
begin
Decchas := Decchas + str[len];
Inc(len, -1);
end;

str := Copy(chas, 21, Length(chas) -5);
str := str + Copy(chas, 5, 1);

Len := Length(str);

For I := 0 To Length(str) -1 do
begin
Decchas := Decchas + str[len];
Inc(len, -1);
end;

Result := Decchas;
end;