Subversion Repositories Kolibri OS

Rev

Rev 840 | Rev 886 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 840 Rev 864
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 840 $
8
$Revision: 864 $
9
 
9
 
Line 583... Line 583...
583
	   lea eax, [attr]
583
	   lea eax, [attr]
584
	   stdcall get_fileinfo, [file_name], eax
584
	   stdcall get_fileinfo, [file_name], eax
585
	   test eax, eax
585
	   test eax, eax
586
	   jnz .fail
586
	   jnz .fail
Line 587... Line 587...
587
 
587
 
588
	   mov eax, [file_size]
588
           mov ecx, [file_size]
589
	   cmp eax, 1024*1024*16
589
           cmp ecx, 1024*1024*16
Line -... Line 590...
-
 
590
	   ja .fail
590
	   ja .fail
591
 
591
 
592
           mov edx, PG_SW
-
 
593
           call @mem_alloc@8
-
 
594
	   mov [file], eax
Line 592... Line 595...
592
	   stdcall kernel_alloc, [file_size]
595
           test eax, eax
593
	   mov [file], eax
596
           jz .fail
594
 
597
 
Line 595... Line 598...
595
	   stdcall read_file, [file_name], eax, dword 0, [file_size]
598
	   stdcall read_file, [file_name], eax, dword 0, [file_size]
596
	   cmp ebx, [file_size]
599
	   cmp ebx, [file_size]
597
	   jne .cleanup
600
	   jne .cleanup
598
 
-
 
599
	   mov eax, [file]
-
 
600
	   cmp dword [eax], 0x4B43504B
-
 
Line -... Line 601...
-
 
601
 
-
 
602
	   mov eax, [file]
-
 
603
	   cmp dword [eax], 0x4B43504B
-
 
604
	   jne .exit
601
	   jne .exit
605
 
602
	   mov ebx, [eax+4]
606
           mov ecx, [eax+4]
Line 603... Line 607...
603
	   mov [file_size], ebx
607
           mov [file_size], ecx
604
	   stdcall kernel_alloc, ebx
608
           mov edx, PG_SW
Line 822... Line 826...
822
	   test eax, eax
826
	   test eax, eax
823
	   jz .exit
827
	   jz .exit
Line 824... Line 828...
824
 
828
 
Line 825... Line 829...
825
	   mov [coff], eax
829
	   mov [coff], eax
826
 
-
 
827
	   movzx ecx, [eax+CFH.nSections]
-
 
828
	   xor ebx, ebx
830
 
-
 
831
           movzx ebx, [eax+CFH.nSections]
829
 
832
	   lea edx, [eax+20]
830
	   lea edx, [eax+20]
833
           xor ecx, ecx
831
@@:
834
@@:
832
	   add ebx, [edx+CFS.SizeOfRawData]
835
           add ecx, [edx+CFS.SizeOfRawData]
833
	   add ebx, 15
836
           add ecx, 15
834
	   and ebx, not 15
837
           and ecx, not 15
835
	   add edx, COFF_SECTION_SIZE
838
	   add edx, COFF_SECTION_SIZE
836
	   dec ecx
-
 
Line -... Line 839...
-
 
839
           dec ebx
-
 
840
	   jnz @B
837
	   jnz @B
841
 
838
	   mov [img_size], ebx
842
           mov [img_size], ecx
839
 
843
           mov edx, PG_SW
840
	   stdcall kernel_alloc, ebx
844
           call @mem_alloc@8
Line 841... Line 845...
841
	   test eax, eax
845
	   test eax, eax