2006-01-03 10:43:31 +01:00
|
|
|
|
;
|
|
|
|
|
; Remote Control Center(Server)
|
|
|
|
|
;
|
|
|
|
|
; <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><>ࢥୠ<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><>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
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 15:48:35 +02:00
|
|
|
|
include '..\..\..\macros.inc'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
remote_ip db 192,168,0,1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
START: ; start of execution
|
|
|
|
|
|
|
|
|
|
mov eax, 53 ; open receiver socket
|
|
|
|
|
mov ebx, 0
|
|
|
|
|
mov ecx, 0x6100 ; local port
|
|
|
|
|
mov edx, 0x6000 ; 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 [socket],eax
|
|
|
|
|
mov [0],eax ; save for remote code
|
2007-05-10 15:48:35 +02:00
|
|
|
|
|
|
|
|
|
red:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_window ; at first, draw the window
|
|
|
|
|
|
|
|
|
|
still:
|
|
|
|
|
|
|
|
|
|
mov eax,23 ; wait here for event
|
|
|
|
|
mov ebx,1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
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
|
|
|
|
|
|
|
|
|
|
mov eax,53 ; data from cluster terminal ?
|
|
|
|
|
mov ebx,2
|
|
|
|
|
mov ecx,[socket]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
cmp eax,0
|
|
|
|
|
jne data_arrived
|
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
key:
|
|
|
|
|
mov eax,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
button:
|
|
|
|
|
|
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,1
|
|
|
|
|
mov ecx,[socket]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
|
|
|
|
or eax,-1
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data_arrived:
|
|
|
|
|
|
|
|
|
|
mov eax,5 ; wait a second for everything to arrive
|
|
|
|
|
mov ebx,10
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov edi,I_END
|
|
|
|
|
|
|
|
|
|
get_data:
|
|
|
|
|
|
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,3
|
|
|
|
|
mov ecx,[socket]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov [edi],bl
|
|
|
|
|
inc edi
|
|
|
|
|
|
|
|
|
|
mov eax,53
|
|
|
|
|
mov ebx,2
|
|
|
|
|
mov ecx,[socket]
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
cmp eax,0
|
|
|
|
|
jne get_data
|
|
|
|
|
|
|
|
|
|
cmp byte [I_END],'C' ;Connect ?
|
|
|
|
|
jne no_con
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_con
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_con.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_con:
|
|
|
|
|
cmp byte [I_END],'S' ; Shutdown ?
|
|
|
|
|
jne no_shut
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_shut
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_shut.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
mov eax,18
|
|
|
|
|
mov ebx,9
|
|
|
|
|
mov ecx,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_shut:
|
|
|
|
|
cmp byte [I_END],'R' ; Reboot ?
|
|
|
|
|
jne no_reb
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_reb
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_reb.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
mov eax,18
|
|
|
|
|
mov ebx,9
|
|
|
|
|
mov ecx,3
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_reb:
|
|
|
|
|
cmp byte [I_END],'F' ; Save image on floppi ?
|
|
|
|
|
jne no_savefi
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_savefi
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_savefi.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
mov eax,18
|
|
|
|
|
mov ebx,9
|
|
|
|
|
mov ecx,1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_savefi:
|
|
|
|
|
cmp byte [I_END],'H' ; Save image on hard disk ?
|
|
|
|
|
jne no_savehi
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_savehi
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_savehi.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
mov eax,18
|
|
|
|
|
mov ebx,6
|
|
|
|
|
mov ecx,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_savehi:
|
|
|
|
|
cmp byte [I_END],'O' ; Hot reboot ?
|
|
|
|
|
jne no_hotreb
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_hotreb
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_hotreb.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
mov eax,18
|
|
|
|
|
mov ebx,9
|
|
|
|
|
mov ecx,4
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_hotreb:
|
|
|
|
|
cmp byte [I_END],'E' ; Unload server ?
|
|
|
|
|
jne no_com
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_exit
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_exit.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
call button
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
no_com:
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,10*65536+60
|
|
|
|
|
add ebx,[y]
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,inp_com
|
2006-08-18 16:32:11 +02:00
|
|
|
|
mov esi,inp_com.len
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add [y],10
|
|
|
|
|
|
|
|
|
|
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 15:48:35 +02:00
|
|
|
|
mcall
|
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-06-22 22:24:06 +02:00
|
|
|
|
mov edx,0x14ffffff ; color of work area RRGGBB
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mov edi,title ; WINDOW LABEL
|
|
|
|
|
mcall
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; DATA AREA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text:
|
2006-08-18 16:32:11 +02:00
|
|
|
|
if lang eq ru
|
2006-01-03 10:43:31 +01:00
|
|
|
|
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> : 0x6100 '
|
|
|
|
|
db '<27><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD>: '
|
2006-08-18 16:32:11 +02:00
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
|
|
|
|
else
|
|
|
|
|
db 'This address : 192.168.0.2 '
|
|
|
|
|
db 'Used port : 0x6100 '
|
|
|
|
|
db 'Status: '
|
|
|
|
|
db 'x' ; <- END MARKER, DONT DELETE
|
|
|
|
|
end if
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-05-10 15:48:35 +02:00
|
|
|
|
title db 'Remote Control Center(Server)',0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
socket dd 0x0
|
|
|
|
|
y dd 0x10
|
|
|
|
|
sysclock dd 0x0
|
|
|
|
|
|
2006-08-18 16:32:11 +02:00
|
|
|
|
if lang eq ru
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_con db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>稫<EFBFBD><E7A8AB> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_con
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_shut db '<27><><EFBFBD><EFBFBD> <20>⪫<EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD>⥬<EFBFBD>...'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_shut
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_reb db '<27><><EFBFBD><EFBFBD> <20><>१<EFBFBD><E0A5A7><EFBFBD>㧪<EFBFBD>...'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_reb
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_savefi db '<27><><EFBFBD>࠭塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>᪥<EFBFBD><E1AAA5>...'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_savefi
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_savehi db '<27><><EFBFBD>࠭塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20>. <20><><EFBFBD><EFBFBD>...'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_savehi
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_hotreb db '<27><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>...'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_hotreb
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_exit db '<27><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>...'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_exit
|
2006-01-03 10:43:31 +01:00
|
|
|
|
inp_com db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'
|
2006-08-18 16:32:11 +02:00
|
|
|
|
.len = $-inp_com
|
|
|
|
|
else
|
|
|
|
|
inp_con db 'Note, client has been connected!'
|
|
|
|
|
.len = $-inp_con
|
|
|
|
|
inp_shut db 'Turn off in progress...'
|
|
|
|
|
.len = $-inp_shut
|
|
|
|
|
inp_reb db 'Reboot in progress...'
|
|
|
|
|
.len = $-inp_reb
|
|
|
|
|
inp_savefi db 'Saving image to floppy...'
|
|
|
|
|
.len = $-inp_savefi
|
|
|
|
|
inp_savehi db 'Saving image to hard disk...'
|
|
|
|
|
.len = $-inp_savehi
|
|
|
|
|
inp_hotreb db 'Kernel restart in progress...'
|
|
|
|
|
.len = $-inp_hotreb
|
|
|
|
|
inp_exit db 'Exiting from program...'
|
|
|
|
|
.len = $-inp_exit
|
|
|
|
|
inp_com db 'Unknown command!'
|
|
|
|
|
.len = $-inp_com
|
|
|
|
|
end if
|
2006-01-03 10:43:31 +01:00
|
|
|
|
I_END:
|