116,7 → 116,6 |
local lp |
local lp1 |
local correction |
;local end_tr |
local exit_ |
;/equ |
err_message1 equ dword [esp+8] |
265,18 → 264,21 |
end_tr: |
|
;--------------------------------------------------------------------- |
@library_name equ dword [esp+12] |
@cur_dir_path equ dword [esp+8] |
@library_path equ dword [esp+4] |
|
@library_name equ dword [esp+16] |
@cur_dir_path equ dword [esp+12] |
@library_path equ dword [esp+8] |
@point_dir_name equ dword [esp+4] |
|
align 4 |
@copy_path: |
mov ebx,@library_name |
; mov ebx,@library_name |
mov esi,@cur_dir_path |
mov edi,@library_path |
|
xor eax,eax |
cld |
align 4 |
.lp1: |
lodsb |
stosb |
285,21 → 287,38 |
mov esi,edi |
|
std |
align 4 |
.lp2: |
lodsb |
cmp al,'/' |
jnz .lp2 |
mov edi,esi |
mov esi,ebx |
|
add edi,2 |
cld |
; mov esi,@library_name |
|
mov esi,@point_dir_name |
test esi,esi |
jz .str_lp4 |
|
cld |
align 4 |
.lp3: |
lodsb |
stosb |
test eax,eax |
jnz .lp3 |
|
|
dec edi |
.str_lp4: |
mov esi,@library_name |
align 4 |
.lp4: |
lodsb |
stosb |
test eax,eax |
jnz .lp4 |
;--------------------------------------------------------------------- |
ret |
} |
306,7 → 325,7 |
|
|
|
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__ |
macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__ |
{ |
local end_steep |
local exit |
317,7 → 336,11 |
test eax,eax |
jnz end_steep |
|
copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library |
if point_dir_name__ eq |
copy_path library_name__, cur_dir_path__, library_path__,0x0 |
else |
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library |
end if |
|
mcall 68,19,library_path__ ; load of alternative |
test eax,eax |
342,7 → 365,7 |
} |
|
|
macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__ |
macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__,point_dir_name__ |
{ |
local end_steep |
local exit |
349,7 → 372,11 |
;--------------------------------------------------------------------- |
; loading Box_Lib library |
|
copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library |
if point_dir_name__ eq |
copy_path library_name__, cur_dir_path__, library_path__,0x0 |
else |
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library |
end if |
|
mcall 68,19,library_path__ ; load of alternative |
test eax,eax |
393,8 → 420,9 |
my_import equ [ebp+24] |
err_message_import__ equ [ebp+28] |
head_f_i__ equ [ebp+32] |
adr_load_lib equ dword [ebp+36] |
status_lib equ dword [ebp+40] |
point_dir_name__ equ [ebp+36] |
adr_load_lib equ dword [ebp+40] |
status_lib equ dword [ebp+44] |
|
mov ebp,_start |
mov ecx,((_end-_start)/ll_struc_size) |
405,7 → 433,7 |
test eax,eax |
jnz end_steep |
|
copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library |
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library |
|
mcall 68,19,library_path__ ; load of alternative |
test eax,eax |
413,7 → 441,7 |
|
or status_lib,0x1 ; status of code - enable error - not found library |
|
show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window |
show_error_window err_message_found_lib__, head_f_l__, ;show error message /create window |
jmp next |
|
align 4 |
470,8 → 498,9 |
my_import equ [ebp+24] |
err_message_import__ equ [ebp+28] |
head_f_i__ equ [ebp+32] |
adr_load_lib equ dword [ebp+36] |
status_lib equ dword [ebp+40] |
point_dir_name__ equ [ebp+36] |
adr_load_lib equ dword [ebp+40] |
status_lib equ dword [ebp+44] |
|
mov ebp,_start |
mov ecx,((_end-_start)/ll_struc_size) |
479,7 → 508,7 |
align 4 |
lp: push ecx |
|
copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library |
copy_path library_name__, cur_dir_path__, library_path__,point_dir_name__ ;the macros making way /current pach a program/+ name system library |
|
mcall 68,19,library_path__ ; load of alternative |
test eax,eax |
534,16 → 563,16 |
} |
|
|
macro copy_path lib_name,dir_path,lib_path |
macro copy_path lib_name,dir_path,lib_path,point_dir_name |
{ |
pushad ;save all registers |
push dword lib_name |
push dword dir_path |
push dword lib_path |
|
push dword point_dir_name |
call @copy_path |
|
add esp,12 |
add esp,16 |
popad ;restore all registers |
} |
|
613,8 → 642,8 |
e.exit: |
;--------------------------------------------------------------------- |
} |
ll_struc_size = 44;($-library_name__) ; constant size of struct |
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__; struct for loading libraries |
ll_struc_size = 48;($-library_name__) ; constant size of struct |
struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__,point_dir_name; struct for loading libraries |
{ |
.library_name__ dd library_name__ ; èìÿ çàãðóæàåìîé áèáëèîòåêè |
.cur_dir_path__ dd cur_dir_path__ ; óêàçàòåëü íà áóôåð â êîòîðîì ñîäåðæèòüñÿ ïóòü îò êóäà áûëà çàïóùåíà ïðîãðàììà |
627,7 → 656,11 |
.my_import dd my_import |
.err_message_import__ dd err_message_import__ |
.head_f_i__ dd head_f_i__ |
|
if point_dir_name eq |
.point_dir_name__ dd 0x0 |
else |
.point_dir_name__ dd point_dir_name ; èìÿ âëîæåííîé äèððåêòîðèè â êòîðîé õðàíÿòüñÿ ïîäãðóæàåìûå ìîäóëè. |
end if |
.adr_load_lib dd 0x0 |
.status_lib dd 0x0 ;status of load library |
; |