2006-01-03 12:43:31 +03:00
|
|
|
|
;
|
|
|
|
|
; Remote Control Center(Client)
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>: Hex
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>: www.mestack.narod.ru
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>ᠭ<EFBFBD><E1A0AD>:
|
|
|
|
|
; <20>ணࠬ<E0AEA3><E0A0AC>, <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> 㤠<><E3A4A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use32
|
|
|
|
|
org 0x0
|
|
|
|
|
|
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
|
dd 0x01 ; header version
|
|
|
|
|
dd START ; start of code
|
|
|
|
|
dd I_END ; size of image
|
|
|
|
|
dd 0x5000 ; memory for app
|
|
|
|
|
dd 0x5000 ; esp
|
|
|
|
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
|
|
|
|
|
|
|
|
|
include 'lang.inc'
|
2007-05-10 17:48:35 +04:00
|
|
|
|
include '..\..\..\macros.inc'
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
START: ; start of execution
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; open socket
|
|
|
|
|
mov ebx,0
|
|
|
|
|
mov ecx,0x6000 ; local port
|
|
|
|
|
mov edx,0x6100 ; remote port
|
|
|
|
|
mov esi,dword [remote_ip] ; remote IP
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
mov [socket], eax
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; send connect code
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,connect
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
|
red:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
call draw_window ; at first, draw the window
|
|
|
|
|
|
|
|
|
|
still:
|
|
|
|
|
|
|
|
|
|
mov eax,23 ; wait here for event
|
|
|
|
|
mov ebx,1
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
cmp eax,1 ; redraw request ?
|
|
|
|
|
jz red
|
|
|
|
|
cmp eax,2 ; key in buffer ?
|
|
|
|
|
jz key
|
|
|
|
|
cmp eax,3 ; button in buffer ?
|
|
|
|
|
jz button
|
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
key:
|
|
|
|
|
mov eax,2
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
button:
|
|
|
|
|
mov eax,17
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
cmp ah,1 ; button id=1 ?
|
|
|
|
|
jnz noclose
|
|
|
|
|
mov eax, 53
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov ecx, [socket]
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
|
|
|
|
or eax,-1
|
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
noclose:
|
|
|
|
|
|
|
|
|
|
cmp ah,2 ; SEND SHUTDOWN COMMAND?
|
|
|
|
|
je send_shutdown
|
|
|
|
|
|
|
|
|
|
cmp ah,3 ; SEND REBOOT COMMAND?
|
|
|
|
|
je send_reboot
|
|
|
|
|
|
|
|
|
|
cmp ah,4 ; SEND SAVEFI COMMAND?
|
|
|
|
|
je send_savefi
|
|
|
|
|
|
|
|
|
|
cmp ah,5 ; SEND SAVEHI COMMAND?
|
|
|
|
|
je send_savehi
|
|
|
|
|
|
|
|
|
|
cmp ah,6 ; SEND HOTREBOOT COMMAND?
|
|
|
|
|
je send_hotreboot
|
|
|
|
|
|
|
|
|
|
cmp ah,7 ; SEND EXIT COMMAND?
|
|
|
|
|
je send_exit
|
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; SEND COMMANDS TO SERVER ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
send_shutdown:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,sen_shutdown
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
send_reboot:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,sen_reboot
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
send_savefi:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,sen_savefi
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
send_savehi:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,sen_savehi
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
send_hotreboot:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,sen_hotreboot
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
send_exit:
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; SEND CODE TO REMOTE
|
|
|
|
|
mov ebx,4
|
|
|
|
|
mov ecx,[socket]
|
|
|
|
|
mov edx,1
|
|
|
|
|
mov esi,sen_exit
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
get_data:
|
|
|
|
|
|
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,3
|
|
|
|
|
mov ecx,[socket]
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
mov [edi],bl
|
|
|
|
|
inc edi
|
|
|
|
|
|
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,2
|
|
|
|
|
mov ecx,[socket]
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
cmp eax,0
|
|
|
|
|
jne get_data
|
|
|
|
|
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,30*65536+30
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,I_END
|
|
|
|
|
mov esi,15
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
|
; *********************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_window:
|
|
|
|
|
|
|
|
|
|
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
|
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+280 ; [y start] *65536 + [y size]
|
2007-06-23 00:24:06 +04:00
|
|
|
|
mov edx,0x14ffffff ; color of work area RRGGBB
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mov edi,title ; WINDOW LABEL
|
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax,8 ; CONTROL BUTTONS
|
|
|
|
|
mov ebx,25*65536+9
|
|
|
|
|
mov ecx,113*65536+9
|
|
|
|
|
mov edx,2
|
|
|
|
|
mov esi,0x667788
|
|
|
|
|
newbut:
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
add ecx,16*65536
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx,8
|
|
|
|
|
jb newbut
|
|
|
|
|
|
|
|
|
|
cld
|
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
|
|
|
|
|
add edx,40
|
|
|
|
|
cmp [edx],byte 'x'
|
|
|
|
|
jnz newline
|
|
|
|
|
|
|
|
|
|
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
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; DATA AREA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text:
|
2006-08-18 18:32:11 +04:00
|
|
|
|
if lang eq ru
|
2006-01-03 12:43:31 +03:00
|
|
|
|
db ' <20>६<EFBFBD> <20><>ࢥ<EFBFBD><E0A2A5>: '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' <20><><EFBFBD><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><>ࢥ: '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' - <20>몫<EFBFBD><EBAAAB><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
db ' - <20><>१<EFBFBD><E0A5A7><EFBFBD>㧨<EFBFBD><E3A7A8> '
|
|
|
|
|
db ' - <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> 䫮<><E4ABAE><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
db ' - <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>. <20><>᪠ '
|
|
|
|
|
db ' - <20><><EFBFBD><EFBFBD>稩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> '
|
|
|
|
|
db ' - <20><><EFBFBD><EFBFBD><EFBFBD>⨥ <20><>ࢥ୮<E0A2A5> <20><><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
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><>ࢥ<EFBFBD><E0A2A5> - <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> '
|
2006-08-18 18:32:11 +04:00
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-18 18:32:11 +04:00
|
|
|
|
else
|
|
|
|
|
db ' On server: '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' Server control menu: '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' - Shutdown '
|
|
|
|
|
db ' - Reboot '
|
|
|
|
|
db ' - Save ramdisk image to floppy '
|
|
|
|
|
db ' - Save ramdisk image to hard disk '
|
|
|
|
|
db ' - Kernel restart '
|
|
|
|
|
db ' - Close server part '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' Local address : 192.168.0.1 '
|
|
|
|
|
db ' Remote address : 192.168.0.2 '
|
|
|
|
|
db 'Address of server is in end of source '
|
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
|
|
|
|
end if
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
|
title db 'Remote Control Center(Client)',0
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
socket dd 0x0
|
|
|
|
|
|
|
|
|
|
remote_ip db 192,168,0,2
|
|
|
|
|
|
|
|
|
|
sen_shutdown db 'S'
|
|
|
|
|
sen_reboot db 'R'
|
|
|
|
|
sen_savefi db 'F'
|
|
|
|
|
sen_savehi db 'H'
|
|
|
|
|
sen_hotreboot db 'O'
|
|
|
|
|
sen_exit db 'E'
|
|
|
|
|
connect db 'C'
|
|
|
|
|
|
|
|
|
|
I_END:
|