Subversion Repositories Kolibri OS

Rev

Rev 589 | Rev 644 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 589 Rev 631
Line 1... Line 1...
1
;
1
;
2
; project name:         KFar_Arc - plugin for KFar, which supports various archives
2
; project name:         KFar_Arc - plugin for KFar, which supports various archives
3
; target platform:      KolibriOS
3
; target platform:      KolibriOS
4
; compiler:             FASM 1.67.14
4
; compiler:             FASM 1.67.14
5
; version:              0.1
5
; version:              0.11
6
; last update:          2007-07-11 (Jul 11, 2007)
6
; last update:          2007-09-20 (Sep 20, 2007)
7
; minimal KFar version: 0.4
7
; minimal KFar version: 0.41
8
; minimal kernel:       no limit
8
; minimal kernel:       no limit
9
;
9
;
10
; author:               Diamond
10
; author:               Diamond
11
; email:                diamondz@land.ru
11
; email:                diamondz@land.ru
12
; web:                  http://diamondz.land.ru
12
; web:                  http://diamondz.land.ru
Line 28... Line 28...
28
include '7z.inc'                ; *.7z
28
include '7z.inc'                ; *.7z
29
include 'lzma.inc'              ; LZMA-decoder for *.7z
29
include 'lzma.inc'              ; LZMA-decoder for *.7z
30
include 'ppmd.inc'              ; PPMD-decoder for *.7z
30
include 'ppmd.inc'              ; PPMD-decoder for *.7z
31
include '7zbranch.inc'          ; branch filters for *.7z
31
include '7zbranch.inc'          ; branch filters for *.7z
32
include '7zaes.inc'             ; AES cryptor for *.7z
32
include '7zaes.inc'             ; AES cryptor for *.7z
-
 
33
include 'zip.inc'               ; *.zip
-
 
34
include 'deflate.inc'           ; Deflate[64] decoder for *.7z and *.zip
Line 33... Line 35...
33
 
35
 
34
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35
;;;;;;;;;;;;;;; Interface for KFar ;;;;;;;;;;;;;;
37
;;;;;;;;;;;;;;; Interface for KFar ;;;;;;;;;;;;;;
36
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
38
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
37
virtual at 0
39
virtual at 0
38
kfar_info_struc:
40
kfar_info_struc:
39
.lStructSize    dd      ?
41
.lStructSize    dd      ?
40
.kfar_ver       dd      ?
42
.kfar_ver       dd      ?
-
 
43
.open           dd      ?
41
.open           dd      ?
44
.open2          dd      ?
42
.read           dd      ?
45
.read           dd      ?
43
.write          dd      ?
46
.write          dd      ?
-
 
47
.seek           dd      ?
44
.seek           dd      ?
48
.tell           dd      ?
45
.flush          dd      ?
49
.flush          dd      ?
46
.filesize       dd      ?
50
.filesize       dd      ?
47
.close          dd      ?
51
.close          dd      ?
48
.pgalloc        dd      ?
52
.pgalloc        dd      ?
Line 63... Line 67...
63
; int __stdcall plugin_load(kfar_info* info);
67
; int __stdcall plugin_load(kfar_info* info);
64
; Initialization of plugin + Save used KFar functions.
68
; Initialization of plugin + Save used KFar functions.
65
plugin_load:
69
plugin_load:
66
        mov     eax, [esp+4]
70
        mov     eax, [esp+4]
67
        mov     [kfar_info], eax
71
        mov     [kfar_info], eax
-
 
72
        push    [eax+kfar_info_struc.open2]
-
 
73
        pop     [open2]
-
 
74
        push    [eax+kfar_info_struc.filesize]
-
 
75
        pop     [filesize]
68
        push    [eax+kfar_info_struc.read]
76
        push    [eax+kfar_info_struc.read]
69
        pop     [read]
77
        pop     [read]
70
        push    [eax+kfar_info_struc.seek]
78
        push    [eax+kfar_info_struc.seek]
71
        pop     [seek]
79
        pop     [seek]
72
        push    [eax+kfar_info_struc.close]
80
        push    [eax+kfar_info_struc.close]
Line 87... Line 95...
87
        call    init_aes
95
        call    init_aes
88
        call    init_ppmd
96
        call    init_ppmd
89
        xor     eax, eax        ; success
97
        xor     eax, eax        ; success
90
        ret     4
98
        ret     4
Line 91... Line 99...
91
 
99
 
92
; HANDLE __stdcall OpenFilePlugin(HANDLE basefile, const char* name,
100
; HANDLE __stdcall OpenFilePlugin(HANDLE basefile,
-
 
101
;       const void* attr, const void* data, int datasize,
93
;       const void* attr, const void* data, int datasize);
102
;       int baseplugin_id, HANDLE baseplugin_instance, const char* name);
94
; This function is called when user presses Enter (or Ctrl+PgDn) on file.
103
; This function is called when user presses Enter (or Ctrl+PgDn) on file.
95
; Plugin tests whether given file is of supported type
104
; Plugin tests whether given file is of supported type
96
;   and if so, loads information and returns
105
;   and if so, loads information and returns
97
;   handle to be used in subsequent calls to ReadFolder, SetFolder and so on.
106
;   handle to be used in subsequent calls to ReadFolder, SetFolder and so on.
98
OpenFilePlugin:
107
OpenFilePlugin:
99
        mov     [bPasswordDefined], 0
108
        mov     [bPasswordDefined], 0
100
        mov     esi, [esp+16]
109
        mov     esi, [esp+12]
101
        mov     ebp, [esp+4]
110
        mov     ebp, [esp+4]
102
; test for 7z archive
111
; test for 7z archive
103
        cmp     dword [esp+20], 20h     ; minimal size of 7z archive is 20h bytes
112
        cmp     dword [esp+16], 20h     ; minimal size of 7z archive is 20h bytes
104
        jb      .no_7z
113
        jb      .no_7z
105
        cmp     word [esi], '7z'                ; signature, part 1
114
        cmp     word [esi], '7z'                ; signature, part 1
106
        jnz     .no_7z
115
        jnz     .no_7z
107
        cmp     dword [esi+2], 0x1C27AFBC       ; signature, part 2
116
        cmp     dword [esi+2], 0x1C27AFBC       ; signature, part 2
108
        jnz     .no_7z
117
        jnz     .no_7z
109
        call    open_7z
118
        call    open_7z
110
        ret     20
119
        ret     28
-
 
120
.no_7z:
-
 
121
; test for zip archive
-
 
122
        cmp     dword [esp+16], 22      ; minimal size of zip archive is 22 bytes
-
 
123
        jb      .no_zip
-
 
124
        cmp     word [esi], 0x4B50
-
 
125
        jnz     .no_zip
-
 
126
        cmp     word [esi+2], 0x0403
-
 
127
        jz      .zip
-
 
128
        cmp     word [esi+2], 0x0201
-
 
129
        jz      .zip
-
 
130
        cmp     word [esi+2], 0x0606
-
 
131
        jz      .zip
-
 
132
        cmp     word [esi+2], 0x0706
-
 
133
        jz      .zip
-
 
134
        cmp     word [esi+2], 0x0605
-
 
135
        jnz     .no_zip
-
 
136
.zip:
-
 
137
        call    open_zip
-
 
138
        ret     28
111
.no_7z:
139
.no_zip:
112
        xor     eax, eax
140
        xor     eax, eax
Line 113... Line 141...
113
        ret     20
141
        ret     28
114
 
142
 
115
; Handle of plugin in kfar_arc is as follow:
143
; Handle of plugin in kfar_arc is as follow:
116
virtual at 0
144
virtual at 0
117
handle_common:
145
handle_common:
118
.type           dd      ?
146
.type           dd      ?
119
.root.subfolders        dd      ?
147
.root.subfolders        dd      ?
120
.root.subfolders.end    dd      ?
148
.root.subfolders.end    dd      ?
121
.root.subfiles          dd      ?
149
.root.subfiles          dd      ?
-
 
150
.root.subfiles.end      dd      ?
-
 
151
.root.NumSubItems       dd      ?
122
.root.subfiles.end      dd      ?
152
.curdir                 dd      ?
123
.root.NumSubItems       dd      ?
153
.NumFiles               dd      ?
Line 124... Line 154...
124
; ... some plugin-specific data follows ...
154
; ... some plugin-specific data follows ...
125
end virtual
155
end virtual
Line 139... Line 169...
139
.subfiles       dd      ?       ; head of L2-list of files [for folders]
169
.subfiles       dd      ?       ; head of L2-list of files [for folders]
140
.subfiles.end   dd      ?
170
.subfiles.end   dd      ?
141
.NumSubItems    dd      ?
171
.NumSubItems    dd      ?
142
.next           dd      ?       ; next item in list of subfolders/files
172
.next           dd      ?       ; next item in list of subfolders/files
143
.prev           dd      ?       ; previous item in list of subfolders/files
173
.prev           dd      ?       ; previous item in list of subfolders/files
-
 
174
.stamp          dd      ?       ; stamp for GetFiles
144
end virtual
175
end virtual
Line 145... Line 176...
145
 
176
 
146
; void __stdcall ClosePlugin(HANDLE hPlugin);
177
; void __stdcall ClosePlugin(HANDLE hPlugin);
147
; This function frees all resources allocated in OpenFilePlugin.
178
; This function frees all resources allocated in OpenFilePlugin.
Line 153... Line 184...
153
        jmp     dword [ClosePluginTable+eax*4]
184
        jmp     dword [ClosePluginTable+eax*4]
Line 154... Line 185...
154
 
185
 
155
; int __stdcall ReadFolder(HANDLE hPlugin,
186
; int __stdcall ReadFolder(HANDLE hPlugin,
156
;       unsigned dirinfo_start, unsigned dirinfo_size, void* dirdata);
187
;       unsigned dirinfo_start, unsigned dirinfo_size, void* dirdata);
-
 
188
ReadFolder:
-
 
189
; init header
-
 
190
        mov     edi, [esp+16]
-
 
191
        mov     ecx, 32/4
-
 
192
        xor     eax, eax
-
 
193
        rep     stosd
-
 
194
        mov     byte [edi-32], 1        ; version
-
 
195
        mov     ebp, [esp+4]
-
 
196
; get current directory
-
 
197
        lea     ebx, [ebp+handle_common.root.subfolders]
-
 
198
        cmp     [ebp+handle_common.curdir], 0
-
 
199
        jz      @f
-
 
200
        mov     ebx, [ebp+handle_common.curdir]
-
 
201
        add     ebx, file_common.subfolders
-
 
202
@@:
-
 
203
        mov     ecx, [ebx+16]
-
 
204
        mov     [edi-24], ecx           ; number of files
-
 
205
; edi points to BDFE
-
 
206
        push    6               ; assume EOF
-
 
207
        pop     eax
-
 
208
        sub     ecx, [esp+8]
-
 
209
        ja      @f
-
 
210
        and     dword [edi-28], 0       ; number of files read
-
 
211
        ret     10h
-
 
212
@@:
-
 
213
        cmp     ecx, [esp+12]
-
 
214
        jb      @f
-
 
215
        mov     ecx, [esp+12]
-
 
216
        xor     eax, eax        ; OK
-
 
217
@@:
-
 
218
        mov     [edi-28], ecx
-
 
219
        push    eax
-
 
220
; copy files data
-
 
221
        jecxz   .done
157
ReadFolder:
222
; seek to required item
158
        mov     eax, [esp+4]
223
        mov     eax, [esp+8+4]
-
 
224
        mov     esi, [ebx]
-
 
225
.0:
-
 
226
        test    esi, esi
-
 
227
        jnz     .1
-
 
228
        mov     esi, [ebx+8]
-
 
229
.1:
159
        mov     eax, [eax]
230
        add     esi, ebp
-
 
231
        dec     eax
-
 
232
        js      .2
-
 
233
        mov     esi, [esi+file_common.next]
-
 
234
        jmp     .0
-
 
235
.2:
-
 
236
.copy:
-
 
237
        pushad
-
 
238
        mov     eax, esi
160
        dec     eax
239
        mov     ecx, [ebp]
-
 
240
        call    dword [getattrTable+(ecx-1)*4]
-
 
241
        pop     edi esi
-
 
242
        push    esi edi
-
 
243
        add     edi, 40
-
 
244
        mov     ecx, [esi+file_common.namelen]
-
 
245
        mov     esi, [esi+file_common.name]
-
 
246
        rep     movsb
-
 
247
        mov     byte [edi], 0
-
 
248
        popad
-
 
249
        add     edi, 304
-
 
250
        mov     esi, [esi+file_common.next]
-
 
251
        test    esi, esi
-
 
252
        jnz     @f
-
 
253
        mov     esi, [ebx+8]
-
 
254
@@:
-
 
255
        add     esi, ebp
-
 
256
        loop    .copy
-
 
257
.done:
-
 
258
        pop     eax
Line 161... Line 259...
161
        jmp     dword [ReadFolderTable+eax*4]
259
        ret     10h
162
 
260
 
163
; bool __stdcall SetFolder(HANDLE hPlugin,
261
; bool __stdcall SetFolder(HANDLE hPlugin,
164
;       const char* relative_path, const char* absolute_path);
262
;       const char* relative_path, const char* absolute_path);
-
 
263
SetFolder:
165
SetFolder:
264
        mov     ebp, [esp+4]
-
 
265
        mov     edx, [ebp+handle_common.curdir]
-
 
266
        mov     esi, [esp+8]
-
 
267
        cmp     dword [esi], '..'
-
 
268
        jz      .toparent
166
        mov     eax, [esp+4]
269
        xor     ecx, ecx
-
 
270
@@:
-
 
271
        inc     ecx
-
 
272
        cmp     byte [esi+ecx], 0
-
 
273
        jnz     @b
-
 
274
        mov     ebx, [ebp+handle_common.root.subfolders]
-
 
275
        test    edx, edx
-
 
276
        jz      .scan
-
 
277
        mov     ebx, [edx+file_common.subfolders]
-
 
278
.scan:
-
 
279
        test    ebx, ebx
167
        mov     eax, [eax]
280
        jz      .err
-
 
281
        add     ebx, ebp
-
 
282
        cmp     [ebx+file_common.namelen], ecx
-
 
283
        jnz     .cont
-
 
284
        push    ecx esi
-
 
285
        mov     edi, [ebx+file_common.name]
-
 
286
        repz    cmpsb
-
 
287
        pop     esi ecx
-
 
288
        jz      .set
-
 
289
.cont:
-
 
290
        mov     ebx, [ebx+file_common.next]
-
 
291
        jmp     .scan
-
 
292
.toparent:
-
 
293
        test    edx, edx
-
 
294
        jz      .err
-
 
295
        mov     ebx, [edx+file_common.parent]
-
 
296
        test    ebx, ebx
-
 
297
        jz      @f
-
 
298
        add     ebx, ebp
-
 
299
@@:
-
 
300
.set:
-
 
301
        mov     [ebp+handle_common.curdir], ebx
-
 
302
        mov     al, 1
-
 
303
        ret     12
-
 
304
.err:
-
 
305
        xor     eax, eax
-
 
306
        ret     12
-
 
307
 
-
 
308
iglobal
-
 
309
cur_stamp dd 0
-
 
310
endg
-
 
311
 
-
 
312
uglobal
Line 168... Line 313...
168
        dec     eax
313
tmp_bdfe        rb      304
169
        jmp     dword [SetFolderTable+eax*4]
314
endg
170
 
315
 
171
; void __stdcall GetFiles(HANDLE hPlugin, int NumItems, void* items[],
316
; void __stdcall GetFiles(HANDLE hPlugin, int NumItems, void* items[],
172
;       void* addfile, void* adddir);
317
;       void* addfile, void* adddir);
173
;       bool __stdcall addfile(const char* name, void* bdfe_info, HANDLE hFile);
318
;       bool __stdcall addfile(const char* name, void* bdfe_info, HANDLE hFile);
-
 
319
;       bool __stdcall adddir(const char* name, void* bdfe_info);
-
 
320
GetFiles:
-
 
321
        mov     ebp, [esp+4]
-
 
322
        mov     ecx, [ebp+handle_common.NumFiles]
-
 
323
        test    ecx, ecx
-
 
324
        jz      .ret
-
 
325
        mov     ebx, ebp
-
 
326
        mov     eax, [ebx]
-
 
327
        add     ebx, [basesizes+(eax-1)*8]
-
 
328
        inc     [cur_stamp]
-
 
329
.loop:
-
 
330
        push    ecx
-
 
331
        mov     esi, [ebx+file_common.fullname]
-
 
332
        mov     edx, [ebp+handle_common.curdir]
-
 
333
        test    edx, edx
-
 
334
        jz      .incur
-
 
335
        mov     eax, [cur_stamp]
-
 
336
        mov     [edx+file_common.stamp], eax
-
 
337
        mov     edi, [edx+file_common.fullname]
-
 
338
        mov     ecx, [edx+file_common.namelen]
-
 
339
        add     ecx, [edx+file_common.name]
-
 
340
        sub     ecx, edi
-
 
341
        repz    cmpsb
-
 
342
        jnz     .cont
-
 
343
.incur:
-
 
344
        cmp     byte [esi], '/'
-
 
345
        jnz     @f
-
 
346
        inc     esi
-
 
347
@@:
-
 
348
        mov     ecx, [esp+12]   ; NumItems
-
 
349
        mov     edx, [esp+16]   ; items
-
 
350
        cmp     ecx, -1
-
 
351
        jz      .ok
-
 
352
.check:
-
 
353
        sub     ecx, 1
-
 
354
        js      .cont
-
 
355
        push    esi
-
 
356
        mov     edi, [edx]
-
 
357
        add     edi, 40
-
 
358
@@:
-
 
359
        lodsb
-
 
360
        scasb
-
 
361
        jnz     @f
-
 
362
        test    al, al
-
 
363
        jz      .ok2
-
 
364
        jmp     @b
-
 
365
@@:
-
 
366
        pop     esi
-
 
367
        cmp     al, '/'
-
 
368
        jnz     @f
-
 
369
        cmp     byte [edi-1], 0
-
 
370
        jz      .ok
-
 
371
@@:
-
 
372
        add     edx, 4
-
 
373
        jmp     .check
-
 
374
.ok2:
-
 
375
        pop     esi
-
 
376
.ok:
-
 
377
; add all parents directories if needed
-
 
378
.parloope:
-
 
379
        mov     ecx, [ebx+file_common.parent]
-
 
380
        jecxz   .pardone
-
 
381
        add     ecx, ebp
-
 
382
        mov     eax, [cur_stamp]
-
 
383
        cmp     [ecx+file_common.stamp], eax
-
 
384
        jz      .pardone
-
 
385
.parloopi:
-
 
386
        mov     edx, ecx
-
 
387
        mov     ecx, [ecx+file_common.parent]
-
 
388
        jecxz   @f
-
 
389
        add     ecx, ebp
-
 
390
        cmp     [ecx+file_common.stamp], eax
-
 
391
        jnz     .parloopi
-
 
392
@@:
-
 
393
        mov     [edx+file_common.stamp], eax
-
 
394
        push    esi
-
 
395
        mov     eax, edx
-
 
396
        mov     edi, tmp_bdfe
-
 
397
        push    edi
-
 
398
        sub     esi, [ebx+file_common.fullname]
-
 
399
        add     esi, [edx+file_common.fullname]
-
 
400
        push    esi
-
 
401
        mov     ecx, [ebp]
-
 
402
        call    dword [getattrTable+(ecx-1)*4]
-
 
403
        mov     eax, [esp+16+20]
-
 
404
        call    eax
-
 
405
        pop     esi
-
 
406
        test    al, al
-
 
407
        jz      .forced_exit
-
 
408
        jmp     .parloope
-
 
409
.pardone:
-
 
410
        cmp     [ebx+file_common.bIsDirectory], 0
-
 
411
        jz      .addfile
-
 
412
        mov     eax, [cur_stamp]
-
 
413
        cmp     [ebx+file_common.stamp], eax
-
 
414
        jz      .cont
-
 
415
        mov     [ebx+file_common.stamp], eax
-
 
416
        push    esi
-
 
417
        mov     eax, ebx
-
 
418
        mov     edi, tmp_bdfe
-
 
419
        push    edi
-
 
420
        push    esi
-
 
421
        mov     ecx, [ebp]
-
 
422
        call    dword [getattrTable+(ecx-1)*4]
-
 
423
        mov     eax, [esp+16+20]
-
 
424
        call    eax
-
 
425
        pop     esi
-
 
426
        test    al, al
-
 
427
        jz      .forced_exit
-
 
428
        jmp     .cont
-
 
429
.addfile:
-
 
430
        push    ebx esi ebp
-
 
431
        push    11h
-
 
432
        pop     edi
-
 
433
        mov     eax, ebx
-
 
434
        mov     ecx, [ebp]
-
 
435
        call    dword [openTable+(ecx-1)*4]
-
 
436
        pop     ebp esi ebx
-
 
437
        test    eax, eax
-
 
438
        jz      .cont
-
 
439
        push    eax
-
 
440
        push    eax
-
 
441
        mov     edi, tmp_bdfe
-
 
442
        push    edi
-
 
443
        push    esi
-
 
444
        mov     eax, ebx
-
 
445
        mov     ecx, [ebp]
-
 
446
        call    dword [getattrTable+(ecx-1)*4]
-
 
447
        mov     eax, [esp+20+16]
-
 
448
        call    eax
-
 
449
        pop     ecx
-
 
450
        push    eax ebp
-
 
451
        push    ebx
-
 
452
        push    ecx
-
 
453
        call    myclose
-
 
454
        pop     ebx
-
 
455
        pop     ebp eax
174
;       bool __stdcall adddir(const char* name, void* bdfe_info);
456
        test    al, al
-
 
457
        jz      .forced_exit
-
 
458
.cont:
175
GetFiles:
459
        mov     eax, [ebp]
-
 
460
        add     ebx, [basesizes+(eax-1)*8+4]
-
 
461
        pop     ecx
-
 
462
        dec     ecx
-
 
463
        jnz     .loop
-
 
464
.ret:
176
        mov     ebp, [esp+4]
465
        ret     20
Line 177... Line 466...
177
        mov     eax, [ebp]
466
.forced_exit:
178
        dec     eax
467
        pop     ecx
179
        jmp     dword [GetFilesTable+eax*4]
468
        jmp     .ret
180
 
469
 
Line 880... Line 1169...
880
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1169
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 881... Line 1170...
881
 
1170
 
882
; export table
1171
; export table
883
align 4
1172
align 4
884
EXPORTS:
1173
EXPORTS:
885
        dd      aVersion,       1
1174
        dd      aVersion,       2
886
        dd      aPluginLoad,    plugin_load
1175
        dd      aPluginLoad,    plugin_load
887
        dd      aOpenFilePlugin,OpenFilePlugin
1176
        dd      aOpenFilePlugin,OpenFilePlugin
888
        dd      aClosePlugin,   ClosePlugin
1177
        dd      aClosePlugin,   ClosePlugin
889
        dd      aReadFolder,    ReadFolder
1178
        dd      aReadFolder,    ReadFolder
Line 928... Line 1217...
928
aEnterPasswordTitle db  '‚¢®¤ ¯ à®«ï',0
1217
aEnterPasswordTitle db  '‚¢®¤ ¯ à®«ï',0
929
aArchiveDataError db    'Žè¨¡ª  ¢ ¤ ­­ëå  à娢 ',0
1218
aArchiveDataError db    'Žè¨¡ª  ¢ ¤ ­­ëå  à娢 ',0
930
aArchiveDataErrorPass db 'Žè¨¡ª  ¢ ¤ ­­ëå  à娢  ¨«¨ ­¥¢¥à­ë© ¯ à®«ì',0
1219
aArchiveDataErrorPass db 'Žè¨¡ª  ¢ ¤ ­­ëå  à娢  ¨«¨ ­¥¢¥à­ë© ¯ à®«ì',0
931
aChangePass     db      '‚¢¥á⨠¯ à®«ì',0
1220
aChangePass     db      '‚¢¥á⨠¯ à®«ì',0
932
aNameTooLong    db      '‘«¨èª®¬ ¤«¨­­®¥ ¨¬ï',0
1221
aNameTooLong    db      '‘«¨èª®¬ ¤«¨­­®¥ ¨¬ï',0
-
 
1222
aCannotOpenFile db      '¥ ¬®£ã ®âªàëâì ä ©«',0
933
else
1223
else
934
aContinue       db      'Continue',0
1224
aContinue       db      'Continue',0
935
aCancel         db      'Cancel',0
1225
aCancel         db      'Cancel',0
936
aHeaderError    db      'Invalid archive header',0
1226
aHeaderError    db      'Invalid archive header',0
937
aReadError      db      'Read error',0
1227
aReadError      db      'Read error',0
Line 945... Line 1235...
945
aEnterPasswordTitle db  'Get password',0
1235
aEnterPasswordTitle db  'Get password',0
946
aArchiveDataError db    'Error in archive data',0
1236
aArchiveDataError db    'Error in archive data',0
947
aArchiveDataErrorPass db 'Error in archive data or incorrect password',0
1237
aArchiveDataErrorPass db 'Error in archive data or incorrect password',0
948
aChangePass     db      'Enter password',0
1238
aChangePass     db      'Enter password',0
949
aNameTooLong    db      'Name is too long',0
1239
aNameTooLong    db      'Name is too long',0
-
 
1240
aCannotOpenFile db      'Cannot open file',0
950
end if
1241
end if
Line 951... Line 1242...
951
 
1242
 
952
; kfar_arc supports [hmm... will support...] many archive types.
1243
; kfar_arc supports many archive types.
953
; OpenFilePlugin looks for supported archive signature and gives control
1244
; OpenFilePlugin looks for supported archive signature and gives control
954
;   to concrete handler if found.
1245
;   to concrete handler if found.
955
; Other functions just determine type of opened archive and jumps to corresponding handler.
1246
; Other functions just determine type of opened archive and jump to corresponding handler.
956
type_mem_stream = 0     ; memory stream - for file handles (returned from 'open')
1247
type_mem_stream = 0     ; memory stream - for file handles (returned from 'open')
-
 
1248
type_7z = 1
Line 957... Line 1249...
957
type_7z = 1
1249
type_zip = 2
958
 
1250
 
959
; archive functions (types start from type_7z)
1251
; archive functions (types start from type_7z)
960
align 4
1252
align 4
961
ClosePluginTable:
-
 
962
        dd      close_7z
-
 
963
ReadFolderTable:
-
 
964
        dd      ReadFolder_7z
1253
ClosePluginTable:
965
SetFolderTable:
-
 
966
        dd      SetFolder_7z
-
 
967
GetFilesTable:
1254
        dd      close_7z
968
        dd      GetFiles_7z
1255
        dd      close_zip
-
 
1256
getattrTable:
969
getattrTable:
1257
        dd      getattr_7z
970
        dd      getattr_7z
1258
        dd      getattr_zip
-
 
1259
openTable:
-
 
1260
        dd      open_file_7z
-
 
1261
        dd      open_file_zip
-
 
1262
basesizes:
Line 971... Line 1263...
971
openTable:
1263
        dd      handle_7z.basesize, file_in_7z.size
972
        dd      open_file_7z
1264
        dd      handle_zip.basesize, file_in_zip.size
973
 
1265
 
974
; file functions (types start from type_mem_stream)
1266
; file functions (types start from type_mem_stream)
-
 
1267
readTable:
975
readTable:
1268
        dd      read_mem_stream
976
        dd      read_mem_stream
1269
        dd      read_7z
977
        dd      read_7z
1270
        dd      read_zip
-
 
1271
setposTable:
978
setposTable:
1272
        dd      setpos_mem_stream
979
        dd      setpos_mem_stream
1273
        dd      setpos_7z
980
        dd      setpos_7z
1274
        dd      setpos_zip
-
 
1275
closeTable:
Line 981... Line 1276...
981
closeTable:
1276
        dd      close_mem_stream
982
        dd      close_mem_stream
1277
        dd      close_file_7z
983
        dd      close_file_7z
1278
        dd      close_file_zip
984
 
1279
 
Line 1043... Line 1338...
1043
 
1338
 
1044
error_proc      dd      ?
1339
error_proc      dd      ?
Line 1045... Line 1340...
1045
clear_proc      dd      ?
1340
clear_proc      dd      ?
-
 
1341
 
-
 
1342
; import from kfar
1046
 
1343
open2           dd      ?
1047
; import from kfar
1344
filesize        dd      ?
1048
read            dd      ?
1345
read            dd      ?
1049
seek            dd      ?
1346
seek            dd      ?
1050
close           dd      ?
1347
close           dd      ?