Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3067 | leency | 1 | struct f70{ |
2 | dword func; |
||
3 | dword param1; |
||
4 | dword param2; |
||
5 | dword param3; |
||
6 | dword param4; |
||
7 | char rezerv; |
||
8 | dword name; |
||
9 | }; |
||
10 | |||
11 | struct BDVK{ |
||
12 | dword attr; |
||
13 | byte type_name; |
||
14 | byte rez1, rez2, rez3; |
||
15 | dword timecreate; |
||
16 | dword datecreate; |
||
17 | dword timelastaccess; |
||
18 | dword datelastaccess; |
||
19 | dword timelastedit; |
||
20 | dword datelastedit; |
||
21 | dword sizelo; |
||
22 | dword sizehi; |
||
23 | char name[518]; |
||
24 | }; |
||
25 | |||
26 | |||
27 | /////////////////////////// |
||
28 | // Запуск программы // |
||
29 | /////////////////////////// |
||
30 | f70 run_file_70; |
||
31 | :int RunProgram(dword run_path, run_param) |
||
32 | { |
||
33 | run_file_70.func = 7; |
||
34 | run_file_70.param1 = |
||
35 | run_file_70.param3 = |
||
36 | run_file_70.param4 = |
||
37 | run_file_70.rezerv = 0; |
||
38 | run_file_70.param2 = run_param; |
||
39 | run_file_70.name = run_path; |
||
40 | $mov eax,70 |
||
41 | $mov ebx,#run_file_70.func |
||
42 | $int 0x40 |
||
43 | } |
||
44 | |||
45 | /////////////////////////// |
||
46 | // Создание папки // |
||
47 | /////////////////////////// |
||
48 | f70 create_dir_70; |
||
49 | :int CreateDir(dword new_folder_path) |
||
50 | { |
||
51 | create_dir_70.func = 9; |
||
52 | create_dir_70.param1 = |
||
53 | create_dir_70.param2 = |
||
54 | create_dir_70.param3 = |
||
55 | create_dir_70.param4 = |
||
56 | create_dir_70.rezerv = 0; |
||
57 | create_dir_70.name = new_folder_path; |
||
58 | $mov eax,70 |
||
59 | $mov ebx,#create_dir_70.func |
||
60 | $int 0x40 |
||
61 | } |
||
62 | |||
63 | //////////////////////////// |
||
64 | // Удаление файла/папки // |
||
65 | //////////////////////////// |
||
66 | f70 del_file_70; |
||
67 | :int DeleteFile(dword del_file_path) |
||
68 | { |
||
69 | del_file_70.func = 8; |
||
70 | del_file_70.param1 = |
||
71 | del_file_70.param2 = |
||
72 | del_file_70.param3 = |
||
73 | del_file_70.param4 = |
||
74 | del_file_70.rezerv = 0; |
||
75 | del_file_70.name = del_file_path; |
||
76 | $mov eax,70 |
||
77 | $mov ebx,#del_file_70.func |
||
78 | $int 0x40 |
||
79 | } |
||
80 | |||
81 | //////////////////////////// |
||
82 | // Прочитать файл // |
||
83 | //////////////////////////// |
||
84 | f70 read_file_70; |
||
85 | :int ReadFile(dword read_pos, read_file_size, read_buffer, read_file_path) |
||
86 | { |
||
87 | read_file_70.func = 0; |
||
88 | read_file_70.param1 = read_pos; |
||
89 | read_file_70.param2 = 0; |
||
90 | read_file_70.param3 = read_file_size; |
||
91 | read_file_70.param4 = read_buffer; |
||
92 | read_file_70.rezerv = 0; |
||
93 | read_file_70.name = read_file_path; |
||
94 | $mov eax,70 |
||
95 | $mov ebx,#read_file_70.func |
||
96 | $int 0x40 |
||
97 | } |
||
98 | |||
99 | //////////////////////////// |
||
100 | // Записать файл // |
||
101 | //////////////////////////// |
||
102 | f70 write_file_70; |
||
103 | :int WriteFile(dword write_file_size, write_buffer, write_file_path) |
||
104 | { |
||
105 | write_file_70.func = 2; |
||
106 | write_file_70.param1 = 0; |
||
107 | write_file_70.param2 = 0; |
||
108 | write_file_70.param3 = write_file_size; |
||
109 | write_file_70.param4 = write_buffer; |
||
110 | write_file_70.rezerv = 0; |
||
111 | write_file_70.name = write_file_path; |
||
112 | $mov eax,70 |
||
113 | $mov ebx,#write_file_70.func |
||
114 | $int 0x40 |
||
115 | } |
||
116 | |||
117 | /////////////////////////// |
||
118 | // Прочитать папку // |
||
119 | /////////////////////////// |
||
120 | f70 read_dir_70; |
||
121 | :int ReadDir(dword file_count, read_buffer, dir_path) |
||
122 | { |
||
123 | read_dir_70.func = 1; |
||
124 | read_dir_70.param1 = |
||
125 | read_dir_70.param2 = |
||
126 | read_dir_70.rezerv = 0; |
||
127 | read_dir_70.param3 = file_count; |
||
128 | read_dir_70.param4 = read_buffer; |
||
129 | read_dir_70.name = dir_path; |
||
130 | $mov eax,70 |
||
131 | $mov ebx,#read_dir_70.func |
||
132 | $int 0x40 |
||
133 | } |
||
134 | |||
135 | |||
136 | /////////////////////////// |
||
137 | // Параметры файла // |
||
138 | /////////////////////////// |
||
139 | f70 getinfo_file_70; |
||
140 | BDVK getinfo_file_info; |
||
141 | :dword GetFileInfo(dword file_path) |
||
142 | { |
||
143 | getinfo_file_70.func = 5; |
||
144 | getinfo_file_70.param1 = |
||
145 | getinfo_file_70.param2 = |
||
146 | getinfo_file_70.param3 = 0; |
||
147 | getinfo_file_70.param4 = #getinfo_file_info; |
||
148 | getinfo_file_70.rezerv = 0; |
||
149 | getinfo_file_70.name = file_path; |
||
150 | $mov eax,70 |
||
151 | $mov ebx,#getinfo_file_70.func |
||
152 | $int 0x40 |
||
153 | } |
||
154 | |||
155 | |||
156 | /////////////////////////// |
||
157 | // Скопировать файл // |
||
158 | /////////////////////////// |
||
159 | :int CopyFile(dword copy_from, copy_in) |
||
160 | { |
||
161 | BDVK CopyFile_atr; |
||
162 | dword cBufer=0; |
||
163 | |||
164 | if (! GetFileInfo(copy_from)) |
||
165 | { |
||
166 | mem_Init(); |
||
167 | cBufer = mem_Alloc(CopyFile_atr.sizelo); |
||
3081 | leency | 168 | if (! ReadFile(0, CopyFile_atr.sizelo, cBufer, copy_from)) |
3067 | leency | 169 | if (! WriteFile(CopyFile_atr.sizelo, cBufer, copy_in)) return 1; |
170 | } |
||
171 | |||
172 | return 0; |
||
173 | } |
||
174 | |||
175 | |||
176 | //Asper |
||
177 | void ReadAttributes(dword read_buffer, file_path) |
||
178 | { |
||
179 | read_file_70.func = 5; |
||
180 | read_file_70.param1 = 0; |
||
181 | read_file_70.param2 = 0; |
||
182 | read_file_70.param3 = 0; |
||
183 | read_file_70.param4 = read_buffer; |
||
184 | read_file_70.rezerv = 0; |
||
185 | read_file_70.name = file_path; |
||
186 | $mov eax,70 |
||
187 | $mov ebx,#read_file_70.func |
||
188 | $int 0x40 |
||
189 | } |
||
190 | |||
191 | inline fastcall void SetCurDir( ECX) |
||
192 | { |
||
193 | $mov eax,30 |
||
194 | $mov ebx,1 |
||
195 | $int 0x40 |
||
196 | } |
||
197 | |||
198 | inline fastcall void GetCurDir( ECX, EDX) |
||
199 | { |
||
200 | $mov eax,30 |
||
201 | $mov ebx,2 |
||
202 | $int 0x40 |
||
203 | } |
||
204 | |||
205 | void notify(dword notify_param) |
||
206 | { |
||
207 | RunProgram("@notify", notify_param); |
||
3081 | leency | 208 | } |