New versions of End and RDsave. See forum for detales.

git-svn-id: svn://kolibrios.org@4213 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2013-11-11 22:49:12 +00:00
parent daa2b8868e
commit fa45c7e5db
7 changed files with 875 additions and 569 deletions

View File

@ -0,0 +1,5 @@
[path]
path=/usbhdd0/1/kolibri.img
[settings]
autoclose=0
autosave=0

View File

@ -24,7 +24,7 @@ else if lang eq it
else else
label2: label2:
db 'Power off Kernel',0 db ' Power off Kernel',0
label3: label3:
db ' Restart Cancel',0 db ' Restart Cancel',0
label4: label4:
@ -38,5 +38,61 @@ end if
db '(Enter) (Esc)',0 db '(Enter) (Esc)',0
rdsave: rdsave:
dd 7,0,0,0,0 dd 7,0,hide,0,0
db '/sys/rdsave',0 db '/sys/rdsave',0
;---------------------------------------------------------------------
;Lib_DATA
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
system_dir_libini db '/sys/lib/libini.obj',0
;---------------------------------------------------------------------
head_f_i:
head_f_l db 'System error',0
err_message_found_lib1 db 'box_lib.obj - Not found!',0
err_message_found_lib2 db 'libini.obj - Not found!',0
err_message_import1 db 'box_lib.obj - Wrong import!',0
err_message_import2 db 'libini.obj - Wrong import!',0
;---------------------------------------------------------------------
l_libs_start:
library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
library02 l_libs system_dir_libini+9, cur_dir_path, library_path, system_dir_libini, \
err_message_found_lib2, head_f_l, libini_import, err_message_import2, head_f_i
end_l_libs:
;---------------------------------------------------------------------
align 4
Box_lib_import:
init_checkbox2 dd aInit_checkbox2
check_box_draw2 dd aCheck_box_draw2
check_box_mouse2 dd aCheck_box_mouse2
;version_ch2 dd aVersion_ch2
dd 0
dd 0
aInit_checkbox2 db 'init_checkbox2',0
aCheck_box_draw2 db 'check_box_draw2',0
aCheck_box_mouse2 db 'check_box_mouse2',0
;aVersion_ch2 db 'version_ch2',0
;---------------------------------------------------------------------
align 4
libini_import:
init_lib dd a_init
ini_get_int dd aini_get_int
ini_set_int dd aini_set_int
dd 0
dd 0
a_init db 'lib_init',0
aini_get_int db 'ini_get_int',0
aini_set_int db 'ini_set_int',0
;---------------------------------------------------------------------
check1 check_box2 20 shl 16 +8,93 shl 16 +8,6,0xffffff,0,0,label4
hide db 'h',0
asettings db 'settings',0
aautosave db 'autosave',0
ini_file db '/sys/settings/rdsave.ini',0

View File

@ -2,71 +2,83 @@
; END ; END
; KolibriOS Team 2005-2013 ; KolibriOS Team 2005-2013
; ;
include "lang.inc"
include "..\..\..\macros.inc"
; <diamond> note that 'mov al,xx' is shorter than 'mov eax,xx' ; <diamond> note that 'mov al,xx' is shorter than 'mov eax,xx'
; and if we know that high 24 bits of eax are zero, we can use 1st form ; and if we know that high 24 bits of eax are zero, we can use 1st form
; the same about ebx,ecx,edx ; the same about ebx,ecx,edx
meos_app_start use32 ; âêëþ÷èòü 32-áèòíûé ðåæèì àññåìáëåðà
code org 0x0 ; àäðåñàöèÿ ñ íóëÿ
draw_window:
mov al,12
mcall ,1
mov al,14 db 'MENUET01' ; 8-áàéòíûé èäåíòèôèêàòîð MenuetOS
mcall ;eax=14 - get screen max x & max y dd 0x01 ; âåðñèÿ çàãîëîâêà (âñåãäà 1)
movzx ecx,ax dd START ; àäðåñ ïåðâîé êîìàíäû
shr eax,17 dd IM_END ; ðàçìåð ïðîãðàììû
shl eax,16 dd I_END ; êîëè÷åñòâî ïàìÿòè
lea ebx,[eax-110 shl 16+222] dd stacktop ; àäðåñ âåðøèíû ñòåêà
shr ecx,1 dd 0x0 ; àäðåñ áóôåðà äëÿ ïàðàìåòðîâ
shl ecx,16 dd cur_dir_path
lea ecx,[ecx-65 shl 16+137]
xor eax,eax include 'lang.inc'
mcall , , ,0x019098b0,0x01000000 ;define and draw window include '../../../macros.inc'
include '../../../proc32.inc'
include '../../../dll.inc'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
mov al,13 @use_library
mcall ,<0,223> ,<0,275>
mcall ,<1,221>,<1,136>,0xffffff
mcall ,<2,220>,<2,135>,0xe4dfe1
mcall ,<16,189>,<97,23>,0x9098b0
mov al,8 align 4
mcall ,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons START:
mcall ,<113,90>, ,2,0xaa7700
mcall , ,<54,27>,1,0x777777
mcall ,<16,90> , ,3,0x007700
mcall ,<17,186>,<98,20>,5,0xe4dfe1
mov al,4 load_libraries l_libs_start,end_l_libs
mcall ,<28,105>,0x80000000,label4 ;eax=4 - write text inc eax
mcall ,<35,24> ,0x80ffffff,label2 test eax,eax
mcall ,<34,58> , ,label3 jz close
mcall ,<47,37> , ,label5
mcall ,<43,71> , ,label6
mov al,12 push dword check1
mcall ,2 call [init_checkbox2]
stdcall dll.Init,[init_lib]
invoke ini_get_int,ini_file,asettings,aautosave,0
mov [autosave],eax
cmp eax,1
jne @f
bts dword [check1.flags],1
@@:
mcall 40,0x00000027
redraw:
call draw_window
still: still:
mov al,10 mov al,10
mcall ;wait here for event mcall ;wait here for event
dec eax dec eax
jz draw_window jz redraw
dec eax dec eax
jnz button jz key
dec eax
jz button
push dword check1
call [check_box_mouse2]
bt dword [check1.flags],1
jnc @f
mov [autosave],1
jmp still
@@:
mov [autosave],0
jmp still
key:
mov al,2 mov al,2
mcall ;eax=2 - get key code mcall ;eax=2 - get key code
mov al,ah mov al,ah
cmp al,13 cmp al,13
jz restart jz restart
cmp al,19 cmp al,19
jz run_rdsave jz checkbox
cmp al,27 cmp al,27
jz close_1 jz close
cmp al,180 cmp al,180
jz restart_kernel jz restart_kernel
cmp al,181 cmp al,181
@ -74,45 +86,127 @@ still:
jmp still jmp still
button: button:
mov al,17 mcall 17 ;eax=17 - get pressed button id
mcall ;eax=17 - get pressed button id
xchg al,ah xchg al,ah
dec eax dec eax
jz close_1 jz close
dec eax dec eax
jz restart_kernel jz restart_kernel
dec eax dec eax
jz restart jz restart
dec eax dec eax
jnz run_rdsave jnz checkbox
; dec eax ; we have only one button left, this is close button
; jnz still
power_off: power_off:
push 2 push 2
jmp mcall_and_close jmp mcall_and_close
restart: restart:
push 3 push 3
jmp mcall_and_close jmp mcall_and_close
restart_kernel: restart_kernel:
push 4 push 4
mcall_and_close: mcall_and_close:
invoke ini_set_int,ini_file,asettings,aautosave,[autosave]
cmp [autosave],1
jne no_save
mcall 70,rdsave
test eax,eax
js no_save
mov ecx,eax
mcall 18,21
mov ecx,eax
@@:
push ecx
mcall 23,50
dec eax
jnz no_red
call draw_window
no_red:
pop ecx pop ecx
mov al,18 mcall 9,proc_info
mcall ,9 cmp [proc_info+50],9
je no_save
jmp @b
no_save:
pop ecx
mcall 18,9
close_1: close:
or eax,-1 mcall -1
mcall
run_rdsave: checkbox:
mov al,70 btc dword [check1.flags],1
mcall ,rdsave jc .1
mov [autosave],1
jmp .draw
.1:
mov [autosave],0
.draw:
push dword check1
call [check_box_draw2]
jmp still jmp still
draw_window:
mov al,12
mcall ,1
mcall 14 ;eax=14 - get screen max x & max y
movzx ecx,ax
shr eax,17
shl eax,16
lea ebx,[eax-110 shl 16+222]
shr ecx,1
shl ecx,16
lea ecx,[ecx-70 shl 16+117]
xor eax,eax
mcall , , ,0x019098b0,0x01000000 ;define and draw window
mov al,13
mcall ,<0,223> ,<0,118>
mcall ,<1,221>,<1,116>,0xffffff
mcall ,<2,220>,<2,115>,0xe4dfe1
mov al,8
mcall ,<16,90> ,<20,27>,4,0x990022 ;eax=8 - draw buttons
mcall ,<113,90>, ,2,0xaa7700
mcall , ,<54,27>,1,0x777777
mcall ,<16,90> , ,3,0x007700
push dword check1
call [check_box_draw2]
mcall 4,<27,24> ,0x90ffffff,label2 ;eax=4 - write text
mcall ,<23,58> , ,label3
mcall ,<47,37> ,0x90ffffff,label5
mcall ,<44,71> , ,label6
mov al,12
mcall ,2
ret
data data
include 'data.inc' include 'data.inc'
udata ;---------------------------------------------------------------------
IM_END:
;---------------------------------------------------------------------
align 4
meos_app_end proc_info rb 1024
autosave rd 1
;---------------------------------------------------------------------
cur_dir_path:
rb 4096
;---------------------------------------------------------------------
library_path:
rb 4096
;---------------------------------------------------------------------
align 32
rb 4096
stacktop:
I_END: ; ìåòêà êîíöà ïðîãðàììû

View File

@ -0,0 +1,6 @@
@erase lang.inc
@echo lang fix it >lang.inc
@fasm rdsave.asm rdsave
@kpack rdsave
@erase lang.inc
@pause

View File

@ -1,79 +1,98 @@
;
; RDsave ¤«ï Kolibri (0.6.5.0 ¨ áâ àè¥) ; RDsave ¤«ï Kolibri (0.6.5.0 ¨ áâ àè¥)
; Save RAM disk to a hard or floppy drive ; Save RAM-disk to hard or floppy drive
;
; version: 1.3
; last update: 08/09/2010
; written by: Marat Zakiyanov aka Mario79, aka Mario
; changes: select path with OpenDialog,
; keys 1,2,3,4 for select options
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
; Mario79 2005 ; Mario79 2005
; Heavyiron 12.02.2007 ; Heavyiron 12.02.2007
; <Lrz> 11.05.2009 - ¤«ï à ¡®âë ­ã¦­  á¨á⥬­ ï ¡¨¡«¨®â¥ª  box_lib.obj ; <Lrz> 11.05.2009 - ¤«ï à ¡®âë ­ã¦­  á¨á⥬­ ï ¡¨¡«¨®â¥ª  box_lib.obj
; Š®¬¯¨«¨à®¢ âì FASM'®¬ ; Mario79 08.09.2010 - select path with OpenDialog,keys 1,2,3,4 for select options
; ; Heavyiron 01.12.2013 - new logic
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
include 'lang.inc'
include '../../../config.inc' ;for nightbuild
include '..\..\..\macros.inc'
appname equ 'RDsave ' appname equ 'RDsave '
version equ '1.3' version equ '1.4'
debug equ no
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à  use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
org 0x0 ;  ¤à¥á æ¨ï á ­ã«ï org 0x0 ;  ¤à¥á æ¨ï á ­ã«ï
db 'MENUET01' ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS db 'MENUET01' ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1) dd 0x01 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
dd START ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë dd START ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
dd IM_END ; à §¬¥à ¯à®£à ¬¬ë dd IM_END ; à §¬¥à ¯à®£à ¬¬ë
dd I_END ; ª®«¨ç¥á⢮ ¯ ¬ï⨠dd I_END ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd stacktop ;  ¤à¥á ¢¥à設ë áâíª  dd stacktop ;  ¤à¥á ¢¥à設ë á⥪ 
dd 0x0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï) dd PARAMS ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
dd cur_dir_path dd cur_dir_path
;include '..\..\..\develop\examples\editbox\trunk\editbox.inc'
include 'lang.inc'
include '../../../macros.inc'
if debug eq yes
include '../../../debug.inc'
end if
include '../../../proc32.inc'
include '../../../dll.inc'
include '../../../develop/libraries/box_lib/load_lib.mac' include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'str.inc'
@use_library @use_library
;use_edit_box
;al equ eax ; \ decrease kpack'ed size
;purge mov ; /
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ---------------------------------------------- ;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
START: START:
;---------------------------------------------------------------------
mcall 48,3,sc,sizeof.system_colors
mcall 68,11 mcall 68,11
load_libraries l_libs_start,end_l_libs load_libraries l_libs_start,end_l_libs
inc eax
cmp eax,-1 test eax,eax
jz close jz close
mov edi,filename_area stdcall dll.Init,[init_lib]
mov esi,start_temp_file_name
xor eax,eax
cld
@@:
lodsb
stosb
test eax,eax
jnz @b
invoke ini_get_int,ini_file,asettings,aautoclose,0
mov [autoclose],eax
mov edi,fname_buf mov ecx,PARAMS
mov esi,path4 cmp byte[ecx], 0
xor eax,eax je no_params
cld cmp byte[ecx], 'h'
je @f
cmp byte[ecx], 'H'
jne .no_h
@@: @@:
lodsb mov [hidden],1
stosb jmp no_params
.no_h:
mov [param],1
mov ah,2
jmp noclose
no_params:
invoke ini_get_str,ini_file,apath,apath,fname_buf,4096,path
stdcall _lstrcpy,filename_area,start_temp_file_name
;---------------------------------------------------------------------
stdcall _lstrcpy,check_dir,fname_buf
call check_path
test eax,eax test eax,eax
jnz @b jz path_ok
cmp eax,6
je path_ok
;---------------------------------------------------------------------
if debug eq yes
dps 'read_folder_error'
newline
end if
;---------------------------------------------------------------------
stdcall _lstrcpy,fname_buf,communication_area_default_path
mov [hidden],0
;OpenDialog initialisation ;OpenDialog initialisation
push dword OpenDialog_data push dword OpenDialog_data
@ -82,14 +101,29 @@ load_libraries l_libs_start,end_l_libs
; prepare for PathShow ; prepare for PathShow
push dword PathShow_data_1 push dword PathShow_data_1
call [PathShow_prepare] call [PathShow_prepare]
call draw_window
mcall 40,100111b mov ah,3
red: ; ¯¥à¥à¨á®¢ âì ®ª­® mov ecx,fname_buf
mcall 48,3,sc,sizeof.system_colors jmp noclose
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª­ 
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
;--- –ˆŠ‹ Ž<><C5BD><EFBFBD>ŽŠˆ Ž<E28098>ˆ‰ ---------------------------------------- path_ok:
;OpenDialog initialisation
push dword OpenDialog_data
call [OpenDialog_Init]
; prepare for PathShow
push dword PathShow_data_1
call [PathShow_prepare]
mcall 40,0x00000027
cmp [hidden],1
jne red
mov ah,2
mov ecx,fname_buf
jmp noclose
red:
call draw_window
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
still: still:
mcall 10 mcall 10
@ -100,34 +134,52 @@ still:
jz key jz key
dec eax dec eax
jz button jz button
jmp still jmp still
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
button: button:
mcall 17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨ mcall 17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
dec ah
jz close
mov ecx,fname_buf
cmp ah,1 ; ª­®¯ª  á id=1("§ ªàëâì")? cmp ah,1 ; ª­®¯ª  á id=1("§ ªàëâì")?
jne noclose jne noclose
close: close:
or eax,-1 ; äã­ªæ¨ï -1: § ¢¥àè¨âì ¯à®£à ¬¬ã or eax,-1 ; äã­ªæ¨ï -1: § ¢¥àè¨âì ¯à®£à ¬¬ã
mcall mcall
;---------------------------------------------------------------------
key:
mcall 2
cmp ah,0x1b
je close
mov ecx,fname_buf
cmp ah,0x0D
jne @f
mov ah,2
jmp noclose
@@:
cmp ah,9h
jne still
;---------------------------------------------------------------------
noclose: noclose:
push eax
call clear_err
pop eax
push 16 push 16
xor ebx,ebx mov ebx,1
inc ebx ; 16.1 = save to /FD/1 cmp byte[ecx+1],'f'
je @f
cmp byte[ecx+1],'F'
jne not_fdd
@@:
cmp byte[ecx+4],'1'
jne @f
cmp ah,2 cmp ah,2
je doit je doit
inc ebx ; 16.2 = save to /FD/2 @@:
cmp ah,3 inc ebx
cmp ah,2
je doit je doit
pop ebx not_fdd:
push 18 push 18
mov bl,6 ; 18.6 = save to specified folder mov ebx,6 ; 18.6 = save to specified folder
mov ecx, path3 cmp ah,2
cmp ah,4
je doit je doit
; invoke OpenDialog ; invoke OpenDialog
@ -139,247 +191,166 @@ noclose:
; prepare for PathShow ; prepare for PathShow
push dword PathShow_data_1 push dword PathShow_data_1
call [PathShow_prepare] call [PathShow_prepare]
call draw_window
mov ecx,fname_buf
mov ah,2
jmp noclose
call draw_PathShow
mov ecx,fname_buf ;path4
doit: doit:
call save_ini
pop eax pop eax
mcall mcall
call check_for_error call check_for_error
cmp [param],1
je @f
jmp still jmp still
;--------------------------------------------------------------------- @@:
key: jmp no_params
mcall 2
cmp ah,0x31
jb still
cmp ah,0x34
ja still
sub ah,0x30
inc ah
jmp noclose
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
check_for_error: ;Ž¡à ¡®â稪 ®è¨¡®ª check_for_error: ;Ž¡à ¡®â稪 ®è¨¡®ª
mov ecx,[sc.work_text] stdcall _lstrcpy,check_dir,ok
mov edx,ok stdcall _lstrcat,check_dir,fname_buf
mov edx,check_dir
test eax,eax test eax,eax
jz print jz print_ok
mov ecx,0xdd2222 cmp ebx,6
add edx,error3 - ok je @f
dec eax mov edx,error11
dec eax jmp print_err
jz print @@:
add edx,error5 - error3 mov edi, error_msg
dec eax cmp eax, 11
dec eax ja .unknown
jz print mov esi, [errors+eax*4]
add edx,error8 - error5 @@:
dec eax lodsb
dec eax stosb
dec eax test al, al
jz print jnz @b
add edx,error9 - error8 mov edx, error_msg
dec eax jmp print_err
jz print .unknown:
add edx,error10 - error9 mov edx, aUnknownError
dec eax print_err:
jz print mov dword [is_notify + 8], edx
add edx,error11 - error10 mcall 70, is_notify
dec eax
jz print
add edx,aUnknownError - error11
print:
mov eax,4 ;­ ¤¯¨á¨
mov ebx,20 shl 16 + 148
or ecx,0x80000000
mcall
ret ret
;--------------------------------------------------------------------- print_ok:
clear_err: mov dword [is_notify + 8], edx
mov eax,13 mcall 70, is_notify
mov ebx,15 shl 16 + 240 cmp [hidden],1
mov ecx,145 shl 16 +15 je close
mov edx,[sc.work] cmp [autoclose],0
mcall je @f
mcall 5,50
jmp close
@@:
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
draw_PathShow: draw_PathShow:
pusha pushad
mcall 13,<8,172>,<110,15>,0xffffff mcall 13,<15,280>,<32,16>,0xffffff
; draw for PathShow
push dword PathShow_data_1 push dword PathShow_data_1
call [PathShow_draw] call [PathShow_draw]
popa popad
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
;--- Ž<><C5BD>…„…<E280B9>ˆˆ Ž<C5BD>ˆŽŠ€ ŽŠ<C5BD>€ ---------------------------------- save_ini:
pushad
stdcall _lstrlen,fname_buf
invoke ini_set_str,ini_file,apath,apath,fname_buf,eax
invoke ini_set_int,ini_file,asettings,aautoclose,[autoclose]
popad
ret
;---------------------------------------------------------------------
check_path:
stdcall _lstrlen,check_dir
mov edi,check_dir
add edi,eax
@@:
mov byte [edi],0
dec edi
cmp byte [edi],'/'
jne @b
if debug eq yes
dps 'read_folder_name: '
mov edx,check_dir
call debug_outstr
newline
end if
mcall 70,read_folder
ret
;---------------------------------------------------------------------
;--- Draw window ---------------------------------------------------
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
draw_window: draw_window:
mcall 12,1 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­  mcall 12,1
; 1 - ­ ç¨­ ¥¬ à¨á®¢ âì
; ‘Ž‡„€ðŒ ŽŠ<C5BD>Ž mov edx,[sc.work]
xor eax,eax ; äã­ªæ¨ï 0 : ®¯à¥¤¥«¨âì ¨ ®âà¨á®¢ âì ®ª­®
mov ebx,200 shl 16 + 300 ; [x áâ àâ] *65536 + [x à §¬¥à]
mov ecx,200 shl 16 + 190 ; [y áâ àâ] *65536 + [y à §¬¥à]
mov edx,[sc.work] ; 梥â à ¡®ç¥© ®¡« á⨠RRGGBB,8->color gl
or edx,0x34000000 or edx,0x34000000
mov edi,title ; ‡€ƒŽ‹Ž‚ŽŠ ŽŠ<C5BD> mcall 0,<200,400>,<200,120>, , ,title
mcall
;buttons
mcall 8,<198,70>,<68,20>,2,[sc.work_button]
inc edx
mcall ,<125,70>,
inc edx
mcall ,<300,75>,<30,20>
;labels
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mcall 4,<134,75>, ,save
mcall ,<215,75>, ,cansel
mcall ,<315,36>, ,select
mov ecx,[sc.work]
mov dword [frame_data.font_backgr_color],ecx
push dword frame_data
call [Frame_draw]
call draw_PathShow call draw_PathShow
;®âà¨á®¢ª  ⥭¥© ª­®¯®ª mcall 12,2
mcall 13,<194,60>,<34,15>,0x444444
add ecx,20 shl 16
mcall
add ecx,20 shl 16
mcall
add ecx,40 shl 16
mcall
;®âà¨á®¢ª  ª­®¯®ª
sub ebx,4 shl 16
sub ecx,4 shl 16
mcall 8,,,5,[sc.work_button]
sub ecx,40 shl 16
dec edx
mcall
sub ecx,20 shl 16
dec edx
mcall
sub ecx,20 shl 16
dec edx
mcall
; ­ ¤¯¨á¨
mov ecx,[sc.work_text]
or ecx,0x80000000
mcall 4,<10,12>,,label1
mov ebx,150 shl 16 + 35
mov edx,path1
mcall
add ebx,20
mov edx,path2
mcall
mov ebx,75 shl 16 + 75
mov edx,path3
mcall
mov ebx,30 shl 16 + 97
mov edx,label2
mcall
mov ebx,40 shl 16 + 135
mov edx,label3
mcall
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mov ebx,195 shl 16 + 35
mov edx,save
mcall
push edx
mov edx,key_help
call key_help_correct
pop edx
add ebx,20
mcall
push edx
mov edx,key_help+2
call key_help_correct
pop edx
add ebx,20
mcall
push edx
mov edx,key_help+4
call key_help_correct
pop edx
mov edx,select
add ebx,40
mcall
mov edx,key_help+6
call key_help_correct
mcall 12,2 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
; 2, § ª®­ç¨«¨ à¨á®¢ âì
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
;---------------------------------------------------------------------
key_help_correct:
push ebx
ror ebx,16
mov bx,270
rol ebx,16
pusha
mov ecx,ebx
sub ebx,3 shl 16
mov bx,13
sub cx,3
shl ecx,16
mov cx,13
mcall 13,,,[sc.work_graph]
popa
mcall
pop ebx
ret ret
;---------------------------------------------------------------------
;--- „€<E2809E><E282AC><20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
title db appname,version,0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
PathShow_data_1: ;--- Data ----------------------------------------------------------
.type dd 0 ;+0
.start_y dw 113 ;+4
.start_x dw 10 ;+6
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
.area_size_x dw 170 ;+10
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
.background_flag dd 0 ;+16
.font_color dd 0x0 ;+20
.background_color dd 0x0 ;+24
.text_pointer dd fname_buf ;+28
.work_area_pointer dd text_work_area ;+32
.temp_text_length dd 0 ;+36
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
if lang eq ru if lang eq ru
save db '‘®åà ­¨âì',0 save db '‘®åà ­¨âì',0
select db ' ‚ë¡à âì',0 cansel db 'Žâ¬¥­ ',0
label1 db '‚ë¡¥à¨â¥ ªã¤  á®åà ­¨âì ᮤ¥à¦¨¬®¥ RAM-¤¨áª :',0 select db 'ˆ§¬¥­¨âì',0
label2 db 'ˆ«¨ ¢ë¡¥à¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã:',0 label1 db ' Ž¡à § ¡ã¤¥â á®åà ­¥­ ¢: ',0
label3 db '‚ᥠ¯ ¯ª¨ ¤®«¦­ë áãé¥á⢮¢ âì',0 ok db 'RAM-¤¨áª á®åà ­¥­ ãᯥ譮 ¢ ',0
ok db 'RAM-¤¨áª á®åà ­¥­ ãᯥ譮',0 error1 db '<27>¥ ®¯à¥¤¥«¥­  ¡ §  ¨/¨«¨ à §¤¥« ¦ñá⪮£® ¤¨áª ',0
error2 db '”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ­­®© ä ©«®¢®© á¨á⥬ë',0
error3 db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 error3 db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0
error4 db '‘âà ­­®... Žè¨¡ª  4',0
error5 db '<27>¥áãé¥áâ¢ãî騩 ¯ãâì',0 error5 db '<27>¥áãé¥áâ¢ãî騩 ¯ãâì',0
error8 db '<27>¥â ¬¥áâ  ­  ¤¨áª¥',0 error6 db '” ©« § ª®­ç¨«áï',0
error9 db '’ ¡«¨æ  FAT à §àã襭 ',0 error7 db '“ª § â¥«ì ¢­¥ ¯ ¬ï⨠¯à¨«®¦¥­¨ï',0
error10 db '„®áâ㯠§ ¯à¥é¥­',0 error8 db '„¨áª § ¯®«­¥­',0
error9 db '” ©«®¢ ï áâàãªâãà  à §àã襭 ',0
error10 db '„®áâ㯠§ ¯à¥éñ­',0
error11 db 'Žè¨¡ª  ãáâனá⢠',0 error11 db 'Žè¨¡ª  ãáâனá⢠',0
aUnknownError db '<27>¥¨§¢¥áâ­ ï ®è¨¡ª ',0 aUnknownError db '<27>¥¨§¢¥áâ­ ï ®è¨¡ª ',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
else if lang eq et else if lang eq et
save db 'Salvesta',0 save db 'Salvesta',0
cansel db 'Cansel',0
select db ' Valige',0 select db ' Valige',0
label1 db 'Vali üks variantidest:',0 label1 db ' RAM-drive will be saved as: ',0
label2 db 'Või valige teekond failinimeni:',0 ok db 'RAM-ketas salvestatud edukalt ',0
label3 db 'Kõik kataloogid peavad eksisteerima',0 error1 db 'Hard disk base and/or partition not defined',0
ok db 'RAM-ketas salvestatud edukalt',0 error2 db 'The file system does not support this function',0
error3 db 'Tundmatu failisüsteem',0 error3 db 'Tundmatu failisüsteem',0
error4 db 'Strange... Error 4',0
error5 db 'Vigane teekond',0 error5 db 'Vigane teekond',0
error6 db 'End of file',0
error7 db 'Pointer is outside of application memory',0
error8 db 'Ketas täis',0 error8 db 'Ketas täis',0
error9 db 'FAT tabel vigane',0 error9 db 'FAT tabel vigane',0
error10 db 'Juurdepääs keelatud',0 error10 db 'Juurdepääs keelatud',0
@ -387,14 +358,18 @@ error11 db 'Seadme viga',0
aUnknownError db 'Tundmatu viga',0 aUnknownError db 'Tundmatu viga',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
else if lang eq it else if lang eq it
save db 'Salva',0 save db ' Salva',0
cansel db 'Cansel',0
select db 'Seleziona',0 select db 'Seleziona',0
label1 db 'Seleziona cosa salvare:',0 label1 db ' RAM-drive will be saved as: ',0
label2 db ' oppure seleziona il file:',0 ok db 'Il RAM-drivet e stato salvato ',0
label3 db 'Tutte le cartelle devono esistere',0 error1 db 'Hard disk base and/or partition not defined',0
ok db 'Il RAM-drivet e stato salvato',0 error2 db 'The file system does not support this function',0
error3 db 'Filesystem sconosciuto',0 error3 db 'Filesystem sconosciuto',0
error4 db 'Strange... Error 4',0
error5 db 'Percorso non valido',0 error5 db 'Percorso non valido',0
error6 db 'End of file',0
error7 db 'Pointer is outside of application memory',0
error8 db 'Disco pieno',0 error8 db 'Disco pieno',0
error9 db 'Tabella FAT corrotta',0 error9 db 'Tabella FAT corrotta',0
error10 db 'Accesso negato',0 error10 db 'Accesso negato',0
@ -403,36 +378,57 @@ aUnknownError db 'Errore sconosciuto',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
else else
save db ' Save',0 save db ' Save',0
cansel db 'Cansel',0
select db ' Select',0 select db ' Select',0
label1 db 'Select one of the variants:',0 label1 db ' RAM-drive will be saved as: ',0
label2 db ' Or select full path to file:',0 ok db 'RAM-drive was saved successfully in ',0
label3 db ' All folders must exist',0 error1 db 'Hard disk base and/or partition not defined',0
ok db 'RAM-drive was saved successfully',0 error2 db 'The file system does not support this function',0
error3 db 'Unknown file system',0 error3 db 'Unknown file system',0
error4 db 'Strange... Error 4',0
error5 db 'Incorrect path',0 error5 db 'Incorrect path',0
error6 db 'End of file',0
error7 db 'Pointer is outside of application memory',0
error8 db 'Disk is full',0 error8 db 'Disk is full',0
error9 db 'FAT table corrupted',0 error9 db 'File structure is destroyed',0
error10 db 'Access denied',0 error10 db 'Access denied',0
error11 db 'Device error',0 error11 db 'Device error',0
aUnknownError db 'Unknown error',0 aUnknownError db 'Unknown error',0
end if end if
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥ title db appname,version,0
;---------------------------------------------------------------------
errors:
dd ok
dd error1
dd error2
dd error3
dd error4
dd error5
dd error6
dd error7
dd error8
dd error9
dd error10
dd error11
;---------------------------------------------------------------------
;Lib_DATA
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨. ;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_dir_Boxlib db '/sys/lib/box_lib.obj',0 system_dir_Boxlib db '/sys/lib/box_lib.obj',0
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0 system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; system_dir_libini db '/sys/lib/libini.obj',0
;---------------------------------------------------------------------
head_f_i: head_f_i:
head_f_l db 'System error',0 head_f_l db 'System error',0
err_message_found_lib1 db 'box_lib.obj - Not found!',0 err_message_found_lib1 db 'box_lib.obj - Not found!',0
err_message_found_lib2 db 'proc_lib.obj - Not found!',0 err_message_found_lib2 db 'proc_lib.obj - Not found!',0
err_message_found_lib3 db 'libini.obj - Not found!',0
err_message_import1 db 'box_lib.obj - Wrong import!',0 err_message_import1 db 'box_lib.obj - Wrong import!',0
err_message_import2 db 'proc_lib.obj - Wrong import!',0 err_message_import2 db 'proc_lib.obj - Wrong import!',0
err_message_import3 db 'libini.obj - Wrong import!',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
l_libs_start: l_libs_start:
@ -442,6 +438,9 @@ err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
library02 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \ library02 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
library03 l_libs system_dir_libini+9, cur_dir_path, library_path, system_dir_libini, \
err_message_found_lib3, head_f_l, libini_import, err_message_import3, head_f_i
end_l_libs: end_l_libs:
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
OpenDialog_data: OpenDialog_data:
@ -449,8 +448,8 @@ OpenDialog_data:
.procinfo dd procinfo ;+4 .procinfo dd procinfo ;+4
.com_area_name dd communication_area_name ;+8 .com_area_name dd communication_area_name ;+8
.com_area dd 0 ;+12 .com_area dd 0 ;+12
.opendir_pach dd temp_dir_pach ;+16 .opendir_path dd temp_dir_path ;+16
.dir_default_pach dd communication_area_default_pach ;+20 .dir_default_path dd communication_area_default_path ;+20
.start_path dd open_dialog_path ;+24 .start_path dd open_dialog_path ;+24
.draw_window dd draw_window ;+28 .draw_window dd draw_window ;+28
.status dd 0 ;+32 .status dd 0 ;+32
@ -459,10 +458,10 @@ OpenDialog_data:
.filter_area dd Filter .filter_area dd Filter
.x: .x:
.x_size dw 420 ;+48 ; Window X size .x_size dw 420 ;+48 ; Window X size
.x_start dw 10 ;+50 ; Window X position .x_start dw 200 ;+50 ; Window X position
.y: .y:
.y_size dw 320 ;+52 ; Window y size .y_size dw 320 ;+52 ; Window y size
.y_start dw 10 ;+54 ; Window Y position .y_start dw 120 ;+54 ; Window Y position
communication_area_name: communication_area_name:
db 'FFFFFFFF_open_dialog',0 db 'FFFFFFFF_open_dialog',0
@ -472,8 +471,8 @@ if __nightbuild eq yes
else else
db '/sys/File Managers/opendial',0 db '/sys/File Managers/opendial',0
end if end if
communication_area_default_pach: communication_area_default_path:
db '/hd0/1/kolibri',0 db '/',0
Filter: Filter:
dd Filter.end - Filter dd Filter.end - Filter
@ -490,114 +489,126 @@ align 4
ProcLib_import: ProcLib_import:
OpenDialog_Init dd aOpenDialog_Init OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start OpenDialog_Start dd aOpenDialog_Start
;OpenDialog__Version dd aOpenDialog_Version
dd 0 dd 0
dd 0 dd 0
aOpenDialog_Init db 'OpenDialog_init',0 aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0 aOpenDialog_Start db 'OpenDialog_start',0
;aOpenDialog_Version db 'Version_OpenDialog',0 ;---------------------------------------------------------------------
PathShow_data_1:
.type dd 0 ;+0
.start_y dw 36 ;+4
.start_x dw 20 ;+6
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
.area_size_x dw 270 ;+10
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
.background_flag dd 0 ;+16
.font_color dd 0 ;+20
.background_color dd 0 ;+24
.text_pointer dd fname_buf ;+28
.work_area_pointer dd text_work_area ;+32
.temp_text_length dd 0 ;+36
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
Box_lib_import: Box_lib_import:
;init_lib dd a_init
;version_lib dd a_version
;edit_box_draw dd aEdit_box_draw ;edit_box_draw dd aEdit_box_draw
;edit_box_key dd aEdit_box_key ;edit_box_key dd aEdit_box_key
;edit_box_mouse dd aEdit_box_mouse ;edit_box_mouse dd aEdit_box_mouse
;version_ed dd aVersion_ed ;version_ed dd aVersion_ed
;check_box_draw dd aCheck_box_draw
;check_box_mouse dd aCheck_box_mouse
;version_ch dd aVersion_ch
;option_box_draw dd aOption_box_draw
;option_box_mouse dd aOption_box_mouse
;version_op dd aVersion_op
;scrollbar_ver_draw dd aScrollbar_ver_draw
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
;scrollbar_hor_draw dd aScrollbar_hor_draw
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
;version_scrollbar dd aVersion_scrollbar
;dinamic_button_draw dd aDbutton_draw
;dinamic_button_mouse dd aDbutton_mouse
;version_dbutton dd aVersion_dbutton
;menu_bar_draw dd aMenu_bar_draw
;menu_bar_mouse dd aMenu_bar_mouse
;menu_bar_activate dd aMenu_bar_activate
;version_menu_bar dd aVersion_menu_bar
;FileBrowser_draw dd aFileBrowser_draw
;FileBrowser_mouse dd aFileBrowser_mouse
;FileBrowser_key dd aFileBrowser_key
;Version_FileBrowser dd aVersion_FileBrowser
PathShow_prepare dd sz_PathShow_prepare PathShow_prepare dd sz_PathShow_prepare
PathShow_draw dd sz_PathShow_draw PathShow_draw dd sz_PathShow_draw
;Version_path_show dd szVersion_path_show Frame_draw dd sz_Frame_draw
dd 0 dd 0
dd 0 dd 0
;a_init db 'lib_init',0
;a_version db 'version',0
;aEdit_box_draw db 'edit_box',0 ;aEdit_box_draw db 'edit_box',0
;aEdit_box_key db 'edit_box_key',0 ;aEdit_box_key db 'edit_box_key',0
;aEdit_box_mouse db 'edit_box_mouse',0 ;aEdit_box_mouse db 'edit_box_mouse',0
;aVersion_ed db 'version_ed',0 ;aVersion_ed db 'version_ed',0
;aCheck_box_draw db 'check_box_draw',0
;aCheck_box_mouse db 'check_box_mouse',0
;aVersion_ch db 'version_ch',0
;aOption_box_draw db 'option_box_draw',0
;aOption_box_mouse db 'option_box_mouse',0
;aVersion_op db 'version_op',0
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
;aVersion_scrollbar db 'version_scrollbar',0
;aDbutton_draw db 'dbutton_draw',0
;aDbutton_mouse db 'dbutton_mouse',0
;aVersion_dbutton db 'version_dbutton',0
;aMenu_bar_draw db 'menu_bar_draw',0
;aMenu_bar_mouse db 'menu_bar_mouse',0
;aMenu_bar_activate db 'menu_bar_activate',0
;aVersion_menu_bar db 'version_menu_bar',0
;aFileBrowser_draw db 'FileBrowser_draw',0
;aFileBrowser_mouse db 'FileBrowser_mouse',0
;aFileBrowser_key db 'FileBrowser_key',0
;aVersion_FileBrowser db 'version_FileBrowser',0
sz_PathShow_prepare db 'PathShow_prepare',0 sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0 sz_PathShow_draw db 'PathShow_draw',0
;szVersion_path_show db 'version_PathShow',0
sz_Frame_draw db 'frame_draw',0
;szVersion_frame db 'version_frame',0
;---------------------------------------------------------------------
frame_data:
.type dd 0 ;+0
.x:
.x_size dw 374 ;+4
.x_start dw 8 ;+6
.y:
.y_size dw 45 ;+8
.y_start dw 17 ;+10
.ext_fr_col dd 0x888888 ;+12
.int_fr_col dd 0xffffff ;+16
.draw_text_flag dd 1 ;+20
.text_pointer dd label1 ;+24
.text_position dd 0 ;+28
.font_number dd 0 ;+32
.font_size_y dd 9 ;+36
.font_color dd 0x0 ;+40
.font_backgr_color dd 0xdddddd ;+44
;---------------------------------------------------------------------
align 4
libini_import:
init_lib dd a_init
ini_get_str dd aini_get_str
ini_get_int dd aini_get_int
ini_set_str dd aini_set_str
ini_set_int dd aini_set_int
dd 0
dd 0
a_init db 'lib_init',0
aini_get_str db 'ini_get_str',0
aini_get_int db 'ini_get_int',0
aini_set_str db 'ini_set_str',0
aini_set_int db 'ini_set_int',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
path1 db '/fd/1/',0 apath db 'path',0
path2 db '/fd/2/',0 asettings db 'settings',0
path3 db '/hd0/1/kolibri.img',0 aautoclose db 'autoclose',0
path4 db '/hd0/1/kolibri/kolibri.img',0 ;¤«ï १¥à¢­®£® á®åà ­¥­¨ï path db '/hd2/1/kolibri.img',0
ini_file db '/sys/settings/rdsave.ini',0
;ini_file db '/sys/rdsave.ini',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
key_help: is_notify:
db '1',0 dd 7, 0, ok, 0, 0
db '2',0 db "/rd/1/@notify", 0
db '3',0
db '4',0 read_folder:
.subfunction dd 1
.start dd 0
.flags dd 0
.size dd 1
.return dd folder_data
db 0
.name: dd check_dir
param dd 0
hidden dd 0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
IM_END: IM_END:
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4
PARAMS:
rb 256
ini_path:
rb 4096
check_dir:
rb 4096
sc system_colors sc system_colors
mouse_dd rd 1
;mouse_dd rd 1
autoclose rd 1
error_msg rb 128
folder_data:
rb 304*32+32 ; 9 Kb
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
cur_dir_path: cur_dir_path:
rb 4096 rb 4096
@ -605,7 +616,7 @@ cur_dir_path:
library_path: library_path:
rb 4096 rb 4096
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
temp_dir_pach: temp_dir_path:
rb 4096 rb 4096
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
fname_buf: fname_buf:
@ -620,7 +631,7 @@ filename_area:
text_work_area: text_work_area:
rb 1024 rb 1024
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 32
rb 4096 rb 4096
stacktop: stacktop:
I_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë I_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë

View File

@ -0,0 +1,5 @@
[path]
path=/usbhdd0/1/kolibri.img
[settings]
autoclose=0
autosave=0

View File

@ -0,0 +1,129 @@
; by ManHunter / PCL
; http://www.manhunter.ru
;-----------------------------------------------------
; ”ã­ªæ¨ï ¯®«ã祭¨ï ¤«¨­ë áâப¨ (Fast)
;-----------------------------------------------------
; lpStr - 㪠§ â¥«ì ­  áâபã ASCIIZ
; <EFBFBD>  ¢ë室¥: EAX - ¤«¨­  áâப¨ ¡¥§ ãç¥â  § ¢¥àè î饣®
; ­ã«¥¢®£® ¡ ©â 
;-----------------------------------------------------
;proc _lstrlen lpStr:DWORD
; mov eax, [lpStr]
; sub eax, 4
;@@:
; add eax, 4
; cmp byte [eax], 0
; je .szlen_lb1
; cmp byte [eax+1], 0
; je .szlen_lb2
; cmp byte [eax+2], 0
; je .szlen_lb3
; cmp byte [eax+3], 0
; jne @b
; sub eax, [lpStr]
; add eax, 3
; ret
;.szlen_lb3:
; sub eax, [lpStr]
; add eax, 2
; ret
;.szlen_lb2:
; sub eax, [lpStr]
; add eax, 1
; ret
;.szlen_lb1:
; sub eax, [lpStr]
; ret
;endp
;-----------------------------------------------------
; ”ã­ªæ¨ï ¯®«ã祭¨ï ¤«¨­ë áâப¨
;-----------------------------------------------------
; lpStr - 㪠§ â¥«ì ­  áâபã ASCIIZ
; <EFBFBD>  ¢ë室¥: EAX - ¤«¨­  áâப¨ ¡¥§ ãç¥â  § ¢¥àè î饣®
; ­ã«¥¢®£® ¡ ©â 
;-----------------------------------------------------
proc _lstrlen lpStr:DWORD
push edi ecx
cld
mov edi,[lpStr]
xor ecx,ecx
dec ecx
xor eax,eax
repne scasb
not ecx
dec ecx
mov eax,ecx
pop ecx edi
ret
endp
;-----------------------------------------------------
; ”ã­ªæ¨ï ¡ëáâண® á«¨ï­¨ï ¤¢ãå áâப
; ¨á¯®«ì§ãîâáï ä㭪樨 _lstrlen, _lstrcpy
;-----------------------------------------------------
; lpDst - 㪠§ â¥«ì ­  ¨á室­ãî áâபã ASCIIZ
; lpSrc - 㪠§ â¥«ì ­  ¤®¡ ¢«ï¥¬ãî áâபã ASCIIZ
;-----------------------------------------------------
proc _lstrcat lpDst:DWORD, lpSrc:DWORD
pusha
stdcall _lstrlen,[lpDst]
add eax,[lpDst]
stdcall _lstrcpy,eax,[lpSrc]
popa
ret
endp
;-----------------------------------------------------
; ”ã­ªæ¨ï ¡ëáâண® ª®¯¨à®¢ ­¨ï áâப¨
; ¨á¯®«ì§ãîâáï ä㭪樨 _lstrlen, _memcopy
;-----------------------------------------------------
; lpDst - 㪠§ â¥«ì ­  ¯à¨¥¬­¨ª
; lpSrc - 㪠§ â¥«ì ­  áâபã ASCIIZ
;-----------------------------------------------------
proc _lstrcpy lpDst:DWORD, lpSrc:DWORD
pusha
stdcall _lstrlen,[lpSrc]
inc eax
stdcall _memcopy,[lpDst],[lpSrc],eax
popa
ret
endp
;-----------------------------------------------------
; ”ã­ªæ¨ï ¡ëáâண® ª®¯¨à®¢ ­¨ï ãç á⪠ ¯ ¬ïâ¨
;-----------------------------------------------------
; lpDst - 㪠§ â¥«ì ­  ¯à¨¥¬­¨ª
; lpSrc - 㪠§ â¥«ì ­  ¨áâ®ç­¨ª
; dSize - à §¬¥à ª®¯¨à㥬®£® ¡«®ª 
;-----------------------------------------------------
proc _memcopy lpDst:DWORD, lpSrc:DWORD, dSize:DWORD
pusha
; “áâ ­®¢¨âì 㪠§ â¥«¨ ­  ¨áâ®ç­¨ª ¨ ¯à¨¥¬­¨ª
cld
mov edi,[lpDst]
mov esi,[lpSrc]
mov ecx,[dSize]
push ecx
; <EFBFBD> §¤¥«¨âì ­  4 ¨ ¯®«ãç¨âì ¤«¨­ã ¢ DWORD
shr ecx,2
; ‘ª®¯¨à®¢ âì ®á­®¢­ãî ç áâì áâப¨ DWORD' ¬¨
rep movsd
pop ecx
; <EFBFBD>®«ãç¨âì ®áâ â®ª ®â ¤¥«¥­¨ï ­  4
and ecx,3
; ‘ª®¯¨à®¢ âì ®áâ â®ª áâப¨ ¡ ©â ¬¨
rep movsb
popa
ret
endp