Rev 1322 | Rev 1369 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1322 | Rev 1329 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. 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: 1322 $ |
8 | $Revision: 1329 $ |
Line 9... | Line 9... | ||
9 | 9 | ||
Line 629... | Line 629... | ||
629 | pop ebx |
629 | pop ebx |
630 | ret |
630 | ret |
Line 631... | Line 631... | ||
631 | 631 | ||
632 | check_region: |
632 | check_region: |
633 | ;input: |
633 | ;input: |
634 | ; ebx - start of buffer |
634 | ; esi - start of buffer |
635 | ; ecx - size of buffer |
635 | ; edx - size of buffer |
636 | ;result: |
636 | ;result: |
637 | ; eax = 1 region lays in app memory |
637 | ; eax = 1 region lays in app memory |
638 | ; eax = 0 region don't lays in app memory |
638 | ; eax = 0 region don't lays in app memory |
639 | mov eax,[CURRENT_TASK] |
639 | mov eax,[CURRENT_TASK] |
640 | jmp check_process_region |
640 | ; jmp check_process_region |
641 | ;----------------------------------------------------------------------------- |
641 | ;----------------------------------------------------------------------------- |
642 | check_process_region: |
642 | ;check_process_region: |
643 | ;input: |
643 | ;input: |
644 | ; eax - slot |
644 | ; eax - slot |
645 | ; ebx - start of buffer |
645 | ; esi - start of buffer |
646 | ; ecx - size of buffer |
646 | ; edx - size of buffer |
647 | ;result: |
647 | ;result: |
648 | ; eax = 1 region lays in app memory |
648 | ; eax = 1 region lays in app memory |
Line 649... | Line 649... | ||
649 | ; eax = 0 region don't lays in app memory |
649 | ; eax = 0 region don't lays in app memory |
650 | 650 | ||
651 | test ecx,ecx |
651 | test edx,edx |
652 | jle .ok |
652 | jle .ok |
653 | shl eax,5 |
653 | shl eax,5 |
654 | cmp word [CURRENT_TASK+eax+0xa],0 |
654 | cmp word [CURRENT_TASK+eax+0xa],0 |
Line 714... | Line 714... | ||
714 | 714 | ||
715 | align 4 |
715 | align 4 |
716 | proc read_process_memory |
716 | proc read_process_memory |
717 | ;Input: |
717 | ;Input: |
718 | ; eax - process slot |
718 | ; eax - process slot |
719 | ; ebx - buffer address |
719 | ; ecx - buffer address |
720 | ; ecx - buffer size |
720 | ; edx - buffer size |
721 | ; edx - start address in other process |
721 | ; esi - start address in other process |
722 | ;Output: |
722 | ;Output: |
723 | ; eax - number of bytes read. |
723 | ; eax - number of bytes read. |
724 | locals |
724 | locals |
725 | slot dd ? |
725 | slot dd ? |
Line 728... | Line 728... | ||
728 | offset dd ? |
728 | offset dd ? |
729 | tmp_r_cnt dd ? |
729 | tmp_r_cnt dd ? |
730 | endl |
730 | endl |
Line 731... | Line 731... | ||
731 | 731 | ||
732 | mov [slot], eax |
732 | mov [slot], eax |
733 | mov [buff], ebx |
733 | mov [buff], ecx |
734 | and [r_count], 0 |
734 | and [r_count], 0 |
735 | mov [tmp_r_cnt], ecx |
735 | mov [tmp_r_cnt], edx |
Line 736... | Line 736... | ||
736 | mov [offset], edx |
736 | mov [offset], esi |
737 | 737 | ||
738 | pushad |
738 | pushad |
739 | .read_mem: |
739 | .read_mem: |
Line 784... | Line 784... | ||
784 | 784 | ||
785 | align 4 |
785 | align 4 |
786 | proc write_process_memory |
786 | proc write_process_memory |
787 | ;Input: |
787 | ;Input: |
788 | ; eax - process slot |
788 | ; eax - process slot |
789 | ; ebx - buffer address |
789 | ; ecx - buffer address |
790 | ; ecx - buffer size |
790 | ; edx - buffer size |
791 | ; edx - start address in other process |
791 | ; esi - start address in other process |
792 | ;Output: |
792 | ;Output: |
Line 793... | Line 793... | ||
793 | ; eax - number of bytes written |
793 | ; eax - number of bytes written |
794 | 794 | ||
Line 799... | Line 799... | ||
799 | offset dd ? |
799 | offset dd ? |
800 | tmp_w_cnt dd ? |
800 | tmp_w_cnt dd ? |
801 | endl |
801 | endl |
Line 802... | Line 802... | ||
802 | 802 | ||
803 | mov [slot], eax |
803 | mov [slot], eax |
804 | mov [buff], ebx |
804 | mov [buff], ecx |
805 | and [w_count], 0 |
805 | and [w_count], 0 |
806 | mov [tmp_w_cnt], ecx |
806 | mov [tmp_w_cnt], edx |
Line 807... | Line 807... | ||
807 | mov [offset], edx |
807 | mov [offset], esi |
808 | 808 | ||
809 | pushad |
809 | pushad |
810 | .read_mem: |
810 | .read_mem: |