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