📄 icqworks.pas
字号:
procedure CreateCLI_UPDATEGROUP(Pkt: PRawPkt; Name: String; Tag: Word; IDs: TStringList; var Seq: Word);
procedure CreateCLI_UPDATEBUDDY(Pkt: PRawPkt; UIN, Name, SMSNumber: String; Tag, ID: Word; BuddyType: Word; NotAuthorized: Boolean; var Seq: Word);
procedure CreateCLI_ADDBUDDY(Pkt: PRawPkt; UIN, Name, SMSNumber: String; Tag, ID: Word; BuddyType: Word; NotAuthorized: Boolean; var Seq: Word);
procedure CreateCLI_DELETEBUDDY(Pkt: PRawPkt; UIN, Name, SMSNumber: String; Tag, ID: Word; BuddyType: Word; NotAuthorized, IsGroup: Boolean; var Seq: Word);
{Misc functions}
function SnacToStr(Family, SubType: Word): String;
function SrvMetaToStr(V1, V2: Word): String;
function PeerCmdToStr(Cmd: Byte): String;
function DumpPacket(Buffer: Pointer; BufLen: Word): String;
function Rtf2Txt(Value: String): String;
function StatusToStr(Value: LongWord): String;
function CountryToStr(Value: Word): String;
function LanguageToStr(Value: Byte): String;
function OccupationToStr(Value: Word): String;
function InterestToStr(Value: Word): String;
function PastToStr(Value: Word): String;
function AffiliationToStr(Value: Word): String;
function LoadPacketRaw(Pkt: PRawPkt; const FName: String): Boolean;
function LoadPacket(Pkt: PRawPkt; const FName: String; var Flap: TFlapHdr; var Snac: TSnacHdr): Boolean;
function FileExists(const FileName: String): Boolean;
function FileSize(const FName: String): LongWord;
procedure LogText(const FName, Text: String);
procedure ShowMessage(const Value: String); overload;
procedure ShowMessage(Value: LongInt); overload;
function ExtractName(const Value: String): String;
function ExtractValue(const Value: String): String;
function UTF8ToStr(Value: String): String;
function UTF8ToStrSmart(Value: String): String;
function GetXMLEntry(const Tag, Msg: String): String;
{SMS functions}
function StrToUTF8(Value: String): String;
function STime: String;
function GetSMSTime: String;
function DecryptPak(Pak: Pointer; Size: LongWord; Ver: Byte): Boolean;
procedure EncryptPak(Pak: Pointer; Size: LongWord; Ver: Byte);
{Peer packet functions}
procedure CreatePEER_INIT(Pkt: PRawPkt; Cookie, DestUIN, SrcUIN, SrcPort, SrcIPExt, SrcIPInt: LongWord; ProxyType: TProxyType);
procedure CreatePEER_INIT2(Pkt: PRawPkt; Ack: Boolean);
procedure CreatePEER_ACK(Pkt: PRawPkt);
function CreatePEER_MSG(Pkt: PRawPkt; const Msg: String; RTFFormat: Boolean; var Seq: Word): Word;
procedure CreatePEER_MSGACK(Pkt: PRawPkt; Seq: Word);
function CreatePEER_MSG_FILE(Pkt: PRawPkt; FileSendRec:TSendFileRec; var Seq: Word): Word;
procedure CreatePEER_AUTOMSG_ACK(Pkt: PRawPkt; Answer: String; Status, Seq: Word);
function CreatePEER_CONTACTS(Pkt: PRawPkt; Contacts: TStringList; var Seq: Word): Word;
function CreatePEER_CONTACTREQ(Pkt: PRawPkt; const Reason: String; var Seq: Word): Word;
function CreatePEER_FILEINIT(Pkt: PRawPkt; Response: Boolean; FileDescription, FileName: String; Port: Word; FileLength: LongWord; var Seq: Word; Reason: String; Accept: Boolean): Word;
procedure CreatePEER_FILEINITACK(Pkt: PRawPkt; Speed: LongWord; Nick: String);
procedure CreatePEER_FILE_INIT(Pkt: PRawPkt; Count, Bytes, Speed: LongWord; Nick:String);
procedure CreatePEER_FILE_INIT2(Pkt: PRawPkt; Count, Bytes, Speed: LongWord);
procedure CreatePEER_FILE_START(Pkt: PRawPkt; FileName:String; FileSize, Speed:LongWord);
Procedure CreatePEER_FILE_DATA(Pkt: PRawPkt; Buffer:Pointer; BufLen:Integer);
function EncodeBase64(Value: String): String;
function DecodeBase64(Value: String): String;
function CreateHTTP_Header(const Method, URL, Host: String; DataLen: LongWord; Auth: Boolean; User, Password: String): String;
procedure CreateHTTP_DATA_HDR(Pkt: PRawPkt; PType: Word; DataLen: LongWord);
procedure CreateHTTP_DATA(Pkt: PRawPkt; PType: Word; Data: Pointer; DataLen: LongWord);
function CreateHTTP_INIT(Auth: Boolean; User, Password: String): String;
function CreateHTTP_RECV(Host, SID: String; Auth: Boolean; User, Password: String): String;
procedure CreateHTTP_LOGIN(Pkt: PRawPkt; Host: String; Port: Word);
function Decrypt99bPassword(UIN, CryptIV: LongWord; const HexPass: String): String;
function DecryptMirandaPassword(const Value: String): String;
//Text constants
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//------------------------------------------------------------------------------------------------------------\
const
Countries: array[0..242] of record Ident: Word; Value: String end =
((Ident: 1; Value: 'USA'),
(Ident: 7; Value: 'Russia'),
(Ident: 20; Value: 'Egypt'),
(Ident: 27; Value: 'South Africa'),
(Ident: 30; Value: 'Greece'),
(Ident: 31; Value: 'Netherlands'),
(Ident: 32; Value: 'Belgium'),
(Ident: 33; Value: 'France'),
(Ident: 34; Value: 'Spain'),
(Ident: 36; Value: 'Hungary'),
(Ident: 39; Value: 'Italy'),
(Ident: 40; Value: 'Romania'),
(Ident: 41; Value: 'Switzerland'),
(Ident: 42; Value: 'Czech Republic'),
(Ident: 43; Value: 'Austria'),
(Ident: 44; Value: 'United Kingdom'),
(Ident: 45; Value: 'Denmark'),
(Ident: 46; Value: 'Sweden'),
(Ident: 47; Value: 'Norway'),
(Ident: 48; Value: 'Poland'),
(Ident: 49; Value: 'Germany'),
(Ident: 51; Value: 'Peru'),
(Ident: 52; Value: 'Mexico'),
(Ident: 53; Value: 'Cuba'),
(Ident: 54; Value: 'Argentina'),
(Ident: 55; Value: 'Brazil'),
(Ident: 56; Value: 'Chile'),
(Ident: 57; Value: 'Colombia'),
(Ident: 58; Value: 'Venezuela'),
(Ident: 60; Value: 'Malaysia'),
(Ident: 61; Value: 'Australia'),
(Ident: 62; Value: 'Indonesia'),
(Ident: 63; Value: 'Philippines'),
(Ident: 64; Value: 'New Zealand'),
(Ident: 65; Value: 'Singapore'),
(Ident: 66; Value: 'Thailand'),
(Ident: 81; Value: 'Japan'),
(Ident: 82; Value: 'Korea (Republic of)'),
(Ident: 84; Value: 'Vietnam'),
(Ident: 86; Value: 'China'),
(Ident: 90; Value: 'Turkey'),
(Ident: 91; Value: 'India'),
(Ident: 92; Value: 'Pakistan'),
(Ident: 93; Value: 'Afghanistan'),
(Ident: 94; Value: 'Sri Lanka'),
(Ident: 95; Value: 'Myanmar'),
(Ident: 98; Value: 'Iran'),
(Ident: 101; Value: 'Anguilla'),
(Ident: 102; Value: 'Antigua'),
(Ident: 103; Value: 'Bahamas'),
(Ident: 104; Value: 'Barbados'),
(Ident: 105; Value: 'Bermuda'),
(Ident: 106; Value: 'British Virgin Islands'),
(Ident: 107; Value: 'Canada'),
(Ident: 108; Value: 'Cayman Islands'),
(Ident: 109; Value: 'Dominica'),
(Ident: 110; Value: 'Dominican Republic'),
(Ident: 111; Value: 'Grenada'),
(Ident: 112; Value: 'Jamaica'),
(Ident: 113; Value: 'Montserrat'),
(Ident: 114; Value: 'Nevis'),
(Ident: 115; Value: 'St. Kitts'),
(Ident: 116; Value: 'St. Vincent and the Grenadines'),
(Ident: 117; Value: 'Trinidad and Tobago'),
(Ident: 118; Value: 'Turks and Caicos Islands'),
(Ident: 120; Value: 'Barbuda'),
(Ident: 121; Value: 'Puerto Rico'),
(Ident: 122; Value: 'Saint Lucia'),
(Ident: 123; Value: 'United States Virgin Islands'),
(Ident: 212; Value: 'Morocco'),
(Ident: 213; Value: 'Algeria'),
(Ident: 216; Value: 'Tunisia'),
(Ident: 218; Value: 'Libya'),
(Ident: 220; Value: 'Gambia'),
(Ident: 221; Value: 'Senegal Republic'),
(Ident: 222; Value: 'Mauritania'),
(Ident: 223; Value: 'Mali'),
(Ident: 224; Value: 'Guinea'),
(Ident: 225; Value: 'Ivory Coast'),
(Ident: 226; Value: 'Burkina Faso'),
(Ident: 227; Value: 'Niger'),
(Ident: 228; Value: 'Togo'),
(Ident: 229; Value: 'Benin'),
(Ident: 230; Value: 'Mauritius'),
(Ident: 231; Value: 'Liberia'),
(Ident: 232; Value: 'Sierra Leone'),
(Ident: 233; Value: 'Ghana'),
(Ident: 234; Value: 'Nigeria'),
(Ident: 235; Value: 'Chad'),
(Ident: 236; Value: 'Central African Republic'),
(Ident: 237; Value: 'Cameroon'),
(Ident: 238; Value: 'Cape Verde Islands'),
(Ident: 239; Value: 'Sao Tome and Principe'),
(Ident: 240; Value: 'Equatorial Guinea'),
(Ident: 241; Value: 'Gabon'),
(Ident: 242; Value: 'Congo'),
(Ident: 243; Value: 'Dem. Rep. of the Congo'),
(Ident: 244; Value: 'Angola'),
(Ident: 245; Value: 'Guinea-Bissau'),
(Ident: 246; Value: 'Diego Garcia'),
(Ident: 247; Value: 'Ascension Island'),
(Ident: 248; Value: 'Seychelle Islands'),
(Ident: 249; Value: 'Sudan'),
(Ident: 250; Value: 'Rwanda'),
(Ident: 251; Value: 'Ethiopia'),
(Ident: 252; Value: 'Somalia'),
(Ident: 253; Value: 'Djibouti'),
(Ident: 254; Value: 'Kenya'),
(Ident: 255; Value: 'Tanzania'),
(Ident: 256; Value: 'Uganda'),
(Ident: 257; Value: 'Burundi'),
(Ident: 258; Value: 'Mozambique'),
(Ident: 260; Value: 'Zambia'),
(Ident: 261; Value: 'Madagascar'),
(Ident: 262; Value: 'Reunion Island'),
(Ident: 263; Value: 'Zimbabwe'),
(Ident: 264; Value: 'Namibia'),
(Ident: 265; Value: 'Malawi'),
(Ident: 266; Value: 'Lesotho'),
(Ident: 267; Value: 'Botswana'),
(Ident: 268; Value: 'Swaziland'),
(Ident: 269; Value: 'Mayotte Island'),
(Ident: 290; Value: 'St. Helena'),
(Ident: 291; Value: 'Eritrea'),
(Ident: 297; Value: 'Aruba'),
(Ident: 298; Value: 'Faeroe Islands'),
(Ident: 299; Value: 'Greenland'),
(Ident: 350; Value: 'Gibraltar'),
(Ident: 351; Value: 'Portugal'),
(Ident: 352; Value: 'Luxembourg'),
(Ident: 353; Value: 'Ireland'),
(Ident: 354; Value: 'Iceland'),
(Ident: 355; Value: 'Albania'),
(Ident: 356; Value: 'Malta'),
(Ident: 357; Value: 'Cyprus'),
(Ident: 358; Value: 'Finland'),
(Ident: 359; Value: 'Bulgaria'),
(Ident: 370; Value: 'Lithuania'),
(Ident: 371; Value: 'Latvia'),
(Ident: 372; Value: 'Estonia'),
(Ident: 373; Value: 'Moldova'),
(Ident: 374; Value: 'Armenia'),
(Ident: 375; Value: 'Belarus'),
(Ident: 376; Value: 'Andorra'),
(Ident: 377; Value: 'Monaco'),
(Ident: 378; Value: 'San Marino'),
(Ident: 379; Value: 'Vatican City'),
(Ident: 380; Value: 'Ukraine'),
(Ident: 381; Value: 'Yugoslavia'),
(Ident: 385; Value: 'Croatia'),
(Ident: 386; Value: 'Slovenia'),
(Ident: 387; Value: 'Bosnia and Herzegovina'),
(Ident: 389; Value: 'F.Y.R.O.M. (Former Yugoslav Republic of Macedonia)'),
(Ident: 500; Value: 'Falkland Islands'),
(Ident: 501; Value: 'Belize'),
(Ident: 502; Value: 'Guatemala'),
(Ident: 503; Value: 'El Salvador'),
(Ident: 504; Value: 'Honduras'),
(Ident: 505; Value: 'Nicaragua'),
(Ident: 506; Value: 'Costa Rica'),
(Ident: 507; Value: 'Panama'),
(Ident: 508; Value: 'St. Pierre and Miquelon'),
(Ident: 509; Value: 'Haiti'),
(Ident: 590; Value: 'Guadeloupe'),
(Ident: 591; Value: 'Bolivia'),
(Ident: 592; Value: 'Guyana'),
(Ident: 593; Value: 'Ecuador'),
(Ident: 594; Value: 'French Guiana'),
(Ident: 595; Value: 'Paraguay'),
(Ident: 596; Value: 'Martinique'),
(Ident: 597; Value: 'Suriname'),
(Ident: 598; Value: 'Uruguay'),
(Ident: 599; Value: 'Netherlands Antilles'),
(Ident: 670; Value: 'Saipan Island'),
(Ident: 671; Value: 'Guam'),
(Ident: 672; Value: 'Christmas Island'),
(Ident: 673; Value: 'Brunei'),
(Ident: 674; Value: 'Nauru'),
(Ident: 675; Value: 'Papua New Guinea'),
(Ident: 676; Value: 'Tonga'),
(Ident: 677; Value: 'Solomon Islands'),
(Ident: 678; Value: 'Vanuatu'),
(Ident: 679; Value: 'Fiji Islands'),
(Ident: 680; Value: 'Palau'),
(Ident: 681; Value: 'Wallis and Futuna Islands'),
(Ident: 682; Value: 'Cook Islands'),
(Ident: 683; Value: 'Niue'),
(Ident: 684; Value: 'American Samoa'),
(Ident: 685; Value: 'Western Samoa'),
(Ident: 686; Value: 'Kiribati Republic'),
(Ident: 687; Value: 'New Caledonia'),
(Ident: 688; Value: 'Tuvalu'),
(Ident: 689; Value: 'French Polynesia'),
(Ident: 690; Value: 'Tokelau'),
(Ident: 691; Value: 'Micronesia, Federated States of'),
(Ident: 692; Value: 'Marshall Islands'),
(Ident: 705; Value: 'Kazakhstan'),
(Ident: 706; Value: 'Kyrgyz Republic'),
(Ident: 708; Value: 'Tajikistan'),
(Ident: 709; Value: 'Turkmenistan'),
(Ident: 711; Value: 'Uzbekistan'),
(Ident: 800; Value: 'International Freephone Service'),
(Ident: 850; Value: 'Korea (North)'),
(Ident: 852; Value: 'Hong Kong'),
(Ident: 853; Value: 'Macau'),
(Ident: 855; Value: 'Cambodia'),
(Ident: 856; Value: 'Laos'),
(Ident: 870; Value: 'INMARSAT'),
(Ident: 871; Value: 'INMARSAT (Atlantic-East)'),
(Ident: 872; Value: 'INMARSAT (Pacific)'),
(Ident: 873; Value: 'INMARSAT (Indian)'),
(Ident: 874; Value: 'INMARSAT (Atlantic-West)'),
(Ident: 880; Value: 'Bangladesh'),
(Ident: 886; Value: 'Taiwan, Republic of China'),
(Ident: 960; Value: 'Maldives'),
(Ident: 961; Value: 'Lebanon'),
(Ident: 962; Value: 'Jordan'),
(Ident: 963; Value: 'Syria'),
(Ident: 964; Value: 'Iraq'),
(Ident: 965; Value: 'Kuwait'),
(Ident: 966; Value: 'Saudi Arabia'),
(Ident: 967; Value: 'Yemen'),
(Ident: 968; Value: 'Oman'),
(Ident: 971; Value: 'United Arab Emirates'),
(Ident: 972; Value: 'Israel'),
(Ident: 973; Value: 'Bahrain'),
(Ident: 974; Value: 'Qatar'),
(Ident: 975; Value: 'Bhutan'),
(Ident: 976; Value: 'Mongolia'),
(Ident: 977; Value: 'Nepal'),
(Ident: 994; Value: 'Azerbaijan'),
(Ident: 995; Value: 'Georgia'),
(Ident: 2691; Value: 'Comoros'),
(Ident: 4101; Value: 'Liechtenstein'),
(Ident: 4201; Value: 'Slovak Republic'),
(Ident: 5399; Value: 'Guantanamo Bay'),
(Ident: 5901; Value: 'French Antilles'),
(Ident: 6101; Value: 'Cocos-Keeling Islands'),
(Ident: 6701; Value: 'Rota Island'),
(Ident: 6702; Value: 'Tinian Island'),
(Ident: 6721; Value: 'Australian Antarctic Territory'),
(Ident: 6722; Value: 'Norfolk Island'),
(Ident: 9999; Value: 'Unknown'));
Languages: array[0..72] of record Ident: Byte; Value: String end =
((Ident: 1; Value: 'Arabic'),
(Ident: 2; Value: 'Bhojpuri'),
(Ident: 3; Value: 'Bulgarian'),
(Ident: 4; Value: 'Burmese'),
(Ident: 5; Value: 'Cantonese'),
(Ident: 6; Value: 'Catalan'),
(Ident: 7; Value: 'Chinese'),
(Ident: 8; Value: 'Croatian'),
(Ident: 9; Value: 'Czech'),
(Ident: 10; Value: 'Danish'),
(Ident: 11; Value: 'Dutch'),
(Ident: 12; Value: 'English'),
(Ident: 13; Value: 'Esperanto'),
(Ident: 14; Value: 'Estonian'),
(Ident: 15; Value: 'Farci'),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -