Rev 3520 | Rev 3786 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3520 | Rev 3761 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. 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: 3520 $ |
8 | $Revision: 3761 $ |
9 | 9 | ||
Line 513... | Line 513... | ||
513 | align 4 |
513 | align 4 |
514 | unpack_mutex MUTEX |
514 | unpack_mutex MUTEX |
515 | endg |
515 | endg |
Line 516... | Line 516... | ||
516 | 516 | ||
517 | align 4 |
517 | align 4 |
518 | proc get_proc_ex stdcall, proc_name:dword, imports:dword |
- | |
519 | - | ||
520 | .look_up: |
518 | proc get_proc_ex stdcall uses ebx esi, proc_name:dword, imports:dword |
521 | mov edx, [imports] |
- | |
522 | test edx, edx |
- | |
523 | jz .end |
- | |
524 | mov edx, [edx] |
519 | mov ebx, [imports] |
525 | test edx, edx |
520 | test ebx, ebx |
526 | jz .end |
- | |
527 | .next: |
521 | jz .end |
528 | mov eax, [edx] |
- | |
529 | test eax, eax |
522 | xor esi, esi |
Line -... | Line 523... | ||
- | 523 | .look_up: |
|
- | 524 | ||
530 | jz .next_table |
525 | mov eax, [ebx+32] |
531 | 526 | mov eax, [OS_BASE+eax+esi*4] |
|
532 | push edx |
- | |
533 | stdcall strncmp, eax, [proc_name], 256 |
527 | add eax, OS_BASE |
534 | pop edx |
528 | stdcall strncmp, eax, [proc_name], 256 |
Line 535... | Line 529... | ||
535 | test eax, eax |
529 | test eax, eax |
536 | jz .ok |
530 | jz .ok |
537 | - | ||
538 | add edx, 8 |
- | |
539 | jmp .next |
531 | |
540 | .next_table: |
- | |
541 | add [imports], 4 |
- | |
542 | jmp .look_up |
- | |
543 | .ok: |
532 | inc esi |
544 | mov eax, [edx+4] |
533 | cmp esi, [ebx+24] |
545 | ret |
534 | jb .look_up |
- | 535 | .end: |
|
- | 536 | xor eax, eax |
|
- | 537 | ret |
|
- | 538 | .ok: |
|
- | 539 | mov eax, [ebx+28] |
|
546 | .end: |
540 | mov eax, [OS_BASE+eax+esi*4] |
Line 547... | Line 541... | ||
547 | xor eax, eax |
541 | add eax, OS_BASE |
548 | ret |
542 | ret |
549 | endp |
543 | endp |
Line 711... | Line 705... | ||
711 | strings dd ? |
705 | strings dd ? |
712 | img_size dd ? |
706 | img_size dd ? |
713 | img_base dd ? |
707 | img_base dd ? |
714 | start dd ? |
708 | start dd ? |
Line 715... | Line -... | ||
715 | - | ||
716 | exports dd ? ;fake exports table |
- | |
717 | dd ? |
709 | |
718 | file_name rb 13+16+4+1 ; '/sys/drivers/ |
710 | file_name rb 13+16+4+1 ; '/sys/drivers/ |
Line 719... | Line 711... | ||
719 | endl |
711 | endl |
720 | 712 | ||
Line 801... | Line 793... | ||
801 | add ecx, ecx |
793 | add ecx, ecx |
802 | lea ecx, [ecx+ecx*8];ecx*=18 = nSymbols*CSYM_SIZE |
794 | lea ecx, [ecx+ecx*8];ecx*=18 = nSymbols*CSYM_SIZE |
803 | add ecx, [sym] |
795 | add ecx, [sym] |
804 | mov [strings], ecx |
796 | mov [strings], ecx |
Line 805... | Line -... | ||
805 | - | ||
806 | lea ebx, [exports] |
- | |
807 | mov dword [ebx], kernel_export |
- | |
808 | mov dword [ebx+4], 0 |
797 | |
Line 809... | Line 798... | ||
809 | lea eax, [edx+20] |
798 | lea eax, [edx+20] |
810 | 799 | ||
811 | stdcall fix_coff_symbols, eax, [sym], [edx+COFF_HEADER.nSymbols], \ |
800 | stdcall fix_coff_symbols, eax, [sym], [edx+COFF_HEADER.nSymbols], \ |
812 | [strings], ebx |
801 | [strings], __exports |
Line 813... | Line 802... | ||
813 | test eax, eax |
802 | test eax, eax |
814 | jz .link_fail |
803 | jz .link_fail |