mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-16 20:02:35 +03:00
541 lines
16 KiB
NASM
541 lines
16 KiB
NASM
|
; Copyright (c) 2009, <Lrz>
|
|||
|
; All rights reserved.
|
|||
|
;
|
|||
|
; Redistribution and use in source and binary forms, with or without
|
|||
|
; modification, are permitted provided that the following conditions are met:
|
|||
|
; * Redistributions of source code must retain the above copyright
|
|||
|
; notice, this list of conditions and the following disclaimer.
|
|||
|
; * Redistributions in binary form must reproduce the above copyright
|
|||
|
; notice, this list of conditions and the following disclaimer in the
|
|||
|
; documentation and/or other materials provided with the distribution.
|
|||
|
; * Neither the name of the <organization> nor the
|
|||
|
; names of its contributors may be used to endorse or promote products
|
|||
|
; derived from this software without specific prior written permission.
|
|||
|
;
|
|||
|
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
|
|||
|
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|||
|
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|||
|
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
|||
|
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|||
|
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|||
|
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|||
|
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
|
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|||
|
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
;*****************************************************************************
|
|||
|
|
|||
|
;Fonts library
|
|||
|
;
|
|||
|
;;;;;;;;;;;;;;;;;;
|
|||
|
|
|||
|
format MS COFF
|
|||
|
|
|||
|
public EXPORTS
|
|||
|
|
|||
|
section '.flat' code readable align 16
|
|||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|||
|
;Get info about
|
|||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|||
|
include '../../../../macros.inc'
|
|||
|
align 4
|
|||
|
initialization_font:
|
|||
|
; esp+0 = dd back
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
pushad
|
|||
|
xor eax,eax
|
|||
|
inc eax
|
|||
|
mov [number_function],eax
|
|||
|
;structure is completed
|
|||
|
mov eax,70
|
|||
|
mov ebx,dword struct_f_info
|
|||
|
mcall
|
|||
|
;IF ERROR FT then exit
|
|||
|
test eax,eax
|
|||
|
jnz .exit
|
|||
|
;IF ERROR folder is not found then exit
|
|||
|
test ebx,ebx
|
|||
|
mov eax,ebx
|
|||
|
jnz .exit
|
|||
|
|
|||
|
;Get quantity files
|
|||
|
mov eax,[buffer_32.quantity_files]
|
|||
|
imul eax,304
|
|||
|
add eax,32 ; ??
|
|||
|
push eax ;save eax <20> eax <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;init memory
|
|||
|
mov eax,68
|
|||
|
mov ebx,11
|
|||
|
mcall
|
|||
|
test eax,eax
|
|||
|
jz .exit
|
|||
|
inc ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> ecx <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
pop ecx
|
|||
|
mov eax,68
|
|||
|
mcall
|
|||
|
mov dword [fulder_array_point],eax ;save point for memory's fulder
|
|||
|
;<3B> eax <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
mov [buffer_read_d],eax ;point to new array
|
|||
|
mov eax,[buffer_32.quantity_files]
|
|||
|
mov [read_block],eax
|
|||
|
;get in buffer info of files and sub dir current dir
|
|||
|
mov eax,70
|
|||
|
mov ebx,dword struct_f_info
|
|||
|
mcall
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
mov ebp, dword [buffer_read_d] ;point to structure
|
|||
|
mov ecx, dword [ebp+4] ;<3B><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
mov dword [save_ecx],ecx
|
|||
|
add ebp, 32 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
mov dword [save_ebp],ebp
|
|||
|
; mov dword [save_point_nt],ebp
|
|||
|
cld ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
align 4
|
|||
|
.start_loop:
|
|||
|
push ecx
|
|||
|
lea edi,[ebp+0x28] ;<3B> edi <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
xor eax,eax
|
|||
|
mov ecx,263
|
|||
|
align 4
|
|||
|
.again: mov al,byte[edi]
|
|||
|
test al,al
|
|||
|
jz .next_a
|
|||
|
dec ecx
|
|||
|
inc edi
|
|||
|
jnz .again
|
|||
|
jmp @f
|
|||
|
; repe scasb ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; jnz @f
|
|||
|
;;;; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> fnt )
|
|||
|
; sub edi,6 ;.ksf,0
|
|||
|
;;;;;;;;;;;;;;;;;;;;;;;
|
|||
|
.next_a:
|
|||
|
sub edi,4 ;.ksf,0
|
|||
|
mov esi,dword name_font
|
|||
|
mov ecx,name_font_e-name_font
|
|||
|
repe cmpsb
|
|||
|
jnz @f
|
|||
|
;;;;;;;; <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ))
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
call alloc_mem ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov eax,dword [alloc_memory_point]
|
|||
|
lea edi,dword [eax+4]
|
|||
|
lea esi,[name_fulder]
|
|||
|
mov ecx,name_fuld_end
|
|||
|
rep movsb ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
mov al,'/'
|
|||
|
stosb
|
|||
|
lea esi,[ebp+0x28] ;<3B> esi <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
align 4
|
|||
|
.loop_b:
|
|||
|
lodsb
|
|||
|
stosb
|
|||
|
test al,al
|
|||
|
jnz .loop_b
|
|||
|
|
|||
|
; mov edi,name_of_file ; [ebp+0x28] ;<3B> edi <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
;get in buffer info above own file
|
|||
|
xor eax,eax
|
|||
|
mov dword [number_function],eax
|
|||
|
mov dword [index_start_block],eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dword [flags_],eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dword [read_block],8 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 8 <20><><EFBFBD><EFBFBD>
|
|||
|
mov dword [buffer_read_d],file_buffer ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
mov eax,dword [alloc_memory_point]
|
|||
|
lea edi,dword [eax+4]
|
|||
|
mov dword [offset_to_string],edi
|
|||
|
|
|||
|
mov eax,70
|
|||
|
mov ebx,dword struct_f_info
|
|||
|
mcall
|
|||
|
;;;;;;;;;;;;;;;; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov eax,ebx
|
|||
|
mov eax,dword [file_buffer]
|
|||
|
mov ebx,dword [type_fnt]
|
|||
|
cmp eax,ebx
|
|||
|
jnz @f
|
|||
|
|
|||
|
;;;;;;; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
mov dword [save_point_nt],ebp
|
|||
|
; mov esi, ebp
|
|||
|
; mov ecx,304/4
|
|||
|
|
|||
|
|
|||
|
|
|||
|
;align 4
|
|||
|
;.transfer:
|
|||
|
; lodsd
|
|||
|
; stosd
|
|||
|
; loop .transfer
|
|||
|
; add dword [save_point_nt],304 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
;;; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
pop ecx
|
|||
|
mov dword [esp+28],0
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
|
|||
|
align 4
|
|||
|
@@: pop ecx
|
|||
|
add ebp,304
|
|||
|
dec ecx
|
|||
|
jnz .start_loop
|
|||
|
; loop .start_loop
|
|||
|
; xor eax,eax
|
|||
|
;;;;;;;; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
|
|||
|
align 4
|
|||
|
.exit: mov dword [esp+28],eax
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
|
|||
|
align 4
|
|||
|
get_font:
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>c<EFBFBD><63><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; esp+4 = dd width font shl 16 +hight font
|
|||
|
; esp+0 = dd back
|
|||
|
pop eax
|
|||
|
pop dword [font_x_y]
|
|||
|
push eax
|
|||
|
; pop eax
|
|||
|
; mov dword [font_x_y],eax
|
|||
|
pushad
|
|||
|
|
|||
|
|
|||
|
|
|||
|
xor eax,eax
|
|||
|
mov dword [number_function],eax
|
|||
|
mov dword [index_start_block],eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dword [flags_],eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dword [read_block],8 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 8 <20><><EFBFBD><EFBFBD>
|
|||
|
mov dword [buffer_read_d],file_buffer ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
mov eax,dword [alloc_memory_point]
|
|||
|
lea edi,dword [eax+4]
|
|||
|
mov dword [offset_to_string],edi
|
|||
|
|
|||
|
|
|||
|
; mov ecx,dword [save_ecx] ; <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
align 4
|
|||
|
;.start_check:
|
|||
|
; push ecx
|
|||
|
mov eax,70
|
|||
|
mov ebx,dword struct_f_info
|
|||
|
mcall
|
|||
|
;;;;;;;;;;;;;;;; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov eax,ebx
|
|||
|
mov eax,dword [file_buffer]
|
|||
|
mov ebx,dword [type_fnt]
|
|||
|
cmp eax,ebx
|
|||
|
; jnz @f
|
|||
|
|
|||
|
|
|||
|
; xor eax,eax
|
|||
|
; mov dword [number_function],eax
|
|||
|
; add eax,8
|
|||
|
; mov dword [read_block],eax
|
|||
|
; mov dword [buffer_read_d],file_buffer
|
|||
|
; mov ebx,dword struct_f_info
|
|||
|
; mov eax,70
|
|||
|
;align 4
|
|||
|
;.start_check:
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
; lea edi, [ebp+0x28] ;<3B> edi <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
; mov dword [offset_to_string],edi
|
|||
|
;get in buffer info above own file
|
|||
|
; mcall
|
|||
|
;;;;;;;;;;;;;;;; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; mov ecx,dword [file_buffer.type_fnt]
|
|||
|
; mov edx,dword [type_fnt]
|
|||
|
; cmp ecx,edx
|
|||
|
; jnz @f
|
|||
|
|
|||
|
mov ecx,dword [file_buffer.font_size]
|
|||
|
mov edx,dword [font_x_y]
|
|||
|
cmp ecx,edx
|
|||
|
; jnz @f ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD> <20><><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>
|
|||
|
|
|||
|
; mov ebp,dword [save_point_nt]
|
|||
|
mov ecx, 4096;dword [ebp+32] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> 4294967296 <20><><EFBFBD><EFBFBD> <20>.<2E>. 4 <20><>
|
|||
|
|
|||
|
mov dword [read_block],ecx
|
|||
|
mov eax,68
|
|||
|
mov ebx,12
|
|||
|
mcall
|
|||
|
|
|||
|
mov dword [font_array_point],eax ;save point to array
|
|||
|
mov dword [buffer_read_d],eax
|
|||
|
|
|||
|
;load font
|
|||
|
mov ebx,dword struct_f_info
|
|||
|
mov eax,70
|
|||
|
mcall
|
|||
|
test eax,eax
|
|||
|
jnz @f
|
|||
|
|
|||
|
lea eax,[buffer_read_d]
|
|||
|
mov eax,dword [eax]
|
|||
|
mov ebx,dword [eax+8]
|
|||
|
add eax,ebx
|
|||
|
; add eax,dword [eax+8]
|
|||
|
; add eax,dword [buffer_read_d]
|
|||
|
mov dword [font_array_data],eax
|
|||
|
mov dword [esp+28],0
|
|||
|
; pop ecx
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
;here error file system
|
|||
|
align 4
|
|||
|
@@:
|
|||
|
; pop ecx
|
|||
|
; add ebp,304
|
|||
|
; dec ecx
|
|||
|
; jnz .start_check
|
|||
|
|
|||
|
or dword [esp+28],-1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; esp+12= dd x shl 16 + y x- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>, y - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Y
|
|||
|
; esp+8 = dd point to color of background and font
|
|||
|
; esp+4 = dd point to ASCIIZ
|
|||
|
; esp+0 = dd back
|
|||
|
align 4
|
|||
|
font_draw_on_string:
|
|||
|
pushad
|
|||
|
|
|||
|
mov esi,dword [esp+4+32] ;ASCIIZ
|
|||
|
mov edx,dword [esp+12+32] ; x shl 16 +y
|
|||
|
mov ecx,dword [font_x_y] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> x shl 16 +y
|
|||
|
mov edi,dword [esp+8+32] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
|||
|
xor ebp,ebp ;<3B><> 65 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ))
|
|||
|
|
|||
|
;;;;;;;;;;;;;;;;;;;;;
|
|||
|
; pushad
|
|||
|
; mov ebp, dword [esp+4+32+32]
|
|||
|
; mov ebp, dword [save_point_nt]
|
|||
|
; lea edi, [ebp+0x28] ;<3B> edi <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
; sub edi,4 ;.ksf,0
|
|||
|
; mov eax,4
|
|||
|
; mov ebx,dword [show_dir]
|
|||
|
; add dword [show_dir],10
|
|||
|
; mov ecx,0x80000000;DDBBCC
|
|||
|
; mov edx,ebp;[ebp+0x28];eax;edi
|
|||
|
; xor esi,esi
|
|||
|
;mov esi,8
|
|||
|
; mcall
|
|||
|
; popad
|
|||
|
;;;;;;;;;;;;;;;;;;;;;;;;
|
|||
|
|
|||
|
cld
|
|||
|
align 4
|
|||
|
@@: ;pushad
|
|||
|
xor eax,eax
|
|||
|
lodsb
|
|||
|
test al,al
|
|||
|
jz .exit
|
|||
|
; movzx eax,al
|
|||
|
shl eax,4 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 16 <20>.<2E>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; imul eax,16
|
|||
|
|
|||
|
mov ebx,dword [font_array_data] ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; add eax,ebx
|
|||
|
; mov ebx,dword [ebx+8] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; add eax,ebx
|
|||
|
add ebx,eax
|
|||
|
push esi
|
|||
|
mov esi,1
|
|||
|
mov eax,65
|
|||
|
mcall
|
|||
|
pop esi
|
|||
|
add edx,8 shl 16 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = 8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
jmp @b
|
|||
|
align 4
|
|||
|
.exit: ;popad
|
|||
|
|
|||
|
; add edx,16
|
|||
|
; loop .next
|
|||
|
|
|||
|
align 4
|
|||
|
.return:
|
|||
|
popad
|
|||
|
ret 12
|
|||
|
|
|||
|
|
|||
|
align 4
|
|||
|
; esp+4 = dd point to color of background and font
|
|||
|
show_all_glif:
|
|||
|
pushad
|
|||
|
|
|||
|
mov edx,10 shl 16+20 ;dword [esp+12+32] ; x shl 16 +y
|
|||
|
mov ecx,128 shl 16 +256;dword [font_x_y] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> x shl 16 +y
|
|||
|
mov edi,dword [esp+4+32] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
|||
|
xor ebp,ebp ;<3B><> 65 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ))
|
|||
|
|
|||
|
align 4
|
|||
|
@@:
|
|||
|
mov ebx,dword [font_array_data] ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov esi,1
|
|||
|
mov eax,65
|
|||
|
mcall
|
|||
|
|
|||
|
popad
|
|||
|
ret 4
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
align 4
|
|||
|
free_fulder_info:
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
pushad
|
|||
|
mov ecx, dword [fulder_array_point]
|
|||
|
mov eax,68
|
|||
|
mov ebx,13
|
|||
|
mcall
|
|||
|
test eax,eax
|
|||
|
jnz @f
|
|||
|
or dword [esp+28],-1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
align 4
|
|||
|
@@:
|
|||
|
popad
|
|||
|
ret
|
|||
|
align 4
|
|||
|
free_font:
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
pushad
|
|||
|
mov ecx, dword [font_array_point]
|
|||
|
mov eax,68
|
|||
|
mov ebx,13
|
|||
|
mcall
|
|||
|
test eax,eax
|
|||
|
jnz @f
|
|||
|
or dword [esp+28],-1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
align 4
|
|||
|
@@:
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
align 4
|
|||
|
; alloc mem get 4 Kb for own data
|
|||
|
alloc_mem:
|
|||
|
pushad
|
|||
|
mov eax, dword [alloc_memory_point]
|
|||
|
test eax,eax
|
|||
|
jnz .mem_allocating
|
|||
|
mov eax,68
|
|||
|
mov ebx,12
|
|||
|
mov ecx,4096
|
|||
|
mcall
|
|||
|
mov dword [alloc_memory_point],eax ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 <20><> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dword [eax],-1
|
|||
|
popad
|
|||
|
ret
|
|||
|
align 4
|
|||
|
.mem_allocating:
|
|||
|
mov ebp, dword [eax]
|
|||
|
mov eax,ebp
|
|||
|
cmp eax, -1
|
|||
|
jnz .mem_allocating
|
|||
|
|
|||
|
mov eax,68
|
|||
|
mov ebx,12
|
|||
|
mov ecx,4096
|
|||
|
mcall
|
|||
|
mov dword [ebp],eax ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 <20><> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dword [ebp],-1
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
align 16
|
|||
|
EXPORTS:
|
|||
|
|
|||
|
dd sz_initialization_font, initialization_font
|
|||
|
dd sz_get_font, get_font
|
|||
|
dd sz_free_fulder_info, free_fulder_info
|
|||
|
dd sz_free_font, free_font
|
|||
|
dd sz_font_draw_on_string, font_draw_on_string
|
|||
|
dd sz_show_all_glif, show_all_glif
|
|||
|
; dd szVersion_ch, 0x00000001
|
|||
|
; dd sz_option_box_draw, option_box_draw
|
|||
|
; dd sz_option_box_mouse, option_box_mouse
|
|||
|
dd szVersion_fn, 0x00000001
|
|||
|
dd 0,0
|
|||
|
|
|||
|
sz_initialization_font db 'initialization_font',0
|
|||
|
sz_get_font db 'get_font',0
|
|||
|
sz_free_fulder_info db 'free_fulder_info',0
|
|||
|
sz_free_font db 'free_font',0
|
|||
|
sz_font_draw_on_string db 'font_draw_on_string',0
|
|||
|
sz_show_all_glif db 'show_all_glif',0
|
|||
|
;sz_check_box_mouse db 'check_box_mouse',0
|
|||
|
;szVersion_ch db 'version_ch',0
|
|||
|
;sz_option_box_draw db 'option_box_draw',0
|
|||
|
;sz_option_box_mouse db 'option_box_mouse',0
|
|||
|
szVersion_fn db 'version_fn',0
|
|||
|
|
|||
|
;;;;;;;;;;;
|
|||
|
;;Data
|
|||
|
;;;;;;;;;;;
|
|||
|
align 4
|
|||
|
;buffer_font file 'font_8x16.fon' ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> raw <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1bpp
|
|||
|
save_ecx dd 0x0
|
|||
|
;buffer_font file 'font01.ksf' ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> raw <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1bpp
|
|||
|
alloc_memory_point dd 0x0 ; point to mem block in RAM 4096-4
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 4096-4, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> dd -1
|
|||
|
font_x_y dd 0x0
|
|||
|
fulder_array_point dd 0x0
|
|||
|
font_array_point dd 0x0
|
|||
|
font_array_data dd 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
save_ebp dd 0x0
|
|||
|
save_point_nt dd 0x0
|
|||
|
;name_of_file db 263 dup(0x0)
|
|||
|
;name_of_file db '/sys/FONTS/font01.ksf',0
|
|||
|
name_fulder db '/sys/FONTS',0
|
|||
|
name_fuld_end= ($-name_fulder) -1
|
|||
|
name_font db '.ksf'
|
|||
|
name_font_e:
|
|||
|
type_fnt db 'kf01'
|
|||
|
type_fnt_e:
|
|||
|
|
|||
|
|
|||
|
|
|||
|
align 16
|
|||
|
struct_f_info:
|
|||
|
number_function dd 0x0
|
|||
|
index_start_block dd 0x0
|
|||
|
flags_ dd 0x0
|
|||
|
read_block dd 0x0
|
|||
|
buffer_read_d dd buffer_32
|
|||
|
free_byte db 0x0
|
|||
|
offset_to_string dd name_fulder
|
|||
|
|
|||
|
align 16
|
|||
|
file_buffer:
|
|||
|
.type_fnt dd 0x0
|
|||
|
.font_size dd 0x0
|
|||
|
|
|||
|
align 16
|
|||
|
buffer_32:
|
|||
|
.head dd ?
|
|||
|
.quantity_block dd ?
|
|||
|
.quantity_files dd ?
|
|||
|
rb 20
|