Rev 9025 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9025 | Rev 9583 | ||
---|---|---|---|
1 | format MS COFF |
1 | format MS COFF |
2 | 2 | ||
3 | public _get_moviefile |
3 | public _get_moviefile |
4 | 4 | ||
5 | section '.text' align 16 |
5 | section '.text' align 16 |
6 | 6 | ||
7 | align 4 |
7 | align 4 |
8 | getprocaddress: |
8 | getprocaddress: |
9 | mov edx, [esp + 8] ; hlib |
9 | mov edx, [esp + 8] ; hlib |
10 | xor eax, eax |
10 | xor eax, eax |
11 | test edx, edx ; If hlib = 0 then goto .end |
11 | test edx, edx ; If hlib = 0 then goto .end |
12 | jz .end |
12 | jz .end |
13 | 13 | ||
14 | .next: |
14 | .next: |
15 | cmp [edx], dword 0 ; If end of export table then goto .end |
15 | cmp [edx], dword 0 ; If end of export table then goto .end |
16 | jz .end |
16 | jz .end |
17 | 17 | ||
18 | xor eax, eax |
18 | xor eax, eax |
19 | mov esi, [edx] |
19 | mov esi, [edx] |
20 | mov edi, [esp + 4] ; name |
20 | mov edi, [esp + 4] ; name |
21 | 21 | ||
22 | .next_: |
22 | .next_: |
23 | lodsb |
23 | lodsb |
24 | scasb |
24 | scasb |
25 | jne .fail |
25 | jne .fail |
26 | or al, al |
26 | or al, al |
27 | jnz .next_ |
27 | jnz .next_ |
28 | jmp .ok |
28 | jmp .ok |
29 | .fail: |
29 | .fail: |
30 | add edx, 8 |
30 | add edx, 8 |
31 | jmp .next |
31 | jmp .next |
32 | 32 | ||
33 | .ok: ; return address |
33 | .ok: ; return address |
34 | mov eax, [edx + 4] |
34 | mov eax, [edx + 4] |
35 | .end: |
35 | .end: |
36 | ret 8 |
36 | ret 8 |
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | align 8 |
40 | align 8 |
41 | _get_moviefile: |
41 | _get_moviefile: |
42 | 42 | ||
43 | pushad |
43 | pushad |
44 | mov eax, 68 |
44 | mov eax, 68 |
45 | mov ebx, 19 |
45 | mov ebx, 19 |
46 | mov ecx, sz_proc_lib |
46 | mov ecx, sz_proc_lib |
47 | int 0x40 |
47 | int 0x40 |
48 | mov [proclib], eax |
48 | mov [proclib], eax |
49 | test eax, eax |
49 | test eax, eax |
50 | jz .fail |
50 | jz .fail |
51 | 51 | ||
52 | push [proclib] |
52 | push [proclib] |
53 | push sz_OpenDialog_init |
53 | push sz_OpenDialog_init |
54 | call getprocaddress |
54 | call getprocaddress |
55 | mov [opendialog_init], eax |
55 | mov [opendialog_init], eax |
56 | 56 | ||
57 | push dword[proclib] |
57 | push dword[proclib] |
58 | push sz_OpenDialog_start |
58 | push sz_OpenDialog_start |
59 | call getprocaddress |
59 | call getprocaddress |
60 | mov [opendialog_start], eax |
60 | mov [opendialog_start], eax |
61 | 61 | ||
62 | mov eax, 68 |
62 | mov eax, 68 |
63 | mov ebx, 12 |
63 | mov ebx, 12 |
64 | mov ecx, 4096*3 |
64 | mov ecx, 4096*3 |
65 | int 0x40 |
65 | int 0x40 |
66 | 66 | ||
67 | mov [od.procinfo], eax |
67 | mov [od.procinfo], eax |
68 | 68 | ||
69 | add eax, 1024 |
69 | add eax, 1024 |
70 | mov [od.filename_area], eax |
70 | mov [od.filename_area], eax |
71 | 71 | ||
72 | add eax, 3072 |
72 | add eax, 3072 |
73 | mov [od.opendir_path], eax |
73 | mov [od.opendir_path], eax |
74 | 74 | ||
75 | add eax, 4096 |
75 | add eax, 4096 |
76 | mov [od.openfile_path], eax |
76 | mov [od.openfile_path], eax |
77 | 77 | ||
78 | push od |
78 | push od |
79 | call [opendialog_init] |
79 | call [opendialog_init] |
80 | 80 | ||
81 | mov eax, [od.openfile_path] |
81 | mov eax, [od.openfile_path] |
82 | mov [eax], byte 0 ; end of ASCIIZ-string(may be don't need?) |
82 | mov [eax], byte 0 ; end of ASCIIZ-string(may be don't need?) |
83 | 83 | ||
84 | push od |
84 | push od |
85 | call [opendialog_start] |
85 | call [opendialog_start] |
86 | cmp [od.status], 1 |
86 | cmp [od.status], 1 |
87 | jne .fail |
87 | jne .fail |
88 | 88 | ||
89 | popad |
89 | popad |
90 | mov eax, [od.openfile_path]; selected filePath |
90 | mov eax, [od.openfile_path]; selected filePath |
91 | 91 | ||
92 | ret |
92 | ret |
93 | .fail: |
93 | .fail: |
94 | popad |
94 | popad |
95 | xor eax, eax |
95 | xor eax, eax |
96 | ret |
96 | ret |
97 | 97 | ||
98 | align 4 |
98 | align 4 |
99 | fake_on_redraw: |
99 | fake_on_redraw: |
100 | ret |
100 | ret |
101 | 101 | ||
102 | section '.rdata' align 16 |
102 | section '.rdata' align 16 |
103 | 103 | ||
104 | sz_proc_lib db "/rd/1/lib/proc_lib.obj",0 |
104 | sz_proc_lib db "/sys/lib/proc_lib.obj",0 |
105 | sz_OpenDialog_init db "OpenDialog_init",0 |
105 | sz_OpenDialog_init db "OpenDialog_init",0 |
106 | sz_OpenDialog_start db "OpenDialog_start",0 |
106 | sz_OpenDialog_start db "OpenDialog_start",0 |
107 | sz_com_area_name db "FFFFFFFF_open_dialog",0 |
107 | sz_com_area_name db "FFFFFFFF_open_dialog",0 |
108 | sz_dir_default_path db "/rd/1",0 |
108 | sz_dir_default_path db "/sys",0 |
109 | sz_start_path db "/rd/1/File managers/opendial",0 |
109 | sz_start_path db "/sys/File managers/opendial",0 |
110 | 110 | ||
111 | 111 | ||
112 | section '.data' align 16 |
112 | section '.data' align 16 |
113 | 113 | ||
114 | od: |
114 | od: |
115 | .mode dd 0 |
115 | .mode dd 0 |
116 | .procinfo dd 0 |
116 | .procinfo dd 0 |
117 | .com_area_name dd sz_com_area_name |
117 | .com_area_name dd sz_com_area_name |
118 | .com_area dd 0 |
118 | .com_area dd 0 |
119 | .opendir_path dd 0 |
119 | .opendir_path dd 0 |
120 | .dir_default_path dd sz_dir_default_path |
120 | .dir_default_path dd sz_dir_default_path |
121 | .start_path dd sz_start_path |
121 | .start_path dd sz_start_path |
122 | .draw_window dd fake_on_redraw |
122 | .draw_window dd fake_on_redraw |
123 | .status dd 0 |
123 | .status dd 0 |
124 | .openfile_path dd 0 |
124 | .openfile_path dd 0 |
125 | .filename_area dd 0 |
125 | .filename_area dd 0 |
126 | .filter_area dd filefilter |
126 | .filter_area dd filefilter |
127 | .x_size dw 512 |
127 | .x_size dw 512 |
128 | .x_start dw 512 |
128 | .x_start dw 512 |
129 | .y_size dw 512 |
129 | .y_size dw 512 |
130 | .y_start dw 512 |
130 | .y_start dw 512 |
131 | 131 | ||
132 | filefilter: |
132 | filefilter: |
133 | dd filefilter.end - filefilter |
133 | dd filefilter.end - filefilter |
134 | db 'avi',0 |
134 | db 'avi',0 |
135 | db 'flv',0 |
135 | db 'flv',0 |
136 | db 'mov',0 |
136 | db 'mov',0 |
137 | db 'mpg',0 |
137 | db 'mpg',0 |
138 | db 'mpeg',0 |
138 | db 'mpeg',0 |
139 | db 'mkv',0 |
139 | db 'mkv',0 |
140 | db 'mp4',0 |
140 | db 'mp4',0 |
141 | db 'webm',0 |
141 | db 'webm',0 |
142 | db 'wmv',0 |
142 | db 'wmv',0 |
143 | .end: |
143 | .end: |
144 | db 0 |
144 | db 0 |
145 | 145 | ||
146 | 146 | ||
147 | section '.bss' align 16 |
147 | section '.bss' align 16 |
148 | 148 | ||
149 | proclib dd ? |
149 | proclib dd ? |
150 | opendialog_init dd ? |
150 | opendialog_init dd ? |
151 | opendialog_start dd ? |
151 | opendialog_start dd ? |