2006-01-03 12:43:31 +03:00
|
|
|
|
;
|
|
|
|
|
; LAUNCHER - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20><><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> ᮢᥬ <20><> <20><>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD><E0AEA2>, <20><> <20>祭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>㧨<EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>᪠ <20><> 䠩<><E4A0A9>
|
|
|
|
|
; AUTORUN.DAT. <20><>ଠ<EFBFBD> <20>祭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦤<EFBFBD><E3A6A4><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FASM 1.52 <20> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
2011-01-18 14:56:31 +03:00
|
|
|
|
include "../../../macros.inc"
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
use32
|
|
|
|
|
org 0x0
|
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
|
dd 0x01 ; header version
|
|
|
|
|
dd START ; start of code
|
|
|
|
|
dd I_END ; size of image
|
|
|
|
|
dd 0x8000 ; memory for app
|
|
|
|
|
dd 0x8000 ; esp
|
|
|
|
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
|
|
|
|
|
|
|
|
|
;include "DEBUG.INC"
|
|
|
|
|
|
|
|
|
|
START: ; start of execution
|
|
|
|
|
|
2006-08-18 18:32:11 +04:00
|
|
|
|
; mov eax, 5
|
|
|
|
|
; mov ebx, 10
|
2007-05-10 17:48:35 +04:00
|
|
|
|
; mcall
|
2006-08-18 18:32:11 +04:00
|
|
|
|
|
2009-01-30 03:09:58 +03:00
|
|
|
|
; mcall 18,15
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-29 16:52:52 +04:00
|
|
|
|
mov eax, 70 ; load AUTORUN.DAT
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov ebx, autorun_dat_info
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2009-01-30 03:09:58 +03:00
|
|
|
|
add ebx, file_data
|
|
|
|
|
mov [fileend], ebx
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2009-01-30 03:09:58 +03:00
|
|
|
|
; this cycle does not contain an obvious exit condition,
|
|
|
|
|
; but auxiliary procedures (like "get_string") will exit
|
|
|
|
|
; at EOF
|
2006-01-03 12:43:31 +03:00
|
|
|
|
start_program:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
call skip_spaces
|
|
|
|
|
cmp al,'#'
|
|
|
|
|
jz skip_this_string
|
2006-01-03 12:43:31 +03:00
|
|
|
|
call clear_strings
|
|
|
|
|
mov edi, program
|
|
|
|
|
call get_string
|
|
|
|
|
mov edi, parameters
|
|
|
|
|
call get_string
|
|
|
|
|
call get_number
|
2009-01-30 03:09:58 +03:00
|
|
|
|
;dps <"STARTING A PROGRAM",13,10>
|
2006-01-03 12:43:31 +03:00
|
|
|
|
call run_program
|
2009-01-30 03:09:58 +03:00
|
|
|
|
skip_this_string:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
call next_line
|
2009-01-30 03:09:58 +03:00
|
|
|
|
jmp start_program
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
exit:
|
|
|
|
|
or eax, -1
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_program: ; time to delay in eax
|
|
|
|
|
push eax
|
2006-08-29 16:52:52 +04:00
|
|
|
|
mcall 70, start_info
|
2006-01-03 12:43:31 +03:00
|
|
|
|
pop ebx
|
|
|
|
|
|
2009-01-30 03:09:58 +03:00
|
|
|
|
; if delay is negative, wait for termination
|
|
|
|
|
; of the spawned process
|
|
|
|
|
test ebx, ebx
|
|
|
|
|
js must_wait_for_termination
|
|
|
|
|
; otherwise, simply wait
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax, 5
|
2007-05-10 17:48:35 +04:00
|
|
|
|
mcall
|
2009-01-30 03:09:58 +03:00
|
|
|
|
ret
|
|
|
|
|
must_wait_for_termination:
|
|
|
|
|
mov esi, eax ; save slot for the future
|
|
|
|
|
; get process slot
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mcall 18, 21
|
|
|
|
|
; if an error has occured, exit
|
|
|
|
|
test eax, eax
|
|
|
|
|
jz child_exited
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
; wait
|
|
|
|
|
wait_for_termination:
|
|
|
|
|
mcall 5, 1
|
|
|
|
|
mov ebx, processinfo
|
|
|
|
|
mcall 9
|
|
|
|
|
cmp word [ebx+50], 9 ; the slot was freed?
|
|
|
|
|
jz child_exited
|
|
|
|
|
cmp dword [ebx+30], esi ; the slot is still occupied by our child?
|
|
|
|
|
jz wait_for_termination
|
|
|
|
|
child_exited:
|
|
|
|
|
ret
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
clear_strings: ; clears buffers
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
mov ecx, 60
|
|
|
|
|
mov edi, program
|
|
|
|
|
xor al, al ;mov al, ' '
|
|
|
|
|
rep stosb
|
|
|
|
|
|
|
|
|
|
mov ecx, 60
|
|
|
|
|
mov edi, parameters
|
|
|
|
|
rep stosb
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_string: ; pointer to destination buffer in edi
|
|
|
|
|
pushad
|
|
|
|
|
call skip_spaces
|
|
|
|
|
mov esi, [position]
|
|
|
|
|
;dpd esi
|
|
|
|
|
;dps <13,10>
|
|
|
|
|
add esi, file_data
|
|
|
|
|
.start:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
cmp esi, [fileend]
|
|
|
|
|
jae exit
|
2006-01-03 12:43:31 +03:00
|
|
|
|
lodsb
|
|
|
|
|
cmp al, ' '
|
|
|
|
|
je .finish
|
|
|
|
|
stosb
|
|
|
|
|
inc [position]
|
|
|
|
|
jmp .start
|
|
|
|
|
.finish:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_number:
|
|
|
|
|
push ebx esi
|
|
|
|
|
call skip_spaces
|
|
|
|
|
mov esi, [position]
|
|
|
|
|
add esi, file_data
|
|
|
|
|
xor eax, eax
|
2009-01-30 03:09:58 +03:00
|
|
|
|
cmp byte [esi], '-'
|
|
|
|
|
jnz @f
|
|
|
|
|
inc eax
|
|
|
|
|
inc esi
|
|
|
|
|
inc [position]
|
|
|
|
|
@@:
|
|
|
|
|
push eax
|
|
|
|
|
xor eax, eax
|
2006-01-03 12:43:31 +03:00
|
|
|
|
xor ebx, ebx
|
|
|
|
|
.start:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
cmp esi, [fileend]
|
|
|
|
|
jae .finish
|
2006-01-03 12:43:31 +03:00
|
|
|
|
lodsb
|
|
|
|
|
sub al, '0'
|
2006-08-29 16:52:52 +04:00
|
|
|
|
cmp al, 9
|
|
|
|
|
ja .finish
|
|
|
|
|
lea ebx,[ebx*4+ebx]
|
|
|
|
|
lea ebx,[ebx*2+eax]
|
2006-01-03 12:43:31 +03:00
|
|
|
|
inc [position]
|
|
|
|
|
jmp .start
|
|
|
|
|
.finish:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
pop eax
|
|
|
|
|
dec eax
|
|
|
|
|
jnz @f
|
|
|
|
|
neg ebx
|
|
|
|
|
@@:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
mov eax, ebx
|
|
|
|
|
pop esi ebx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skip_spaces:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
push esi
|
2006-01-03 12:43:31 +03:00
|
|
|
|
xor eax, eax
|
|
|
|
|
mov esi, [position]
|
|
|
|
|
add esi, file_data
|
|
|
|
|
.start:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
cmp esi, [fileend]
|
|
|
|
|
jae .finish
|
2006-01-03 12:43:31 +03:00
|
|
|
|
lodsb
|
|
|
|
|
cmp al, ' '
|
|
|
|
|
jne .finish
|
|
|
|
|
inc [position]
|
|
|
|
|
jmp .start
|
|
|
|
|
.finish:
|
|
|
|
|
;dps "NOW AL = "
|
|
|
|
|
;mov [tmp],al
|
|
|
|
|
;mov edx, tmp
|
|
|
|
|
;call debug_outstr
|
|
|
|
|
;dps <13,10>
|
2009-01-30 03:09:58 +03:00
|
|
|
|
pop esi
|
2006-01-03 12:43:31 +03:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next_line:
|
|
|
|
|
mov esi, [position]
|
|
|
|
|
add esi, file_data
|
|
|
|
|
.start:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
cmp esi, [fileend]
|
|
|
|
|
jae exit
|
2006-01-03 12:43:31 +03:00
|
|
|
|
lodsb
|
|
|
|
|
cmp al, 13
|
|
|
|
|
je .finish
|
2009-01-30 03:09:58 +03:00
|
|
|
|
cmp al, 10
|
|
|
|
|
je .finish
|
2006-01-03 12:43:31 +03:00
|
|
|
|
inc [position]
|
|
|
|
|
jmp .start
|
|
|
|
|
.finish:
|
2009-01-30 03:09:58 +03:00
|
|
|
|
inc [position]
|
|
|
|
|
cmp esi, [fileend]
|
|
|
|
|
jae exit
|
2006-01-03 12:43:31 +03:00
|
|
|
|
lodsb
|
|
|
|
|
cmp al, 13
|
2009-01-30 03:09:58 +03:00
|
|
|
|
je .finish
|
|
|
|
|
cmp al, 10
|
|
|
|
|
je .finish
|
|
|
|
|
ret
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; DATA:
|
|
|
|
|
position dd 0 ; position in file
|
|
|
|
|
|
|
|
|
|
autorun_dat_info: ; AUTORUN.DAT
|
|
|
|
|
.mode dd 0 ; read file
|
|
|
|
|
.start_block dd 0 ; block to read
|
2006-08-29 16:52:52 +04:00
|
|
|
|
dd 0
|
|
|
|
|
.blocks dd 16*512 ; 16*512 bytes max
|
2006-01-03 12:43:31 +03:00
|
|
|
|
.address dd file_data
|
2007-05-30 18:45:45 +04:00
|
|
|
|
db "AUTORUN.DAT",0
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
start_info:
|
2006-08-29 16:52:52 +04:00
|
|
|
|
.mode dd 7
|
2006-01-03 12:43:31 +03:00
|
|
|
|
dd 0
|
|
|
|
|
.params dd parameters
|
|
|
|
|
dd 0
|
2006-08-29 16:52:52 +04:00
|
|
|
|
dd 0
|
2006-01-03 12:43:31 +03:00
|
|
|
|
.path: ;
|
|
|
|
|
|
|
|
|
|
I_END:
|
|
|
|
|
|
|
|
|
|
program rb 61 ; 60 + [0] char
|
|
|
|
|
parameters rb 61
|
|
|
|
|
|
2009-01-30 03:09:58 +03:00
|
|
|
|
processinfo rb 1024
|
|
|
|
|
fileend dd ?
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
file_data rb 16*512
|