2006-01-03 12:43:31 +03:00
|
|
|
|
;
|
|
|
|
|
; NetSend(Client)
|
2007-10-20 22:12:58 +04:00
|
|
|
|
;
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>: Hex
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>: www.mestack.narod.ru
|
2007-10-20 22:12:58 +04:00
|
|
|
|
;
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; <20><><EFBFBD>ᠭ<EFBFBD><E1A0AD>:
|
|
|
|
|
; <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD>ﬨ <20> <20><><EFBFBD><EFBFBD>.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪠<EFBFBD> <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 22:12:58 +04:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
use32
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
org 0x0
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-08-18 17:32:18 +04:00
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
|
dd 1 ; header version
|
2006-01-03 12:43:31 +03:00
|
|
|
|
dd START ; program start
|
|
|
|
|
dd I_END ; program image size
|
2006-08-18 17:32:18 +04:00
|
|
|
|
dd mem ; required amount of memory
|
|
|
|
|
dd mem ; stack pointer
|
|
|
|
|
dd 0, 0 ; param, icon
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-08-18 17:32:18 +04:00
|
|
|
|
include 'lang.inc'
|
2007-10-20 22:12:58 +04:00
|
|
|
|
include 'macros.inc'
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
START: ; start of execution
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax,53 ; open socket
|
|
|
|
|
mov ebx,0
|
|
|
|
|
mov ecx,0x4000 ; local port
|
|
|
|
|
mov edx,0x5000 ; remote port
|
|
|
|
|
mov esi,dword [remote_ip] ; node IP
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov [socketNum], eax
|
2006-08-18 17:32:18 +04:00
|
|
|
|
|
2007-10-20 22:12:58 +04:00
|
|
|
|
red:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
call draw_window ; at first, draw the window
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
still:
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-08-18 17:32:18 +04:00
|
|
|
|
mov eax,10 ; wait here for event
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-08-18 17:32:18 +04:00
|
|
|
|
|
|
|
|
|
dec eax
|
2006-01-03 12:43:31 +03:00
|
|
|
|
jz red
|
2006-08-18 17:32:18 +04:00
|
|
|
|
dec eax
|
|
|
|
|
jnz button
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
key:
|
2006-08-18 17:32:18 +04:00
|
|
|
|
mov al,2
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
jmp still
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
button:
|
2006-08-18 17:32:18 +04:00
|
|
|
|
mov al,17
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-08-18 17:32:18 +04:00
|
|
|
|
dec ah ; button id=1 ?
|
2006-01-03 12:43:31 +03:00
|
|
|
|
jnz noclose
|
|
|
|
|
mov eax, 53
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov ecx, [socketNum]
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
|
|
|
|
or eax,-1
|
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
noclose:
|
2006-08-18 17:32:18 +04:00
|
|
|
|
; it was not close button, so it must be send code button
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; SEND CODE TO REMOTE ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
send_xcode:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socketNum]
|
|
|
|
|
mov edx,end_message-send_data
|
2006-08-18 17:32:18 +04:00
|
|
|
|
mov esi,send_data
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-08-18 17:32:18 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
jmp still
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
|
; *********************************************
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
draw_window:
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax,12 ; function 12:tell os about windowdraw
|
|
|
|
|
mov ebx,1 ; 1, start of draw
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; DRAW WINDOW
|
|
|
|
|
mov eax,0 ; function 0 : define and draw window
|
|
|
|
|
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
|
|
|
|
|
mov ecx,60*65536+150 ; [y start] *65536 + [y size]
|
2007-10-20 22:12:58 +04:00
|
|
|
|
mov edx,0x14ffffff ; color of work area RRGGBB
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mov edi,title ; WINDOW LABEL
|
|
|
|
|
mcall
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax,8 ; SEND MESSAGE
|
|
|
|
|
mov ebx,50*65536+145
|
|
|
|
|
mov ecx,47*65536+13
|
|
|
|
|
mov edx,2
|
|
|
|
|
mov esi,0x667788
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mov eax,4
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov ebx,25*65536+50 ; draw info text with function 4
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,text
|
|
|
|
|
mov esi,40
|
|
|
|
|
newline:
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
add ebx,16
|
2006-08-18 17:32:18 +04:00
|
|
|
|
add edx,esi
|
2006-01-03 12:43:31 +03:00
|
|
|
|
cmp [edx],byte 'x'
|
|
|
|
|
jnz newline
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax,12 ; function 12:tell os about windowdraw
|
|
|
|
|
mov ebx,2 ; 2, end of draw
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
ret
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; DATA AREA
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
|
|
|
|
if lang eq ru
|
2006-01-03 12:43:31 +03:00
|
|
|
|
text:
|
|
|
|
|
db ' <20><><EFBFBD><E1ABA0> ᮮ<>饭<EFBFBD><E9A5AD> '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.1 '
|
|
|
|
|
db ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> : 192.168.0.2 '
|
|
|
|
|
db '<27><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> '
|
2006-08-18 17:32:18 +04:00
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
|
|
|
|
else
|
|
|
|
|
text:
|
|
|
|
|
db ' Send message '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' Local address : 192.168.0.1 '
|
|
|
|
|
db ' Remote address : 192.168.0.2 '
|
|
|
|
|
db 'Text and address in end of source '
|
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
2007-10-20 22:12:58 +04:00
|
|
|
|
end if
|
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
|
title db 'NetSend(Client)',0
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
remote_ip db 192,168,1,2
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
send_data db '<27>ਢ<EFBFBD><E0A8A2>,<2C><><EFBFBD> <20><><EFBFBD><EFBFBD>!Hello,this is a test!'
|
|
|
|
|
end_message:
|
|
|
|
|
|
2007-10-20 22:12:58 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
I_END:
|
2006-08-18 17:32:18 +04:00
|
|
|
|
align 4
|
|
|
|
|
socketNum dd ?
|
|
|
|
|
|
|
|
|
|
rb 32 ; this is for stack
|
|
|
|
|
|
|
|
|
|
mem:
|
|
|
|
|
|