Siema!
Jako iż komponent THGG nie chce mi działać poprawnie, postanowiłem samemu napisać taki no i oczywiście nie obyło się bez problemów.
Mam taki rekord:
TLogin = record
Header: THeader;
Number: Integer;
Lang: array[0..1] of Char;
HashType: Char;
Hash: integer;
Hash2: array[0..59] of Char;
Status: integer;
Flags: integer;
Features: integer;
LocalIP: integer;
LocalPort: SmallInt;
ExternalIp: integer;
ExternalPort: SmallInt;
ImageSize: Char;
Unknow1: Char;
VersionLen: integer;
Version: array[0..34] of Char;
DescSize: integer;
end;
Którego wypełniam tak:
Login.Header.PacketType := $31;
Login.Number := uin;
Login.Lang := 'pl';
Login.HashType := #1;
//Login.Hash := ObliczHash(password + #0, seed);
Login.Hash := $ABCDEF12;
FillChar(Login.Hash2, SizeOf(Login.Hash2), #0);
Login.Status := $2;
Login.Flags := 0;
Login.Features := $7;
Login.LocalIP := 0;
Login.LocalPort := 0;
Login.ExternalIp := 0;
Login.ExternalPort := 0;
Login.ImageSize := #0;
Login.Unknow1 := #64;
Login.VersionLen := $23;
Login.Version := 'Gadu-Gadu Client build 10.0.0.10450';
Login.DescSize := $0;
Login.Header.PacketLength := 139;
Pakiet wyjściowy wygląda tak:
0000 31 00 00 00 8b 00 00 00 5a d8 13 03 70 6c 01 00 1.......Z...pl..
0010 12 ef cd ab 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050 02 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 ................
0060 00 00 18 00 00 00 00 00 00 00 00 64 23 00 00 00 ...........d#...
0070 47 61 64 75 2d 47 61 64 75 20 43 6c 69 65 6e 74 Gadu-Gadu Client
0080 20 62 75 69 6c 64 20 31 30 2e 30 2e 30 2e 31 30 build 10.0.0.10
0090 34 35 30 00 00 00 00 00 450.....
A tu poodzielałem wartości i zaznaczyłem znakiem zapytania bajty które albo mają dziwaczną wartość albo nie powinno ich tam być:
0000 31 00 00 00| 8b 00 00 00| 5a d8 13 03| 70 6c| 01| ?00 1.......Z...pl..
0010 |12 ef cd ab| 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ................
0050 02 00 00 00| 00 00 00 00| 07 00 00 00| 00 00 00 00| ................
0060 00 00| ?18 00 00 00| 00 00| ?00 ?00| 00| 64| 23 00 00 00| ...........d#...
0070 47 61 64 75 2d 47 61 64 75 20 43 6c 69 65 6e 74 Gadu-Gadu Client
0080 20 62 75 69 6c 64 20 31 30 2e 30 2e 30 2e 31 30 build 10.0.0.10
0090 34 35 30| ?00| 00 00 00 00 450.....
Nie mam pojęcia skąd się biorą te dziwne bajty. Pomoże ktoś?