Compare commits
2 Commits
webview-ne
...
rewrite_id
Author | SHA1 | Date | |
---|---|---|---|
b96437334b | |||
bff8f4e5a5 |
@@ -12,13 +12,6 @@
|
|||||||
; Source code author - Kulakov Vladimir Gennadievich.
|
; Source code author - Kulakov Vladimir Gennadievich.
|
||||||
; Adaptation and improvement - Mario79.
|
; Adaptation and improvement - Mario79.
|
||||||
|
|
||||||
give_back_application_data_1:
|
|
||||||
mov esi, FDD_BUFF;FDD_DataBuffer ;0x40000
|
|
||||||
mov ecx, 128
|
|
||||||
cld
|
|
||||||
rep movsd
|
|
||||||
ret
|
|
||||||
|
|
||||||
take_data_from_application_1:
|
take_data_from_application_1:
|
||||||
mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000
|
mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000
|
||||||
mov ecx, 128
|
mov ecx, 128
|
||||||
@@ -717,18 +710,38 @@ endg
|
|||||||
; This function is called in boot process.
|
; This function is called in boot process.
|
||||||
; It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives.
|
; It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives.
|
||||||
proc floppy_init
|
proc floppy_init
|
||||||
|
; search for FDDs and add them to the list of disks
|
||||||
|
; author - Mario79
|
||||||
|
mov al, 0x10
|
||||||
|
out 0x70, al
|
||||||
|
mov cx, 0xff
|
||||||
|
.wait_cmos:
|
||||||
|
dec cx
|
||||||
|
test cx, cx
|
||||||
|
jnz .wait_cmos
|
||||||
|
in al, 0x71
|
||||||
|
test al, al
|
||||||
|
jz .no_fdd
|
||||||
|
|
||||||
|
push eax ; b[esp]=al [esp+1..3]- ??
|
||||||
|
|
||||||
|
stdcall attach_int_handler, 6, FDCInterrupt, 0
|
||||||
|
DEBUGF 1, "K : Set Floppy IRQ6 return code %x\n", eax
|
||||||
|
|
||||||
mov ecx, floppy_mutex
|
mov ecx, floppy_mutex
|
||||||
call mutex_init
|
call mutex_init
|
||||||
; First floppy is present if [DRIVE_DATA] and 0xF0 is nonzero.
|
; First floppy is present if [esp] and 0xF0 is nonzero.
|
||||||
test byte [DRIVE_DATA], 0xF0
|
test byte [esp], 0xF0
|
||||||
jz .no1
|
jz .no1
|
||||||
stdcall disk_add, floppy_functions, floppy1_name, 1, DISK_NO_INSERT_NOTIFICATION
|
stdcall disk_add, floppy_functions, floppy1_name, 1, DISK_NO_INSERT_NOTIFICATION
|
||||||
.no1:
|
.no1:
|
||||||
; Second floppy is present if [DRIVE_DATA] and 0x0F is nonzero.
|
; Second floppy is present if [esp] and 0x0F is nonzero.
|
||||||
test byte [DRIVE_DATA], 0x0F
|
test byte [esp], 0x0F
|
||||||
jz .no2
|
jz .no2
|
||||||
stdcall disk_add, floppy_functions, floppy2_name, 2, DISK_NO_INSERT_NOTIFICATION
|
stdcall disk_add, floppy_functions, floppy2_name, 2, DISK_NO_INSERT_NOTIFICATION
|
||||||
.no2:
|
.no2:
|
||||||
|
add esp, 4
|
||||||
|
.no_fdd:
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
@@ -878,37 +878,6 @@ struct PCIDEV
|
|||||||
owner dd ? ; pointer to SRV or 0
|
owner dd ? ; pointer to SRV or 0
|
||||||
ends
|
ends
|
||||||
|
|
||||||
struct IDE_DATA
|
|
||||||
ProgrammingInterface dd ?
|
|
||||||
Interrupt dw ?
|
|
||||||
RegsBaseAddres dw ?
|
|
||||||
BAR0_val dw ?
|
|
||||||
BAR1_val dw ?
|
|
||||||
BAR2_val dw ?
|
|
||||||
BAR3_val dw ?
|
|
||||||
dma_hdd_channel_1 db ?
|
|
||||||
dma_hdd_channel_2 db ?
|
|
||||||
pcidev dd ? ; pointer to corresponding PCIDEV structure
|
|
||||||
ends
|
|
||||||
|
|
||||||
struct IDE_CACHE
|
|
||||||
pointer dd ?
|
|
||||||
size dd ? ; not use
|
|
||||||
data_pointer dd ?
|
|
||||||
system_data_size dd ? ; not use
|
|
||||||
appl_data_size dd ? ; not use
|
|
||||||
system_data dd ?
|
|
||||||
appl_data dd ?
|
|
||||||
system_sad_size dd ?
|
|
||||||
appl_sad_size dd ?
|
|
||||||
search_start dd ?
|
|
||||||
appl_search_start dd ?
|
|
||||||
ends
|
|
||||||
|
|
||||||
struct IDE_DEVICE
|
|
||||||
UDMA_possible_modes db ?
|
|
||||||
UDMA_set_mode db ?
|
|
||||||
ends
|
|
||||||
|
|
||||||
; The following macro assume that we are on uniprocessor machine.
|
; The following macro assume that we are on uniprocessor machine.
|
||||||
; Serious work is needed for multiprocessor machines.
|
; Serious work is needed for multiprocessor machines.
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;; ;;
|
|
||||||
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
|
|
||||||
;; Distributed under terms of the GNU General Public License ;;
|
|
||||||
;; ;;
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
|
|
||||||
;***************************************************
|
|
||||||
; clear the DRIVE_DATA table,
|
|
||||||
; search for FDDs and add them into the table
|
|
||||||
; author - Mario79
|
|
||||||
;***************************************************
|
|
||||||
xor eax, eax
|
|
||||||
mov edi, DRIVE_DATA
|
|
||||||
mov ecx, DRIVE_DATA_SIZE/4
|
|
||||||
cld
|
|
||||||
rep stosd
|
|
||||||
|
|
||||||
mov al, 0x10
|
|
||||||
out 0x70, al
|
|
||||||
mov cx, 0xff
|
|
||||||
wait_cmos:
|
|
||||||
dec cx
|
|
||||||
test cx, cx
|
|
||||||
jnz wait_cmos
|
|
||||||
in al, 0x71
|
|
||||||
mov [DRIVE_DATA], al
|
|
||||||
test al, al
|
|
||||||
jz @f
|
|
||||||
|
|
||||||
stdcall attach_int_handler, 6, FDCInterrupt, 0
|
|
||||||
DEBUGF 1, "K : Set IDE IRQ6 return code %x\n", eax
|
|
||||||
call floppy_init
|
|
||||||
@@:
|
|
||||||
|
|
@@ -1,13 +0,0 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;; ;;
|
|
||||||
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
|
|
||||||
;; Distributed under terms of the GNU General Public License ;;
|
|
||||||
;; ;;
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
|
|
||||||
include 'dev_fd.inc'
|
|
||||||
include 'dev_hdcd.inc'
|
|
||||||
include 'getcache.inc'
|
|
||||||
include 'sear_par.inc'
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@@ -754,7 +754,7 @@ end if
|
|||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
mov esi, boot_detectfloppy
|
mov esi, boot_detectfloppy
|
||||||
call boot_log
|
call boot_log
|
||||||
include 'detect/dev_fd.inc'
|
call floppy_init
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; create pci-devices list
|
; create pci-devices list
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
@@ -521,7 +521,7 @@ bool GetUrl(dword _http_url)
|
|||||||
http.get(_http_url);
|
http.get(_http_url);
|
||||||
return true;
|
return true;
|
||||||
} else if (!strncmp(_http_url,"https://",8)) {
|
} else if (!strncmp(_http_url,"https://",8)) {
|
||||||
strcpy(#new_url_full, "http://176.223.130.192:82/?site=");
|
strcpy(#new_url_full, "http://gate.aspero.pro/?site=");
|
||||||
strncat(#new_url_full, _http_url, URL_SIZE);
|
strncat(#new_url_full, _http_url, URL_SIZE);
|
||||||
http.get(#new_url_full);
|
http.get(#new_url_full);
|
||||||
return true;
|
return true;
|
||||||
|
@@ -168,9 +168,9 @@ void StartDownloading()
|
|||||||
ResetDownloadSpeed();
|
ResetDownloadSpeed();
|
||||||
pb.back_color = 0xFFFfff;
|
pb.back_color = 0xFFFfff;
|
||||||
if (!strncmp(#uEdit,"https:",6)) {
|
if (!strncmp(#uEdit,"https:",6)) {
|
||||||
miniprintf(#get_url, "http://176.223.130.192:82/?site=%s", #uEdit);
|
//miniprintf(#get_url, "http://gate.aspero.pro/?site=%s", #uEdit);
|
||||||
// notify("'HTTPS for download temporary is not supported,\ntrying to download the file via HTTP' -W");
|
notify("'HTTPS for download temporary is not supported,\ntrying to download the file via HTTP' -W");
|
||||||
// miniprintf(#uEdit, "http://%s", #uEdit+8);
|
miniprintf(#uEdit, "http://%s", #uEdit+8);
|
||||||
}
|
}
|
||||||
strcpy(#get_url, #uEdit);
|
strcpy(#get_url, #uEdit);
|
||||||
|
|
||||||
|
@@ -112,7 +112,7 @@ struct _http
|
|||||||
dword _http::get(dword _url)
|
dword _http::get(dword _url)
|
||||||
{
|
{
|
||||||
cur_url = _url;
|
cur_url = _url;
|
||||||
if (streqrp(cur_url, "http://176.223.130.192:82/?site=")) cur_url += 29;
|
if (streqrp(cur_url, "http://gate.aspero.pro/?site=")) cur_url += 29;
|
||||||
http_get stdcall (_url, 0, 0, #accept_language);
|
http_get stdcall (_url, 0, 0, #accept_language);
|
||||||
transfer = EAX;
|
transfer = EAX;
|
||||||
return EAX;
|
return EAX;
|
||||||
|
@@ -100,10 +100,6 @@ lib_init: ;//////////////////////////////////////////////////////////////////;;
|
|||||||
mov [mem.alloc], eax
|
mov [mem.alloc], eax
|
||||||
mov [mem.free], ebx
|
mov [mem.free], ebx
|
||||||
mov [mem.realloc], ecx
|
mov [mem.realloc], ecx
|
||||||
|
|
||||||
cmp [dll.load], edx
|
|
||||||
je .ok
|
|
||||||
|
|
||||||
mov [dll.load], edx
|
mov [dll.load], edx
|
||||||
|
|
||||||
invoke dll.load, @IMPORT
|
invoke dll.load, @IMPORT
|
||||||
@@ -119,7 +115,6 @@ lib_init: ;//////////////////////////////////////////////////////////////////;;
|
|||||||
invoke ini.get_str, inifile, sec_proxy, key_password, proxyPassword, 256, proxyPassword
|
invoke ini.get_str, inifile, sec_proxy, key_password, proxyPassword, 256, proxyPassword
|
||||||
popa
|
popa
|
||||||
|
|
||||||
.ok:
|
|
||||||
DEBUGF 1, "HTTP library: init OK\n"
|
DEBUGF 1, "HTTP library: init OK\n"
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
@@ -78,10 +78,6 @@ proc lib_init ;///////////////////////////////////////////////////////////////;;
|
|||||||
mov [mem.alloc], eax
|
mov [mem.alloc], eax
|
||||||
mov [mem.free], ebx
|
mov [mem.free], ebx
|
||||||
mov [mem.realloc], ecx
|
mov [mem.realloc], ecx
|
||||||
|
|
||||||
cmp [dll.load], edx
|
|
||||||
je .ok
|
|
||||||
|
|
||||||
mov [dll.load], edx
|
mov [dll.load], edx
|
||||||
|
|
||||||
or edx, edx
|
or edx, edx
|
||||||
|
@@ -34,25 +34,21 @@ proc libini._.init ;////////////////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< eax = 1 (fail) / 0 (ok) (library initialization result) ;;
|
;< eax = 1 (fail) / 0 (ok) (library initialization result) ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
mov [mem.alloc], eax
|
mov [mem.alloc], eax
|
||||||
mov [mem.free], ebx
|
mov [mem.free], ebx
|
||||||
mov [mem.realloc], ecx
|
mov [mem.realloc], ecx
|
||||||
|
mov [dll.load], edx
|
||||||
|
|
||||||
cmp [dll.load], edx
|
invoke dll.load, @IMPORT
|
||||||
je .ok
|
or eax, eax
|
||||||
|
jz .ok
|
||||||
|
|
||||||
mov [dll.load], edx
|
xor eax, eax
|
||||||
|
inc eax
|
||||||
|
ret
|
||||||
|
|
||||||
invoke dll.load, @IMPORT
|
.ok: xor eax,eax
|
||||||
or eax, eax
|
ret
|
||||||
jz .ok
|
|
||||||
|
|
||||||
xor eax, eax
|
|
||||||
inc eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
.ok: xor eax,eax
|
|
||||||
ret
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -64,16 +60,16 @@ proc libini._.unget_char _f ;///////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push eax ecx
|
push eax ecx
|
||||||
mov ecx, [_f]
|
mov ecx, [_f]
|
||||||
inc [ecx + IniFile.cnt]
|
inc [ecx + IniFile.cnt]
|
||||||
dec esi
|
dec esi
|
||||||
mov eax, [ecx + IniFile.bsize]
|
mov eax, [ecx + IniFile.bsize]
|
||||||
cmp [ecx + IniFile.cnt], eax
|
cmp [ecx + IniFile.cnt], eax
|
||||||
jle @f
|
jle @f
|
||||||
stdcall libini._.unload_block, [_f]
|
stdcall libini._.unload_block, [_f]
|
||||||
@@: pop ecx eax
|
@@: pop ecx eax
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -85,13 +81,13 @@ proc libini._.get_char _f ;/////////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
mov ecx, [_f]
|
mov ecx, [_f]
|
||||||
dec [ecx + IniFile.cnt]
|
dec [ecx + IniFile.cnt]
|
||||||
jns @f
|
jns @f
|
||||||
stdcall libini._.preload_block, [_f]
|
stdcall libini._.preload_block, [_f]
|
||||||
dec [ecx + IniFile.cnt]
|
dec [ecx + IniFile.cnt]
|
||||||
@@: lodsb
|
@@: lodsb
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -103,22 +99,22 @@ proc libini._.skip_nonblanks _f ;///////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
mov ecx, [_f]
|
mov ecx, [_f]
|
||||||
@@: stdcall libini._.get_char, [_f]
|
@@: stdcall libini._.get_char, [_f]
|
||||||
cmp al, 32
|
cmp al, 32
|
||||||
je @b
|
je @b
|
||||||
cmp al, 13
|
cmp al, 13
|
||||||
je @b
|
je @b
|
||||||
cmp al, 10
|
cmp al, 10
|
||||||
je @b
|
je @b
|
||||||
cmp al, 9
|
cmp al, 9
|
||||||
je @b
|
je @b
|
||||||
cmp al, ini.COMMENT_CHAR
|
cmp al, ini.COMMENT_CHAR
|
||||||
jne @f
|
jne @f
|
||||||
stdcall libini._.skip_line, [_f]
|
stdcall libini._.skip_line, [_f]
|
||||||
jmp @b
|
jmp @b
|
||||||
@@: stdcall libini._.unget_char, [_f]
|
@@: stdcall libini._.unget_char, [_f]
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -130,14 +126,14 @@ proc libini._.skip_spaces _f ;//////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
mov ecx, [_f]
|
mov ecx, [_f]
|
||||||
@@: stdcall libini._.get_char, [_f]
|
@@: stdcall libini._.get_char, [_f]
|
||||||
cmp al, 32
|
cmp al, 32
|
||||||
je @b
|
je @b
|
||||||
cmp al, 9
|
cmp al, 9
|
||||||
je @b
|
je @b
|
||||||
@@: stdcall libini._.unget_char, [_f]
|
@@: stdcall libini._.unget_char, [_f]
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -149,16 +145,16 @@ proc libini._.skip_line _f ;////////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
mov ecx, [_f]
|
mov ecx, [_f]
|
||||||
@@: stdcall libini._.get_char, [_f]
|
@@: stdcall libini._.get_char, [_f]
|
||||||
or al, al
|
or al, al
|
||||||
jz @f
|
jz @f
|
||||||
cmp al, 13
|
cmp al, 13
|
||||||
je @f
|
je @f
|
||||||
cmp al, 10
|
cmp al, 10
|
||||||
jne @b
|
jne @b
|
||||||
@@: stdcall libini._.unget_char, [_f]
|
@@: stdcall libini._.unget_char, [_f]
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -170,16 +166,16 @@ proc libini._.unload_block _f ;/////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push eax ebx ecx
|
push eax ebx ecx
|
||||||
mov ebx, [_f]
|
mov ebx, [_f]
|
||||||
mov eax, [ebx + IniFile.pos]
|
mov eax, [ebx + IniFile.pos]
|
||||||
add eax, -ini.BLOCK_SIZE
|
add eax, -ini.BLOCK_SIZE
|
||||||
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
|
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
|
||||||
stdcall libini._.preload_block, ebx
|
stdcall libini._.preload_block, ebx
|
||||||
add esi, eax
|
add esi, eax
|
||||||
mov [ebx + IniFile.cnt], 0
|
mov [ebx + IniFile.cnt], 0
|
||||||
pop ecx ebx eax
|
pop ecx ebx eax
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -191,25 +187,25 @@ proc libini._.preload_block _f ;////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push eax ebx ecx
|
push eax ebx ecx
|
||||||
mov ebx, [_f]
|
mov ebx, [_f]
|
||||||
@@: mov esi, [ebx + IniFile.buf]
|
@@: mov esi, [ebx + IniFile.buf]
|
||||||
push edi
|
push edi
|
||||||
mov edi, esi
|
mov edi, esi
|
||||||
mov ecx, ini.BLOCK_SIZE / 4
|
mov ecx, ini.BLOCK_SIZE / 4
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
rep stosd
|
rep stosd
|
||||||
pop edi
|
pop edi
|
||||||
invoke file.tell, [ebx + IniFile.fh]
|
invoke file.tell, [ebx + IniFile.fh]
|
||||||
mov [ebx + IniFile.pos], eax
|
mov [ebx + IniFile.pos], eax
|
||||||
invoke file.read, [ebx + IniFile.fh], esi, ini.BLOCK_SIZE
|
invoke file.read, [ebx + IniFile.fh], esi, ini.BLOCK_SIZE
|
||||||
mov esi,[ebx + IniFile.buf]
|
mov esi,[ebx + IniFile.buf]
|
||||||
cmp eax,ini.BLOCK_SIZE
|
cmp eax,ini.BLOCK_SIZE
|
||||||
jl @f
|
jl @f
|
||||||
@@: mov [ebx + IniFile.cnt], eax
|
@@: mov [ebx + IniFile.cnt], eax
|
||||||
mov [ebx + IniFile.bsize], eax
|
mov [ebx + IniFile.bsize], eax
|
||||||
pop ecx ebx eax
|
pop ecx ebx eax
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -221,18 +217,18 @@ proc libini._.reload_block _f ;/////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push eax ebx ecx
|
push eax ebx ecx
|
||||||
mov ebx, [_f]
|
mov ebx, [_f]
|
||||||
push [ebx + IniFile.bsize]
|
push [ebx + IniFile.bsize]
|
||||||
push esi [ebx + IniFile.cnt]
|
push esi [ebx + IniFile.cnt]
|
||||||
invoke file.seek, [ebx + IniFile.fh], [ebx + IniFile.pos], SEEK_SET
|
invoke file.seek, [ebx + IniFile.fh], [ebx + IniFile.pos], SEEK_SET
|
||||||
stdcall libini._.preload_block, ebx
|
stdcall libini._.preload_block, ebx
|
||||||
pop [ebx + IniFile.cnt] esi
|
pop [ebx + IniFile.cnt] esi
|
||||||
pop eax
|
pop eax
|
||||||
sub eax,[ebx + IniFile.bsize]
|
sub eax,[ebx + IniFile.bsize]
|
||||||
sub [ebx + IniFile.cnt], eax
|
sub [ebx + IniFile.cnt], eax
|
||||||
pop ecx ebx eax
|
pop ecx ebx eax
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
; f_info - contains current file block number
|
; f_info - contains current file block number
|
||||||
@@ -253,91 +249,91 @@ locals
|
|||||||
buf dd ?
|
buf dd ?
|
||||||
endl
|
endl
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
cmp [_delta], 0
|
cmp [_delta], 0
|
||||||
je .skip
|
je .skip
|
||||||
|
|
||||||
push ebx ecx
|
push ebx ecx
|
||||||
invoke mem.alloc, ini.BLOCK_SIZE
|
invoke mem.alloc, ini.BLOCK_SIZE
|
||||||
or eax, eax
|
or eax, eax
|
||||||
jz .fail
|
jz .fail
|
||||||
mov [buf], eax
|
mov [buf], eax
|
||||||
|
|
||||||
cmp [_delta], 0
|
cmp [_delta], 0
|
||||||
jl .down
|
jl .down
|
||||||
|
|
||||||
mov ebx, [_f]
|
mov ebx, [_f]
|
||||||
mov ecx, [ebx + IniFile.cnt]
|
mov ecx, [ebx + IniFile.cnt]
|
||||||
mov ebx, [ebx + IniFile.fh]
|
mov ebx, [ebx + IniFile.fh]
|
||||||
invoke file.tell, ebx
|
invoke file.tell, ebx
|
||||||
sub eax, ecx
|
sub eax, ecx
|
||||||
invoke file.seek, ebx, eax, SEEK_SET
|
invoke file.seek, ebx, eax, SEEK_SET
|
||||||
@@: invoke file.seek, ebx, [_delta], SEEK_CUR
|
@@: invoke file.seek, ebx, [_delta], SEEK_CUR
|
||||||
invoke file.eof?, ebx
|
invoke file.eof?, ebx
|
||||||
or eax, eax
|
or eax, eax
|
||||||
jnz .done
|
jnz .done
|
||||||
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
|
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
|
||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
mov eax, [_delta]
|
mov eax, [_delta]
|
||||||
neg eax
|
neg eax
|
||||||
sub eax, ecx
|
sub eax, ecx
|
||||||
invoke file.seek, ebx, eax, SEEK_CUR
|
invoke file.seek, ebx, eax, SEEK_CUR
|
||||||
push ecx
|
push ecx
|
||||||
invoke file.write, ebx, [buf], ecx
|
invoke file.write, ebx, [buf], ecx
|
||||||
pop ecx
|
pop ecx
|
||||||
cmp eax, ecx
|
cmp eax, ecx
|
||||||
jz @b
|
jz @b
|
||||||
.fail:
|
.fail:
|
||||||
or eax, -1
|
or eax, -1
|
||||||
pop ecx ebx
|
pop ecx ebx
|
||||||
ret
|
ret
|
||||||
.done:
|
.done:
|
||||||
mov eax, [_delta]
|
mov eax, [_delta]
|
||||||
neg eax
|
neg eax
|
||||||
invoke file.seek, ebx, eax, SEEK_CUR
|
invoke file.seek, ebx, eax, SEEK_CUR
|
||||||
invoke file.seteof, ebx
|
invoke file.seteof, ebx
|
||||||
stdcall libini._.reload_block, [_f]
|
stdcall libini._.reload_block, [_f]
|
||||||
invoke mem.free, [buf]
|
invoke mem.free, [buf]
|
||||||
pop ecx ebx
|
pop ecx ebx
|
||||||
.skip:
|
.skip:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.down:
|
.down:
|
||||||
neg [_delta]
|
neg [_delta]
|
||||||
|
|
||||||
mov ebx, [_f]
|
mov ebx, [_f]
|
||||||
mov ecx, [ebx + IniFile.cnt]
|
mov ecx, [ebx + IniFile.cnt]
|
||||||
mov ebx, [ebx + IniFile.fh]
|
mov ebx, [ebx + IniFile.fh]
|
||||||
invoke file.tell, ebx
|
invoke file.tell, ebx
|
||||||
sub eax, ecx
|
sub eax, ecx
|
||||||
lea edx, [eax - 1]
|
lea edx, [eax - 1]
|
||||||
push edx
|
push edx
|
||||||
@@: invoke file.seek, ebx, edx, SEEK_SET
|
@@: invoke file.seek, ebx, edx, SEEK_SET
|
||||||
invoke file.eof?, ebx
|
invoke file.eof?, ebx
|
||||||
or eax, eax
|
or eax, eax
|
||||||
jnz @f
|
jnz @f
|
||||||
add edx, ini.BLOCK_SIZE
|
add edx, ini.BLOCK_SIZE
|
||||||
jmp @b
|
jmp @b
|
||||||
@@: cmp edx, [esp]
|
@@: cmp edx, [esp]
|
||||||
je .skip.2
|
je .skip.2
|
||||||
add edx, -ini.BLOCK_SIZE
|
add edx, -ini.BLOCK_SIZE
|
||||||
cmp edx, [esp]
|
cmp edx, [esp]
|
||||||
jl @f
|
jl @f
|
||||||
invoke file.seek, ebx, edx, SEEK_SET
|
invoke file.seek, ebx, edx, SEEK_SET
|
||||||
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
|
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
|
||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
mov eax, [_delta]
|
mov eax, [_delta]
|
||||||
sub eax, ecx
|
sub eax, ecx
|
||||||
invoke file.seek, ebx, eax, SEEK_CUR
|
invoke file.seek, ebx, eax, SEEK_CUR
|
||||||
invoke file.write, ebx, [buf], ecx
|
invoke file.write, ebx, [buf], ecx
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
@@:
|
||||||
.skip.2:
|
.skip.2:
|
||||||
add esp, 4
|
add esp, 4
|
||||||
stdcall libini._.reload_block, [_f]
|
stdcall libini._.reload_block, [_f]
|
||||||
invoke mem.free, [buf]
|
invoke mem.free, [buf]
|
||||||
pop ecx ebx
|
pop ecx ebx
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -349,25 +345,25 @@ proc libini._.get_value_length _f ;/////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push ebx ecx edx eax
|
push ebx ecx edx eax
|
||||||
mov ebx, [_f]
|
mov ebx, [_f]
|
||||||
invoke file.tell, [ebx + IniFile.fh]
|
invoke file.tell, [ebx + IniFile.fh]
|
||||||
push esi [ebx + IniFile.cnt] [ebx + IniFile.pos]
|
push esi [ebx + IniFile.cnt] [ebx + IniFile.pos]
|
||||||
sub eax, [ebx + IniFile.cnt]
|
sub eax, [ebx + IniFile.cnt]
|
||||||
mov edx, eax
|
mov edx, eax
|
||||||
|
|
||||||
stdcall libini._.skip_line, [_f]
|
stdcall libini._.skip_line, [_f]
|
||||||
invoke file.tell, [ebx + IniFile.fh]
|
invoke file.tell, [ebx + IniFile.fh]
|
||||||
sub eax, [ebx + IniFile.cnt]
|
sub eax, [ebx + IniFile.cnt]
|
||||||
sub eax, edx
|
sub eax, edx
|
||||||
mov [esp + 4 * 3], eax
|
mov [esp + 4 * 3], eax
|
||||||
|
|
||||||
pop eax
|
pop eax
|
||||||
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
|
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
|
||||||
stdcall libini._.preload_block, [_f]
|
stdcall libini._.preload_block, [_f]
|
||||||
pop [ebx + IniFile.cnt] esi
|
pop [ebx + IniFile.cnt] esi
|
||||||
pop eax edx ecx ebx
|
pop eax edx ecx ebx
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -380,10 +376,10 @@ proc libini._.string_copy ;/////////////////////////////////////////////////////
|
|||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@: lodsb
|
@@: lodsb
|
||||||
or al, al
|
or al, al
|
||||||
jz @f
|
jz @f
|
||||||
stosb
|
stosb
|
||||||
jmp @b
|
jmp @b
|
||||||
@@: ret
|
@@: ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
@@ -396,26 +392,26 @@ proc libini._.find_next_section _f ;////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push ebx edi
|
push ebx edi
|
||||||
|
|
||||||
@@: stdcall libini._.skip_nonblanks, [_f]
|
@@: stdcall libini._.skip_nonblanks, [_f]
|
||||||
cmp al, '['
|
cmp al, '['
|
||||||
je @f
|
je @f
|
||||||
or al, al
|
or al, al
|
||||||
jz .exit_error
|
jz .exit_error
|
||||||
stdcall libini._.skip_line, [_f]
|
stdcall libini._.skip_line, [_f]
|
||||||
or al, al
|
or al, al
|
||||||
jz .exit_error
|
jz .exit_error
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
@@:
|
||||||
pop edi ebx
|
pop edi ebx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.exit_error:
|
.exit_error:
|
||||||
pop edi ebx
|
pop edi ebx
|
||||||
or eax, -1
|
or eax, -1
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -429,50 +425,50 @@ proc libini._.find_section _f, _sec_name ;//////////////////////////////////////
|
|||||||
;< eax = -1 (fail) / 0 (ok) ;;
|
;< eax = -1 (fail) / 0 (ok) ;;
|
||||||
;< [_f.pos] = new cursor position (right after ']' char if eax = 0, at the end of file otherwise) ;;
|
;< [_f.pos] = new cursor position (right after ']' char if eax = 0, at the end of file otherwise) ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push ebx edi
|
push ebx edi
|
||||||
|
|
||||||
mov ecx, [_f]
|
mov ecx, [_f]
|
||||||
invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET
|
invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET
|
||||||
stdcall libini._.preload_block, [_f]
|
stdcall libini._.preload_block, [_f]
|
||||||
|
|
||||||
.next_section:
|
.next_section:
|
||||||
stdcall libini._.find_next_section, [_f]
|
stdcall libini._.find_next_section, [_f]
|
||||||
or eax, eax
|
or eax, eax
|
||||||
jnz .exit_error
|
jnz .exit_error
|
||||||
|
|
||||||
stdcall libini._.get_char, [_f]
|
stdcall libini._.get_char, [_f]
|
||||||
stdcall libini._.skip_spaces, [_f]
|
stdcall libini._.skip_spaces, [_f]
|
||||||
mov edi, [_sec_name]
|
mov edi, [_sec_name]
|
||||||
@@: stdcall libini._.get_char, [_f]
|
@@: stdcall libini._.get_char, [_f]
|
||||||
cmp al, ']'
|
cmp al, ']'
|
||||||
je @f
|
je @f
|
||||||
or al, al
|
or al, al
|
||||||
jz .exit_error
|
jz .exit_error
|
||||||
cmp al, 13
|
cmp al, 13
|
||||||
je .next_section
|
je .next_section
|
||||||
cmp al, 10
|
cmp al, 10
|
||||||
je .next_section
|
je .next_section
|
||||||
scasb
|
scasb
|
||||||
je @b
|
je @b
|
||||||
cmp byte[edi - 1], 0
|
cmp byte[edi - 1], 0
|
||||||
jne .next_section
|
jne .next_section
|
||||||
dec edi
|
dec edi
|
||||||
stdcall libini._.unget_char, [_f]
|
stdcall libini._.unget_char, [_f]
|
||||||
stdcall libini._.skip_spaces, [_f]
|
stdcall libini._.skip_spaces, [_f]
|
||||||
stdcall libini._.get_char, [_f]
|
stdcall libini._.get_char, [_f]
|
||||||
cmp al, ']'
|
cmp al, ']'
|
||||||
jne .next_section
|
jne .next_section
|
||||||
@@:
|
@@:
|
||||||
cmp byte[edi], 0
|
cmp byte[edi], 0
|
||||||
jne .next_section
|
jne .next_section
|
||||||
pop edi ebx
|
pop edi ebx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.exit_error:
|
.exit_error:
|
||||||
pop edi ebx
|
pop edi ebx
|
||||||
or eax, -1
|
or eax, -1
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -487,44 +483,44 @@ proc libini._.find_key _f, _key_name ;//////////////////////////////////////////
|
|||||||
;< [_f.pos] = new cursor position (right after '=' char if eax = 0, at the end of file or right ;;
|
;< [_f.pos] = new cursor position (right after '=' char if eax = 0, at the end of file or right ;;
|
||||||
;< before '[' char otherwise) ;;
|
;< before '[' char otherwise) ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push ebx edi
|
push ebx edi
|
||||||
|
|
||||||
.next_value:
|
.next_value:
|
||||||
mov edi, [_key_name]
|
mov edi, [_key_name]
|
||||||
stdcall libini._.skip_line, [_f]
|
stdcall libini._.skip_line, [_f]
|
||||||
stdcall libini._.skip_nonblanks, [_f]
|
stdcall libini._.skip_nonblanks, [_f]
|
||||||
or al, al
|
or al, al
|
||||||
jz .exit_error
|
jz .exit_error
|
||||||
cmp al, '['
|
cmp al, '['
|
||||||
je .exit_error
|
je .exit_error
|
||||||
@@: stdcall libini._.get_char, [_f]
|
@@: stdcall libini._.get_char, [_f]
|
||||||
or al, al
|
or al, al
|
||||||
jz .exit_error
|
jz .exit_error
|
||||||
cmp al, '='
|
cmp al, '='
|
||||||
je @f
|
je @f
|
||||||
scasb
|
scasb
|
||||||
je @b
|
je @b
|
||||||
cmp byte[edi - 1], 0
|
cmp byte[edi - 1], 0
|
||||||
jne .next_value
|
jne .next_value
|
||||||
dec edi
|
dec edi
|
||||||
stdcall libini._.unget_char, [_f]
|
stdcall libini._.unget_char, [_f]
|
||||||
stdcall libini._.skip_spaces, [_f]
|
stdcall libini._.skip_spaces, [_f]
|
||||||
stdcall libini._.get_char, [_f]
|
stdcall libini._.get_char, [_f]
|
||||||
cmp al, '='
|
cmp al, '='
|
||||||
je @f
|
je @f
|
||||||
jmp .next_value
|
jmp .next_value
|
||||||
@@:
|
@@:
|
||||||
cmp byte[edi], 0
|
cmp byte[edi], 0
|
||||||
jne .next_value
|
jne .next_value
|
||||||
|
|
||||||
pop edi ebx
|
pop edi ebx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.exit_error:
|
.exit_error:
|
||||||
pop edi ebx
|
pop edi ebx
|
||||||
or eax, -1
|
or eax, -1
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -536,31 +532,31 @@ proc libini._.low.read_value _f_addr, _buffer, _buf_len ;///////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push edi eax
|
push edi eax
|
||||||
mov edi, [_buffer]
|
mov edi, [_buffer]
|
||||||
stdcall libini._.skip_spaces, [_f_addr]
|
stdcall libini._.skip_spaces, [_f_addr]
|
||||||
@@: dec [_buf_len]
|
@@: dec [_buf_len]
|
||||||
jz @f
|
jz @f
|
||||||
stdcall libini._.get_char, [_f_addr]
|
stdcall libini._.get_char, [_f_addr]
|
||||||
cmp al, 13
|
cmp al, 13
|
||||||
je @f
|
je @f
|
||||||
cmp al, 10
|
cmp al, 10
|
||||||
je @f
|
je @f
|
||||||
stosb
|
stosb
|
||||||
or al, al
|
or al, al
|
||||||
jnz @b
|
jnz @b
|
||||||
@@: stdcall libini._.unget_char, [_f_addr]
|
@@: stdcall libini._.unget_char, [_f_addr]
|
||||||
mov byte[edi], 0
|
mov byte[edi], 0
|
||||||
dec edi
|
dec edi
|
||||||
@@: cmp edi, [_buffer]
|
@@: cmp edi, [_buffer]
|
||||||
jb @f
|
jb @f
|
||||||
cmp byte[edi], 32
|
cmp byte[edi], 32
|
||||||
ja @f
|
ja @f
|
||||||
mov byte[edi], 0
|
mov byte[edi], 0
|
||||||
dec edi
|
dec edi
|
||||||
jmp @b
|
jmp @b
|
||||||
@@: pop eax edi
|
@@: pop eax edi
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -572,25 +568,25 @@ proc libini._.str_to_int ;//////////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< eax = binary number representation (no overflow checks made) ;;
|
;< eax = binary number representation (no overflow checks made) ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push edx
|
push edx
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
xor edx, edx
|
xor edx, edx
|
||||||
|
|
||||||
@@: lodsb
|
@@: lodsb
|
||||||
cmp al, '0'
|
cmp al, '0'
|
||||||
jb @f
|
jb @f
|
||||||
cmp al, '9'
|
cmp al, '9'
|
||||||
ja @f
|
ja @f
|
||||||
add eax, -'0'
|
add eax, -'0'
|
||||||
imul edx, 10
|
imul edx, 10
|
||||||
add edx, eax
|
add edx, eax
|
||||||
jmp @b
|
jmp @b
|
||||||
|
|
||||||
@@: dec esi
|
@@: dec esi
|
||||||
mov eax, edx
|
mov eax, edx
|
||||||
pop edx
|
pop edx
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -604,29 +600,29 @@ proc libini._.int_to_str ;//////////////////////////////////////////////////////
|
|||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
;< --- TBD --- ;;
|
;< --- TBD --- ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push ecx edx
|
push ecx edx
|
||||||
|
|
||||||
or eax, eax
|
or eax, eax
|
||||||
jns @f
|
jns @f
|
||||||
mov byte[edi], '-'
|
mov byte[edi], '-'
|
||||||
inc edi
|
inc edi
|
||||||
@@: call .recurse
|
@@: call .recurse
|
||||||
pop edx ecx
|
pop edx ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.recurse:
|
.recurse:
|
||||||
cmp eax,ecx
|
cmp eax,ecx
|
||||||
jb @f
|
jb @f
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
div ecx
|
div ecx
|
||||||
push edx
|
push edx
|
||||||
call .recurse
|
call .recurse
|
||||||
pop eax
|
pop eax
|
||||||
@@: cmp al,10
|
@@: cmp al,10
|
||||||
sbb al,0x69
|
sbb al,0x69
|
||||||
das
|
das
|
||||||
stosb
|
stosb
|
||||||
retn
|
retn
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
@@ -639,50 +635,50 @@ proc libini._.ascii_to_scan ;_ascii_code ;//////////////////////////////////////
|
|||||||
;< eax = 0 (error) / scancode (success) ;;
|
;< eax = 0 (error) / scancode (success) ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
; /sys/keymap.key
|
; /sys/keymap.key
|
||||||
sub esp, 256
|
sub esp, 256
|
||||||
mov eax, esp
|
mov eax, esp
|
||||||
push ebx
|
push ebx
|
||||||
push 'key'
|
push 'key'
|
||||||
push 'map.'
|
push 'map.'
|
||||||
push '/key'
|
push '/key'
|
||||||
push '/sys'
|
push '/sys'
|
||||||
push eax ; buffer in the stack
|
push eax ; buffer in the stack
|
||||||
push 0x100 ; read 0x100 bytes
|
push 0x100 ; read 0x100 bytes
|
||||||
push 0
|
push 0
|
||||||
push 0 ; from position zero
|
push 0 ; from position zero
|
||||||
push 0 ; subfunction: read
|
push 0 ; subfunction: read
|
||||||
mov ebx, esp
|
mov ebx, esp
|
||||||
push 70
|
push 70
|
||||||
pop eax
|
pop eax
|
||||||
mcall
|
mcall
|
||||||
add esp, 36
|
add esp, 36
|
||||||
pop ebx
|
pop ebx
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jnz .die
|
jnz .die
|
||||||
mov al, [esp+256+4] ; get ASCII code
|
mov al, [esp+256+4] ; get ASCII code
|
||||||
push edi
|
push edi
|
||||||
; first keytable - no modifiers pressed
|
; first keytable - no modifiers pressed
|
||||||
; check scancodes from 1 to 36h (inclusive)
|
; check scancodes from 1 to 36h (inclusive)
|
||||||
lea edi, [esp+4+1]
|
lea edi, [esp+4+1]
|
||||||
mov edx, edi
|
mov edx, edi
|
||||||
mov ecx, 36h
|
mov ecx, 36h
|
||||||
repnz scasb
|
repnz scasb
|
||||||
jz .found
|
jz .found
|
||||||
; second keytable - Shift pressed
|
; second keytable - Shift pressed
|
||||||
lea edi, [esp+4+128+1]
|
lea edi, [esp+4+128+1]
|
||||||
mov edx, edi
|
mov edx, edi
|
||||||
mov ecx, 36h
|
mov ecx, 36h
|
||||||
repnz scasb
|
repnz scasb
|
||||||
jz .found
|
jz .found
|
||||||
pop edi
|
pop edi
|
||||||
.die:
|
.die:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
jmp .ret
|
jmp .ret
|
||||||
.found:
|
.found:
|
||||||
mov eax, edi
|
mov eax, edi
|
||||||
sub eax, edx
|
sub eax, edx
|
||||||
pop edi
|
pop edi
|
||||||
.ret:
|
.ret:
|
||||||
add esp, 256
|
add esp, 256
|
||||||
ret 4
|
ret 4
|
||||||
endp
|
endp
|
||||||
|
@@ -33,39 +33,38 @@ use_ColorDialog
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
align 16
|
align 16
|
||||||
lib_init:
|
lib_init:
|
||||||
xor eax, eax
|
ret
|
||||||
ret
|
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
align 16
|
align 16
|
||||||
EXPORTS:
|
EXPORTS:
|
||||||
|
|
||||||
|
|
||||||
dd sz_init, lib_init
|
dd sz_init, lib_init
|
||||||
dd sz_version, 0x00000001
|
dd sz_version, 0x00000001
|
||||||
|
|
||||||
dd sz_OpenDialog_init, OpenDialog.init
|
dd sz_OpenDialog_init, OpenDialog.init
|
||||||
dd sz_OpenDialog_start, OpenDialog.start
|
dd sz_OpenDialog_start, OpenDialog.start
|
||||||
dd sz_OpenDialog_set_file_name, OpenDialog.set_file_name
|
dd sz_OpenDialog_set_file_name, OpenDialog.set_file_name
|
||||||
dd sz_OpenDialog_set_file_ext, OpenDialog.set_file_ext
|
dd sz_OpenDialog_set_file_ext, OpenDialog.set_file_ext
|
||||||
dd szVersion_OpenDialog, 0x00010001
|
dd szVersion_OpenDialog, 0x00010001
|
||||||
|
|
||||||
dd sz_ColorDialog_init, ColorDialog.init
|
dd sz_ColorDialog_init, ColorDialog.init
|
||||||
dd sz_ColorDialog_start, ColorDialog.start
|
dd sz_ColorDialog_start, ColorDialog.start
|
||||||
dd szVersion_ColorDialog, 0x00010001
|
dd szVersion_ColorDialog, 0x00010001
|
||||||
|
|
||||||
dd 0,0
|
dd 0,0
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
sz_init db 'lib_init',0
|
sz_init db 'lib_init',0
|
||||||
sz_version db 'version',0
|
sz_version db 'version',0
|
||||||
|
|
||||||
sz_OpenDialog_init db 'OpenDialog_init',0
|
sz_OpenDialog_init db 'OpenDialog_init',0
|
||||||
sz_OpenDialog_start db 'OpenDialog_start',0
|
sz_OpenDialog_start db 'OpenDialog_start',0
|
||||||
sz_OpenDialog_set_file_name db 'OpenDialog_set_file_name',0
|
sz_OpenDialog_set_file_name db 'OpenDialog_set_file_name',0
|
||||||
sz_OpenDialog_set_file_ext db 'OpenDialog_set_file_ext',0
|
sz_OpenDialog_set_file_ext db 'OpenDialog_set_file_ext',0
|
||||||
szVersion_OpenDialog db 'Version_OpenDialog',0
|
szVersion_OpenDialog db 'Version_OpenDialog',0
|
||||||
|
|
||||||
sz_ColorDialog_init db 'ColorDialog_init',0
|
sz_ColorDialog_init db 'ColorDialog_init',0
|
||||||
sz_ColorDialog_start db 'ColorDialog_start',0
|
sz_ColorDialog_start db 'ColorDialog_start',0
|
||||||
szVersion_ColorDialog db 'Version_ColorDialog',0
|
szVersion_ColorDialog db 'Version_ColorDialog',0
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user