/programs/network/icq/trunk/CMDIPC.INC |
---|
0,0 → 1,221 |
include "MACROS.INC" |
initipc: |
mov eax,9 |
mov ebx,prc |
mov ecx,-1 |
int 0x40 |
mov ecx,eax |
loop1: |
push ecx |
mov eax,9 |
mov ebx,prc |
int 0x40 |
cmp word [prc+10],'CM' |
jne no_cmd |
cmp byte [prc+12],'D' |
jne no_cmd |
mov ebx,[prc+30] |
mov dword [cmdpid],ebx |
mov dword [cmdnumb],ecx |
no_cmd: |
pop ecx |
loop loop1 |
cmp dword [cmdpid],0 |
jne no_exit |
jmp exit |
no_exit: |
mov eax,60 |
mov ebx,2 |
mov ecx,dword [cmdpid] |
mov edx,printf |
mov esi,4 |
int 0x40 |
call initcmd |
waitcmdinit: |
mov eax,40 |
mov ebx,01000000b |
int 0x40 |
mov eax,23 |
mov ebx,100 |
int 0x40 |
cmp eax,7 |
je cmd_ok |
jmp exit |
cmd_ok: |
cmp byte [ipcb+16],'.' |
jne exit |
mov eax,18 |
mov ebx,3 |
mov ecx,dword [cmdnumb] |
int 0x40 |
ret |
pause1: |
mov eax,5 |
mov ebx,1 |
int 0x40 |
ret |
exit: |
mov eax,-1 |
int 0x40 |
cls: |
mov eax,60 |
mov ebx,2 |
mov ecx,dword [cmdpid] |
mov edx,ipccls |
mov esi,4 |
int 0x40 |
call pause1 |
ret |
print: |
mov ecx,84 |
loopprt: |
mov edi,stripc |
add edi,ecx |
mov esi,fill_symbol |
movsb |
loop loopprt |
cld |
mov ecx,4 |
mov edi,stripc |
mov esi,printf |
rep movsb |
cld |
mov edx,79 |
sub edx,eax |
mov ecx,79 |
sub ecx,edx |
mov edi,stripc+4 |
mov esi,ebx |
rep movsb |
mov eax,60 |
mov ebx,2 |
mov ecx,dword [cmdpid] |
mov edx,stripc |
mov esi,84 |
int 0x40 |
call pause1 |
ret |
eol: |
mov eax,60 |
mov ebx,2 |
mov ecx,dword [cmdpid] |
mov edx,ipceol |
mov esi,4 |
int 0x40 |
call pause1 |
ret |
initcmd: |
mov eax,60 |
mov ebx,2 |
mov ecx,dword [cmdpid] |
mov edx,ipckey |
mov esi,4 |
int 0x40 |
mov eax,60 |
mov ebx,1 |
mov ecx,ipcb |
mov edx,28 |
int 0x40 |
cld |
mov ecx,28 |
mov edi,ipcb |
mov esi,ipcc |
rep movsb |
ret |
getkey: |
call initcmd |
waitagain: |
mov eax,40 |
mov ebx,01000000b |
int 0x40 |
mov eax,10 |
int 0x40 |
cmp eax,7 |
jne waitagain |
mov edi,key |
mov esi,ipcb+16 |
movsb |
ret |
endipc: |
mov eax,60 |
mov ebx,2 |
mov ecx,dword [cmdpid] |
mov edx,ipcend |
mov esi,4 |
int 0x40 |
jmp exit |
cmdpid dd 0 |
cmdnumb dd 0 |
printf db '~ppp' |
ipceol db '~lll' |
ipcend db '~eee' |
ipccls db '~ccc' |
ipckey db '~kkk' |
key db 0 |
ipcb: |
db 0 |
db 0,0,0 |
dd 8 |
times 20 db 0 |
ipcc: |
db 0 |
db 0,0,0 |
dd 8 |
times 20 db 0 |
stripc: times 84 db 0 |
fill_symbol db 0 |
prc: times 52 db 0 |
/programs/network/icq/trunk/README.TXT |
---|
5,7 → 5,7 |
è âûâîäÿòñÿ îòëàäî÷íûå ñîîáùåíèÿ |
Ïîääåðæèâàåòñÿ: |
* Ëîêàëüíûé êîíòàêò-ëèñò, ïîêà æåñòêî çàøèò â êîä |
* Ñåðâåðíûé ÊË |
* ïåðåäà÷à/ïðèåì ñîîáùåíèé plain-text |
* Ïåðåêîäèðîâêà CP866<->CP1251 |
* Ïðèåì offline ñîîáùåíèé |
13,7 → 13,7 |
/UIN Ñîîáùåíèå |
Íåäîðàáîòêè: Ìíîãî :-) |
* Îòêëþ÷åíî çàêðûòèå ñîêåòîâ - ìîÿ VM (Parallels) íàãëóõî âèñíåò, ïðè |
* Îòêëþ÷åíî çàêðûòèå ñîêåòîâ - ÿäðî âèñíåò, ïðè |
ïîïûòêå çàêðûòü ñîêåò |
* Âñå ñîîáùåíèÿ îò ðàçíûõ þçåðîâ â îäíîì ïîëå âûâîäà |
24,37 → 24,14 |
* editbox èíîãäà âåäåò ñåáÿ ñòðàííî :-) |
* .......... |
Äëÿ èçìåíåíèÿ óèíà/ïàðîëÿ íàäî ïåðåêîìïèëèðîâàòü ïðîãðàììó |
- ôàéë ki.asm, ïåðåìåííûå UIN è PASS |
Äëÿ âíåñåíèÿ þçåðîâ â ÊË - ôàéë comp.inc, ôóíêöèÿ loaduin, |
ïåðåìííûå U1, U2, U3 .... |
(Ñêîðåå âñåãî, ïîòîì áóäåò ïåðåïèñàíî äëÿ çàãðóçêè èç ôàéëà) |
Ò.ê. ÿ òåñòèðîâàë ïðîãðàììó òîëüêî ïîä VM, âîçìîæíî, ÷òî íè÷åãî è íå çàðàáîòàåò |
Òåñòèðîâàíèå ïðîâîäèëîñü ñ ëîêàëüíûì ñåðâåðîì SIQ ïîä Windows, VM Parallels |
è ñ îñíîâíûì ñåðâåðîì àñè ïîä Menuet, VM VMware (ò.ê. â parallels íåò ïîääåðæêè NAT, |
à Kolibri íå ïîääåðæèâàåò ñåòåâóþ êàðòó â VMware, ìîæåò, ÿ è îøèáàþñü :-)) |
Âûðàæàþ áëàãîäàðíîñòü âñåì ðàçðàáîò÷èêàì OS Kolibri |
çà ïðåêðàñíûå èíñòðóìåíòû è äîêóìåíòàöèþ, áåç êîòîðîé ÿ áû |
íè÷åãî íå íàïèñàë :-) |
íè÷åãî íå íàïèñàë :-), à òàêæå ïðîåêòó iserverd.khstu.ru, |
ñåðâåð è îïèñàíèÿ ïðîòîêîëîâ êîòîðîãî ÿ èñïîëüçîâàë. |
åñëè ó âàñ åñòü êàêèå-íèáóäü ïðåäëîæåíèÿ, ïðèñûëàéòå íà lv4evil@yandex.ru |
Âñå ïîæåëàíèÿ î äàëüíåéøåé ñóäüáå ïðîåêòà (çàêðûòü, íàïðèìåð :-))øëèòå íà lv4evil@ya.ru |
;Òîëüêî çà êðèâîé êîä è óæàñíûé àíãëèéñêèé íîãàìè íå áåéòå :-) |
/programs/network/icq/trunk/SSI_INFO.txt |
---|
0,0 → 1,56 |
00 00 08 00 07 36 32 31 38 38 39 37 0A 1E 43 18 .....6218897..C. |
^^ byte Version number of SSI protocol (currently 0x00) |
^^ ^^ word Number of items in this snac |
^^ ^^ word Length of the item name |
^^ ^^ ^^ ^^ ^^ ^^ ^^ string Item name string |
^^ ^^ word Group ID# |
^^ ^^ word Item ID# |
00 00 00 0A 01 31 00 06 46 75 6E 42 6F 6F 00 09 .....1..FunBoo.. |
^^ ^^ word Type of item flag (see list bellow) |
^^ ^^ word Length of the additional data |
^^ ^^ word TLV.Type (TLV #1) |
^^ ^^ word TLV.Length |
^^ ^^ ^^ ^^ ^^ ^^ TLV.Value |
31 37 36 33 33 33 30 37 38 17 B7 2A 18 00 00 00 176333078..*.... |
09 01 31 00 05 45 2E 53 2E 56 00 07 36 32 31 38 ..1..E.S.V..6218 |
38 39 38 23 8C 12 A1 00 00 00 09 01 31 00 05 74 898#........1..t |
68 6F 72 64 00 07 46 72 69 65 6E 64 73 7F ED 00 hord..Friends... |
00 00 01 00 00 00 0A 43 6F 2D 57 6F 72 6B 65 72 .......Co-Worker |
73 55 7F 00 00 00 01 00 00 00 07 36 32 31 38 38 sU.........62188 |
39 35 23 8C 08 80 00 00 00 0D 01 31 00 09 52 65 95#........1..Re |
67 72 65 73 73 6F 72 00 07 36 32 35 31 37 32 33 gressor..6251723 |
23 8C 05 83 00 00 00 0D 01 31 00 05 47 68 6F 73 #........1..Ghos |
74 00 66 00 00 00 07 36 32 31 33 39 34 39 23 8C t.f....6213949#. |
26 9A 00 00 00 0D 01 31 00 05 6D 69 63 6B 79 00 &......1..micky. |
66 00 00 3B B7 4B 7D |
0x0000 Buddy record (name: uin for ICQ and screenname for AIM) |
0x0001 Group record |
0x0002 Permit record ("Allow" list in AIM, and "Visible" list in ICQ) |
0x0003 Deny record ("Block" list in AIM, and "Invisible" list in ICQ) |
0x0004 Permit/deny settings or/and bitmask of the AIM classes |
0x0005 Presence info (if others can see your idle status, etc) |
0x0009 Unknown. ICQ2k shortcut bar items ? |
0x000E Ignore list record. |
0x000F Last update date (name: "LastUpdateDate"). |
0x0010 Non-ICQ contact (to send SMS). Name: 1#EXT, 2#EXT, etc |
0x0013 Item that contain roster import time (name: "Import time") |
0x0014 Own icon (avatar) info. Name is an avatar id number as text |
[TLV(0x0131), itype 0x00, size XX] - This stores the name that the contact should show up as in the contact list. It should initially be set to the contact's nick name, and can be changed to anything by the client. |
/programs/network/icq/trunk/STDCALL.INC |
---|
0,0 → 1,151 |
..Open = 0 |
; When some procedure is not finished with 'endp' macro, |
; "Unexpected end of file" error, occur without any info, where is error. |
; in this case, comment followind 2 rows and uncomment next two. |
; proc_used and endp_used are optimized versions of the macroses. |
; proc_debug and endp_debug are debug versions. When you use debug |
; versions, error message will show you where is missing 'endp'. |
; |
; Don't forget to recompile with *_used versions, to get optimised |
; binary with all not used procedure excluded. |
macro RestoreEx [name] |
{ |
macro rstr#name _% RESTORE name %_ |
macro rstr _% %_ |
rstr#name |
purge rstr,rstr#name |
} |
_% fix { |
%_ fix } |
restore fix RestoreEx |
proc fix proc_used |
endp fix endp_used |
;proc fix proc_debug |
;endp fix endp_debug |
macro proc_used name,[arg] { ; define procedure |
common |
proc_args fix arg |
; if ~ used name |
; if ~..ShowSkipped eq OFF |
; display 1,'Procedure skiped: ',`name, $0d, $0a |
; end if |
; else |
if used name |
name: |
virtual at ebp+8 |
if ~ arg eq |
forward |
local ..arg |
..arg dd ? |
arg equ ..arg |
common |
end if |
..ret = $ - (ebp+8) |
end virtual |
local ..dynamic_data,..dynamic_size |
dynamic_data equ ..dynamic_data |
dynamic_size equ ..dynamic_size |
virtual at ebp - dynamic_size |
dynamic_data: |
} |
macro proc_debug name,[arg] { ; define procedure |
common |
proc_args fix arg |
if ..Open > 0 |
Error! Missing 'endp' before procedure `name |
end if |
..Open = ..Open+1 |
name: |
virtual at ebp+8 |
if ~ arg eq |
forward |
local ..arg |
..arg dd ? |
arg equ ..arg |
common |
end if |
..ret = $ - (ebp+8) |
end virtual |
local ..dynamic_data,..dynamic_size |
dynamic_data equ ..dynamic_data |
dynamic_size equ ..dynamic_size |
virtual at ebp - dynamic_size |
dynamic_data: |
} |
macro begin { ; begin procedure instructions |
; continue from "proc" macro. |
; align 4 |
rb (4 - ($ - dynamic_data) and 11b) and 11b ; align the stack at dword. |
dynamic_size = $ - dynamic_data |
end virtual |
if (dynamic_size = 0) |
if ..ret <> 0 |
push ebp ; smaller is dynamic_size = 0 |
mov ebp, esp |
end if |
else |
enter dynamic_size, 0 |
end if |
} |
macro return { ; return from procedure |
; continue from "enter" macro. |
if ..ret <> 0 |
leave |
ret ..ret |
else |
if dynamic_size <> 0 |
leave |
end if |
ret |
end if |
} |
macro endp_used { |
restore proc_args |
end if |
} |
macro endp_debug { |
restore proc_args |
..Open = ..Open - 1 |
} |
macro _reversepusharg [arg] { |
reverse |
pushd arg |
} |
macro stdcall proc,[arg] { ; call procedure |
common |
if ~ arg eq |
_reversepusharg arg |
end if |
call proc |
} |
macro invoke proc,[arg] { ; invoke procedure (indirect) |
common |
stdcall [proc],arg |
} |
;end of file |
/programs/network/icq/trunk/build_ru.bat |
---|
1,5 → 1,2 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm ki.asm ki |
@erase lang.inc |
@pause |
/programs/network/icq/trunk/comp.inc |
---|
9,9 → 9,9 |
{ |
pushad |
mov edx, color |
;mov edx, color |
; ------------ |
mov eax, 38 |
;mov eax, 38 |
mov ebx, x1 |
shl ebx, 16 |
add ebx, x2 |
18,10 → 18,11 |
mov ecx, y1 |
shl ecx, 16 |
add ecx, y1 |
int 40h |
;int 40h |
mcall 38, ebx, ecx, color |
; ------------ |
mov eax, 38 |
;mov eax, 38 |
mov ebx, x1 |
shl ebx, 16 |
add ebx, x2 |
28,11 → 29,12 |
mov ecx, y2 |
shl ecx, 16 |
add ecx, y2 |
int 40h |
;int 40h |
mcall 38, ebx, ecx, color |
; | |
; | |
; | |
mov eax, 38 |
;mov eax, 38 |
mov ebx, x1 |
shl ebx, 16 |
add ebx, x1 |
39,11 → 41,12 |
mov ecx, y1 |
shl ecx, 16 |
add ecx, y2 |
int 40h |
;int 40h |
mcall 38, ebx, ecx, color |
; | |
; | |
; | |
mov eax, 38 |
;mov eax, 38 |
mov ebx, x2 |
shl ebx, 16 |
add ebx, x2 |
50,7 → 53,8 |
mov ecx, y1 |
shl ecx, 16 |
add ecx, y2 |
int 40h |
;int 40h |
mcall 38, ebx, ecx, color |
popad |
} |
59,9 → 63,9 |
; 뢮¤ íªà ¡ãä¥à á® áâப ¬¨ |
; |
scbuff db 512*128 dup 0 |
; 512 - ¤«¨ áâப¨ |
; 128 - ª®«¨ç¥á⢮ áâப |
scbuff db 80*41 dup 0 |
; 60 - ¤«¨ áâப¨ |
; 41 - ª®«¨ç¥á⢮ áâப |
; |
ind db 0 ; ¥ªã騩 ¨¤¥ªá |
; |
72,7 → 76,7 |
; ëá®â áâப¨ |
SH = 10 |
xlen dw 512 ; ¤«¨ áâப¨ |
xlen dw 80 ; ¤«¨ áâப¨ |
;ylen dw 128 ; ª®«¨ç¥á⢮ áâப |
ylen dw 40 |
84,11 → 88,12 |
; |
; à¨á㥬 ¡¥«ë© ¯àאַ㣮«ì¨ª |
; |
mov eax, 13 |
mov ebx, 15*65536+480 |
mov ecx, 31*65536+418 |
mov edx, 0FFFFFFh |
int 40h |
;mov eax, 13 |
;mov ebx, 15*65536+480 |
;mov ecx, 31*65536+418 |
;mov edx, 0FFFFFFh |
;int 40h |
mcall 13, (15 * 65536 + 480), (31 * 65536 + 418), 0x00FFFFFF |
142,9 → 147,10 |
xor ecx, ecx |
mov ecx, dword [edx+eax] ; ®á«¥¤¨¥ 4 ©â á 梥⮬ |
or ecx, 0x80000000 ; 뢮¤¨âì ASCIIZ |
mov eax, 4 |
mov esi, -1 ; For Menuet |
int 40h |
;mov eax, 4 |
;mov esi, -1 ; For Menuet |
;int 40h |
mcall 4, ebx, ecx, edx |
pop ecx |
inc ecx |
jmp pb_loop |
159,7 → 165,7 |
; |
macro write_debug str |
{ |
local ..string, ..label, ..end, ..loop, ..fin |
local ..string, ..label, ..end, ..loop, ..fin, ..n_inc |
jmp ..label |
..string db str, 0 |
176,6 → 182,16 |
imul ebx, eax |
add ebx, scbuff |
; |
; ¥àë© æ¢¥â ¢ë¢®¤ |
; |
mov edx, ebx |
lea edx, [edx+eax] |
sub edx, 4 ;4 ¡ ©â á 梥⮬ |
mov dword [edx], dword 0 |
xor edx, edx |
..loop: |
mov dl, [..string+ecx] |
cmp dl, 0 |
189,10 → 205,10 |
xor ebx, ebx |
mov bl, [ind] |
cmp bx, [ylen] |
jz @f |
jz ..n_inc |
inc bl |
jmp ..fin |
@@: |
..n_inc: |
xor bl, bl |
..fin: |
213,20 → 229,11 |
..string db str, 0 |
..label: |
mov eax, 8 |
mov ebx, x*65536+xlen |
mov ecx, y*65536+ylen |
mov edx, id |
mov esi, 0x4466aa |
int 40h |
mov eax, 4 |
mov ebx, (x+5)*65536+y+ylen/2-3 |
xor ecx, ecx |
or ecx, 0x80FFFFFF |
mov edx, ..string |
int 40h |
mcall 8, (x*65536+xlen), (y*65536+ylen), id, 0x4466aa |
mcall 4, ((x+5)*65536+y+ylen/2-3), 0x80FFFFFF, ..string |
popad |
} |
236,7 → 243,7 |
macro data_debug str, rg |
{ |
pushad |
local ..string, ..end, ..loop, ..strend, ..fin, ..label |
local ..string, ..end, ..loop, ..strend, ..fin, ..label, ..n_inc |
jmp ..label |
..string db str, 20h, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
..strend: |
259,6 → 266,15 |
imul ebx, eax |
add ebx, scbuff |
; |
; ¥àë© æ¢¥â ¢ë¢®¤ |
; |
mov edx, ebx |
lea edx, [edx+eax] |
sub edx, 4 ;4 ¡ ©â á 梥⮬ |
mov dword [edx], dword 0 |
xor edx, edx |
..loop: |
mov dl, [..string+ecx] |
cmp dl, 0 |
272,10 → 288,10 |
xor ebx, ebx |
mov bl, [ind] |
cmp bx, [ylen] |
jz @f |
jz ..n_inc |
inc bl |
jmp ..fin |
@@: |
..n_inc: |
xor bl, bl |
..fin: |
334,151 → 350,60 |
popf |
ret |
; |
; |
CP866 db ' ¡¢£¤¥¦§¨©ª«¬®¯àáâãäåæçèéêëìíîï' |
; |
; ¥à¥ª®¤¨à®¢ª ¨§ cp1251 ¢ cp866 |
; «ï ¢ë¢®¤ á®®¡é¥¨© |
; [eax] <-- null-terminated string |
; ebx <-- color |
; |
; [eax] <-- Null-terminated string |
; |
win2dos: |
writemsg: |
pushad |
pushf |
xor edi, edi |
xor ebx, ebx |
xor ecx, ecx |
;xor edx, edx |
w2d_loop: |
mov bl, [eax+ecx] |
cmp bl, 0 |
jz w2d_end |
cmp bl, 0A8h ; ð |
jz w2d_yo1 |
cmp bl, 0B8h ; ñ |
jz w2d_yo2 |
cmp bl, 0C0h ; ãááª ï ¡ãª¢ |
jnc w2d_rchar |
inc ecx |
jmp w2d_loop |
wm_loop: |
xor esi, esi ; ᫨ 1 - ¥áâì ¥é¥ á¨¬¢®«ë ¢ áâப¥ |
lea eax, [eax+edi] |
w2d_yo1: |
mov [eax+ecx], byte 0F0h |
inc ecx |
jmp w2d_loop |
push ebx |
push eax |
w2d_yo2: |
mov [eax+ecx], byte 0F1h |
inc ecx |
jmp w2d_loop |
xor eax, eax |
xor ebx, ebx |
w2d_rchar: |
sub bl, 0C0h |
mov bl, [CP866+ebx] |
mov [eax+ecx], bl |
inc ecx |
jmp w2d_loop |
mov bl, [ind] |
mov ax, [xlen] |
imul ebx, eax |
add ebx, scbuff |
w2d_end: |
popf |
popad |
ret |
CP1251 db 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
; |
; ¥à¥ª®¤¨à®¢ª ¨§ CP866 ¢ CP1251 |
; [eax] <-- Null termainated string |
; §¡¨¢ ¥¬ áâபã á®®¡é¥¨ï ¥áª®«ìª® áâப ¯® xlen-4 (â.ª ¢ ª®æ¥ ¤¢®©®¥ á«®¢® - 梥â áâப¨) |
; |
dos2win: |
pushf |
pushad |
xor ebx, ebx |
xor ecx, ecx |
pop eax |
mov edx, eax |
call strlen |
dec ecx |
movzx ecx, [xlen] |
cmp eax, ecx |
jc @f ;< |
d2w_loop: |
inc ecx |
mov bl, [eax+ecx] |
cmp bl, 0 |
jz d2w_end |
cmp bl, 80h |
jnc d2w_rchar |
movzx edi, [xlen] |
lea edi, [edi-4] |
;inc ecx |
jmp d2w_loop |
mov ecx, eax |
inc esi |
d2w_yo1: |
mov byte [eax+ecx], 0A8h |
;inc ecx |
jmp d2w_loop |
d2w_yo2: |
mov byte [eax+ecx], 0B8h |
;inc ecx |
jmp d2w_loop |
@@: |
d2w_rchar: |
cmp bl, 0B0h |
jnc d2w_rchar2 |
sub bl, 80h |
mov bl, [CP1251+ebx] |
mov [eax+ecx], bl |
jmp d2w_loop |
d2w_rchar2: |
cmp bl, 0E0h |
jc d2w_loop |
cmp bl, 0F0h |
jz d2w_yo1 |
cmp bl, 0F1h |
jz d2w_yo2 |
cmp bl, 0F2h |
jnc d2w_loop |
add bl, 10h |
mov [eax+ecx], bl |
jmp d2w_loop |
d2w_end: |
popad |
popf |
ret |
; |
; «ï ¢ë¢®¤ á®®¡é¥¨© |
; [eax] <-- null-terminated string |
; ebx <-- color |
; |
writemsg: |
pushad |
push ebx |
push eax |
xor eax, eax |
xor ebx, ebx |
mov bl, [ind] |
mov ax, [xlen] |
imul ebx, eax |
add ebx, scbuff |
pop eax |
mov edx, eax |
call strlen |
mov ecx, eax |
mov eax, edx |
call strcpy |
491,20 → 416,25 |
mov dword [ebx+eax], ecx ; ®á«¥¤¨¥ 4 ©â á 梥⮬ |
xor ebx, ebx |
mov bl, [ind] |
cmp bx, [ylen] |
xor eax, eax |
mov al, [ind] |
cmp ax, [ylen] |
jz @f |
inc bl |
inc al |
jmp ..fin |
@@: |
xor bl, bl |
xor al, al |
..fin: |
mov [ind], bl |
mov [ind], al |
mov ebx, ecx ; 梥â |
mov eax, edx ; 㪠§ ⥫ì áâபã |
cmp esi, 0 |
jnz wm_loop |
call printbuff |
;call draw_window |
popad |
ret |
515,7 → 445,7 |
; <--EAX ¥à¥¢®¤ ¨§ 16 ¢ 10 ä®à¬ã |
; -->[ebx] |
; -->[ebx] áâப |
; --> eax ¤«¨ |
int2strd: |
pushf |
597,9 → 527,9 |
y_bb dw 30 ; |
; |
bb_width dw 100 ; ¨à¨ ª®¯®ª |
bb_height dw 15 ; ¢ëá®â ª®¯®ª |
bb_height dw 12 ; ¢ëá®â ª®¯®ª |
; |
bb_dist dw 10 ; ááâ®ï¨¥ ¬¥¦¤ã ª®¯ª ¬¨ |
bb_dist dw 6 ; ááâ®ï¨¥ ¬¥¦¤ã ª®¯ª ¬¨ |
; ¤¥â¨ä¨ª â®àë ª®¯®ª ç¨ ï á 100 |
; |
617,12 → 547,23 |
bb_loop: |
; ஢¥à塞 ¯¥à¢ë© ¡ ©â 㨠, ¥á«¨ 0, ª®¯ªã à¨á®¢ âì ¥ ¤® |
mov ebx, NAME_LEN |
;mov ebx, NAME_LEN |
;imul ebx, ecx |
;mov al, [names+ebx] |
;cmp al, 0 |
;jz bb_end |
mov ebx, UIN_LEN |
imul ebx, ecx |
mov al, [names+ebx] |
mov al, [uins + ebx] |
cmp al, 0 |
jz bb_end |
; à¨á㥬 ª®¯ªã |
; ¢¥â § ¢¨á¨â ®â áâ âãá UIN |
mov ebx, 4 |
726,7 → 667,7 |
; áᨢ á UIN |
; |
UIN_LEN = 11 ; Ǭ |
UINS = 15 ; ®«¨ç¥á⢮ |
UINS = 22 ; ®«¨ç¥á⢮ |
; |
uins db UIN_LEN*UINS dup 0 |
; |
742,12 → 683,13 |
; |
; |
U1 db '123456789',0 |
U2 db '123456789',0 |
U3 db '123456789',0 |
U1 db '405577261',0 |
U2 db '455395049',0 |
U3 db '488118046',0 |
; |
; £à㧪 ¬ áᨢ UIN |
; |
; FIXME ¡ã¤¥â 㤠«¥ |
loaduin: |
pushad |
mov eax, U1 |
923,4 → 865,108 |
popf |
popad |
ret |
ret |
; |
; |
; â« ¤®ç ï äãªæ¨ï - ¢ë¢®¤¨â ®¡« áâì ¯ ¬ï⨠|
; EAX - 㪠§ â¥«ì ®¡« áâì |
; EBX - ª®«¨ç¥á⢮ ¡ ©â |
; |
print_mem: |
push eax |
push ebx |
push ecx |
push edx |
push esi |
xor ecx, ecx |
xor esi, esi |
pm_loop: |
cmp ecx, ebx |
jz pm_exit |
mov dl, [eax + ecx] |
shr dl, 4 ;¤¢¨ãâì 4 à §àï¤ ¢¯à ¢® |
cmp dl, 0x0A |
jnb pm_chars |
or dl, 0x30 |
jmp pm_write |
pm_chars: |
add dl, 0x37 |
pm_write: |
mov [membuff + esi], dl |
inc esi |
; |
; |
mov dl, [eax + ecx] |
and dl, 0x0F |
cmp dl, 0x0A |
jnb pm_chars2 |
or dl, 0x30 |
jmp pm_write2 |
pm_chars2: |
add dl, 0x37 |
pm_write2: |
mov [membuff + esi], dl |
inc esi |
mov [membuff + esi], 0x20 |
inc esi |
cmp esi, MEMBUFF_SIZE - 2 |
jb pm_nwrite |
; |
; ¢ë¢¥á⨠¡ãä¥à |
mov [membuff + esi], byte 0 |
push eax |
push ebx |
mov eax, membuff |
xor ebx, ebx |
xor esi, esi |
call writemsg |
pop ebx |
pop eax |
pm_nwrite: |
inc ecx |
jmp pm_loop |
pm_exit: |
mov [membuff + esi], byte 0 |
mov eax, membuff |
xor ebx, ebx |
xor esi, esi |
call writemsg |
pop esi |
pop edx |
pop ecx |
pop ebx |
pop eax |
ret |
/programs/network/icq/trunk/comp_data.inc |
---|
0,0 → 1,3 |
MEMBUFF_SIZE = (16 * 3 + 1) |
membuff db MEMBUFF_SIZE dup 0 |
/programs/network/icq/trunk/config.inc |
---|
0,0 → 1,0 |
__CPU_type fix p5 |
/programs/network/icq/trunk/debug.inc |
---|
0,0 → 1,137 |
macro debug_print str |
{ |
local ..string, ..label |
jmp ..label |
..string db str,0 |
..label: |
pushf |
pushad |
mov edx,..string |
call debug_outstr |
popad |
popf |
} |
dps fix debug_print |
macro debug_print_dec arg |
{ |
pushf |
pushad |
if ~arg eq eax |
mov eax,arg |
end if |
call debug_outdec |
popad |
popf |
} |
dpd fix debug_print_dec |
;--------------------------------- |
debug_outdec: ;(eax - num, edi-str) |
push 10 ;2 |
pop ecx ;1 |
push -'0' ;2 |
.l0: |
xor edx,edx ;2 |
div ecx ;2 |
push edx ;1 |
test eax,eax ;2 |
jnz .l0 ;2 |
.l1: |
pop eax ;1 |
add al,'0' ;2 |
call debug_outchar ; stosb |
jnz .l1 ;2 |
ret ;1 |
;--------------------------------- |
debug_outchar: ; al - char |
pushf |
pushad |
mov cl,al |
mov eax,63 |
mov ebx,1 |
int 0x40 |
popad |
popf |
ret |
debug_outstr: |
mov eax,63 |
mov ebx,1 |
@@: |
mov cl,[edx] |
test cl,cl |
jz @f |
int 40h |
inc edx |
jmp @b |
@@: |
ret |
_debug_crlf db 13, 10, 0 |
macro newline |
{ |
pushf |
pushad |
mov edx, _debug_crlf |
call debug_outstr |
popad |
popf |
} |
macro print message |
{ |
dps message |
newline |
} |
macro pregs |
{ |
dps "EAX: " |
dpd eax |
dps " EBX: " |
dpd ebx |
newline |
dps "ECX: " |
dpd ecx |
dps " EDX: " |
dpd edx |
newline |
} |
macro debug_print_hex arg |
{ |
pushf |
pushad |
if ~arg eq eax |
mov eax, arg |
end if |
call debug_outhex |
popad |
popf |
} |
dph fix debug_print_hex |
debug_outhex: |
; eax - number |
mov edx, 8 |
.new_char: |
rol eax, 4 |
movzx ecx, al |
and cl, 0x0f |
mov cl, [__hexdigits + ecx] |
pushad |
mcall 63, 1 |
popad |
dec edx |
jnz .new_char |
ret |
__hexdigits: |
db '0123456789ABCDEF' |
/programs/network/icq/trunk/dialogs1.inc |
---|
0,0 → 1,597 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; ; |
; DIALOGS1.INC ; |
; ; |
; COMPILE WITH FASM for MENUET ; |
; ; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
menus dd 3 ; number of menus |
m_x dd 0x5 ; x start |
m_y dd 20 ; y start |
m_xs dd 290 ; x size |
m_ys dd 14 ; y size |
g_stack dd 0xf000 ; thread stack - required |
menu:; AB C D E F G |
db '*D FILE +Save File +Load File +- +Quit ' |
db '*B EDIT +Copy +Paste ' |
db '*B HELP +Setup +About.. ' |
db '@' ; end mark |
; A : Data type '*' -> New menu , '+' -> menu selection |
; B : Number of selections in menu (A+) |
; C : Menu header text |
; D-G : Menu selection text |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; |
; DATA BELOW IS FOR DIALOGS1.INC INTERNALS |
menu_action dd '----' |
window_on db 0 |
g_n dd -1 |
g_x dd 0x0 |
g_t dd 0x0 |
g_1 dd 0x0 |
g_l dd 0x0 |
closet db 0 |
table: times 1024 db 0 |
last_mouse dd 0x0 |
mo_x dd 0x0 |
mo_y dd 0x0 |
check_mouse: |
pusha |
cmp [window_on],1 |
je no_open |
mov eax,37 |
mov ebx,2 |
int 0x40 |
cmp [window_on],0 |
jne openw2 |
cmp eax,0 |
je no_open |
openw2: |
waitformouse: |
mov eax,23 |
mov ebx,2 |
int 0x40 |
cmp eax,0 |
jne no_open |
mov eax,37 |
mov ebx,2 |
int 0x40 |
cmp eax,0 |
jne waitformouse |
mov eax,37 |
mov ebx,1 |
int 0x40 |
mov esi,eax |
shr eax,16 |
xor edx,edx |
mov ebx,50 |
div ebx |
mov edx,eax |
cmp edx,[g_n] |
je no_open |
cmp edx,[menus] |
jge no_open |
mov eax,esi |
and eax,0xffff |
mov ebx,[m_y] |
cmp eax,ebx |
jbe no_open |
add ebx,[m_ys] |
cmp eax,ebx |
jge no_open |
cmp [window_on],0 |
je noww |
mov [closet],1 |
mov ecx,100 |
waitm: |
mov eax,5 |
mov ebx,1 |
int 0x40 |
dec ecx |
jz no_open |
cmp [window_on],0 |
jne waitm |
noww: |
mov eax,edx |
jmp cll |
no_open: |
mov [last_mouse],esi |
popa |
ret |
cll: |
mov [window_on],2 |
mov [g_n],eax |
mov [g_x],96 |
mov [g_t],0 |
mov [g_1],1 |
mov eax,9 |
mov ebx,table |
mov ecx,-1 |
int 0x40 |
mov eax,[table+34] |
mov [mo_x],eax |
mov eax,[table+38] |
mov [mo_y],eax |
mov eax,51 |
mov ebx,1 |
mov ecx,alert_entry |
mov edx,[g_stack] |
int 0x40 |
mov [esp+28],dword 0 ; clear button entry |
mov [menu_action],'MD ' |
check_gr: |
popa |
ret |
draw_menu: |
mov eax,9 |
mov ebx,table |
mov ecx,-1 |
int 0x40 |
cmp [table+46],dword 30 |
jb drmr |
mov eax,13 ; white background |
mov ebx,[m_x] |
shl ebx,16 |
add ebx,[m_xs] |
inc ebx |
mov ecx,[m_y] |
shl ecx,16 |
add ecx,[m_ys] |
mov edx,0xf0f8ff |
int 0x40 |
mov eax,38 ; egde lines |
mov ebx,[m_x] |
shl ebx,16 |
add ebx,[m_x] |
add ebx,[m_xs] |
mov ecx,[m_y] |
shl ecx,16 |
add ecx,[m_y] |
mov edx,0x000000 |
int 0x40 |
mov eax,38 |
mov ecx,[m_y] |
add ecx,[m_ys] |
shl ecx,16 |
add ecx,[m_y] |
add ecx,[m_ys] |
int 0x40 |
mov esi,menu-1 |
mov edi,[m_x] |
mov ebp,1 |
new_menu: |
inc esi |
cmp [esi],byte '*' |
jne drmnl1 |
push esi |
mov eax,4 |
mov ebx,edi |
shl ebx,16 |
add ebx,[m_y] |
add ebx,0x00050004 |
mov ecx,0x000000 |
mov edx,esi |
add edx,3 |
mov esi,12 |
int 0x40 ; draw text |
pop esi |
add esi,2 |
add edi,50 |
inc ebp |
drmnl1: |
cmp [esi],byte '@' |
jne new_menu |
drmr: |
ret |
alert_box: |
; eax : x size - min 200 |
; ebx : pointer to ASCIIZ - max 128 character text |
; ecx : button 1 id ( OK or YES ) |
; edx : button 2 id or zero ( NO ) |
cmp [window_on],0 |
jne alert_box_return |
mov [window_on],1 |
cmp eax,100 |
jg size_ok |
mov eax,100 |
size_ok: |
mov [g_x],eax |
mov [g_t],ebx |
mov [g_1],ecx |
mov ecx,0 |
new_search: |
cmp [ebx],byte 0 |
je found_len |
inc ebx |
inc ecx |
cmp ecx,128 |
jbe new_search |
found_len: |
mov [g_l],ecx |
mov eax,51 |
mov ebx,1 |
mov ecx,alert_entry |
mov edx,[g_stack] |
int 0x40 |
mov [menu_action],'MA ' |
alert_box_return: |
ret |
alert_entry: |
call alert_draw_window |
alert_still: |
mov eax,23 ; wait here for event |
mov ebx,1 |
int 0x40 |
cmp eax,1 ; redraw request ? |
je alert_red |
cmp eax,2 ; key in buffer ? |
je alert_key |
cmp eax,3 ; button in buffer ? |
je alert_button |
cmp [closet],0 |
jne ccc |
mov eax,9 |
mov ebx,table |
mov ecx,-1 |
int 0x40 |
cmp ax,[table+4] |
je no_close |
ccc: |
mov [closet],0 |
mov [g_n],-1 |
mov [menu_action],'----' |
mov [window_on],0 |
mov eax,-1 |
int 0x40 |
no_close: |
jmp alert_still |
alert_red: ; redraw |
call alert_draw_window |
jmp alert_still |
alert_key: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
jmp alert_still |
alert_button: ; button |
mov eax,17 ; get id |
int 0x40 |
shr eax,8 |
cmp eax,3 |
jg no_action1 |
dec eax |
shl eax,2 |
mov eax,dword [eax+rtext] |
mov [menu_action],eax |
jmp action_done |
no_action1: |
sub eax,16 |
add eax,65 |
shl eax,8 |
mov ebx,[g_n] |
add ebx,65 |
add eax,ebx |
mov [menu_action],eax |
action_done: |
mov [closet],0 |
mov [g_n],-1 |
mov [window_on],0 |
mov eax,-1 ; close this program |
int 0x40 |
rtext db 'NO YES OK ' |
jmp alert_still |
; ********************************************* |
; ******* WINDOW DEFINITIONS AND DRAW ******** |
; ********************************************* |
alert_draw_window: |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
cmp [window_on],2 |
jne no_win_type_2 |
mov edx,menu-1 |
mov ecx,[g_n] |
add ecx,1 |
find_menu: |
inc edx |
cmp [edx],byte '*' |
je menu_loop |
jmp find_menu |
menu_loop: |
loop find_menu |
movzx ebp,byte [edx+1] |
sub ebp,64 |
push edx |
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
mov ebx,[g_n] |
imul ebx,50 |
add ebx,[mo_x] |
add ebx,[m_x] |
shl ebx,16 |
add ebx,[g_x] |
mov ecx,[mo_y] |
add ecx,[m_y] |
add ecx,[m_ys] |
shl ecx,16 |
mov edx,14 |
imul edx,ebp |
add edx,7 |
add ecx,edx |
mov edx,0x00ffffff ; color of work area RRGGBB,8->color gl |
mov esi,0x00ffffff ; color of grab bar RRGGBB,8->color gl |
mov edi,0x000000cc ; color of frames RRGGBB |
int 0x40 |
pop edx |
mov ebx,5*65536+7 ; draw info text with function 4 |
mov ecx,0x10000000 |
mov esi,12 |
mov ebp,16 |
no_d_found: |
inc edx |
cmp [edx],byte '*' |
je d_drawed |
cmp [edx],byte '@' |
je d_drawed |
cmp [edx],byte '+' |
jne no_d_found |
inc edx |
pusha ; draw button |
mov eax,8 |
mov ecx,ebx |
mov ebx,[g_x] |
add ebx,0x0000fffe |
shl ecx,16 |
add ecx,0xfffc0000+14 |
mov edx,0x40000000 |
add edx,ebp |
mov esi,0 |
int 0x40 |
popa |
mov eax,4 ; draw text |
int 0x40 |
inc ebp |
add ebx,14 |
jmp no_d_found |
d_drawed: |
no_win_type_2: |
cmp [window_on],1 |
jne no_win_1 |
mov eax,14 ; to middle of screen |
int 0x40 |
mov ecx,eax |
and ecx,0xffff |
shr ecx,1 |
shr eax,1 |
mov ebx,[g_x] |
shr ebx,1 |
shl ebx,16 |
sub eax,ebx |
mov ebx,eax |
mov eax,0 ; function 0 : define and draw window |
mov bx,word [g_x] |
sub ecx,80 |
shl ecx,16 |
mov cx,110 ; [y start] *65536 + [y size] |
mov edx,0x02ffffff ; color of work area RRGGBB,8->color gl |
mov esi,0x80d05050 ; color of grab bar RRGGBB,8->color gl |
mov edi,0x00d05050 ; color of frames RRGGBB |
int 0x40 |
mov eax,4 ; label |
mov ebx,8*65536+8 |
mov ecx,0x10ddeeff |
mov edx,alert_labelt1 |
mov esi,alert_label1len-alert_labelt1 |
int 0x40 |
mov eax,4 |
mov ebx,10*65536+43 |
mov ecx,0x10000000 |
mov edx,[g_t] |
mov esi,[g_l] |
int 0x40 |
cmp [g_1],1 |
jne gadgets_no_1 |
mov eax,8 |
mov ebx,[g_x] |
sub ebx,100 |
shr ebx,1 |
shl ebx,16 |
add ebx,30*65536+40 |
mov ecx,75*65536+16 |
mov edx,3 |
mov esi,0x446688 |
int 0x40 |
mov eax,4 |
mov ebx,[g_x] |
sub ebx,100 |
shr ebx,1 |
shl ebx,16 |
add ebx,31*65536+80 |
mov ecx,0x10ffffff |
mov edx,alert_t2 |
mov esi,alert_t2len-alert_t2 |
int 0x40 |
gadgets_no_1: |
cmp [g_1],2 |
jne gadgets_no_2 |
mov eax,8 |
mov ebx,[g_x] |
sub ebx,100 |
shr ebx,1 |
shl ebx,16 |
add ebx,0*65536+40 |
mov ecx,75*65536+16 |
mov edx,1 |
mov esi,0x446688 |
int 0x40 |
mov eax,8 |
mov ebx,[g_x] |
sub ebx,100 |
shr ebx,1 |
shl ebx,16 |
add ebx,57*65536+40 |
mov ecx,75*65536+16 |
mov edx,2 |
mov esi,0x446688 |
int 0x40 |
mov eax,4 |
mov ebx,[g_x] |
sub ebx,100 |
shr ebx,1 |
shl ebx,16 |
add ebx,1*65536+80 |
mov ecx,0x10ffffff |
mov edx,alert_t1 |
mov esi,alert_t1len-alert_t1 |
int 0x40 |
gadgets_no_2: |
no_win_1: |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
ret |
; DATA AREA |
alert_t1: |
db ' No Yes' |
alert_t1len: |
alert_t2: |
db ' OK' |
alert_t2len: |
alert_labelt1: |
db 'ALERT' |
alert_label1len: |
/programs/network/icq/trunk/dos2win.inc |
---|
0,0 → 1,121 |
; |
; |
CP866 db ' ¡¢£¤¥¦§¨©ª«¬®¯àáâãäåæçèéêëìíîï' |
; |
; ¥à¥ª®¤¨à®¢ª ¨§ cp1251 ¢ cp866 |
; |
; [eax] <-- Null-terminated string |
; |
win2dos: |
pushad |
pushf |
xor ebx, ebx |
xor ecx, ecx |
;xor edx, edx |
w2d_loop: |
mov bl, [eax+ecx] |
cmp bl, 0 |
jz w2d_end |
cmp bl, 0A8h ; ð |
jz w2d_yo1 |
cmp bl, 0B8h ; ñ |
jz w2d_yo2 |
cmp bl, 0C0h ; ãááª ï ¡ãª¢ |
jnc w2d_rchar |
inc ecx |
jmp w2d_loop |
w2d_yo1: |
mov [eax+ecx], byte 0F0h |
inc ecx |
jmp w2d_loop |
w2d_yo2: |
mov [eax+ecx], byte 0F1h |
inc ecx |
jmp w2d_loop |
w2d_rchar: |
sub bl, 0C0h |
mov bl, [CP866+ebx] |
mov [eax+ecx], bl |
inc ecx |
jmp w2d_loop |
w2d_end: |
popf |
popad |
ret |
CP1251 db 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' |
; |
; ¥à¥ª®¤¨à®¢ª ¨§ CP866 ¢ CP1251 |
; [eax] <-- Null termainated string |
; |
dos2win: |
pushf |
pushad |
xor ebx, ebx |
xor ecx, ecx |
dec ecx |
d2w_loop: |
inc ecx |
mov bl, [eax+ecx] |
cmp bl, 0 |
jz d2w_end |
cmp bl, 80h |
jnc d2w_rchar |
;inc ecx |
jmp d2w_loop |
d2w_yo1: |
mov byte [eax+ecx], 0A8h |
;inc ecx |
jmp d2w_loop |
d2w_yo2: |
mov byte [eax+ecx], 0B8h |
;inc ecx |
jmp d2w_loop |
d2w_rchar: |
cmp bl, 0B0h |
jnc d2w_rchar2 |
sub bl, 80h |
mov bl, [CP1251+ebx] |
mov [eax+ecx], bl |
jmp d2w_loop |
d2w_rchar2: |
cmp bl, 0E0h |
jc d2w_loop |
cmp bl, 0F0h |
jz d2w_yo1 |
cmp bl, 0F1h |
jz d2w_yo2 |
cmp bl, 0F2h |
jnc d2w_loop |
add bl, 10h |
mov [eax+ecx], bl |
jmp d2w_loop |
d2w_end: |
popad |
popf |
ret |
/programs/network/icq/trunk/editbox.mac |
---|
31,9 → 31,9 |
mov edx,ed_offset |
add ebx,2 |
shl ebx,16 |
mov bx,ed_top |
add ebx,ed_top |
mov ecx,ed_text_color |
add ebx,4 |
mov ecx,ed_text_color |
add edx,ed_text |
mcall |
ret |
47,20 → 47,19 |
.draw_bg: |
mov ebx,ed_left |
add ebx,1 |
mov edx,ed_color |
shl ebx,16 |
mov bx,ed_width |
add ebx,ed_width |
sub ebx,1 |
mov edx,ed_color |
.draw_bg_eax: |
mov ecx,ed_top |
mov eax,13 |
add ecx,1 |
shl ecx,16 |
mov cx,ed_height |
add ecx,ed_height |
dec ecx |
mcall |
ret |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ¯®«ãç¥¨ï ª®«¨ç¥á⢠ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨¥ ª®¬¯®¥â |
;---------------------------------------------------------- |
89,7 → 88,7 |
lea ebx,[ebx*2+ebx] |
shl ebx,1 |
;imul ebx,6 |
add bx,ed_left |
add ebx,ed_left |
mov ecx,ed_top |
inc ebx |
add ecx,2 |
100,7 → 99,7 |
shl ecx,16 |
mov cx,bp |
add cx,ed_height-4 |
add ecx,ed_height-4 |
mov cl_curs_x,ebx |
mov cl_curs_y,ecx |
123,7 → 122,7 |
mov ecx,ebx |
shl ebx,16 |
mov bx,cx |
add bx,ed_width |
add ebx,ed_width |
mov ecx, ed_top |
mov esi,ecx |
shl ecx,16 |
139,7 → 138,7 |
;--- á«¥¢ --- |
mov cx,si |
mov ebp,ebx |
sub bx,ed_width |
sub ebx,ed_width |
mcall |
;--- á¯à ¢ --- |
mov ebx,ebp |
534,7 → 533,7 |
inc ebx |
add ebx,ed_left |
shl ebx,16 |
mov bx,6 |
add ebx,6 |
mov edx,ebp |
call .draw_bg_eax |
ret |
627,9 → 626,12 |
mov ecx,ed_pos |
pusha |
;;;;;;;;;;;;;;;;;;;;; |
;clear input arrea |
mov ebp,ed_color |
mov ebx,dword ed_shift_pos |
call .sh_cl_ |
mov ebp,ed_size |
call .clear_bg |
;;;;;;;;;;;;;;;;;;;;; |
popa |
call .del_char |
1075,4 → 1077,53 |
stosb ;§ ¯¨á âì í«¥¬¥â ¨§ ॣ¨áâà al ¢ ï祪㠯 ¬ï⨠es:edi |
ret ;¢¥àãâìáï ç¥ì ¨â¥à¥áë© å®¤ â.ª. ¯®ª ¢ á⥪¥ åà ¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï |
} |
;;;;;;;;;;;;;;; |
;For LibGui |
;;;;;;;;;;;;;;; |
macro srt_ed_libgui |
{ |
ed_width equ [EditBox.ed_width] ;è¨à¨ ª®¬¯®¥â |
ed_left equ [EditBox.ed_left] ;¯®«®¦¥¨¥ ¯® ®á¨ å |
ed_top equ [EditBox.ed_top] ;¯®«®¦¥¨¥ ¯® ®á¨ ã |
ed_color equ [EditBox.ed_color] ;梥â ä® ª®¬¯®¥â |
shift_color equ [EditBox.shift_color] ;=0x6a9480 |
ed_focus_border_color equ [EditBox.ed_focus_border_color] ;梥â à ¬ª¨ ª®¬¯®¥â |
ed_blur_border_color equ [EditBox.ed_blur_border_color] ;梥⠥ ªâ¨¢®£® ª®¬¯®¥â |
ed_text_color equ [EditBox.ed_text_color] ;梥â ⥪áâ |
ed_max equ [EditBox.ed_max] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦® ¬ ªá¨¬ «ì® ¢¢¥á⨠|
ed_text equ [EditBox.ed_text] ;㪠§ â¥«ì ¡ãä¥à |
ed_flags equ [EditBox.ed_flags] ;ä« £¨ |
ed_size equ [EditBox.ed_size] ;ª®«-¢® ᨬ¢®«®¢ |
ed_pos equ [EditBox.ed_poz] ;¯®§¨æ¨ï ªãàá®à |
ed_offset equ [EditBox.ed_offset] ;ᬥ饨¥ |
cl_curs_x equ [EditBox.cl_curs_x] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® å |
cl_curs_y equ [EditBox.cl_curs_y] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® ã |
ed_shift_pos equ [EditBox.ed_shift_pos] ;¯®«®¦¥¨¥ ªãàá®à |
ed_shift_pos_old equ [EditBox.ed_shift_pos_old] ;áâ ஥ ¯®«®¦¥¨¥ ªãàá®à |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;Bit mask from editbox |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
ed_figure_only= 1000000000000000b ;®¤¨ ᨬ¢®«ë |
ed_always_focus= 100000000000000b |
ed_focus= 10b ;䮪ãá ¯à¨«®¦¥¨ï |
ed_shift_on= 1000b ;¥á«¨ ¥ ãáâ ®¢«¥ -§ ç¨â ¢¯¥à¢ë¥ ¦ â shift,¥á«¨ ¡ë« ãáâ ®¢«¥, § ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift |
ed_shift_on_off=1111111111110111b |
ed_shift= 100b ;¢ª«îç ¥âáï ¯à¨ ¦ ⨨ shift â.¥. ¥á«¨ ¦¨¬ î |
ed_shift_off= 1111111111111011b |
ed_shift_bac= 10000b ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥®£® shift â.¥. ¯à¨ ãáâ ®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥¨¥ |
ed_shift_bac_cl=1111111111101111b ;®ç¨á⪠¯à¨ 㤠«¥¨¨ ¢ë¤¥«¥¨ï |
ed_shift_cl= 1111111111100011b |
ed_shift_mcl= 1111111111111011b |
ed_left_fl= 100000b |
ed_right_fl= 1111111111011111b |
ed_offset_fl= 1000000b |
ed_offset_cl= 1111111110111111b |
ed_insert= 10000000b |
ed_insert_cl= 1111111101111111b |
ed_mouse_on = 100000000b |
ed_mous_adn_b= 100011000b |
ed_mouse_on_off=1111111011111111b |
ed_height=14 ; ¢ëá®â |
} |
/programs/network/icq/trunk/icons.inc |
---|
0,0 → 1,64 |
redicq: |
db 0,0,0,0,0,0,0,0,0,0 |
db 0,0,0,0,128,0,0,128,0,0,128,0,0,0,0,0 |
db 128,0,0,128,0,0,128 |
db 0,0,0,0,0,0 |
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
db 0,128,0,0,179,0,0,179,0,0,179,0,0,128,0,0 |
db 179,0,0,179,0,0,179,0,0,128 |
db 0,0,0 |
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
db 0,128,0,0,230,0,0,202,0,0,179,0,0,128,0,0 |
db 230,0,0,202,0,0,179,0,0,128 |
db 0,0,0 |
db 0,0,0,0,0,0,0,0,0,0,0,128,0,0,128,0 |
db 0,128,0,0,179,0,0,202,0,0,230,0,0,128,0,0 |
db 230,0,0,202,0,0,179,0,0,128,0,0,128,0,0,128 |
db 0,0,0 |
db 0,0,128,0,0,179,0,0,179,0 |
db 0,179,0,0,128,0,0,230,0,0,230,0,0,128,0,0 |
db 230,0,0,230,0,0,128,0,0,179,0,0,179,0,0,179 |
db 0,0,128 |
db 0,0,128,0,0,179,0,0,202,0 |
db 0,202,0,0,230,0,0,128,0,0,230,0,0,128,0,0 |
db 230,0,0,128,0,0,230,0,0,202,0,0,202,0,0,179 |
db 0,0,128 |
db 0,0,128,0,0,179,0,0,230,0 |
db 0,230,0,0,230,0,0,230,0,0,128,0,255,255,0,0 |
db 128,0,0,230,0,0,230,0,0,230,0,0,230,0,0,179 |
db 0,0,128 |
db 0,0,0,0,0,128,0,0,128,0 |
db 0,128,0,0,128,0,0,128,0,255,255,0,255,255,0,255 |
db 255,0,0,128,0,0,128,0,0,128,0,0,128,0,0,128 |
db 0,0,0,0,0,128,0,0,179,0,0,179,0 |
db 0,179,0,0,179,0,0,179,0,0,128,0,255,255,0,0 |
db 128,0,0,179,0,0,179,0,0,179,0,0,179,0,0,179 |
db 0,0,128 |
db 0,0,128,0,0,202,0,0,202,0 |
db 0,202,0,0,202,0,0,128,0,0,179,0,0,128,0,0 |
db 179,0,0,128,0,0,230,0,0,202,0,0,202,0,0,179 |
db 0,0,128 |
db 0,0,128,0,0,230,0,0,230,0 |
db 0,230,0,0,128,0,0,202,0,0,179,0,0,128,0,0 |
db 230,0,0,179,0,0,128,0,0,230,0,0,230,0,0,179 |
db 0,0,128 |
db 0,0,0,0,0,128,0,0,128,0 |
db 0,128,0,0,230,0,0,202,0,0,179,0,0,128,0,0 |
db 230,0,0,202,0,0,179,0,0,128,0,0,128,0,0,128 |
db 0,0,0,0,0,0,0,0,0,0,0,0,0 |
db 0,128,0,0,230,0,0,202,0,0,179,0,0,128,0,0 |
db 230,0,0,202,0,0,179,0,0,128 |
db 0,0,0 |
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
db 0,128,0,0,230,0,0,230,0,0,179,0,0,128,0,0 |
db 230,0,0,230,0,0,179,0,0,128 |
db 0,0,0 |
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
db 0,0,0,0,128,0,0,128,0,0,128,0,0,0,0,0 |
db 128,0,0,128,0,0,128,0,0,0,0,0,0,0,0,0 |
db 0,0,0 |
/programs/network/icq/trunk/ki.asm |
---|
1,29 → 1,37 |
; <--- description ---> |
; compiler: FASM 1.67.21 |
; name: ICQ for Kolibri |
; version: 0.01 |
; name: ICQ client for Kolibri |
; version: 0.1.30 |
; written by: LV |
; e-mail: lv4evil@ya.ru |
; e-mail: lv4evil@yandex.ru |
; <--- include all MeOS stuff ---> |
include "lang.inc" |
include "../../../macros.inc" |
purge mov |
include "MACROS.INC" |
;purge mov |
;include "ASCL9/ascl.inc" |
;include "debug.inc" |
include "EDITBOX.INC" |
include "editbox.inc" |
; <--- start of MenuetOS application ---> |
MEOS_APP_START |
;include "debug.inc" |
include "2000.inc" |
include "comp.inc" |
;include "fsio.inc" |
include "dos2win.inc" |
include "parser.inc" |
include "ssi.inc" |
use_edit_box procinfo,22,5 |
; <--- start of code ---> |
; |
; ᫨ == 0, ª®¤ ¤«ï ¨á¯®«ì§®¢ ¨ï ª®â ªâ «¨áâ |
; á¥à¢¥à¥ ¥ áᥬ¡«¨àã¥âáï |
; |
USE_SSI = 1 |
; |
; |
CODE |
31,15 → 39,33 |
;mov ebx, 47h |
;int 40h |
call loaduin |
; |
; £à㧪 ª®ä¨£®¢ |
; |
mov eax, fname |
call parseconf |
; |
; 뢮¤ § £à㦥®© ¨ä®à¬ 樨 |
; |
mov eax, cfg_message |
xor ebx, ebx |
call writemsg |
call showcfg |
;call loaduin |
call draw_window ; at first create and draw the window |
;call buttonbox |
wait_event: ; main cycle |
mov eax, 23 |
mov ebx, 20 |
int 0x40 |
;mov eax, 23 |
;mov ebx, 20 |
;int 0x40 |
mcall 23,20 |
cmp eax, 1 ; if event == 1 |
je redraw ; jump to redraw handler |
51,12 → 77,8 |
; |
; ¤¥¬ ¤ ëå |
; |
mov eax, 53 |
mov ebx, 2 |
push ecx |
mov ecx, [socket] |
int 0x40 |
pop ecx |
mcall 53,2,[socket] |
cmp eax, 0 |
jnz read_socket |
63,8 → 85,8 |
mouse_edit_box inputbox |
; |
; ᫨ ¥áâì ᮥ¤¨¥¨¥ á á¥à¢¥à®¬, ¯®áë« ¥¬ ¯ ª¥âë - ¯®¤â¢¥¦¤¥¨ï ª ¦¤ë¥ 60 á |
; |
call sendkeep |
; ¥ âॡã¥âáï |
; call sendkeep |
jmp wait_event ; else return to the start of main cycle |
74,10 → 96,10 |
jmp wait_event |
key: ; key event handler |
mov eax, 2 ; get key code |
int 0x40 |
key: ; get key code |
mcall 2 |
cmp ah, 0Dh ; ஡¥« - ®â¯à ¢¨âì á®®¡é¥¨¥ |
jz send |
88,8 → 110,9 |
button: ; button event handler |
mov eax, 17 ; get button identifier |
int 0x40 |
;mov eax, 17 ; get button identifier |
;int 0x40 |
mcall 17 |
cmp ah, 2 |
jz connect |
131,6 → 154,12 |
mov [buff+ecx], ' ' ; ஡¥« |
lea ebx, [buff+ecx+1] |
mov ecx, NAME_LEN |
;debug |
push ebx |
mov ebx, NAME_LEN |
call print_mem |
pop ebx |
; |
call strcpy |
mov eax, buff |
xor ebx, ebx |
143,30 → 172,16 |
cmp ah, 1 |
jne wait_event ; return if button id != 1 |
or eax, -1 ; exit application |
int 0x40 |
; exit application |
mcall -1 |
draw_window: |
mov eax, 12 ; start drawing |
mov ebx, 1 |
int 0x40 |
; start drawing |
mcall 12,1 |
mov eax, 0 ; create and draw the window |
mov ebx, 100*65536+700 ; (window_cx)*65536+(window_sx) |
mov ecx, 100*65536+500 ; (window_cy)*65536+(window_sy) |
mov edx, 0x03ffffff ; work area color & window type 3 |
; mov esi, 0 ; grab color (not used) |
; mov edi, 0 ; frame color (not used) |
int 0x40 |
mcall 0,(100*65536+700),(100*65536+500),0x14ffffff,0,head |
mov eax, 4 ; window header |
mov ebx, 8*65536+8 ; coordinates |
mov ecx, 0x10ffffff ; color & font N1 |
mov edx, header ; address of text |
mov esi, header.size ; length of text |
int 0x40 |
draw_edit_box inputbox |
rect 10, 30, 500, 450, 0 |
178,11 → 193,21 |
call printbuff |
call buttonbox |
; |
; Image |
; |
;mov eax, 7 |
;mov ebx, redicq |
;mov ecx, 15*65536+15 |
;mov edx, 100*65536+100 |
;int 40h |
mov eax, 12 ; finish drawing |
mov ebx, 2 |
int 0x40 |
; finish drawing |
mcall 12,2 |
ret |
; |
189,12 → 214,17 |
; ®¥¤¨¥¨¥ |
; |
connect: |
mov eax, ICQ_IP |
lea eax, [vtable + vartable.icqip] |
call ip_parser |
call htonl |
data_debug 'IP:', eax |
;mov eax, ICQ_IP |
mov ebx, ICQ_PORT |
call srv_connect |
;call srv_login |
jmp wait_event |
306,11 → 336,12 |
cmp [hrf], 1 |
jz rs_head_recived |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 40h |
rs_check_sock: |
;mov eax, 53 |
;mov ebx, 2 |
;mov ecx, [socket] |
;int 40h |
mcall 53,2,[socket] |
cmp eax, 6 ; Flap head size |
jc r_end |
; |
320,11 → 351,11 |
;mov ecx, [socket] |
rs_loop: |
mov eax, 53 |
mov ebx, 3 |
;mov eax, 53 |
;mov ebx, 3 |
;int 40h |
mcall 53,3,[socket] |
int 40h |
mov [mbuff+edx], bl |
inc edx |
cmp edx, 6 |
365,10 → 396,12 |
; |
rs_head_recived: |
mov eax, 53 |
mov ebx, 2 |
;mov eax, 53 |
;mov ebx, 2 |
;mov ecx, [socket] |
int 40h |
;int 40h |
mcall 53,2,[socket] |
cmp ax, [rflap.wDs] ; §¬¥à ¤ ëå |
jc r_end |
; |
390,9 → 423,10 |
cmp edx, esi |
jz rs_data_end |
mov eax, 53 |
mov ebx, 3 |
int 40h |
;mov eax, 53 |
;mov ebx, 3 |
;int 40h |
mcall 53,3,[socket] |
mov [mbuff+edx], bl |
inc edx |
jmp rs_data_loop |
402,7 → 436,7 |
; |
rs_data_end: |
mov [hrf], 0 |
write_debug 'Some data received' |
;write_debug 'Some data recived' |
; |
; |
; |
409,13 → 443,18 |
cmp [login], 0 |
jz rs_login |
call main_loop |
jmp r_end |
; |
; áâì á¬ëá« ¯à®¢¥à¨âì ᮪¥â «¨ç¨¥ á«¥¤ãî饣® § £®«®¢ª |
; |
;jmp r_end |
jmp rs_check_sock |
rs_login: |
call srv_login |
;write_debug 'Exited srv_login' |
jmp r_end |
;jmp r_end |
jmp rs_check_sock |
rs_flap_error: |
write_debug 'Invalid Flap' |
432,10 → 471,10 |
; |
rs_big_flap: |
write_debug 'Too BIG FLAP Received' |
write_debug 'Too BIG FLAP Recived' |
mov [hrf], 0 |
mov ecx, [socket] |
;mov ecx, [socket] |
mov ax, [rflap.wDs] |
xor esi, esi |
mov esi, eax |
445,9 → 484,10 |
cmp edx, esi |
jz r_end |
mov eax, 53 |
mov ebx, 3 |
int 40h |
;mov eax, 53 |
;mov ebx, 3 |
;int 40h |
mcall 53,3,[socket] |
;mov [mbuff+edx], bl |
inc edx |
jmp rs_data_loop2 |
479,57 → 519,70 |
getlp: |
inc ecx |
push ecx |
mov eax, 53 |
mov ebx, 9 |
int 0x40 |
;mov eax, 53 |
;mov ebx, 9 |
;int 0x40 |
mcall 53,9,ecx |
pop ecx |
cmp eax, 0 ; íâ®â «®ª «ìë© ¯®à⠨ᯮ«ì§ã¥âáï? |
jz getlp ; ¤ - ¯à®¤®«¦ ¥¬ ¯¥à¥¡¨à âì |
;OK ecx = port number |
;Open Socket |
mov eax, 53 |
mov ebx, 5 |
;mov eax, 53 |
;mov ebx, 5 |
xor edx, edx |
;mov dx, ICQ_PORT |
pop edx |
;mov esi,ICQ_IP |
mov edi, 1;SOCKET_ACTIVE |
;mov edi, 1;SOCKET_ACTIVE |
int 040h |
;int 40h |
mcall 53, 5, ecx, edx, esi, 1 |
; |
mov [socket], eax |
; |
; ¤¥¬ ãáâ ®¢ª¨ ᮥ¤¨¥¨ï |
mov ecx, eax |
srv_loop: |
mov eax, 53 |
mov ebx, 6 |
int 40h |
;mov eax, 5 |
;mov ebx, 50 |
;int 40h |
mcall 5, 50 |
;mov eax, 53 |
;mov ebx, 6 |
;int 40h |
mcall 53, 6, ecx |
cmp eax, TCB_ESTABLISHED |
jz fin |
cmp eax, 11 |
jae @f |
jae c_end |
; |
mov eax, 5 |
mov ebx, 50 |
int 40h |
;inc [timer] |
;cmp [timer], 50 |
;jz srv_err |
jmp srv_loop |
;srv_err: |
;mov [timer], word 0 |
;cmp eax,-1 |
;jnz fin |
;delay 100 |
write_debug 'CONNECTION FAILED' ;®¤ª«î票¥ ¥ 㤠«®áì |
jmp @f |
jmp c_end |
;connrcted: |
;CONNECTED |
fin: |
write_debug 'Connected!!!!' |
@@: |
c_end: |
pop edi |
pop esi |
pop edx |
540,8 → 593,7 |
; |
; --> ecx socket handle |
; |
buff db 1024 dup 0 |
lbuff db 8 dup 0 ; «ï 1 ¯ ª¥â ®â á¥à¢¥à |
srv_login: |
pushf |
push eax |
575,9 → 627,10 |
;mov [flap.bId], FLAP_ID |
mov [flap.bCh], NEW_CONNECTION |
mov eax, 26 |
mov ebx, 9 |
int 40h |
;mov eax, 26 |
;mov ebx, 9 |
;int 40h |
mcall 26, 9 |
mov [seq], ax |
mov [flap.wSn], ax ; Sequence number |
588,7 → 641,7 |
;mov[buff+4],0 |
mov word [buff+4], 0x0100; TLV.TYPE = UIN 00 01 |
mov eax, UIN |
lea eax, [vtable + vartable.uin] |
call strlen |
mov [buff+6], ah |
mov [buff+7], al ; Length of UIN |
597,18 → 650,19 |
mov ecx, eax ;«¨ áâப¨ |
mov eax, UIN |
lea eax, [vtable + vartable.uin] |
lea ebx, [buff+8] ; + à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ + 1 |
call strcpy |
mov eax, PASS |
lea eax, [vtable + vartable.pass] |
call roast |
mov [buff+edx+2], 2 ; TLV.TYPE - rosted password |
call strlen |
mov word [buff+edx+4], ax ; Length of pass |
mov [buff+edx+4], al |
mov [buff+edx+3], ah ; Length of pass |
add edx, 4 |
mov ebx, buff |
615,7 → 669,7 |
add ebx, edx ; § 票¥ |
add edx, eax ; ®åà 塞 ¢ EDX ¤«¨ã § ¯®«¥®£® ¡ãäà |
mov ecx, eax ; «¨ áâப¨ |
mov eax, PASS ; áâ®ç¨ª |
lea eax, [vtable + vartable.pass] ; áâ®ç¨ª |
inc ebx |
call strcpy |
622,7 → 676,8 |
mov [buff+edx+2], 3 ; TLV.TYPE - client id string |
mov eax, ID_STRING |
call strlen |
mov word [buff+edx+4], ax |
mov [buff+edx+4], al |
mov [buff+edx+3], ah |
add edx, 4 |
mov ecx, eax |
633,34 → 688,48 |
mov eax, ID_STRING |
call strcpy |
xor eax, eax |
mov [buff+edx+2], 016h ; TLV.TYPE - Client id |
mov [buff+edx+4], 2 |
mov word [buff+edx+6], ID_NUM |
mov ax, ID_NUM |
call htons |
mov word [buff+edx+5], ax |
add edx, 6 |
mov [buff+edx+2], 017h ; Client major version |
mov [buff+edx+4], 2 |
mov [buff+edx+6], MAJOR |
mov ax, MAJOR |
call htons |
mov word [buff+edx+5], ax |
add edx, 6 |
mov [buff+edx+2], 018h ; Client minor version |
mov [buff+edx+4], 2 |
mov [buff+edx+6], MINOR |
mov ax, MINOR |
call htons |
mov word [buff+edx+5], ax |
add edx, 6 |
mov [buff+edx+2], 019h ; Client lesser version |
mov [buff+edx+4], 2 |
mov [buff+edx+6], LESSER |
mov ax, LESSER |
call htons |
mov word [buff+edx+5], ax |
add edx, 6 |
mov [buff+edx+2], 01Ah ; Client build number |
mov [buff+edx+4], 2 |
mov word [buff+edx+6], BUILD |
mov ax, BUILD |
call htons |
mov word [buff+edx+5], ax |
add edx, 6 |
mov [buff+edx+2], 014h ; Client distribution number |
mov [buff+edx+4], 4 |
mov [buff+edx+8], DISTR |
mov eax, DISTR |
call htonl |
mov dword [buff+edx+5], eax |
add edx, 8 |
mov [buff+edx+2], 0Fh ; Client language |
676,7 → 745,7 |
mov eax, CL_LANG |
call strcpy |
mov [buff+edx+2], 0Fh ; Client language |
mov [buff+edx+2], 0Eh ; Client country |
mov eax, CL_COUNTRY |
call strlen |
mov word [buff+edx+4], ax |
737,7 → 806,7 |
mov ax, word [mbuff+ebx] |
cmp ax, 0100h ; 00 01 TLV.Type UIN |
jz l_uin_ok ; ¥¯¥àì á¥à¢¥à ¯¥à¥¤ ¥â ¥é¥ ¤ ë¥ ¯à¨ ᮥ¤¨¥¨¨, ¯®â®¬ ®¯ïâì |
add ebx, 5 ; â®â ¦¥ TLV 1 |
add ebx, 5 ; â®â ¦¥ TLV 1 (®¢ë© ä®à¬ â ¯ ª¥ªâ ) |
cmp ebx, 5 |
ja l_tlvt_err |
jmp uin_loop |
804,17 → 873,18 |
; |
;call srv_disconnect |
mov ecx, [socket] |
;write_debug 'Closing socket' |
write_debug 'Closing socket' |
;call closesocket |
; |
; |
;mov eax, 53 |
;mov ebx, 8 |
;int 40h |
; |
;FIXME!!! |
; ª®¬¬¥â®à®¢ ® ¨§-§ ¯à®¡«¥¬ë á á¥â¥¢ë¬ á⥪®¬ |
;§ ªàë⨥ ᮪¥â § ¢¥è¨¢ ¥â á¨á⥬ã |
;mcall 53, 8, ecx |
mov eax, bos_address |
call ip_parser |
846,7 → 916,7 |
jmp l_fin |
l_len_err: |
write_debug 'RECEIVED DATA LENGTH MISMATCH' |
write_debug 'RECIVED DATA LENGTH MISMATCH' |
jmp l_fin |
l_tlvt_err: |
858,7 → 928,7 |
jmp l_fin |
l_flap_err: |
write_debug 'FLAP ID MISMATCH / RECEIVE ERROR' |
write_debug 'FLAP ID MISMATCH / RECIVE ERROR' |
l_fin: |
866,7 → 936,7 |
; ¥®¡å®¤¨¬® § ªàëâì ᮪¥â |
; |
;call srv_disconnect |
;call closesocket |
call closesocket |
l_end: |
pop edx |
;pop ecx |
957,6 → 1027,27 |
; |
; ªà®á ¤«ï áà ¢¥¨ï áâப |
; |
macro strcmp first, second, len |
{ |
push ecx |
push esi |
push edi |
mov ecx, len |
mov esi, first |
mov edi, second |
repe cmpsb |
pop edi |
pop esi |
pop ecx |
} |
; |
; ¯®«ï¥â ¡ãä¥à, ¯® ¤à¥áã ¢ ebx |
; ¤ 묨, ¯® ¤à¥áã eax, ¢ |
; cx - ¨¯ TLV |
1031,9 → 1122,10 |
xchg ecx, edx ; ecx - handle, edx - data size |
s_wait: |
mov eax, 53 ; ஢¥à塞 á®áâ®ï¨¥ ᮪¥â . ᫨ ᮥ¤¨¥¨¥ |
mov ebx, 6 ; ãáâ ®¢«¥® - ¯®áë« ¥¬ ¡ãä¥à, ¥á«¨ ᮪¥â § ªàëâ, ã室¨¬ |
int 40h |
;mov eax, 53 ; ஢¥à塞 á®áâ®ï¨¥ ᮪¥â . ᫨ ᮥ¤¨¥¨¥ |
;mov ebx, 6 ; ãáâ ®¢«¥® - ¯®áë« ¥¬ ¡ãä¥à, ¥á«¨ ᮪¥â § ªàëâ, ã室¨¬ |
;int 40h |
mcall 53, 6, ecx |
cmp eax, TCB_ESTABLISHED ; ãáâ ®¢«¥® |
jz s_est |
cmp eax, TCB_CLOSED |
1042,19 → 1134,21 |
jnc s_fin ; |
mov eax, 5 |
mov ebx, 1 |
int 40h ; ¤¥¬ |
;mov eax, 5 |
;mov ebx, 1 |
;int 40h ; ¤¥¬ |
mcall 5, 1 |
jmp s_wait |
s_est: |
mov eax, 53 |
mov ebx, 7 ; ¯¨á âì ¢ ᮪¥â |
;xchg ecx, edx ; ecx - handle, edx - data length |
;mov eax, 53 |
;mov ebx, 7 ; ¯¨á âì ¢ ᮪¥â |
add edx, 6 ; + size of header |
mov esi, sbuff ; data |
int 40h |
;mov esi, sbuff ; data |
;int 40h |
mcall 53, 7, ecx, edx, sbuff |
s_fin: |
pop ecx |
1065,129 → 1159,6 |
popf |
ret |
; |
; ਨ¬ ¥â ¯ ª¥â ¨§ ᮪¥â |
; eax - 㪠§ ⥫ì FLAP_head |
; ebx - 㪠§ â¥«ì ¬ áᨢ |
; ecx - 奤« ᮪¥â |
; ®§¢à é ¥â ¢ eax ª®«¨ç¥á⢮ ¯à¨ïâëå ¡ ©â ¢ ¬ áᨢ¥ |
; |
; recvflap: |
; pushf |
; |
; ;push eax |
; push ebx |
; push esi |
; push edi |
; push edx |
; mov esi, eax |
; mov edi, ebx |
; |
; r_fail: |
; mov eax, 53 ; ¯à 訢 ¥¬ ᮪¥â |
; mov ebx, 2 ; ¢ eax ª®«¨ç¥á⢮ ¯®«ãç¥ëå ¡ ©â |
; int 40h ; |
; cmp eax, 6 ; ¡ãä¥à ¥ ¯ãá⮩ |
; jnc r_ok |
; |
; mov eax, 53 ; ®«ãç ¥¬ á®áâ®ï¨¥ ᮪¥â |
; mov ebx, 6 ; |
; int 40h ; |
; |
; cmp eax, TCB_CLOSED ; § ªàëâ - ã室¨¬ |
; jz r_err |
; |
; |
; ;mov eax, 5 ; ¦¤¥¬ |
; ;mov ebx, 1 |
; ;int 40h |
; ; ã室¨¬ |
; |
; ;jmp r_fail |
; jmp rf_fin |
; |
; r_ok: ; ¡ãä¥à¥ ¤ ë¥ |
; |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [esi], bl ; flap.bId |
; cmp bl, FLAP_ID |
; jnz r_err |
; |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [esi+1], bl ; flap.bCh |
; |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [esi+3], bl ; flap.wSn áâ à訩 ¡ ©â |
; |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [esi+2], bl ; flap.wSn ¬« ¤è¨© ¡ ©â |
; |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [esi+5], bl ; flap.wDs áâ à訩 ¡ ©â |
; |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [esi+4], bl ; flap.wDs ¬« ¤è¨© ¡ ©â |
; |
; r_check: |
; mov eax, 53 ; ஢¥à塞 ç¨á«® ¯®«ãç¥ëå ¡ ©â |
; mov eax, 2 |
; int 40h |
; |
; xor ebx, ebx |
; mov bx, word [esi+4] ; flap.wDs |
; cmp eax, ebx |
; jnc r_drr ;>= |
; |
; mov eax, 68 ; wait |
; mov ebx, 1 |
; int 40h |
; jmp r_check |
; |
; r_drr: ; ready for data recive |
; |
; |
; xor edx, edx |
; mov dx, word [esi+4] ; flap.wDs |
; xor esi, esi |
; |
; rf_loop: |
; mov eax, 53 |
; mov ebx, 3 |
; int 40h |
; mov [edi+esi], bl |
; inc esi |
; cmp esi, edx |
; jnz rf_loop |
; mov eax, edx |
; jmp rf_fin |
; |
; r_err: |
; ;pop ebx |
; ;pop eax |
; mov eax, -1 |
; jmp rf_fin |
; |
; |
; rf_fin: |
; pop edx |
; pop edi |
; pop esi |
; pop ebx |
; ;pop eax |
; popf |
; ret |
; |
; eax - 㪠§ â¥«ì ¡ãä¥à |
1251,15 → 1222,16 |
; |
closesocket: |
push eax |
push ebx |
;push ebx |
mov eax, 53 |
mov ebx, 8 |
int 40h |
;mov eax, 53 |
;mov ebx, 8 |
;int 40h |
mcall 53, 8, ecx |
mov ecx, eax |
pop ebx |
;pop ebx |
pop eax |
ret |
1304,7 → 1276,7 |
xor ecx, ecx |
;xor eax, eax |
xor ebx, ebx |
mov ebx, eax |
xor edx, edx |
xor esi, esi |
xor edi, edi |
1312,7 → 1284,7 |
ip_loop: |
xor eax, eax |
;xor edx, edx |
mov al, [bos_address+ecx] |
mov al, [ebx+ecx] |
cmp al, '.' |
jz ip_dot |
1362,7 → 1334,7 |
shl esi, 8 ; ¤¢¨£ ¥¬ ¯à¥¤ë¤ã騩 ¡ ©â |
add esi, eax |
;mov eax, esi ; IP ¢ 16 à¨ç®© ä®à¬¥ |
;xor ebx, ebx ; ®¬¥à ¯®àâ ¥â |
xor ebx, ebx ; ®¬¥à ¯®àâ ¥â |
jmp ip_end |
@@: ; ë«® : |
1608,7 → 1580,7 |
; ¡à ¡®âª à áᮥ¤¨¥¨ï |
; |
m_close_conn: |
write_debug 'Another Computer is Using YOUR UIN!' |
write_debug 'Another Computer Use YOUR UIN!' |
call srv_disconnect |
call closesocket |
jmp m_fin |
1629,9 → 1601,10 |
; £¥¥à¨à㥬 á«ãç ©ë© seq |
; «ï í⮣® ¡¥à¥¬ ¢à¥¬ï, ¯à®è¥¤è¥¥ á ¬®¬¥â § ¯ã᪠á¨á⥬ë |
; |
mov eax, 26 |
mov ebx, 9 |
int 40h |
;mov eax, 26 |
;mov ebx, 9 |
;int 40h |
mcall 26, 9 |
mov [seq], ax |
; |
; ⤠¥¬ á¥à¢¥àã cookie |
1881,7 → 1854,7 |
m_snac_1_other: |
data_debug 'Unknown SNAC Family 1 received, type ', edx |
data_debug 'Unknown SNAC Family 1 recived, type ', edx |
jmp m_fin |
1999,7 → 1972,7 |
; |
; § ¢á¥© ¨ä®à¬ 樨 ¯®ª 㦥 ⮫쪮 áâ âãá |
; |
xor edx, edx ; ç¥â稪 |
xor edx, edx ; ç¥â稪 - ®¬¥à UIN ¢ ¬ áᨢ¥ |
xor ecx, ecx |
xor eax, eax |
cld ; ¯à ¢«¥¨¨ 㢥«¨ç¥¨ï ¤à¥á®¢ |
2023,34 → 1996,79 |
; UIN ¯à¥¤¥«¥ |
; |
lea ecx, [eax+10+11] ; +sizeof SNAC_head + offset #2 TLV |
mov ax, word [mbuff+ecx] ;#2 TLV.Type |
cmp ax, 0C00h ;dc info (optional) |
jz m_snac_3_b_dc |
cmp ax, 0A00h ;external ip address |
jz m_snac_3_b_extip |
jmp m_snac_3_b_bad_tlv |
; |
; ©â¨ TLV á® áâ âãᮬ |
; á®åà ïâì edx |
xor esi, esi ; ç¥â稪 TLV |
m_snac_3_b_dc: |
xor ecx, ecx |
mov ch, byte [mbuff + eax + 13] ; ®«-¢® TLV ¢ 楯®çª¥ |
mov cl, byte [mbuff + eax + 14] ; |
lea eax, [eax + 10 + 5] ; eax 㪠§ ⥫ì 楯®çªã TLV |
lea eax, [mbuff + eax] ; |
m_snac_3_b_next_tlv: |
cmp esi, ecx |
jz m_snac_3_b_endchain |
xor ebx, ebx |
mov bh, [eax] ; |
mov bl, [eax + 1] ; TLV.Type |
data_debug 'TLV type', ebx |
cmp ebx, 0x06 ;TLV.Type(0x06) - user status |
jz m_snac_3_b_status |
; |
; §¡¨à ¥¬ 楯®çªã ¤ «ìè¥ |
; |
get_next_tlv |
inc esi |
jmp m_snac_3_b_next_tlv |
; FIXME ¥®¯â¨¬ «ì® - ª®¤ ¡ã¤¥â 㤠«¥ |
; |
;lea ecx, [eax+10+11] ; +sizeof SNAC_head + offset #2 TLV |
;mov ax, word [mbuff+ecx] ;#2 TLV.Type |
;cmp ax, 0C00h ;dc info (optional) |
;jz m_snac_3_b_dc |
;cmp ax, 0A00h ;external ip address |
;jz m_snac_3_b_extip |
;jmp m_snac_3_b_bad_tlv |
;m_snac_3_b_dc: |
; |
; யã᪠¥¬ íâ®â TLV |
; |
lea ecx, [ecx+41] |
m_snac_3_b_extip: |
;lea ecx, [ecx+41] |
;m_snac_3_b_extip: |
; |
; íâ®â :-) |
lea ecx, [ecx+8] |
mov ax, word [mbuff+ecx] |
cmp ax, 0600h ;TLV.Type(0x0A) - external ip address |
jz m_snac_3_b_status |
jmp m_snac_3_b_bad_tlv |
;lea ecx, [ecx+8] |
;mov ax, word [mbuff+ecx] |
;cmp ax, 0600h ;TLV.Type(0x0A) - external ip address |
;jz m_snac_3_b_status |
;jmp m_snac_3_b_bad_tlv |
; |
; |
m_snac_3_b_status: |
; |
; ª®¥æ-â® áâ âãá 8-) |
; áâ âãá |
; |
mov eax, dword [mbuff+ecx+4] |
mov ecx, eax |
mov eax, dword [ecx + 4] |
;mov eax, dword [mbuff+ecx+4] |
call ntohl |
;mov ebx, 4 |
;imul ebx, edx |
2072,8 → 2090,11 |
write_debug 'UIN not in local Contact List' |
jmp m_fin |
m_snac_3_b_endchain: |
jmp m_fin |
m_snac_3_c: |
; |
; User offline notification |
2115,7 → 2136,7 |
m_snac_3_other: |
write_debug 'Unknown SNAC Family 3 Received' |
write_debug 'Unknown SNAC Family 3 Recived' |
jmp m_fin |
2331,10 → 2352,64 |
call strcpy |
lea ebx, [ebx+ecx] |
; |
; ¥¯«®å® ¡ë«® ¡ë ¢ë¢¥á⨠¥ UIN Nickname, ¥á«¨ ® ¥áâì ¢ ª®â ªâ «¨á⥠|
; |
xor esi, esi ; ç¥â稪 |
m_snac_ch1_next_uin: |
cmp esi, UINS |
jz m_snac_ch1_notfound |
mov edx, UIN_LEN |
imul edx, esi |
lea edx, [uins + edx] |
movzx ecx, byte [ui.bUinLength] |
strcmp edx, ui.bUin, ecx |
jz m_snac_ch1_uin |
inc esi |
jmp m_snac_ch1_next_uin |
; |
; ®¤å®¤ï騩 UIN ¥áâì ¢ ª®â ªâ-«¨á⥠|
; |
m_snac_ch1_uin: |
mov edx, NAME_LEN |
imul edx, esi |
lea edx, [names + edx] |
mov eax, edx |
call strlen |
mov ecx, eax |
mov eax, edx |
call strcpy |
jmp m_snac_ch1_msgfrom |
; |
; ᫨ ¯®¤å®¤ï饣® UIN ¥â ¢ ª®â ªâ-«¨á⥠|
; |
m_snac_ch1_notfound: |
lea eax, [ui.bUin] |
movzx ecx, byte [ui.bUinLength] |
call strcpy |
; |
; 뢮¤ á®®¡é¥¨ï "®â ª®£®" |
; |
m_snac_ch1_msgfrom: |
mov [ebx+ecx], byte 0 |
mov eax, buff |
2447,7 → 2522,7 |
m_snac_4_other: |
write_debug 'Unknown SNAC Family 4 received' |
write_debug 'Unknown SNAC Family 4 recived' |
jmp m_fin |
2467,8 → 2542,28 |
; |
; ¡à ¡®âª¨ ¯®ª ¥â |
; |
if USE_SSI <> 0 |
; |
; ¯à®á á á¥à¢¥à |
; |
; |
; Request contact list (first time) |
; |
mov [ssnac.wFid], 13h ; Family |
mov [ssnac.wSid], 04h ; Subtype |
mov [ssnac.dRi], 04h ; request-id |
mov eax, ssnac |
mov ebx, buff |
xor edx, edx |
call sendsnac |
else |
; ⪫î祮, ⪠¥ ¯®¤¤¥à¦¨¢ ¥âáï SIQ |
; |
2546,32 → 2641,32 |
; |
; &RQ áâì ¯ ª¥â ãáâ ®¢ª¨ à §à¥è¥¨©. ï ¨á¯®«ì§ãî ¥£® ¡¥§ ¨§¬¥¥¨ï |
; â.ª. ¥ § î, çâ® ® ᮤ¥à¦¨â |
; |
; - ¢®§¬®¦®, ¡ã¤ã ¨á¯®«ì§®¢ âì ¯®§¤¥¥ |
mov [ssnac.wFid], 15 ; Family |
mov [ssnac.wSid], 2 ; Subtype |
mov [ssnac.dRi], 2 |
;mov [ssnac.wFid], 15 ; Family |
;mov [ssnac.wSid], 2 ; Subtype |
;mov [ssnac.dRi], 2 |
mov word [buff], 0100h ; 00 01 encapsulated META_DATA |
mov word [buff+2], 1000h ; 00 10 Len |
mov word [buff+4], 000Eh ; LE Len |
mov word [buff+10], 07D0h ; META_DATA_REQ |
;mov word [buff], 0100h ; 00 01 encapsulated META_DATA |
;mov word [buff+2], 1000h ; 00 10 Len |
;mov word [buff+4], 000Eh ; LE Len |
;mov word [buff+10], 07D0h ; META_DATA_REQ |
mov eax, UIN |
call ascitoint |
mov dword [buff+6], eax |
;mov eax, UIN |
;call ascitoint |
;mov dword [buff+6], eax |
mov word [buff+12], 0102h ; request sequence number (incrementing) |
mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO |
mov [buff+16], 1 ; authorization (1-required, 0-not required) |
mov [buff+17], byte 0 ; webaware (0-no, 1-yes) |
mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) |
mov [buff+19], 0 ;unknown |
;mov word [buff+12], 0102h ; request sequence number (incrementing) |
;mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO |
;mov [buff+16], 1 ; authorization (1-required, 0-not required) |
;mov [buff+17], byte 0 ; webaware (0-no, 1-yes) |
;mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) |
;mov [buff+19], 0 ;unknown |
mov eax, ssnac |
mov ebx, buff |
mov edx, 20 |
;mov eax, ssnac |
;mov ebx, buff |
;mov edx, 20 |
; |
2604,12 → 2699,12 |
mov word [buff], 0100h ; TLV type 01 |
mov word [buff+2], 0A00h ; 00 0a Ǭ |
mov word [buff+4], 0008h ; 08 00 |
mov eax, UIN |
lea eax, [vtable + vartable.uin] |
call ascitoint |
mov dword [buff+6], eax |
mov [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
mov [buff+12], 0002 ; 02 00 - request sequence number |
mov word [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
mov word [buff+12], 0002 ; 02 00 - request sequence number |
mov edx, 14 ; ¡é¨© à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ |
2628,10 → 2723,13 |
; |
mov [login], 2 |
end if ; USE_SSI = 0 |
jmp m_fin |
m_snac_9_other: |
write_debug 'Unknown SNAC Family 9 Received' |
write_debug 'Unknown SNAC Family 9 Recived' |
jmp m_fin |
2641,6 → 2739,8 |
m_snac_13: |
cmp dx, 3 |
jz m_snac_13_3 |
cmp dx, 6 |
jz m_snac_13_6 |
cmp dx, 0fh |
jz m_snac_13_F |
2661,14 → 2761,17 |
mov [ssnac.wSid], 5 ; Subtype |
mov [ssnac.dRi], 5 ; request-id |
mov eax, ssnac |
; 3D E7 48 17 |
; |
; |
; |
mov [buff], 03Dh ; |
mov [buff+1], 0E7h ; modification date/time of client local SSI copy |
mov [buff+2], 48h ; |
mov [buff+3], 17h ; |
; 00 10 |
; |
; |
mov [buff+4], 00 ; |
mov [buff+5], 10h ; number of items in client local SSI copy |
mov [buff+5], 00h ; number of items in client local SSI copy |
mov ebx, buff |
mov edx, 5 |
2676,7 → 2779,181 |
jmp m_fin |
; |
; Server contact list reply |
; |
m_snac_13_6: |
lea eax, [mbuff+10] ; eax § £à㦠¥¬ ¤à¥á ¯à¨¥¬®£® ¡ãä¥à + à §¬¥à § £®«®¢ª snac |
call ssi_process_data ; ¡à ¡®âª ¯ ª¥â á |
; |
; ªâ¨¢¨à㥬 SSI |
; |
mov [ssnac.wFid], 13h ; Family |
mov [ssnac.wSid], 7 ; Subtype |
mov [ssnac.dRi], 7 ; request-id |
mov eax, ssnac |
mov ebx, buff |
xor edx, edx |
call sendsnac |
; |
; ¯®á«¥¤ïï áâ ¤¨ï ᮥ¤¨¥¨ï |
; |
; |
; ¯à 訢 ¥¬ á¢®î ¨ä®à¬ æ¨î |
; |
mov [ssnac.wFid], 1 ; Family |
mov [ssnac.wSid], 0Eh ; Subtype |
mov [ssnac.dRi], 0Eh ; request-id |
mov eax, ssnac |
mov ebx, buff |
xor edx, edx ; TLV head len |
call sendsnac |
; |
; Client sends its DC info and status to server |
; |
mov [ssnac.wFid], 1 ; Family |
mov [ssnac.wSid], 1Eh ; Subtype |
mov [ssnac.dRi], 1Eh ; request-id |
mov [buff], 0 ; TLV type 06 |
mov [buff+1], 6h ; |
mov [buff+2], 0 ; TLV data length |
mov [buff+3], 4 ; |
; |
; |
mov ax, STATUS_DCDISABLED ; DC disabled |
call htons |
mov word [buff+4], ax |
mov ax, STATUS_ONLINE |
mov [status], ax |
mov word [buff+6], ax |
mov eax, ssnac |
mov ebx, buff |
mov edx, 8 ; TLV head len+ data len |
call sendsnac |
; |
; ë£à㦠¥¬ á¥à¢¥à |
; FIXME ®§¬®¦®, §¤¥áì ¥ 㦠íâ äãªæ¨ï |
;call uploadkl |
; |
; ë£à㦠¥¬ ¨¢¨§¨¡« «¨áâ, ¯®ª ¯ãá⮩ |
; |
;mov [ssnac.wFid], 9 ; Family |
;mov [ssnac.wSid], 7 ; Subtype |
;mov [ssnac.dRi], 7 |
;mov eax, ssnac |
;mov ebx, buff |
;xor edx, edx |
;call sendsnac |
; |
; &RQ áâì ¯ ª¥â ãáâ ®¢ª¨ à §à¥è¥¨©. ï ¨á¯®«ì§ãî ¥£® ¡¥§ ¨§¬¥¥¨ï |
; â.ª. ¥ § î, çâ® ® ᮤ¥à¦¨â |
; - ¢®§¬®¦®, ¡ã¤ã ¨á¯®«ì§®¢ âì ¯®§¤¥¥ |
;mov [ssnac.wFid], 15 ; Family |
;mov [ssnac.wSid], 2 ; Subtype |
;mov [ssnac.dRi], 2 |
;mov word [buff], 0100h ; 00 01 encapsulated META_DATA |
;mov word [buff+2], 1000h ; 00 10 Len |
;mov word [buff+4], 000Eh ; LE Len |
;mov word [buff+10], 07D0h ; META_DATA_REQ |
;mov eax, UIN |
;call ascitoint |
;mov dword [buff+6], eax |
;mov word [buff+12], 0102h ; request sequence number (incrementing) |
;mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO |
;mov [buff+16], 1 ; authorization (1-required, 0-not required) |
;mov [buff+17], byte 0 ; webaware (0-no, 1-yes) |
;mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) |
;mov [buff+19], 0 ;unknown |
;mov eax, ssnac |
;mov ebx, buff |
;mov edx, 20 |
; |
; Client READY command |
; |
mov [ssnac.wFid], 1 ; Family |
mov [ssnac.wSid], 2 ; Subtype |
mov [ssnac.dRi], 2 ; request-id |
mov eax, FAMILY_ARR |
mov ebx, buff |
push ecx |
mov ecx, FA_LEN |
call strcpy |
pop ecx |
mov eax, ssnac |
mov ebx, buff |
mov edx, FA_LEN |
call sendsnac |
; |
; ¯à 訢 ¥¬ offline á®®¡é¥¨ï |
; |
mov [ssnac.wFid], 15h ; Family |
mov [ssnac.wSid], 2 ; Subtype |
mov [ssnac.dRi], 2 ; request-id |
mov word [buff], 0100h ; TLV type 01 |
mov word [buff+2], 0A00h ; 00 0a Ǭ |
mov word [buff+4], 0008h ; 08 00 |
lea eax, [vtable + vartable.uin] |
call ascitoint |
mov dword [buff+6], eax |
mov word [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
mov word [buff+12], 0002 ; 02 00 - request sequence number |
mov edx, 14 ; ¡é¨© à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ |
mov eax, ssnac |
mov ebx, buff |
call sendsnac |
; |
; ¯à 訢 ¥¬ ¨ä®à¬ æ¨î ¢á¥å UIN |
; FIXME ®§¬®¦®, §¤¥áì ¥ 㦠íâ äãªæ¨ï |
;call getinfo |
; |
; § ¢¥à襮 ᮥ¤¨¥¨¥ |
; |
mov [login], 2 |
jmp m_fin |
; |
; Server tell client its local copy up-to-date |
; |
m_snac_13_F: |
2715,8 → 2992,9 |
mov ax, STATUS_DCDISABLED ; DC disabled |
call htons |
mov word [buff+4], ax |
mov ax, STATUS_ONLINE |
mov [status], ax |
; |
; |
mov ax, [status] |
mov word [buff+6], ax |
mov eax, ssnac |
2754,7 → 3032,7 |
mov word [buff], 0100h ; TLV type 01 |
mov word [buff+2], 0A00h ; 00 0a Ǭ |
mov word [buff+4], 0008h ; 08 00 |
mov eax, UIN |
lea eax, [vtable + vartable.uin] |
call ascitoint |
mov dword [buff+6], eax |
2772,7 → 3050,7 |
jmp m_fin |
m_snac_13_other: |
write_debug 'Unknown SNAC Family 13 Received' |
write_debug 'Unknown SNAC Family 13 Recived' |
jmp m_fin |
2901,7 → 3179,7 |
mov word [buff], 0100h ; 00 01 TLV.Type(1) - encapsulated META_DATA1 |
mov word [buff+2], 0A00h ; 00 0A TLV.Length |
mov word [buff+4], 0008h ; 08 00 data chunk size (TLV.Length-2) |
mov eax, UIN |
lea eax, [vtable + vartable.uin] |
call ascitoint |
mov dword [buff+6], eax ; xx xx xx xx (LE) client uin |
mov word [buff+10], 003Eh ; 3E 00 (LE) data type: delete offline msgs request cmd |
2990,13 → 3268,13 |
m_snac_15_other: |
write_debug 'Unknown SNAC Family 15 Received' |
write_debug 'Unknown SNAC Family 15 Recived' |
jmp m_fin |
m_other_snac: |
write_debug 'Unknown SNAC received' |
write_debug 'Unknown SNAC recived' |
jmp m_fin |
3130,9 → 3408,10 |
; |
; ®«ãç ¥¬ ¢à¥¬ï á § ¯ã᪠á¨á⥬ë, ¤«ï cookie |
; |
mov eax, 26 |
mov ebx, 9 |
int 40h |
;mov eax, 26 |
;mov ebx, 9 |
;int 40h |
mcall 26, 9 |
mov dword [buff], eax ; Cookie 1 |
mov dword [buff+4], eax ; Cookie 2 |
3231,7 → 3510,7 |
mov word [buff], 0100h ;TLV.Type(1) - encapsulated META_DATA |
mov word [buff+2], 1000h ; 00 10 TLV.Length |
mov word [buff+4], 000Eh ; (LE) data chunk size (TLV.Length-2) |
mov eax, UIN |
lea eax, [vtable + vartable.uin] |
call ascitoint |
mov dword [buff+6], eax ;(LE) request owner uin |
mov word [buff+10], 07D0h ;data type: META_DATA_REQ |
3357,25 → 3636,230 |
popf |
ret |
; |
; ãªæ¨ï ¤«ï ãáâ ®¢ª¨ áâ âãá |
; áâ âãá ¢ ¯¥à¥¬¥®© status |
setstatus: |
push eax |
push ebx |
push edx |
; |
; Client sends its DC info and status to server |
; |
mov [ssnac.wFid], 1 ; Family |
mov [ssnac.wSid], 1Eh ; Subtype |
mov [ssnac.dRi], 1Eh ; request-id |
mov [buff], 0 ; TLV type 06 |
mov [buff+1], 6h ; |
mov [buff+2], 0 ; TLV data length |
mov [buff+3], 4 ; |
; |
; |
mov ax, STATUS_DCDISABLED ; DC disabled |
call htons |
mov word [buff+4], ax |
; |
; |
mov ax, [status] |
mov word [buff+6], ax |
mov eax, ssnac |
mov ebx, buff |
mov edx, 8 ; TLV head len+ data len |
call sendsnac |
pop edx |
pop ebx |
pop eax |
ret |
; |
; ªà®á ¯à®¯ã᪠¥â ¢á¥ ¯à®¡¥«ë ¢ áâப¥ ¤® |
; 1 £® § ç 饣® ᨬ¢®« |
; eax - 㪠§ ⥫ì null-terminated áâபã |
macro skip_spaces { |
local ..sp_end, ..sp_loop |
push ebx |
push ecx |
xor ebx, ebx |
xor ecx, ecx |
..sp_loop: |
mov bl, [eax + ecx] |
cmp bl, 0x20 |
jnz ..sp_end |
inc ecx |
jmp ..sp_loop |
..sp_end: |
lea eax, [eax + ecx] |
pop ecx |
pop ebx |
} |
; |
; ¡à ¡®âª ª®¬ ¤ |
; ¥ax ¯¥à¥¤ ¥âáï 㪠§ ⥫ì áâபã. ®¬ ¤ ¨ à£ã¬¥âë à §¤¥«¥ë ¯à®¡¥«®¬ |
; ª®¬ ¤ ç¨ ¥âáï á / |
; ¢ eax - १ã«ìâ ⠢믮«¥¨ï ª®¬ ¤ë, -1 ª®¬ ¤ ¥ áãé¥áâ¢ã¥â, 0 ®ª, ¤à㣨¥ § ¢¨áï⠮⠪®¬ ¤ë |
cmd: |
push ebx |
push ecx |
push edi |
push esi |
; |
; ஢¥à¨âì ¯¥à¢ë© ᨬ¢®« |
; |
xor ebx, ebx |
mov bl, [eax] |
cmp bl, '/' |
jnz cmd_end |
; |
; §¤¥«¥¨¥ ¯® 1© ¡ãª¢¥ ª®¬ ¤ë |
; |
mov bl, [eax + 1] |
cmp bl, 'c' |
jz cmd_c |
cmp bl, 'e' |
jz cmd_e |
cmp bl, 's' |
jz cmd_s |
jmp cmd_no |
cmd_c: |
cmd_e: |
lea ebx, [eax + 1] |
strcmp ebx, str_exit, str_exit.len |
jz cmd_exit |
jmp cmd_no |
cmd_s: |
lea ebx, [eax + 1] |
strcmp ebx, str_status, str_status.len |
jz cmd_status |
jmp cmd_no |
cmd_exit: |
cmd_status: |
; |
; ãáâ ®¢¨âì áâ âãá ¨ ¯®á« âì ¯ ª¥â ᬥë áâ âãá |
; |
lea eax, [eax + 1 + str_status.len] |
skip_spaces |
strcmp eax, str_online, str_online.len |
jz cmd_st_online |
strcmp eax, str_away, str_away.len |
jz cmd_st_away |
strcmp eax, str_na, str_na.len |
jz cmd_st_na |
strcmp eax, str_dnd, str_dnd.len |
jz cmd_st_dnd |
strcmp eax, str_bisy, str_bisy.len |
jz cmd_st_bisy |
strcmp eax, str_free4chat, str_free4chat.len |
jz cmd_st_free4chat |
; |
; â âãá ¥ ®¯à¥¤¥«¥. |
; 뢥á⨠ᮮ¡é¥¨¥ ® ¤®áâã¯ëå áâ âãá å |
; |
mov eax, str_status_message |
xor ebx, ebx |
call writemsg |
jmp cmd_end |
cmd_st_online: |
cmd_st_away: |
cmd_st_na: |
cmd_st_dnd: |
cmd_st_bisy: |
cmd_st_free4chat: |
cmd_no: |
cmd_end: |
pop esi |
pop edi |
pop ecx |
pop ebx |
ret |
; <--- initialised data ---> |
DATA |
lsz header,\ |
ru, "KI",\ |
en, "KI",\ |
fr, "KI" |
include "parser_data.inc" |
include "ssi_data.inc" |
include "comp_data.inc" |
head db 'KI',0 |
; |
MESS db 'Message from ', 0 |
CUSER db 'Current user: ', 0 |
; |
; ¯¨á®ª IP á¥à¢¥à®¢ ICQ |
;ICQ_IP = 0x0A00A8C0 ; 192.168.0.10 |
ICQ_IP = 0x99A10C40 |
;205.188.153.121 |
;icq_ip db '64.12.200.089',0 |
;icq_ip db '64.12.161.185',0 |
;icq_ip db '205.188.179.233',0 |
; |
flap FLAP_head |
rflap FLAP_head |
3387,15 → 3871,37 |
; |
procinfo process_information |
; |
UIN db '123456789',0 |
PASS db 'coolpass',0 |
;UIN db '362820484',0 |
;PASS db 'test',0 |
ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2000b.4.65.1.3281.85',0 |
;ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2001b.5.17.1.3642.85',0 |
CAPABILITIES db 053h, 054h, 0, 0, 097h, 0B1h, 027h, 051h, 024h, 03Ch, 043h, 034h, 0ADh, 022h, 0D6h, 0ABh,\ |
0F7h, 03Fh, 014h, 092h, 02Eh, 07Ah, 064h, 075h, 0FAh, 0DFh, 04Dh, 0C8h, 088h, 06Fh, 0EAh, 035h,\ |
095h, 0FDh, 0B6h, 0DFh, 09h, 046h, 013h, 044h, 04Ch, 07Fh, 011h, 0D1h, 082h, 022h, 044h, 045h,\ |
053h, 054h, 0, 0 |
;CAPABILITIES db 0x09, 0x46, 0x13, 0x49, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00,\ |
;0x97, 0xB1, 0x27, 0x51, 0x24, 0x3C, 0x43, 0x34, 0xAD, 0x22, 0xD6, 0xAB, 0xF7, 0x3F, 0x14, 0x92,\ |
CAPABILITIES db 0x2E, 0x7A, 0x64, 0x75, 0xFA, 0xDF, 0x4D, 0xC8, 0x88, 0x6F, 0xEA, 0x35, 0x95, 0xFD, 0xB6, 0xDF,\ |
'KOLIBRI KI(cq)',0,0 |
;0x09, 0x46, 0x13, 0x44, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 |
; 1 áâப |
; {09461349-4C7F-11D1-8222-444553540000} |
; Client supports channel 2 extended, TLV(0x2711) based messages. Currently used only by ICQ clients. |
;ICQ clients and clones use this GUID as message format sign. Trillian client use another GUID |
; in channel 2 messages to implement its own message format (trillian doesn't use TLV(x2711) in SecureIM channel 2 messages!). |
; |
; 2 áâப |
; {97B12751-243C-4334-AD22-D6ABF73F1492} |
; Client supports RTF messages. This capability currently used by ICQ service and ICQ clients. |
; |
; 4 áâப |
; {0946134E-4C7F-11D1-8222-444553540000} |
; Client supports UTF-8 messages. This capability currently used by AIM service and AIM clients |
; |
; |
; From &RQ |
; |
3407,7 → 3913,7 |
; 0x00, 0x00, 0x00, 0x00 |
C_LEN = 40h |
C_LEN = 32 |
;C_LEN = 80 |
ICBM_PARAMS db 0, 0, 0, 0, 0, 0Bh, 01Fh, 040h, 3, 0E7h, 3, 0E7h, 0, 0, 0, 0 |
ICBMP_LEN = 16 ; ^^^ from &RQ |
3422,13 → 3928,14 |
0x00, 0x06, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x09, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
0x00, 0x0A, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x06, 0x6A |
; |
; |
; |
FA_LEN = 50h |
; |
; |
; |
ID_NUM = 010Ah |
MAJOR = 05h |
;MAJOR = 04h |
3438,6 → 3945,9 |
;BUILD = 0CD1h |
BUILD = 0E3Ah |
DISTR = 055h |
; |
; |
TCB_ESTABLISHED = 4 |
TCB_CLOSED = 11 |
; |
3447,7 → 3957,9 |
sbuff db 1024 dup 0 ; ãä¥à ¤«ï ¯¥à¥¤ ç¨ ¨á¯®«ì§ã¥âáï ¢ãâਠsendflap |
rbuff db 1024 dup 0 ; ਥ¬ë© ¡ãä¥à |
;recived db 0 ; à¨ïâ® ¤ ëå ¨§ ⥫ ¯ ª¥â |
;rbuff db 1024 dup 0 ; ਥ¬ë© ¡ãä¥à |
tbuff db 512 dup 0 ; «ï TLV |
srv_cookie db 512 dup 0 ; 㪨 ¤«ï ¢â®à¨§ 樨 |
bos_address db 128 dup 0 ; ¤à¥á BOS á¥à¢¥à |
3476,10 → 3988,48 |
timer dw 0 |
;ltest db "ADMIN",0 |
buff db 1024 dup 0 |
; lbuff db 8 dup 0 ; «ï 1 ¯ ª¥â ®â á¥à¢¥à |
; |
; âப¨ ª®¬ ¤ ¤«ï áà ¢¥¨ï |
; |
str_status db 'status ' |
str_status.len = $ - str_status |
str_exit db 'exit ' |
str_exit.len = $ - str_exit |
; |
; âப¨ áâ âãᮢ ¤«ï áà ¢¥¨ï |
; |
str_away db 'away' |
str_away.len = $ - str_away |
str_dnd db 'dnd' |
str_dnd.len = $ - str_dnd |
str_bisy db 'bisy' |
str_bisy.len = $ - str_bisy |
str_na db 'na' |
str_na.len = $ - str_na |
str_online db 'online' |
str_online.len = $ - str_online |
str_free4chat db 'free4chat' |
str_free4chat.len = $ - str_free4chat |
str_status_message db '®áâã¯ë¥ áâ âãáë: away, bisy, na, dnd, online, free4chat',0 |
; |
; |
; |
cfg_message db 'Config:',0 |
; |
; EDITBOXES |
; |
inputbuff: |
/programs/network/icq/trunk/ki.cfg |
---|
0,0 → 1,9 |
# |
# |
# |
UIN="123456789" |
PASS="PASS" |
# |
# |
ICQIP="64.12.200.89" |
#ICQIP="192.168.0.1" |
/programs/network/icq/trunk/lang.inc |
---|
0,0 → 1,0 |
lang fix ru |
/programs/network/icq/trunk/macros.inc |
---|
0,0 → 1,543 |
@^ fix macro comment { |
^@ fix } |
; ------------------------- |
macro library [lname,fname] |
{ |
forward |
dd __#lname#_library_table__,__#lname#_library_name__ |
common |
dd 0 |
forward |
align 4 |
__#lname#_library_name__ db fname,0 |
} |
macro import lname,[name,sname] |
{ |
common |
align 4 |
__#lname#_library_table__: |
forward |
if used name |
name dd __#name#_import_name__ |
end if |
common |
dd 0 |
forward |
if used name |
align 4 |
__#name#_import_name__ db sname,0 |
end if |
} |
macro export [name,sname] |
{ |
forward |
dd __#name#_export_name__,name |
common |
dd 0 |
forward |
align 4 |
__#name#_export_name__ db sname,0 |
} |
; ------------------------- |
macro m2m dest,src { |
push src |
pop dest |
} |
macro iglobal { |
IGlobals equ IGlobals, |
macro __IGlobalBlock { } |
macro uglobal { |
UGlobals equ UGlobals, |
macro __UGlobalBlock { } |
endg fix } ; Use endg for ending iglobal and uglobal blocks. |
macro IncludeIGlobals{ |
macro IGlobals dummy,[n] \{ __IGlobalBlock |
purge __IGlobalBlock \} |
match I, IGlobals \{ I \} } |
macro IncludeUGlobals{ |
macro UGlobals dummy,[n] \{ |
\common |
\local begin, size |
begin = $ |
virtual at $ |
\forward |
__UGlobalBlock |
purge __UGlobalBlock |
\common |
size = $ - begin |
end virtual |
rb size |
\} |
match U, UGlobals \{ U \} } |
uglobal |
endg |
iglobal |
endg |
; new application structure |
macro meos_app_start |
{ |
use32 |
org 0x0 |
db 'MENUET01' |
dd 0x01 |
dd __start |
dd __end |
dd __memory |
dd __stack |
if used __params & ~defined __params |
dd __params |
else |
dd 0x0 |
end if |
dd 0x0 |
} |
MEOS_APP_START fix meos_app_start |
macro code |
{ |
__start: |
} |
CODE fix code |
macro data |
{ |
__data: |
IncludeIGlobals |
} |
DATA fix data |
macro udata |
{ |
if used __params & ~defined __params |
__params: |
db 0 |
__end: |
rb 255 |
else |
__end: |
end if |
__udata: |
IncludeUGlobals |
} |
UDATA fix udata |
macro meos_app_end |
{ |
align 32 |
rb 2048 |
__stack: |
__memory: |
} |
MEOS_APP_END fix meos_app_end |
; macro for defining multiline text data |
struc mstr [sstring] |
{ |
forward |
local ssize |
virtual at 0 |
db sstring |
ssize = $ |
end virtual |
dd ssize |
db sstring |
common |
dd -1 |
} |
; macro for defining multiline text data |
struc mls [sstring] |
{ |
forward |
local ssize |
virtual at 0 |
db sstring ; mod |
ssize = $ |
end virtual |
db ssize |
db sstring |
common |
db -1 ; mod |
} |
; strings |
macro sz name,[data] { ; from MFAR [mike.dld] |
common |
if used name |
name db data |
.size = $-name |
end if |
} |
macro lsz name,[lng,data] { ; from MFAR [mike.dld] |
common |
if used name |
label name |
forward |
if lang eq lng |
db data |
end if |
common |
.size = $-name |
end if |
} |
macro szc name,elsz,[data] { ; from MFAR [mike.dld] |
common |
local s,m |
m = 0 |
if used name |
label name |
forward |
virtual at 0 |
db data |
s = $ |
end virtual |
d#elsz s |
if m < s |
m = s |
end if |
db data |
common |
.size = $-name |
.maxl = m |
end if |
} |
macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld] |
common |
local s,m,c |
m = 0 |
c = 0 |
if used name |
label name |
forward |
if lang eq lng |
virtual at 0 |
db data |
s = $ |
end virtual |
d#elsz s |
if m < s |
m = s |
end if |
db data |
c = c+1 |
end if |
common |
.size = $-name |
.maxl = m |
.count = c |
end if |
} |
; easy system call macro |
macro mpack dest, hsrc, lsrc |
{ |
if (hsrc eqtype 0) & (lsrc eqtype 0) |
mov dest, (hsrc) shl 16 + lsrc |
else |
if (hsrc eqtype 0) & (~lsrc eqtype 0) |
mov dest, (hsrc) shl 16 |
add dest, lsrc |
else |
mov dest, hsrc |
shl dest, 16 |
add dest, lsrc |
end if |
end if |
} |
macro __mov reg,a,b { ; mike.dld |
if (~a eq)&(~b eq) |
mpack reg,a,b |
else if (~a eq)&(b eq) |
mov reg,a |
end if |
} |
include 'config.inc' |
;__CPU_type equ p5 |
SYSENTER_VAR equ 0 |
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls |
local ..ret_point |
__mov eax,a |
__mov ebx,b |
__mov ecx,c |
__mov edx,d |
__mov esi,e |
__mov edi,f |
if __CPU_type eq p5 |
int 0x40 |
else |
if __CPU_type eq p6 |
push ebp |
mov ebp, esp |
push ..ret_point ; it may be 2 or 5 byte |
sysenter |
..ret_point: |
pop edx |
pop ecx |
else |
if __CPU_type eq k6 |
push ecx |
syscall |
pop ecx |
else |
display 'ERROR : unknown CPU type (set to p5)', 10, 13 |
__CPU_type equ p5 |
int 0x40 |
end if |
end if |
end if |
} |
; ------------------------- |
macro header a,[b] { |
common |
use32 |
org 0 |
db 'MENUET',a |
forward |
if b eq |
dd 0 |
else |
dd b |
end if } |
macro section name { align 16 |
label name } |
macro func name { |
if ~used name |
display 'FUNC NOT USED: ',`name,13,10 |
else |
align 4 |
name: |
;diff16 `name,0,name |
;pushad |
;pushfd |
;dps `name |
;newline |
;mcall 5,1 |
;popfd |
;popad |
} |
macro endf { end if } |
macro diff16 title,l1,l2 |
{ |
local s,d |
s = l2-l1 |
display title,': 0x' |
repeat 8 |
d = '0' + s shr ((8-%) shl 2) and $0F |
if d > '9' |
d = d + 'A'-'9'-1 |
end if |
display d |
end repeat |
display 13,10 |
} |
macro diff10 title,l1,l2 |
{ |
local s,d,z,m |
s = l2-l1 |
z = 0 |
m = 1000000000 |
display title,': ' |
repeat 10 |
d = '0' + s / m |
s = s - (s/m)*m |
m = m / 10 |
if d <> '0' |
z = 1 |
end if |
if z <> 0 |
display d |
end if |
end repeat |
display 13,10 |
} |
; optimize the code for size |
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp> |
macro add arg1,arg2 |
{ |
if (arg2 eqtype 0) |
if (arg2) = 1 |
inc arg1 |
else |
add arg1,arg2 |
end if |
else |
add arg1,arg2 |
end if |
} |
macro sub arg1,arg2 |
{ |
if (arg2 eqtype 0) |
if (arg2) = 1 |
dec arg1 |
else |
sub arg1,arg2 |
end if |
else |
sub arg1,arg2 |
end if |
} |
macro mov arg1,arg2 |
{ |
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0')) |
if (arg2) = 0 |
xor arg1,arg1 |
else if (arg2) = 1 |
xor arg1,arg1 |
inc arg1 |
else if (arg2) = -1 |
or arg1,-1 |
else if (arg2) > -128 & (arg2) < 128 |
push arg2 |
pop arg1 |
else |
mov arg1,arg2 |
end if |
else |
mov arg1,arg2 |
end if |
} |
macro RGB [a] { |
common |
match (r=,g=,b),a \{ |
\dd ((r) shl 16) or ((g) shl 8) or (b) |
\} |
} |
struc POINT _t,_dx,_dy { |
.x _t _dx |
.y _t _dy |
} |
; structure definition helper |
include 'struct.inc' |
struct RECT |
left dd ? |
top dd ? |
right dd ? |
bottom dd ? |
ends |
struct BOX |
left dd ? |
top dd ? |
width dd ? |
height dd ? |
ends |
; structures used in MeOS |
struct process_information |
cpu_usage dd ? ; +0 |
window_stack_position dw ? ; +4 |
window_stack_value dw ? ; +6 |
dw ? ; +8 |
process_name rb 12 ; +10 |
memory_start dd ? ; +22 |
used_memory dd ? ; +26 |
PID dd ? ; +30 |
box BOX ; +34 |
slot_state dw ? ; +50 |
dw ? ; +52 |
client_box BOX ; +54 |
wnd_state db ? ; +70 |
rb (1024-71) |
ends |
struct system_colors |
frame dd ? |
grab dd ? |
grab_button dd ? |
grab_button_text dd ? |
grab_text dd ? |
work dd ? |
work_button dd ? |
work_button_text dd ? |
work_text dd ? |
work_graph dd ? |
ends |
struct FILEDATE |
Second db ? |
Minute db ? |
Hour db ? |
db ? |
Day db ? |
Month db ? |
Year dw ? |
ends |
struct FILEINFO |
Attributes dd ? |
IsUnicode db ? |
db 3 dup(?) |
DateCreate FILEDATE |
DateAccess FILEDATE |
DateModify FILEDATE |
Size dq ? |
ends |
; constants |
; events |
EV_IDLE = 0 |
EV_TIMER = 0 |
EV_REDRAW = 1 |
EV_KEY = 2 |
EV_BUTTON = 3 |
EV_EXIT = 4 |
EV_BACKGROUND = 5 |
EV_MOUSE = 6 |
EV_IPC = 7 |
EV_STACK = 8 |
; event mask bits for function 40 |
EVM_REDRAW = 1b |
EVM_KEY = 10b |
EVM_BUTTON = 100b |
EVM_EXIT = 1000b |
EVM_BACKGROUND = 10000b |
EVM_MOUSE = 100000b |
EVM_IPC = 1000000b |
EVM_STACK = 10000000b |
/programs/network/icq/trunk/parser.inc |
---|
0,0 → 1,696 |
; |
; âàãªâãà ¤«ï äãªæ¨¨ 70 |
; |
struc sinfo |
{ |
.subfnc_name dd 0 |
.pos_in_file dd 0 |
.reserved dd 0 |
.bytes_to_read dd 0 |
.pbuffer dd 0 |
.null db 0 |
.pname dd 0 |
} |
; |
; â ¡«¨æë § 票© |
; |
; +----+-------------+-----------------+ |
; | in | Variable | Variable | |
; | de | name | string | |
; | x | | | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | | |
; | | | | |
; | 1 | UIN | 'XXXXX..XX',0 | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | |
; |
; § £à㧪 int ¯®ª ¥ ॠ«¨§®¢ |
; |
; +----+-------------+-----------------+ |
; | in | Variable | Variable | |
; | de | name | int | |
; | x | | | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | | |
; | | | | |
; | 1 | BUFFSIZE | XXXXXXXX | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | |
; |
; |
TABLE_SIZE equ 16 |
VNAME_LEN equ 8 |
VAR_LEN equ 16 |
; |
; ¯¨á ¨¥ â ¡«¨æë § 票© |
virtual at 0 |
vartable: |
.uin db VAR_LEN dup ? |
.pass db VAR_LEN dup ? |
.icqip db VAR_LEN dup ? |
end virtual |
; |
; ®¤ë ®è¨¡®ª ä ©«®¢®© á¨á⥬ë |
; |
FIO_SUCCESS equ 0 |
FIO_UNSUPPORTED equ 2 |
FIO_UNKNOWNFS equ 3 |
FIO_FILENOTFOUND equ 5 |
FIO_EOF equ 6 |
FIO_BADPOINTER equ 7 |
FIO_DISKFULL equ 8 |
FIO_FATDAMAGED equ 9 |
FIO_DENIED equ 10 |
FIO_ERRORDEVICE equ 11 |
IOBUFF_SIZE equ 128 |
; |
; ¬ ªà®á ¤«ï ¯®¨áª í«¥¬¥â ¢ áâப¥ |
; ¢®§¢à é ¥â ¢ eax ®¬¥à í«¥¬¥â ¨«¨ -1 ¥á«¨ ¥ ©¤¥ |
macro findchar string, len, char |
{ |
local ..fc_endstr, ..fc_end |
push ebx |
push ecx |
push edi |
mov edi, string |
mov ecx, len |
mov ebx, ecx |
cld |
mov al, char |
repne scasb |
jcxz ..fc_endstr |
sub ebx, ecx ; ®¬¥à = |
mov eax, ebx |
jmp ..fc_end |
..fc_endstr: |
mov eax, -1 |
..fc_end: |
pop edi |
pop ecx |
pop ebx |
} |
; |
; ªà®á ¤«ï ¯®¨áª í«¥¬¥â áâப¨, ®â«¨ç î饣®áï ®â |
; § ¤ ®£® |
macro findother string, len, char |
{ |
local ..fc_endstr, ..fc_end |
push ebx |
push ecx |
push edi |
mov edi, string |
mov ecx, len |
mov ebx, ecx |
cld |
mov al, char |
repe scasb ; ᫨ ᨬ¢®« ¥ char - ¢ë室¨¬ |
jcxz ..fc_endstr ; áâப ¨§ char |
sub ebx, ecx ; ¢ ebx - ®¬¥à í«¥¬¥â ®â«¨ç®£® ®â char |
mov eax, ebx |
jmp ..fc_end |
..fc_endstr: |
mov eax, -1 |
..fc_end: |
pop edi |
pop ecx |
pop ebx |
} |
; |
; ªà®á ¤«ï ª®¯¨à®¢ ¨ï áâப |
; |
macro mstrcpy from, to, leng |
{ |
push ecx |
push esi |
push edi |
mov ecx, leng |
mov esi, from |
mov edi, to |
cld |
rep movsb |
pop edi |
pop esi |
pop ecx |
} |
; |
; ¨æ¨ «¨§¨àã¥â â ¡«¨æë |
; |
; inittables: |
; |
; |
; mstrcpy name1, nvtable, VNAME_LEN |
; mstrcpy name2, (nvtable + NAME_LEN), VNAME_LEN |
; mstrcpy name3, (nvtable + NAME_LEN * 2), VNAME_LEN |
; |
; |
; |
; ret |
; |
; § ¯®«ï¥â â ¡«¨æë § 票ﬨ |
; IN eax - ASCIIZ ¨¬ï ä ©« |
; OUT eax - १ã«ìâ â ç⥨ï |
; ¥á«¨ १ã«ìâ â -1, ä®à¬ â ä ©« ¥¯à ¢¨«ìë© |
; |
parseconf: |
push edi |
push esi |
;push eax |
push ebx |
push ecx |
push edx |
mov [strnum], dword 0 |
; |
; à®ç¨â âì ¯®áâà®ç® ª®ä¨£ |
; ¥á«¨ áâப ç¨ ¥âáï á ;, # - ª®¬¬¥â ਩ |
; ®à¬ â UIN="1234567890" |
; PASS="******" ¨ â.¤. |
; |
; ¡à®á ᬥ饨ï |
mov [shift], dword 0 |
mov esi, eax |
pc_still: |
mov edx, esi |
mov ecx, IOBUFF_SIZE |
mov ebx, iobuff |
call getstr |
inc [strnum] |
push eax |
; |
;஢¥àª ¯®«ã祮© áâப¨ |
; |
movzx eax, byte [iobuff] |
test eax, eax |
jz pc_next |
cmp al, '#' |
jz pc_next |
cmp al, ';' |
jz pc_next |
; |
; ©â¨ ¨¬ï ¯¥à¥¬¥®© |
; |
findother iobuff, ebx, ' ' |
cmp eax, -1 |
jz pc_next |
mov [stnpos], eax ; ç «® ¨¬¥¨ |
; |
; ©â¨ = |
; |
mov ecx, ebx ; ᪠âì ®â ©¤¥®£® ᨬ¢®« |
sub ecx, eax ; |
mov edi, iobuff |
add edi, eax |
findchar edi, ecx, '=' |
cmp eax, -1 |
jz pc_badformat |
mov edi, [stnpos] |
add eax, edi ; ¢ eax - ᬥ饨¥ ®â ç « áâப¨ |
mov [eqpos], eax |
mov ecx, ebx |
sub ecx, eax |
; |
; ¯à®¢¥à¨âì " |
; |
mov dl, [iobuff + eax] |
cmp dl, '"' |
jnz pc_badformat |
; |
; ©â¨ § ªàë¢ îéãî " |
; |
mov edi, iobuff |
add edi, eax |
inc edi |
findchar edi, ecx, '"' |
cmp eax, -1 |
jz pc_badformat |
inc eax |
mov edx, [eqpos] |
add eax, edx |
mov [edvpos], eax |
; |
; áâ ®¢¨âì § 票¥ |
; |
; ®¡ ¢¨âì § ¢¥àè î騥 0 |
mov eax, [stnpos] |
dec eax |
mov ebx, [eqpos] |
mov ecx, ebx |
dec ecx ; ª®«¨ç¥á⢮ ᨬ¢®«®¢ ¤® = |
inc ebx ; யãáâ¨âì " |
mov [iobuff + ecx], byte 0 |
mov edx, [edvpos] |
dec edx |
mov [iobuff + edx], byte 0 |
lea eax, [iobuff + eax] |
lea ebx, [iobuff + ebx] |
call setavar |
jmp pc_next |
pc_badformat: |
pop eax |
mov ebx, [strnum] |
jmp pc_err |
pc_next: |
pop eax |
cmp eax, FIO_EOF |
jz pc_eof |
cmp eax, FIO_SUCCESS |
jnz pc_err |
jmp pc_still |
pc_eof: |
pc_err: |
pop edx |
pop ecx |
pop ebx |
;pop eax |
pop esi |
pop edi |
ret |
; ®¨áª ¢ â ¡«¨æ¥ ¯¥à¥¬¥®© ¨ ãáâ ®¢ª ¥ñ § 票ï |
; IN eax - §¢ ¨¥ ¯¥à¥¬¥®© 㪠§ ⥫ì ASCIIZ |
; IN ebx - § 票¥ ¯¥à¥¬¥®© 㪠§ ⥫ì ASCIIZ |
; OUT eax -१ã«ìâ â 0 = OK, -1 = ¥â ¢ â ¡«¨æ¥ ¯¥à¥¬¥ëå |
; OUT § ¯®«ï¥â £«®¡ «ìãî â ¡«¨æã |
setavar: |
;push ebx |
push ecx |
push edx |
push esi |
push edi |
push ebx |
; |
; ¯à¥¤¥«¨âì ¤«¨ã áâப¨ - §¢ ¨¥ ¯¥à¥¬¥®© |
; |
mov edi, eax |
push eax |
mov ecx, VNAME_LEN |
xor eax, eax ;饬 \0 |
cld |
repne scasb |
mov eax, VNAME_LEN |
sub eax, ecx ; ecx - ®áâ ⮪ ¤® ¬ ªá¨¬ «ì®£® à §¬¥à áâப¨ |
mov ebx, eax |
pop eax |
; |
; ᪠âì ¢ â ¡«¨æ¥ ¯®¤å®¤ï饥 ¨¬ï |
; |
xor edx, edx ;index |
sv_next: |
mov ecx, ebx |
push eax |
mov esi, eax |
mov edi, nvtable |
mov eax, edx |
imul eax, VNAME_LEN ;offset |
add edi, eax |
pop eax |
cld |
repe cmpsb |
jz sv_match |
sv_inc: |
inc edx |
cmp edx, TABLE_SIZE |
jae sv_fail |
jmp sv_next |
sv_match: |
cmp ebx, VNAME_LEN ; ebx - ¤«¨ ¨á室®© áâà®çª¨ |
jz sv_match2 |
push eax |
mov edi, nvtable |
mov eax, edx |
imul eax, VNAME_LEN ;offset |
add edi, eax |
pop eax |
cmp [edi + ebx], byte 0 ; ᫨ ¨¬ï ¢ â ¡«¨æ¥ ª®à®ç¥ ¬ ªá¨¬ «ì®£®, |
jnz sv_inc ; § ª 稢 ¥âáï 0 |
sv_match2: |
pop edi ; |
push edi |
; |
; ¯à¥¤¥«ïâì ¤«¨ã áâப¨ - ¯¥à¥¬¥ ï |
; |
xor eax, eax |
mov ecx, VAR_LEN |
cld |
repne scasb |
mov eax, VAR_LEN |
sub eax, ecx |
mov ecx, eax |
mov ebx, eax |
; |
; ®¯¨à®¢ âì ¯¥à¥¬¥ãî ¢ â ¡«¨æã |
; |
pop esi |
push esi |
mov eax, VAR_LEN |
imul eax, edx |
mov edi, vtable |
add edi, eax |
cld |
rep movsb |
; |
; ᫨ áâப ª®à®ç¥ ¯®«ï ¢ â ¡«¨æ¥, § ¯¨á âì ¢ ª®¥æ 0 |
; |
cmp ebx, VAR_LEN |
jz sv_end |
mov [edi + ebx], byte 0 |
sv_end: |
xor eax, eax |
jmp sv_fin |
sv_fail: |
mov eax, -1 |
sv_fin: |
pop ebx |
pop edi |
pop esi |
pop edx |
pop ecx |
;pop ebx |
ret |
; |
; ⥨¥ ASCIIZ áâப¨ ¨§ ä ©« |
; IN ebx - 㪠§ â¥«ì ¡ãä¥à |
; ecx - à §¬¥à ¡ãä¥à |
; edx - 㪠§ ⥫ì áâப㠨¬ï ä ©« |
; OUT ebx - ¤«¨ áâப¨ |
; eax - १ã«ìâ â ç⥨ï |
getstr: |
;push eax |
;push ebx |
push ecx |
push edx |
push esi |
;xor edx, edx |
xor esi, esi |
gs_read: |
; |
; ¯®«ï¥¬ áâàãªâãàã |
; |
mov [finfo.subfnc_name], 0 |
mov eax, [shift] |
mov [finfo.pos_in_file], eax |
mov [finfo.bytes_to_read], ecx |
mov [finfo.pbuffer], ebx |
mov [finfo.pname], edx |
push ebx |
; |
; ¨â¥¬ |
; |
;mov eax, 70 |
;mov ebx, finfo |
;int 40h |
mcall 70, finfo |
mov ecx, ebx ; ebx ª®«¨ç¥á⢮ ¯à®çâ¥ëå ¡ ©â |
pop ebx |
; |
; ஢¥à¨âì १ã«ìâ â ç⥨ï - ¥á«¨ ¥ EOF ¨ 0, |
; ¢ë室¨¬ |
cmp eax, FIO_EOF |
jz gs_loop |
cmp eax, 0 |
jz gs_loop |
jmp gs_ok |
; |
; ¡à ¡®âª ¯®«ã祮£® ¡«®ª |
; |
gs_loop: |
mov dl, [ebx + esi] |
cmp dl, 0Ah ;cr |
jz gs_cr |
inc esi |
cmp esi, ecx |
jnb gs_err |
jmp gs_loop |
gs_err: |
; |
; ¡ãä¥à¥ ¥â ᨬ¢®« ¯¥à¥®á áâப¨, â.¥. áâப ᫨誮¬ ¤«¨ ï |
; â¡à áë¢ ¥¬ ¢á¥ ¤® ¡«¨¦ ©è¥£® ᨬ¢®« ¯¥à¥®á áâப¨ |
; ¥á«¨ ª®¥æ ä ©« - ¢ë室¨¬ |
cmp eax, FIO_EOF |
jz gs_endf |
add [shift], ecx |
jmp gs_read |
gs_endf: |
xor ebx, ebx |
jmp gs_ok |
gs_cr: |
; |
; ¡à®á¨âì १ã«ìâ â ç⥨ï |
; |
xor eax, eax |
mov dl, [ebx + esi - 1] |
cmp dl, 0Dh ;le |
jz gs_le |
mov [ebx + esi], byte 0 |
mov ebx, esi |
inc esi |
add [shift], esi |
jmp gs_ok |
gs_le: |
mov [ebx + esi - 1], byte 0 |
mov [ebx + esi], byte 0 |
lea ebx, [esi - 1] |
inc esi |
add [shift], esi |
gs_ok: |
pop esi |
pop edx |
pop ecx |
;pop ebx |
;pop eax |
ret |
; |
; ãªæ¨ï ¤«ï ¢ë¢®¤ § £à㦥®© ¨äë |
; |
showcfg: |
push eax |
push ebx |
push ecx |
push edx |
push edi |
xor edx, edx ; áç¥â稪 |
sc_loop: |
cmp edx, TABLE_SIZE |
jnb sc_end |
; |
; ª®¯¨à®¢ âì ¢ ¡ãä¥à ¨¬ï ¨ § 票¥ ¯¥à¥¬¥®© |
; |
mov eax, VNAME_LEN |
imul eax, edx |
lea eax, [nvtable + eax] |
mov cl, [eax] |
cmp cl, byte 0 |
jz sc_next |
push eax |
call strlen |
mov ecx, eax |
pop eax |
mov ebx, cfgbuff |
call strcpy |
mov [cfgbuff + ecx], ':' |
lea ebx, [cfgbuff + ecx + 1] |
mov eax, VAR_LEN |
imul eax, edx |
lea eax, [vtable + eax] |
push eax |
call strlen |
mov ecx, eax |
pop eax |
call strcpy |
mov [ebx + ecx], byte 0 |
mov eax, cfgbuff |
xor ebx, ebx |
call writemsg |
sc_next: |
inc edx |
jmp sc_loop |
sc_end: |
pop edi |
pop edx |
pop ecx |
pop ebx |
pop eax |
ret |
/programs/network/icq/trunk/parser_data.inc |
---|
0,0 → 1,100 |
; |
; ë¥ ¤«ï parser.inc |
; |
; |
; |
; ¨¬ï ä ©« , ª®â®àë© ã¦® ¯ àá¨âì |
; |
fname db '/sys/ki.cfg',0 |
; |
; â ¡«¨æë § 票© |
; |
; +----+-------------+-----------------+ |
; | in | Variable | Variable | |
; | de | name | string | |
; | x | | | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | | |
; | | | | |
; | 1 | UIN | 'XXXXX..XX' | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | |
; |
; § £à㧪 int ¯®ª ¥ ॠ«¨§®¢ |
; |
; +----+-------------+-----------------+ |
; | in | Variable | Variable | |
; | de | name | int | |
; | x | | | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | | |
; | | | | |
; | 1 | BUFFSIZE | XXXXXXXX | |
; | | | | |
; +----+-------------+-----------------+ |
; | | | |
; |
; |
;nvtable db (TABLE_SIZE * NAME_LEN) dup 0 |
vtable db (TABLE_SIZE * VAR_LEN) dup 0 |
finfo sinfo |
; |
; ¯®«¨âì â ¡«¨æã ¨¬¥ ¯¥à¥¬¥ëå |
; |
nvtable db 'UIN',(VNAME_LEN - 3) dup 0 |
db 'PASS',(VNAME_LEN - 4) dup 0 |
db 'ICQIP',(VNAME_LEN - 5) dup 0 |
db ((TABLE_SIZE - 3) * VNAME_LEN) dup 0 |
; |
; ¤«ï ¨¨æ¨ «¨§ 樨 â ¡«¨æ |
; |
; |
; |
;name1 db 'UIN',(VNAME_LEN - 3) dup 0 |
;name2 db 'PASS',(VNAME_LEN - 4) dup 0 |
;name3 db 'ICQIP',(VNAME_LEN - 5) dup 0 |
; |
; ãä¥à ¤«ï ¢¢®¤ /¢ë¢®¤ |
; |
iobuff db IOBUFF_SIZE dup 0 |
; |
; ¬¥é¥¨¥ ¢ ä ©«¥ |
; |
shift dd 0 |
; |
; ¥à¥¬¥ë¥ ¤«ï åà ¥¨ï ®¬¥à®¢ |
; ᨬ¢®«®¢ ç « ¨¬¥¨ ¯¥à¥¬¥®© |
; ª®æ , à ¢®, ª®æ § 票ï |
stnpos dd 0 |
ednpos dd 0 |
eqpos dd 0 |
edvpos dd 0 |
; |
;®¬¥à áâப¨ ¤«ï ®¯à¥¤¥«¥¨ï ®è¨¡®çëå |
; |
strnum dd 0 |
; |
; ãä¥à ¤«ï ¢ë¢®¤ § £à㦥®£® ª®ä¨£ |
; |
cfgbuff db (VAR_LEN + VNAME_LEN + 8) dup 0 |
cfgbuff.len = $ - cfgbuff |
/programs/network/icq/trunk/proc32.inc |
---|
0,0 → 1,270 |
; Macroinstructions for defining and calling procedures |
macro stdcall proc,[arg] ; directly call STDCALL procedure |
{ common |
if ~ arg eq |
reverse |
pushd arg |
common |
end if |
call proc } |
macro invoke proc,[arg] ; indirectly call STDCALL procedure |
{ common |
if ~ arg eq |
reverse |
pushd arg |
common |
end if |
call [proc] } |
macro ccall proc,[arg] ; directly call CDECL procedure |
{ common |
size@ccall = 0 |
if ~ arg eq |
reverse |
pushd arg |
size@ccall = size@ccall+4 |
common |
end if |
call proc |
if size@ccall |
add esp,size@ccall |
end if } |
macro cinvoke proc,[arg] ; indirectly call CDECL procedure |
{ common |
size@ccall = 0 |
if ~ arg eq |
reverse |
pushd arg |
size@ccall = size@ccall+4 |
common |
end if |
call [proc] |
if size@ccall |
add esp,size@ccall |
end if } |
macro proc [args] ; define procedure |
{ common |
match name params, args> |
\{ define@proc name,<params \} } |
prologue@proc equ prologuedef |
macro prologuedef procname,flag,parmbytes,localbytes,reglist |
{ if parmbytes | localbytes |
push ebp |
mov ebp,esp |
if localbytes |
sub esp,localbytes |
end if |
end if |
irps reg, reglist \{ push reg \} } |
epilogue@proc equ epiloguedef |
macro epiloguedef procname,flag,parmbytes,localbytes,reglist |
{ irps reg, reglist \{ reverse pop reg \} |
if parmbytes | localbytes |
leave |
end if |
if flag and 10000b |
retn |
else |
retn parmbytes |
end if } |
macro define@proc name,statement |
{ local params,flag,regs,parmbytes,localbytes,current |
if used name |
name: |
match =stdcall args, statement \{ params equ args |
flag = 11b \} |
match =stdcall, statement \{ params equ |
flag = 11b \} |
match =c args, statement \{ params equ args |
flag = 10001b \} |
match =c, statement \{ params equ |
flag = 10001b \} |
match =params, params \{ params equ statement |
flag = 0 \} |
virtual at ebp+8 |
match =uses reglist=,args, params \{ regs equ reglist |
params equ args \} |
match =regs =uses reglist, regs params \{ regs equ reglist |
params equ \} |
match =regs, regs \{ regs equ \} |
match =,args, params \{ defargs@proc args \} |
match =args@proc args, args@proc params \{ defargs@proc args \} |
parmbytes = $ - (ebp+8) |
end virtual |
name # % = parmbytes/4 |
all@vars equ |
current = 0 |
match prologue:reglist, prologue@proc:<regs> \{ prologue name,flag,parmbytes,localbytes,reglist \} |
macro locals |
\{ virtual at ebp-localbytes+current |
macro label def \\{ match . type,def> \\\{ deflocal@proc .,label,<type \\\} \\} |
struc db [val] \\{ \common deflocal@proc .,db,val \\} |
struc du [val] \\{ \common deflocal@proc .,du,val \\} |
struc dw [val] \\{ \common deflocal@proc .,dw,val \\} |
struc dp [val] \\{ \common deflocal@proc .,dp,val \\} |
struc dd [val] \\{ \common deflocal@proc .,dd,val \\} |
struc dt [val] \\{ \common deflocal@proc .,dt,val \\} |
struc dq [val] \\{ \common deflocal@proc .,dq,val \\} |
struc rb cnt \\{ deflocal@proc .,rb cnt, \\} |
struc rw cnt \\{ deflocal@proc .,rw cnt, \\} |
struc rp cnt \\{ deflocal@proc .,rp cnt, \\} |
struc rd cnt \\{ deflocal@proc .,rd cnt, \\} |
struc rt cnt \\{ deflocal@proc .,rt cnt, \\} |
struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \} |
macro endl |
\{ purge label |
restruc db,du,dw,dp,dd,dt,dq |
restruc rb,rw,rp,rd,rt,rq |
current = $-(ebp-localbytes) |
end virtual \} |
macro ret operand |
\{ match any, operand \\{ retn operand \\} |
match , operand \\{ match epilogue:reglist, epilogue@proc:<regs> |
\\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \} |
macro finish@proc \{ localbytes = (((current-1) shr 2)+1) shl 2 |
end if \} } |
macro defargs@proc [arg] |
{ common |
if ~ arg eq |
forward |
local ..arg,current@arg |
match argname:type, arg |
\{ current@arg equ argname |
label ..arg type |
argname equ ..arg |
if dqword eq type |
dd ?,?,?,? |
else if tbyte eq type |
dd ?,?,? |
else if qword eq type | pword eq type |
dd ?,? |
else |
dd ? |
end if \} |
match =current@arg,current@arg |
\{ current@arg equ arg |
arg equ ..arg |
..arg dd ? \} |
common |
args@proc equ current@arg |
forward |
restore current@arg |
common |
end if } |
macro deflocal@proc name,def,[val] |
{ common |
match vars, all@vars \{ all@vars equ all@vars, \} |
all@vars equ all@vars name |
forward |
local ..var,..tmp |
match =label,def \{ ..tmp equ \} |
match tmp,..tmp \{ ..var def val \} |
match ,..tmp \{ label ..var val \} |
match =?, val \{ ..tmp equ \} |
match any =dup (=?), val \{ ..tmp equ \} |
match tmp : value, ..tmp : val |
\{ tmp: end virtual |
initlocal@proc ..var,def value |
virtual at tmp\} |
common |
match first rest, ..var, \{ name equ first \} } |
macro initlocal@proc name,def |
{ virtual at name |
def |
size@initlocal = $ - name |
end virtual |
position@initlocal = 0 |
while size@initlocal > position@initlocal |
virtual at name |
def |
if size@initlocal - position@initlocal < 2 |
current@initlocal = 1 |
load byte@initlocal byte from name+position@initlocal |
else if size@initlocal - position@initlocal < 4 |
current@initlocal = 2 |
load word@initlocal word from name+position@initlocal |
else |
current@initlocal = 4 |
load dword@initlocal dword from name+position@initlocal |
end if |
end virtual |
if current@initlocal = 1 |
mov byte [name+position@initlocal],byte@initlocal |
else if current@initlocal = 2 |
mov word [name+position@initlocal],word@initlocal |
else |
mov dword [name+position@initlocal],dword@initlocal |
end if |
position@initlocal = position@initlocal + current@initlocal |
end while } |
macro endp |
{ purge ret,locals,endl |
finish@proc |
purge finish@proc |
restore regs@proc |
match all,args@proc \{ restore all \} |
restore args@proc |
match all,all@vars \{ restore all \} } |
macro local [var] |
{ common |
locals |
forward done@local equ |
match varname[count]:vartype, var |
\{ match =BYTE, vartype \\{ varname rb count |
restore done@local \\} |
match =WORD, vartype \\{ varname rw count |
restore done@local \\} |
match =DWORD, vartype \\{ varname rd count |
restore done@local \\} |
match =PWORD, vartype \\{ varname rp count |
restore done@local \\} |
match =QWORD, vartype \\{ varname rq count |
restore done@local \\} |
match =TBYTE, vartype \\{ varname rt count |
restore done@local \\} |
match =DQWORD, vartype \\{ label varname dqword |
rq count+count |
restore done@local \\} |
match , done@local \\{ virtual |
varname vartype |
end virtual |
rb count*sizeof.\#vartype |
restore done@local \\} \} |
match :varname:vartype, done@local:var |
\{ match =BYTE, vartype \\{ varname db ? |
restore done@local \\} |
match =WORD, vartype \\{ varname dw ? |
restore done@local \\} |
match =DWORD, vartype \\{ varname dd ? |
restore done@local \\} |
match =PWORD, vartype \\{ varname dp ? |
restore done@local \\} |
match =QWORD, vartype \\{ varname dq ? |
restore done@local \\} |
match =TBYTE, vartype \\{ varname dt ? |
restore done@local \\} |
match =DQWORD, vartype \\{ label varname dqword |
dq ?,? |
restore done@local \\} |
match , done@local \\{ varname vartype |
restore done@local \\} \} |
match ,done@local |
\{ var |
restore done@local \} |
common |
endl } |
/programs/network/icq/trunk/ssi.inc |
---|
0,0 → 1,413 |
; |
; |
; Ïîääåðæêà êîíòàêò ëèñòà íà ñåðâåðå |
; |
; |
; |
; Çàïîëíÿåò òàáëèöó ñ UIN |
; è îïöèîíàëüíî òàáëèöû ñ èìåíåì è äîï. èíôîé |
; |
; Èç comp.inc äëÿ îòëàäêè |
; |
; |
; Ìàññèâ ñ UIN |
; |
;UIN_LEN = 11 ; Äëèíà |
;UINS = 15 ; Êîëè÷åñòâî |
; |
;uins db UIN_LEN*UINS dup 0 |
; |
; ìàññèâ ñî ñòàòóñàìè |
; |
;stats dd UINS dup -1 |
; |
; Ìàññèâ ñ èìåíàìè |
; |
;NAME_LEN = 30 |
;names db NAME_LEN*UINS dup 0 |
; |
; Äîñòàåò èç item UIN |
; eax <- óêàçàòåëü íà item |
; Ïðîïóñêàåò ãðóïïû |
; |
ssi_get_uin: |
push eax |
push ebx |
push ecx |
push edx |
; |
; Ïðîâåðÿåì ItemID |
; |
xor ebx, ebx |
mov bl, [eax + 1] ; Length of the item name |
mov bh, [eax] ; |
;push ebx |
;mov ebx, 128 |
;call print_mem |
;pop ebx |
;; FIXIT Ðàçóìíåå ïðîâåðÿòü ôëàãè |
;; Åñëè äëèíà ñòðîêè = 0 |
;; ïðîïóñêàåì item |
;cmp ebx, 0 |
;jz ssi_get_end |
;; |
;;data_debug 'Item name len', ebx |
;;+ñìåùåíèå äî ItemID |
;;xor ecx, ecx |
;;mov ch, [eax + ebx + 4] |
;;mov cl, [eax + ebx + 5] ; Item ID# |
;;cmp ecx, 0 |
;;jz ssi_get_end |
; |
; Ïðîâåðÿåì ôëàãè, îáðàáàòûâàåì òîëüêî çàïèñè UIN |
; |
xor ecx, ecx |
mov ch, [eax + ebx + 6] |
mov cl, [eax + ebx + 7] |
cmp ecx, 0 ; 0x0000 Buddy record (name: uin for ICQ and screenname for AIM) |
jz ssi_uin |
; debug |
; |
lea eax, [eax + ebx + 6] |
mov ebx, 2 |
call print_mem |
jmp ssi_get_end |
ssi_uin: |
; |
; Êîïèðóåì UIN â òàáëèöó |
; |
mov ecx, ebx ; Äëèíà ñòðîêè |
lea eax, [eax + 2] |
mov edx, [uin_ind] |
cmp edx, UINS |
jnb ssi_get_end ;Íåò ñâîáîäíîãî ìåñòà â òàáëèöå UIN |
imul edx, UIN_LEN |
mov ebx, uins |
lea ebx, [ebx + edx] |
call strcpy |
inc [uin_ind] |
;debug |
;mov eax, ebx |
;xor ebx, ebx |
;call writemsg |
; |
ssi_get_end: |
pop edx |
pop ecx |
pop ebx |
pop eax |
ret |
; |
; eax <- óêàçàòåëü íà item |
; âîçâðàùàåò â eax óêàçàòåëü íà ñëåäóþùèé item |
; |
; |
ssi_next_item: |
push ebx |
push ecx |
xor ebx, ebx |
mov bl, [eax + 1] ; äëèíà UIN |
mov bh, [eax] ; |
xor ecx, ecx |
mov cl, [eax + ebx + 9] ; Äëèíà äîïîëíèòåëüíûõ äàííûõ |
mov ch, [eax + ebx + 8] ; |
add ebx, ecx |
add ebx, 10 ;+Äëèíà çàãîëîâêà |
lea eax, [eax + ebx] |
pop ecx |
pop ebx |
ret |
; |
; eax <- óêàçàòåëü íà tlv |
; âîçâðàùàåò â eax óêàçàòåëü íà ñëåä tlv |
; |
macro get_next_tlv { |
push ebx |
xor ebx, ebx |
mov bl, [eax + 3] |
mov bh, [eax + 2] |
; + ðàçìåð çàãîëîâêà |
lea ebx, [ebx + 4] |
lea eax, [eax + ebx] |
pop ebx |
} |
; |
; Èùåò â additional èìÿ è äð. ñâåäåíèÿ |
; eax <- óêàçàòåëü íà item |
; |
ssi_get_add: |
push eax |
push ebx |
push ecx |
push edx |
push esi |
;mov ebx, 128 |
;call print_mem |
xor ebx, ebx |
mov bl, [eax + 1] ; Length of the item name |
mov bh, [eax] ; |
;;cmp ebx, 0 ; Åñëè äëèíà èìåíè = 0 |
;;jz ssi_all_tlv ; Íåò ñìûñëà îáðàáàòûâàòü |
;;+ñìåùåíèå äî ItemID |
;;xor ecx, ecx |
;;mov ch, [eax + ebx + 4] |
;;mov cl, [eax + ebx + 5] ; Item ID# |
; |
;;cmp ecx, 0 ; Ãðóïïû ïîêà íå îáðàáàòûâàþòñÿ |
;;jz ssi_all_tlv ; |
; |
; Ïðîâåðÿåì ôëàãè, îáðàáàòûâàåì òîëüêî çàïèñè UIN |
; |
xor ecx, ecx |
mov ch, [eax + ebx + 6] |
mov cl, [eax + ebx + 7] |
cmp ecx, 0 ; 0x0000 Buddy record (name: uin for ICQ and screenname for AIM) |
jnz ssi_all_tlv |
xor edx, edx |
mov dl, [eax + ebx + 9] ; |
mov dh, [eax + ebx + 8] ; Length of the additional data |
lea eax, [eax + ebx + 10] ; eax óêàçàòåëü íà ïåðâûé tlv |
;FIXME : Iservd íå ïðèñûëàåò additional - ïîêà íå ìîãó îòëàäèòü |
;debug |
;push ebx |
;mov ebx, edx |
;data_debug 'length additional data', ebx |
;call print_mem |
;pop ebx |
; |
xor esi, esi |
ssi_tlv_process: |
cmp esi, edx ; |
jnb ssi_all_tlv ; additional çàêîí÷èëîñü |
xor ecx, ecx |
mov cl, [eax + 3] ; |
mov ch, [eax + 2] ; TLV.Length |
xor ebx, ebx |
mov bl, [eax + 1] ; TLV.Type |
mov bh, [eax] ; |
cmp bx, 0x0131 ;Èìÿ ïîëüçîâàòåëÿ |
jz ssi_name |
cmp bx, 0x0066 ;Îæèäàåì àâòîðèçàöèè |
jz ssi_auth_wait |
jmp ssi_next_tlv |
ssi_auth_wait: |
; |
; |
; |
jmp ssi_next_tlv |
ssi_name: |
; |
; Ñêîïèðîâàòü èìÿ â ìàññèâ |
; |
push eax |
push ecx |
mov ebx, [name_ind] |
cmp ebx, UINS |
jnb ssi_name_end ;Íåò ìåñòà â òàáëèöå |
lea eax, [eax + 4] ;Óêàçàòåëü íà ñòðîêó (Ïðèáàâëÿåì ðàçìåð çàãîëîâêà TLV) |
imul ebx, NAME_LEN |
lea ebx, [names + ebx] |
cmp ecx, NAME_LEN - 1 ; Åñëè èìÿ äëèííåå ïîëÿ â òàáëèöå |
jna @f |
mov ecx, NAME_LEN - 1 |
@@: |
call strcpy |
;; FIXIT |
;; Ïåðåêîäèðîâêà èìåíè |
;; |
;;mov eax, ebx |
;;call win2dos |
; |
;debug |
;push eax |
;push ebx |
;mov eax, ebx |
;xor ebx, ebx |
;call writemsg |
;pop ebx |
;pop eax |
; |
; |
inc [name_ind] |
pop ecx |
pop eax |
ssi_next_tlv: |
lea ecx, [ecx + 4] ; Äëèíà äàííûõ tlv + äëèíà çàãîëîâêà |
add esi, ecx |
get_next_tlv |
jmp ssi_tlv_process |
ssi_name_end: |
pop ecx |
pop eax |
ssi_all_tlv: |
pop esi |
pop edx |
pop ecx |
pop ebx |
pop eax |
ret |
; |
; |
; Îáðàáîòêà êîíòàêò ëèñòà, ïðèøåäøåãî îò ñåðâåðà |
; |
; â eax <- óêàçàòåëü íà äàííûå â ïàêåòå SNAC(13,06) |
ssi_process_data: |
push eax |
push ebx |
push ecx |
push edx |
; |
; Ïðîâåðèòü âåðñèþ ïðîòîêîëà |
; |
xor ebx, ebx |
mov bl, [eax] |
cmp bl, 0 |
jnz ssi_bad_prot |
; |
;â ebx - êîëè÷åñòâî items |
mov bl, [eax + 2] |
mov bh, [eax + 1] |
; |
data_debug 'SSI items:', ebx |
lea eax, [eax + 3] ; Óñòàíîâèòü eax íà ñïèñîê items |
xor ecx, ecx ; Ñ÷åò÷èê items |
ssi_next_uin: |
cmp ecx, ebx |
jnb ssi_all_items |
call ssi_get_uin |
call ssi_get_add |
call ssi_next_item |
inc ecx |
jmp ssi_next_uin |
ssi_bad_prot: |
write_debug "ERR: SSI protocol version mismatch" |
ssi_all_items: |
pop edx |
pop ecx |
pop ebx |
pop eax |
ret |
/programs/network/icq/trunk/ssi_data.inc |
---|
0,0 → 1,5 |
; |
; Èíäåêñ â ìàññèâå UINS |
; |
uin_ind dd 0 |
name_ind dd 0 |
/programs/network/icq/trunk/st_red.bmp |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/network/icq/trunk/struct.inc |
---|
0,0 → 1,180 |
; Macroinstructions for defining data structures |
macro struct name |
{ fields@struct equ name |
match child parent, name \{ fields@struct equ child,fields@\#parent \} |
sub@struct equ |
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \} |
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \} |
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \} |
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \} |
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \} |
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \} |
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \} |
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \} |
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \} |
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \} |
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \} |
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \} |
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \} |
macro db [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,db,<val> \} |
macro dw [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,dw,<val> \} |
macro du [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,du,<val> \} |
macro dd [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,dd,<val> \} |
macro dp [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,dp,<val> \} |
macro dq [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,dq,<val> \} |
macro dt [val] \{ \common \local anonymous |
fields@struct equ fields@struct,anonymous,dt,<val> \} |
macro rb count \{ \local anonymous |
fields@struct equ fields@struct,anonymous,db,count dup (?) \} |
macro rw count \{ \local anonymous |
fields@struct equ fields@struct,anonymous,dw,count dup (?) \} |
macro rd count \{ \local anonymous |
fields@struct equ fields@struct,anonymous,dd,count dup (?) \} |
macro rp count \{ \local anonymous |
fields@struct equ fields@struct,anonymous,dp,count dup (?) \} |
macro rq count \{ \local anonymous |
fields@struct equ fields@struct,anonymous,dq,count dup (?) \} |
macro rt count \{ \local anonymous |
fields@struct equ fields@struct,anonymous,dt,count dup (?) \} |
macro union \{ fields@struct equ fields@struct,,union,< |
sub@struct equ union \} |
macro struct \{ fields@struct equ fields@struct,,substruct,< |
sub@struct equ substruct \} |
virtual at 0 } |
macro ends |
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt |
restruc rb,rw,rd,rp,rq,rt |
purge db,dw,du,dd,dp,dq,dt |
purge rb,rw,rd,rp,rq,rt |
purge union,struct |
match name=,fields,fields@struct \\{ fields@struct equ |
make@struct name,fields |
fields@\\#name equ fields \\} |
end virtual \} |
match any, sub@struct \{ fields@struct equ fields@struct> \} |
restore sub@struct } |
macro make@struct name,[field,type,def] |
{ common |
if $ |
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah |
err |
end if |
local define |
define equ name |
forward |
local sub |
match , field \{ make@substruct type,name,sub def |
define equ define,.,sub, \} |
match any, field \{ define equ define,.#field,type,<def> \} |
common |
match fields, define \{ define@struct fields \} } |
macro define@struct name,[field,type,def] |
{ common |
local list |
list equ |
forward |
if ~ field eq . |
name#field type def |
sizeof.#name#field = $ - name#field |
else |
rb sizeof.#type |
end if |
local value |
match any, list \{ list equ list, \} |
list equ list <value> |
common |
sizeof.#name = $ |
restruc name |
match values, list \{ |
struc name value \\{ |
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\} |
match , fields@struct \\\{ label . |
forward |
match , value \\\\{ field type def \\\\} |
match any, value \\\\{ field type value |
if ~ field eq . |
rb sizeof.#name#field - ($-field) |
end if \\\\} |
common \\\} \\} \} } |
macro enable@substruct |
{ macro make@substruct substruct,parent,name,[field,type,def] |
\{ \common |
\local define |
define equ parent,name |
\forward |
\local sub |
match , field \\{ match any, type \\\{ enable@substruct |
make@substruct type,name,sub def |
purge make@substruct |
define equ define,.,sub, \\\} \\} |
match any, field \\{ define equ define,.\#field,type,<def> \\} |
\common |
match fields, define \\{ define@\#substruct fields \\} \} } |
enable@substruct |
macro define@union parent,name,[field,type,def] |
{ common |
virtual at 0 |
forward |
if ~ field eq . |
virtual at 0 |
parent#field type def |
sizeof.#parent#field = $ - parent#field |
end virtual |
if sizeof.#parent#field > $ |
rb sizeof.#parent#field - $ |
end if |
else if sizeof.#type > $ |
rb sizeof.#type - $ |
end if |
common |
sizeof.#name = $ |
end virtual |
struc name [value] \{ \common |
label .\#name |
last@union equ |
forward |
match any, last@union \\{ virtual at .\#name |
field type def |
end virtual \\} |
match , last@union \\{ match , value \\\{ field type def \\\} |
match any, value \\\{ field type value \\\} \\} |
last@union equ field |
common rb sizeof.#name - ($ - .\#name) \} } |
macro define@substruct parent,name,[field,type,def] |
{ common |
virtual at 0 |
forward |
if ~ field eq . |
parent#field type def |
sizeof.#parent#field = $ - parent#field |
else |
rb sizeof.#type |
end if |
local value |
common |
sizeof.#name = $ |
end virtual |
struc name value \{ |
label .\#name |
forward |
match , value \\{ field type def \\} |
match any, value \\{ field type value |
if ~ field eq . |
rb sizeof.#parent#field - ($-field) |
end if \\} |
common \} } |