/programs/network/VNCclient/ETH.INC |
---|
12,7 → 12,6 |
; v1.1: december 2006 bugfixes and improvements |
; |
macro mov arg1,arg2 { |
if arg1 eq arg2 |
else |
43,7 → 42,7 |
macro eth.get_IP IP { |
mov ebx,1 |
mov eax,52 |
int 0x40 |
mcall |
mov IP ,eax |
} |
54,7 → 53,7 |
macro eth.get_GATEWAY GATEWAY { |
mov ebx,9 |
mov eax,52 |
int 0x40 |
mcall |
move GATEWAY ,eax |
} |
64,7 → 63,7 |
macro eth.get_SUBNET SUBNET { |
mov ebx,10 |
mov eax,52 |
int 0x40 |
mcall |
mov SUBNET ,eax |
} |
74,7 → 73,7 |
macro eth.get_DNS DNS { |
mov ebx,13 |
mov eax,52 |
int 0x40 |
mcall |
mov DNS ,eax |
} |
85,7 → 84,7 |
mov ecx,IP |
mov ebx,3 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.set_GATEWAY eax |
95,7 → 94,7 |
mov ecx,GATEWAY |
mov ebx,11 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.set_SUBNET eax |
105,7 → 104,7 |
mov ecx,SUBNET |
mov ebx,12 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.set_DNS eax |
115,7 → 114,7 |
mov ecx,DNS |
mov ebx,14 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.open eax,80,ebx,[socket] |
128,7 → 127,7 |
mov esi, ip |
mov ebx, 0 |
mov eax, 53 |
int 0x40 |
mcall |
mov socket,eax |
} |
140,7 → 139,7 |
mov ecx, socket |
mov ebx, 1 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.poll [socket],eax |
151,7 → 150,7 |
mov ecx, socket |
mov ebx, 2 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.read_byte [socket], bl |
161,7 → 160,7 |
mov ecx, socket |
mov ebx, 3 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,bl |
} |
174,7 → 173,7 |
mov ecx, socket |
mov ebx, 10 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.write [socket],12,msg |
187,7 → 186,7 |
mov esi, msg |
mov ebx, 4 |
mov eax, 53 |
int 0x40 |
mcall |
if verify eq 1 |
call verifysend |
203,9 → 202,10 |
pusha |
mov eax,5 |
mov ebx,100 |
int 0x40 |
mcall |
popa |
int 0x40 |
mcall |
ret |
; eth.open_tcp 80,80,eax,0,[socket] |
220,7 → 220,7 |
mov edi, passive ; 0 = PASSIVE open |
mov ebx, 5 |
mov eax, 53 |
int 0x40 |
mcall |
mov socket,eax |
} |
232,7 → 232,7 |
mov ecx, socket |
mov ebx, 6 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
248,7 → 248,7 |
mov esi, msg |
mov ebx, 7 |
mov eax, 53 |
int 0x40 |
mcall |
if verify eq 1 |
call verifysend |
262,7 → 262,7 |
mov ecx, socket |
mov ebx, 8 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.check_port 165,eax |
273,7 → 273,7 |
mov ecx, port |
mov ebx, 9 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
285,7 → 285,7 |
mov ebx, 255 |
mov ecx, 6 |
mov eax, 53 |
int 0x40 |
mcall |
mov status,eax |
} |
340,7 → 340,7 |
.loop: |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
eth.poll socket |
376,7 → 376,7 |
mov eax,5 ; wait here for event |
mov ebx,10 |
int 0x40 |
mcall |
jmp @r |
@@: |
/programs/network/VNCclient/VNCclient.asm |
---|
32,6 → 32,7 |
TIMEOUT = 60 ; timeout in seconds |
BUFFER = 1500 ; Buffer size for DNS |
include '..\..\macros.inc' |
include 'fdo.inc' |
include 'ETH.INC' |
include 'logon.inc' |
39,7 → 40,6 |
include 'copyrect.inc' |
include 'thread.inc' |
START: ; start of execution |
call red_logon |
46,7 → 46,7 |
mov eax,40 ; Report events |
mov ebx,00000000b ; Only Stack |
int 0x40 |
mcall |
mov eax,67 ; resize the window (hide it) |
xor ebx,ebx |
53,13 → 53,13 |
mov ecx,ebx |
mov edx,ebx |
mov esi,ebx |
int 0x40 |
mcall |
mov eax,51 |
mov ebx,1 |
mov ecx,thread_start |
mov edx,thread_stack |
int 0x40 |
mcall |
DEBUGF 1,'Thread created: %u\n',eax |
66,7 → 66,7 |
@@: |
mov eax,5 |
mov ebx,10 |
int 0x40 |
mcall |
cmp byte[thread_ready],0 |
je @r |
73,7 → 73,7 |
mov eax,40 ; report events |
mov ebx,100111b ; mouse, button, key, redraw |
int 0x40 |
mcall |
mov eax,67 ; resize the window |
mov ebx,10 |
84,7 → 84,7 |
shr edx,16 |
add edx,2*xpos |
add esi,ypos+xpos |
int 0x40 |
mcall |
mainloop: |
eth.socket_status [socket],eax |
93,7 → 93,7 |
mov eax,23 ; wait for event with timeout |
mov ebx,50 ; 0,5 s |
int 0x40 |
mcall |
cmp eax,1 |
je redraw |
112,7 → 112,7 |
DEBUGF 1,'Sending key event\n' |
mov eax,2 |
int 0x40 |
mcall |
mov byte[keyevent.key+3],ah |
eth.write_tcp [socket],8,keyevent |
124,7 → 124,7 |
mov eax,37 |
mov ebx,1 |
int 0x40 |
mcall |
sub eax,xpos*65536+ypos |
bswap eax |
134,7 → 134,7 |
mov eax,37 |
mov ebx,2 |
int 0x40 |
mcall |
test al,00000010b ; test if right button was pressed (bit 1 in kolibri) |
jz @f |
153,7 → 153,7 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,0 ; draw window |
mov ebx,dword[framebuffer] |
163,9 → 163,7 |
add ebx,2*xpos |
add ecx,ypos+xpos |
mov edx,0x03ffffff |
mov esi,0x80555599 |
mov edi,0x00ffffff |
int 0x40 |
mcall |
mov eax,4 ; label |
mov ebx,9*65536+8 |
173,13 → 171,13 |
mov edx,name |
mov esi,[name_length] |
bswap esi |
int 0x40 |
mcall |
call drawbuffer |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
jmp mainloop |
189,7 → 187,7 |
mov ebx,framebuffer_data |
mov ecx,dword[screen] |
mov edx,xpos*65536+ypos |
int 0x40 |
mcall |
ret |
196,7 → 194,7 |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
close: |
call read_data |
204,7 → 202,7 |
DEBUGF 1,'Socket closed\n' |
mov eax,-1 |
int 0x40 |
mcall |
no_rfb: |
DEBUGF 1,'This is no vnc server!\n' |
/programs/network/VNCclient/build.bat |
---|
0,0 → 1,2 |
@fasm VNCclient.asm VNCclient |
@pause |
/programs/network/VNCclient/fdo.inc |
---|
152,7 → 152,7 |
mov cl,al |
mov ebx,1 |
mov eax,63 |
int 0x40 |
mcall |
popad |
ret |
debug_endf |
164,7 → 164,7 |
.l1: mov cl,[edx] |
or cl,cl |
jz .l2 |
int 0x40 |
mcall |
inc edx |
jmp .l1 |
.l2: ret |
/programs/network/VNCclient/logon.inc |
---|
3,7 → 3,7 |
still_logon: ; main cycle of application begins here |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
checkevent_logon: ; Check what event was called _logon: this will be used to return from textbox focus |
18,7 → 18,7 |
key_logon: ; key event handler |
mov al,2 ; eax was zero so will now be 2 |
int 0x40 ; just read it and ignore |
mcall ; just read it and ignore |
cmp ah,13 |
jne still_logon ; return to main loop |
27,7 → 27,7 |
button_logon: ; eax was zero so will now be 17 |
mov al,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; close ? |
jz close_logon |
66,10 → 66,10 |
.waitev_logon: |
mov eax,10 ; wait for event |
int 0x40 |
mcall |
cmp eax,2 ; button presed ? |
jne checkevent_logon ; a key is pressed or redraw is nessesary, goto checkevent |
int 0x40 ; eax = 2, read button |
mcall ; eax = 2, read button |
shr eax,8 |
cmp eax,8 |
jnz .nobs_logon ; BACKSPACE |
126,7 → 126,7 |
mov ecx, 33*65536+12 |
mov edx, 4 |
mov esi, 0xEBEBEB |
int 0x40 |
mcall |
cmp byte[mode],0 |
je @f |
133,7 → 133,7 |
mov ecx, 49*65536+12 |
inc edx |
int 0x40 |
mcall |
@@: |
mov eax, 4 ; function 4 _logon: write text to window |
141,7 → 141,7 |
xor ecx, ecx ; color of text RRGGBB |
mov edx, first ; pointer to text beginning |
mov esi, STRLEN ; text length |
int 0x40 |
mcall |
cmp byte[mode],0 |
je dont_draw_pass |
156,7 → 156,7 |
dec edi |
mov edx, passchar |
mov esi, 1 |
int 0x40 |
mcall |
add ebx,6*65536 |
jmp @r |
166,8 → 166,8 |
ret |
close_logon: |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
connect_logon: |
ret |
176,14 → 176,15 |
mov eax, 12 ; function 12_logon:tell os about windowdraw |
mov ebx, 1 ; 1, start of draw |
int 0x40 |
mcall |
pusha |
; DRAW WINDOW |
xor eax, eax ; function 0 _logon: define and draw window |
mov ebx, 160*65536+330 ; [x start] *65536 + [x size] |
mov ecx, 160*65536+100 ; [y start] *65536 + [y size] |
mov edx, 0x03DDDDDD ; color of work area RRGGBB |
int 0x40 |
mov edx, 0x13DDDDDD ; color of work area RRGGBB |
mov edi, title ; WINDOW LABEL |
mcall |
mov eax, 8 ; LOGON BUTTON |
mov ebx, 220*65536+85 |
190,30 → 191,24 |
mov ecx, 63*65536+16 |
mov edx, 2 |
mov esi, 0xCCCCCC |
int 0x40 |
mcall |
call print_text_logon |
; WINDOW LABEL |
mov eax, 4 ; function 4 _logon: write text to window |
mov ebx, 8*65536+8 ; [x start] *65536 + [y start] |
mov ecx, 0x10ffffff ; color of text RRGGBB |
mov edx, labelt ; pointer to text beginning |
mov esi, labellen-labelt ; text length |
int 0x40 |
cmp byte[mode],0 |
je servermode_ |
mov eax, 4 ; function 4 _logon: write text to window |
mov ebx, 25*65536+33 ; [x start] *65536 + [y start] |
xor ecx, ecx |
mov edx, userstr ; pointer to text beginning |
mov esi, passstr-userstr ; text length |
int 0x40 |
mcall |
add bl,16 |
mov edx, passstr ; pointer to text beginning |
mov esi, connect-passstr ; text length |
int 0x40 |
mcall |
jmp drawtherest_ |
223,7 → 218,7 |
xor ecx, ecx |
mov edx, serverstr ; pointer to text beginning |
mov esi, userstr-serverstr ; text length |
int 0x40 |
mcall |
drawtherest_: |
230,18 → 225,17 |
mov ebx, 240*65536+67 ; [x start] *65536 + [y start] |
mov edx, connect ; pointer to text beginning |
mov esi, connect_e-connect ; text length |
int 0x40 |
mcall |
popa |
inc ebx |
int 0x40 |
mcall |
ret |
; DATA AREA |
labelt: db 'Kolibrios VNC client by HIDNPLAYR' |
labellen: |
title db 'Kolibrios VNC client by HIDNPLAYR',0 |
first: db '192.168.1.5' |
rb STRLEN |
/programs/network/VNCclient/thread.inc |
---|
3,7 → 3,7 |
mov eax,40 ; Report events |
mov ebx,10000000b ; Only Stack |
int 0x40 |
mcall |
resolve first,[server_ip] ; the input window putted the server @ 'first', resolve it into a real ip |
mov [server_port],5900 ; no port input for now, only standard port 5900 |
171,7 → 171,7 |
mov eax,55 |
mov ebx,eax |
mov esi,beep |
int 0x40 |
mcall |
jmp thread_loop |