Subversion Repositories Kolibri OS

Rev

Rev 9568 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1681 mario79 1
;---------------------------------------------------------------------
7829 leency 2
aQuestion	db '?',0
3
caption_str	db 'KPack - Kolibri Packer',0
1681 mario79 4
buttons1names	db ' InFile:'
5
		db 'OutFile:'
6
		db '   Path:'
7829 leency 7
aCompress	db ' Compress',0
8
aDecompress	db 'Decompress',0
1681 mario79 9
definoutname	db 0
9587 vitalkrilo 10
defpath		db '/sys',0
7834 leency 11
kernel_name db 'kernel.mnt',0
1686 mario79 12
;curedit		dd 0
1681 mario79 13
 
7834 leency 14
info_str	db 'KPack - Kolibri Packer, version 0.22',10
1681 mario79 15
		db 'Uses LZMA v4.32 compression library',10,10
16
info_len	= $ - info_str
7829 leency 17
usage_str	db 'Written by diamond in 2006-2009 specially for KolibriOS',10
1688 mario79 18
		db 'Disassembled code, using Box_Lib, Proc_Lib and OpenDialog',10
7829 leency 19
		db 'by Mario79, 2010',10
20
		db 'LZMA is copyright (c) 1999-2005 by Igor Pavlov',10
1681 mario79 21
		db 10
22
		db 'Command-line usage:',10
7829 leency 23
		db '   path_to_infile with zero',10
7834 leency 24
		db '   use <-ker> key to pack kernel',10
1681 mario79 25
		db 10
26
		db 'Window usage:',10
7829 leency 27
		db '   Select file with PATH-button or set all data in the',10
7835 leency 28
		db '   text fields manually, then press an appropriate button',10
1681 mario79 29
usage_len	= $ - usage_str
1713 mario79 30
already_str	db 'Already packed kernel.mnt file',10
31
already_len	= $ - already_str
32
notkernel_str	db 'This is not kernel.mnt file',10
33
notkernel_len	= $ - notkernel_str
1681 mario79 34
errload_str	db 'Cannot load input file',10
35
errload_len	= $ - errload_str
36
outfileerr_str	db 'Cannot save output file',10
37
outfileerr_len	= $ - outfileerr_str
38
nomem_str	db 'No memory',10
39
nomem_len	= $ - nomem_str
40
too_big_str	db 'failed, output is greater than input.',10
41
too_big_len	= $ - too_big_str
42
compressing_str	db 'Compressing ... '
43
compressing_len = $ - compressing_str
44
lzma_memsmall_str db	'Warning: not enough memory for default LZMA settings,',10
45
		db '         will use less dictionary size',10
46
lzma_memsmall_len = $ - lzma_memsmall_str
47
notpacked_str	db 'Input file is not packed with KPack!',10
48
notpacked_len	= $ - notpacked_str
49
unpacked_ok	db 'Unpacked successful',10
50
unpacked_len	= $ - unpacked_ok
51
 
52
done_str	db 'OK! Compression ratio: '
53
ratio		dw	'00'
54
		db '%',10
55
done_len	= $ - done_str
56
;---------------------------------------------------------------------
57
align 4
58
LiteralNextStates:
59
db 0,0,0,0,1,2,3,4,5,6,4,5
60
MatchNextStates:
61
db 7,7,7,7,7,7,7,10,10,10,10,10
62
RepNextStates:
63
db 8,8,8,8,8,8,8,11,11,11,11,11
64
ShortRepNextStates:
65
db 9,9,9,9,9,9,9,11,11,11,11,11
1686 mario79 66
;---------------------------------------------------------------------
67
align 4
68
ProcLib_import:
69
OpenDialog_Init		dd aOpenDialog_Init
70
OpenDialog_Start	dd aOpenDialog_Start
71
;OpenDialog__Version	dd aOpenDialog_Version
8346 IgorA 72
        dd      0,0
1686 mario79 73
aOpenDialog_Init	db 'OpenDialog_init',0
74
aOpenDialog_Start	db 'OpenDialog_start',0
75
;aOpenDialog_Version	db 'Version_OpenDialog',0
76
;---------------------------------------------------------------------
77
align	4
78
Box_lib_import:
79
edit_box_draw		dd aEdit_box_draw
80
edit_box_key		dd aEdit_box_key
81
edit_box_mouse		dd aEdit_box_mouse
82
 
3177 IgorA 83
init_checkbox		dd aInit_checkbox
1713 mario79 84
check_box_draw		dd aCheck_box_draw
85
check_box_mouse		dd aCheck_box_mouse
1686 mario79 86
 
8346 IgorA 87
	dd 0,0
1686 mario79 88
 
9568 IgorA 89
aEdit_box_draw		db 'edit_box_draw',0
1686 mario79 90
aEdit_box_key		db 'edit_box_key',0
91
aEdit_box_mouse		db 'edit_box_mouse',0
92
 
3177 IgorA 93
aInit_checkbox		db 'init_checkbox2',0
94
aCheck_box_draw		db 'check_box_draw2',0
95
aCheck_box_mouse	db 'check_box_mouse2',0
1686 mario79 96
 
97
;---------------------------------------------------------------------
98
system_dir_Boxlib	db '/sys/lib/box_lib.obj',0
99
system_dir_ProcLib	db '/sys/lib/proc_lib.obj',0
100
;---------------------------------------------------------------------
101
align 4
102
l_libs_start:
103
 
8346 IgorA 104
library01  l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, Box_lib_import
1686 mario79 105
 
8346 IgorA 106
library02  l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, ProcLib_import
1686 mario79 107
 
108
load_lib_end:
109
;---------------------------------------------------------------------
110
align 4
111
OpenDialog_data:
112
.type			dd 0
113
.procinfo		dd procinfo	;+4
114
.com_area_name		dd communication_area_name	;+8
115
.com_area		dd 0	;+12
116
.opendir_pach		dd temp_dir_pach	;+16
117
.dir_default_pach	dd communication_area_default_pach	;+20
118
.start_path		dd open_dialog_path	;+24
119
.draw_window		dd draw_window	;+28
120
.status			dd 0	;+32
121
.openfile_pach 		dd fname_buf	;+36
122
.filename_area		dd filename_area	;+40
123
.filter_area		dd Filter
124
.x:
125
.x_size			dw 420 ;+48 ; Window X size
126
.x_start		dw 10 ;+50 ; Window X position
127
.y:
128
.y_size			dw 320 ;+52 ; Window y size
129
.y_start		dw 10 ;+54 ; Window Y position
130
 
131
communication_area_name:
132
	db 'FFFFFFFF_open_dialog',0
133
open_dialog_path:
1702 Lrz 134
if __nightbuild eq yes
135
    db '/sys/MANAGERS/opendial',0
136
else
137
    db '/sys/File Managers/opendial',0
138
end if
1686 mario79 139
communication_area_default_pach:
9587 vitalkrilo 140
	db '/sys',0
1686 mario79 141
 
9587 vitalkrilo 142
path4	db '/sys/temp',0
1686 mario79 143
 
144
Filter:
145
dd	Filter.end - Filter.1
146
.1:
147
;db	'BIN',0
148
;db	'DAT',0
149
.end:
150
db	0
151
 
7829 leency 152
WIN_W = 490
153
WIN_H = 350
154
LINE_H = 25
155
RIGHT_BTN_W = 103
156
EDIT_X = 76
157
LOG_Y = LINE_H*3+5
158
LOG_H = WIN_H-LOG_Y-9
159
 
1686 mario79 160
start_temp_file_name:	db 'temp.bin',0
161
 
162
;---------------------------------------------------------------------
163
align 4
7829 leency 164
edit1 edit_box WIN_W-EDIT_X-RIGHT_BTN_W-12, EDIT_X, 3,          0xffffff,\
165
        0xA4C4E4, 0x80ff, 0, 0x10000000, 256, inname,  mouse_dd, 0, 11,11
166
edit2 edit_box WIN_W-EDIT_X-RIGHT_BTN_W-12, EDIT_X, LINE_H+3,   0xffffff,\
167
        0xA4C4E4, 0x80ff, 0, 0x10000000, 256, outname, mouse_dd, 0, 7,7
168
edit3 edit_box WIN_W-EDIT_X-RIGHT_BTN_W-12, EDIT_X, LINE_H*2+3, 0xffffff,\
169
        0xA4C4E4, 0x80ff, 0, 0x10000000, 256, path,    mouse_dd, 0, 6,6
1686 mario79 170
editboxes_end:
171
 
172
mouse_dd dd 0
1713 mario79 173
;---------------------------------------------------------------------
174
 
7829 leency 175
check1 check_box2 ((WIN_W - RIGHT_BTN_W - 5) shl 16)+15, ((LINE_H*2+6) shl 16)+15, 6, 0xffffff,\
176
        0x80ff, 0x10000000, check_text,ch_flag_top
2263 leency 177
check1_end:
1713 mario79 178
 
179
check_text db 'Kernel',0
180
;*********************************************************************
181
; Kerpack data
182
;*********************************************************************
183
align 4
184
fn70_read:
185
		dd	0
186
		dd	0
187
		dd	0
188
insize3		dd	200*1024
189
infile3		dd	infile
190
		db	0
191
		dd	fullname
192
 
193
align 4
194
fn70_write:
195
		dd	2
196
		dd	0
197
		dd	0
198
outsize3	dd	?
199
outfile3	dd	outfile
200
		db	0
201
		dd	fullname
202
;*********************************************************************