2006-01-03 10:43:31 +01:00
|
|
|
|
;
|
|
|
|
|
; NetSend(Server)
|
2007-10-20 20:12:58 +02:00
|
|
|
|
;
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>: Hex
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>: www.mestack.narod.ru
|
2007-10-20 20:12:58 +02:00
|
|
|
|
;
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; <20><><EFBFBD>ᠭ<EFBFBD><E1A0AD>:
|
|
|
|
|
; <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD>ﬨ <20> <20><><EFBFBD><EFBFBD>.<2E><>ࢥୠ<E0A2A5> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
;
|
|
|
|
|
; Compile with FASM for Menuet
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FASM'<27><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
|
|
|
|
;
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
use32
|
2007-10-20 20:12:58 +02:00
|
|
|
|
org 0x0
|
|
|
|
|
db 'MENUET01' ; header
|
|
|
|
|
dd 0x01 ; header version
|
|
|
|
|
dd START ; entry point
|
|
|
|
|
dd I_END ; image size
|
|
|
|
|
dd I_END+0x10000 ; required memory
|
|
|
|
|
dd I_END+0x10000 ; esp
|
|
|
|
|
dd 0x0 , 0x0 ; I_Param , I_Path
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
include 'lang.inc'
|
2007-10-20 20:12:58 +02:00
|
|
|
|
include 'macros.inc'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
remote_ip db 192,168,0,1
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
START: ; start of execution
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax, 53 ; open receiver socket
|
|
|
|
|
mov ebx, 0
|
|
|
|
|
mov ecx, 0x5000 ; local port
|
|
|
|
|
mov edx, 0xffff ; remote port
|
|
|
|
|
mov esi, dword [remote_ip] ; remote IP
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov [socketNum],eax
|
|
|
|
|
mov [0],eax ; save for remote code
|
2007-05-10 15:48:35 +02:00
|
|
|
|
|
2007-10-20 20:12:58 +02:00
|
|
|
|
red:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_window ; at first, draw the window
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
still:
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,23 ; wait here for event
|
|
|
|
|
mov ebx,1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp eax,1 ; redraw request ?
|
|
|
|
|
jz red
|
|
|
|
|
cmp eax,2 ; key in buffer ?
|
|
|
|
|
jz key
|
|
|
|
|
cmp eax,3 ; button in buffer ?
|
|
|
|
|
jz button
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,53 ; data from cluster terminal ?
|
|
|
|
|
mov ebx,2
|
|
|
|
|
mov ecx,[socketNum]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp eax,0
|
|
|
|
|
jne data_arrived
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
key:
|
|
|
|
|
mov eax,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
button:
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,1
|
|
|
|
|
mov ecx,[socketNum]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
|
|
|
|
or eax,-1
|
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
data_arrived:
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,5 ; wait a second for everything to arrive
|
|
|
|
|
mov ebx,10
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov edi,I_END
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
get_data:
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,3
|
|
|
|
|
mov ecx,[socketNum]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov [edi],bl
|
|
|
|
|
inc edi
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,2
|
|
|
|
|
mov ecx,[socketNum]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp eax,0
|
|
|
|
|
jne get_data
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,I_END
|
|
|
|
|
mov esi,100
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
y dd 0x10
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
|
; *********************************************
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
draw_window:
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,12 ; function 12:tell os about windowdraw
|
|
|
|
|
mov ebx,1 ; 1, start of draw
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; DRAW WINDOW
|
|
|
|
|
mov eax,0 ; function 0 : define and draw window
|
|
|
|
|
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
|
|
|
|
|
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
|
2007-10-20 20:12:58 +02:00
|
|
|
|
mov edx,0x14ffffff ; color of work area RRGGBB
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mov edi,title ; WINDOW LABEL
|
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; Re-draw the screen text
|
|
|
|
|
cld
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mov eax,4
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,10*65536+30 ; draw info text with function 4
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,text
|
|
|
|
|
mov esi,40
|
|
|
|
|
newline:
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add ebx,16
|
|
|
|
|
add edx,40
|
|
|
|
|
cmp [edx],byte 'x'
|
|
|
|
|
jnz newline
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,12 ; function 12:tell os about windowdraw
|
|
|
|
|
mov ebx,2 ; 2, end of draw
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
ret
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; DATA AREA
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
|
|
|
|
if lang eq ru
|
2006-01-03 10:43:31 +01:00
|
|
|
|
text:
|
|
|
|
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.2 '
|
|
|
|
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> : 0x5000 '
|
|
|
|
|
db '<27><><EFBFBD><EFBFBD><E1ABA0><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>: '
|
2006-08-18 15:32:18 +02:00
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
|
|
|
|
else
|
|
|
|
|
text:
|
|
|
|
|
db 'This address : 192.168.0.2 '
|
|
|
|
|
db 'Used port : 0x5000 '
|
|
|
|
|
db 'Received messages: '
|
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
|
|
|
|
end if
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2007-05-10 15:48:35 +02:00
|
|
|
|
title db 'NetSend(Server)',0
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
socketNum dd 0x0
|
2007-10-20 20:12:58 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
I_END:
|