Subversion Repositories Kolibri OS

Rev

Rev 3177 | Rev 7834 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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