2006-12-29 17:50:24 +03:00
|
|
|
;-----------------------------------------------------------
|
|
|
|
;-----------load heading of file in memory------------------
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
|
|
|
|
load_heading_of_file:
|
|
|
|
|
|
|
|
mov [where_load_file],ebx
|
|
|
|
mov [full_file_path],eax
|
|
|
|
|
|
|
|
mov esi,[full_file_path]
|
|
|
|
mov edi,filepath
|
|
|
|
mov ecx,256
|
|
|
|
rep movsd
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
mov ecx,[where_load_file]
|
|
|
|
mov edx,filepath
|
|
|
|
|
|
|
|
mov [file_information],eax
|
|
|
|
mov [file_information+4],eax
|
|
|
|
mov [file_information+8],eax
|
|
|
|
mov [file_information+12],dword 512
|
|
|
|
mov [file_information+16],ecx
|
|
|
|
mov [file_information+20],al
|
|
|
|
mov [file_information+21],edx
|
|
|
|
|
|
|
|
mov eax,70
|
|
|
|
mov ebx,file_information
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-12-29 17:50:24 +03:00
|
|
|
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
;--------load file in memory--------------------------------
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
load_file:
|
|
|
|
mov [where_load_file],ebx
|
|
|
|
mov [full_file_path],eax
|
|
|
|
|
|
|
|
mov esi,[full_file_path]
|
|
|
|
mov edi,filepath
|
|
|
|
mov ecx,256
|
|
|
|
rep movsd
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
mov ebx,bufer_for_info
|
|
|
|
mov ecx,filepath
|
|
|
|
|
|
|
|
mov [file_information],dword 5
|
|
|
|
mov [file_information+4],eax
|
|
|
|
mov [file_information+8],eax
|
|
|
|
mov [file_information+12],eax
|
|
|
|
mov [file_information+16],ebx
|
|
|
|
mov [file_information+20],al
|
|
|
|
mov [file_information+21],ecx
|
|
|
|
|
|
|
|
mov eax,70
|
|
|
|
mov ebx,file_information
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-12-29 17:50:24 +03:00
|
|
|
|
|
|
|
test eax,eax
|
|
|
|
jnz error_load_file
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
mov ebx,[bufer_for_info+32]
|
|
|
|
mov ecx,[where_load_file]
|
|
|
|
mov edx,filepath
|
|
|
|
|
|
|
|
mov [file_information],eax
|
|
|
|
mov [file_information+4],eax
|
|
|
|
mov [file_information+8],eax
|
|
|
|
mov [file_information+12],ebx
|
|
|
|
mov [file_information+16],ecx
|
|
|
|
mov [file_information+20],al
|
|
|
|
mov [file_information+21],edx
|
|
|
|
|
|
|
|
mov eax,70
|
|
|
|
mov ebx,file_information
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-12-29 17:50:24 +03:00
|
|
|
|
|
|
|
error_load_file:
|
|
|
|
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
;---------------save in file from memory--------------------
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
save_file:
|
|
|
|
mov [size_to_save],ecx
|
|
|
|
mov [pointer_to_data],ebx
|
|
|
|
mov [full_file_path],eax
|
|
|
|
|
|
|
|
mov esi,[full_file_path]
|
|
|
|
mov edi,filepath
|
|
|
|
mov ecx,256
|
|
|
|
rep movsd
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
mov ebx,[size_to_save]
|
|
|
|
mov ecx,[pointer_to_data]
|
|
|
|
mov edx,filepath
|
|
|
|
|
|
|
|
mov [file_information],dword 2
|
|
|
|
mov [file_information+4],eax
|
|
|
|
mov [file_information+8],eax
|
|
|
|
mov [file_information+12],ebx
|
|
|
|
mov [file_information+16],ecx
|
|
|
|
mov [file_information+20],al
|
|
|
|
mov [file_information+21],edx
|
|
|
|
|
|
|
|
mov eax,70
|
|
|
|
mov ebx,file_information
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
2006-12-29 17:50:24 +03:00
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
;----------------------------------------------------------
|
|
|
|
;-------------file information structure-------------------
|
|
|
|
;----------------------------------------------------------
|
|
|
|
|
2016-03-12 23:39:39 +03:00
|
|
|
file_information FileInfoBlock 5,0,0,0,bufer_for_info,0,filepath
|
2006-12-29 17:50:24 +03:00
|
|
|
|
|
|
|
filepath rb 1040
|
|
|
|
|
|
|
|
bufer_for_info rd 10
|
|
|
|
full_file_path dd 0
|
|
|
|
where_load_file dd 0
|
|
|
|
size_to_save dd 0
|
|
|
|
pointer_to_data dd 0
|