Subversion Repositories Kolibri OS

Rev

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

Rev 8592 Rev 8593
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2016. 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: 8592 $
8
$Revision: 8593 $
Line 9... Line 9...
9
 
9
 
Line 80... Line 80...
80
; ebx -> absolute file path
80
; ebx -> absolute file path
81
; eax = string length
81
; eax = string length
82
    locals
82
    locals
83
        cmdline         rd  1
83
        cmdline         rd  1
84
        flags           rd  1
84
        flags           rd  1
85
        slot            rd  1  ; number of new thread slot
85
        slot            rd  1  ; index of new thread slot
86
        slot_base       rd  1  ; base address of it
86
        slot_base       rd  1  ; base address of it
87
; app header data
87
; app header data
88
        hdr_cmdline     rd  1
88
        hdr_cmdline     rd  1
89
        hdr_path        rd  1
89
        hdr_path        rd  1
90
        hdr_eip         rd  1
90
        hdr_eip         rd  1
Line 110... Line 110...
110
        jz      .err_file
110
        jz      .err_file
Line 111... Line 111...
111
 
111
 
112
        mov     [file_base], eax
112
        mov     [file_base], eax
113
        mov     [file_size], ebx
113
        mov     [file_size], ebx
114
        lea     ebx, [hdr_cmdline]
114
        lea     ebx, [hdr_cmdline]
115
        call    test_app_header  ; fill our app header data locals with values from given application header (if its correct)
115
        call    test_app_header  ; fill our app header data locals with values from header of given program (if its correct)
116
        mov     esi, -0x1F
116
        mov     esi, -0x1F
117
        test    eax, eax
117
        test    eax, eax
Line 118... Line 118...
118
        jz      .err_hdr
118
        jz      .err_hdr
Line 844... Line 844...
844
        mov     ecx, 1022
844
        mov     ecx, 1022
845
@@:
845
@@:
846
        push    esi
846
        push    esi
847
        test    edi, edi
847
        test    edi, edi
848
        jz      @f
848
        jz      @f
-
 
849
        stdcall is_region_userspace, edi, [ebp+APP_HDR.filename_size]
-
 
850
        jz      @f
849
        mov     al, '/'
851
        mov     al, '/'
850
        stosb
852
        stosb
851
        rep movsb
853
        rep movsb
852
        mov     byte [edi], 0
854
        mov     byte [edi], 0
853
@@:
855
@@:
Line 869... Line 871...
869
        mov     [APP_HEADER_00_.i_param], edi
871
        mov     [APP_HEADER_00_.i_param], edi
870
        jmp     .copy_cmdline
872
        jmp     .copy_cmdline
871
@@:
873
@@:
872
        mov     [APP_HEADER_01_.i_param], edi
874
        mov     [APP_HEADER_01_.i_param], edi
873
.copy_cmdline:
875
.copy_cmdline:
-
 
876
        inc     ecx  ; keep in mind about 0 in the end
-
 
877
        stdcall is_region_userspace, edi, ecx
-
 
878
        jz      .check_tls_header
-
 
879
        dec     ecx
874
        rep movsb
880
        rep movsb
875
        mov     byte [edi], 0
881
        mov     byte [edi], 0
876
.check_tls_header:
882
.check_tls_header:
877
        cmp     word [6], '02'
883
        cmp     word [6], '02'
878
        jne     .cleanup
884
        jne     .cleanup