2006-08-14 14:52:07 +02:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
;
|
2012-05-28 08:46:50 +02:00
|
|
|
; DOCPAK FOR KOLIBRI v1.2
|
2006-08-14 14:52:07 +02:00
|
|
|
; Written in pure assembly by Ivushkin Andrey aka Willow
|
|
|
|
;
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
FILE_COUNT=0
|
|
|
|
DEF_FILE equ 'g'
|
|
|
|
|
2014-09-12 17:15:23 +02:00
|
|
|
macro embed_docdir_file fn
|
2006-08-14 14:52:07 +02:00
|
|
|
{
|
|
|
|
forward
|
|
|
|
local label,label2,label3
|
|
|
|
dd label2-label
|
|
|
|
dd label-label3
|
|
|
|
label3:
|
|
|
|
db fn
|
|
|
|
label:
|
2011-01-17 12:10:41 +01:00
|
|
|
file '%DOCDIR%' # fn
|
2006-08-14 14:52:07 +02:00
|
|
|
label2:
|
|
|
|
FILE_COUNT=FILE_COUNT+1
|
|
|
|
}
|
2014-09-12 17:15:23 +02:00
|
|
|
macro embed_local_file fn
|
|
|
|
{
|
|
|
|
forward
|
|
|
|
local label,label2,label3
|
|
|
|
dd label2-label
|
|
|
|
dd label-label3
|
|
|
|
label3:
|
|
|
|
db fn
|
|
|
|
label:
|
|
|
|
file fn
|
|
|
|
label2:
|
|
|
|
FILE_COUNT=FILE_COUNT+1
|
|
|
|
}
|
2012-05-28 08:46:50 +02:00
|
|
|
|
2006-08-14 14:52:07 +02:00
|
|
|
use32
|
|
|
|
org 0x0
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
dd 0x01 ; header version
|
|
|
|
dd start ; start of code
|
|
|
|
dd I_END ; size of image
|
|
|
|
dd I_END+0x400 ; memory for app
|
|
|
|
dd I_END+0x400 ; esp
|
|
|
|
dd my_param , 0x0 ; I_Param , I_Icon
|
2011-01-18 12:56:31 +01:00
|
|
|
include '../../../macros.inc'
|
2011-01-17 12:22:41 +01:00
|
|
|
include 'lang.inc'
|
2006-08-14 14:52:07 +02:00
|
|
|
|
|
|
|
start:
|
|
|
|
cmp [my_param],0
|
|
|
|
je red
|
|
|
|
cmp [my_param],'a'
|
|
|
|
jb .par_a
|
|
|
|
cmp [my_param],'z'
|
|
|
|
jbe .ok2
|
2014-03-30 01:12:52 +01:00
|
|
|
.par_a:
|
2006-08-14 14:52:07 +02:00
|
|
|
mov [my_param],DEF_FILE
|
|
|
|
.ok2:
|
|
|
|
movzx ecx,[my_param]
|
|
|
|
mov [my_param],'*'
|
|
|
|
.open:
|
|
|
|
sub ecx,'a'-1
|
|
|
|
mov edx,embedded
|
|
|
|
xor esi,esi
|
2014-03-30 01:12:52 +01:00
|
|
|
.list:
|
2006-08-14 14:52:07 +02:00
|
|
|
lea edx,[edx+esi+8]
|
|
|
|
mov esi,[edx-8]
|
|
|
|
add edx,[edx-4]
|
|
|
|
test esi,esi
|
|
|
|
jz .close
|
|
|
|
loop .list
|
|
|
|
push edx
|
|
|
|
; convert number in esi to decimal representation
|
|
|
|
mov ecx, 10
|
|
|
|
push -'0'
|
|
|
|
mov eax, esi
|
|
|
|
@@:
|
|
|
|
xor edx, edx
|
|
|
|
div ecx
|
|
|
|
push edx
|
|
|
|
test eax, eax
|
|
|
|
jnz @b
|
|
|
|
mov edi, fsize
|
|
|
|
@@:
|
|
|
|
pop eax
|
|
|
|
add al, '0'
|
|
|
|
stosb
|
|
|
|
jnz @b
|
|
|
|
mcall 70,fileinfo
|
|
|
|
mov ecx,eax
|
|
|
|
mcall 5,20
|
|
|
|
pop edx
|
|
|
|
mcall 60,2
|
|
|
|
cmp [my_param],'*'
|
|
|
|
jne still
|
2014-03-30 01:12:52 +01:00
|
|
|
.close:
|
2006-08-14 14:52:07 +02:00
|
|
|
mcall -1
|
|
|
|
|
|
|
|
red:
|
|
|
|
mov [my_param],'a'
|
2014-03-30 01:12:52 +01:00
|
|
|
|
2012-05-28 08:46:50 +02:00
|
|
|
mcall 48, 3, sc, sizeof.system_colors
|
2006-10-12 01:19:10 +02:00
|
|
|
|
2006-08-14 14:52:07 +02:00
|
|
|
mcall 12,1
|
2014-03-30 01:12:52 +01:00
|
|
|
|
2016-02-20 18:21:34 +01:00
|
|
|
BTN_H equ 21
|
2023-10-01 23:53:34 +02:00
|
|
|
|
2006-10-12 01:19:10 +02:00
|
|
|
mov edx,[sc.work]
|
2007-06-22 22:24:06 +02:00
|
|
|
or edx,0x34000000
|
2016-02-20 18:21:34 +01:00
|
|
|
mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title
|
2006-10-12 01:19:10 +02:00
|
|
|
|
2006-08-14 14:52:07 +02:00
|
|
|
mov ecx,FILECOUNT
|
2016-02-20 18:21:34 +01:00
|
|
|
mov ebx,23 shl 16+100
|
2006-10-12 01:19:10 +02:00
|
|
|
mov esi,[sc.work_button]
|
2016-02-20 18:21:34 +01:00
|
|
|
mov edi,5 shl 16+BTN_H
|
2006-08-14 14:52:07 +02:00
|
|
|
mov edx,10
|
|
|
|
mov eax,8
|
|
|
|
.btnlp:
|
|
|
|
push ecx
|
|
|
|
mcall ,,edi
|
2016-02-20 18:21:34 +01:00
|
|
|
add edi,(BTN_H+3) shl 16
|
2006-08-14 14:52:07 +02:00
|
|
|
inc edx
|
|
|
|
pop ecx
|
|
|
|
loop .btnlp
|
|
|
|
mov ecx,FILECOUNT
|
|
|
|
mov edx,embedded
|
|
|
|
xor edi,edi
|
2016-02-20 18:21:34 +01:00
|
|
|
mov ebx,30 shl 16+8
|
2006-08-14 14:52:07 +02:00
|
|
|
mov eax,4
|
2014-03-30 01:12:52 +01:00
|
|
|
.list:
|
2006-08-14 14:52:07 +02:00
|
|
|
lea edx,[edx+edi+8]
|
|
|
|
mov edi,[edx-8]
|
|
|
|
pusha
|
2016-02-20 18:21:34 +01:00
|
|
|
sub ebx,20 shl 16
|
|
|
|
mov ecx, [sc.work_text]
|
|
|
|
or ecx, 0x30000000
|
|
|
|
mcall ,,,my_param,1
|
2006-08-14 14:52:07 +02:00
|
|
|
inc [my_param]
|
|
|
|
popa
|
|
|
|
push ecx
|
2014-03-30 01:12:52 +01:00
|
|
|
mov esi, [edx-4]
|
|
|
|
sub esi, 4 ;remove .txt extension
|
2016-02-20 18:21:34 +01:00
|
|
|
mov ecx, [sc.work_button_text]
|
|
|
|
or ecx, 0x30000000
|
|
|
|
mcall
|
2006-08-14 14:52:07 +02:00
|
|
|
pop ecx
|
2014-03-30 01:18:37 +01:00
|
|
|
add esi, 4
|
|
|
|
add edx, esi
|
2016-02-20 18:21:34 +01:00
|
|
|
add ebx,(BTN_H+3)
|
2006-08-14 14:52:07 +02:00
|
|
|
loop .list
|
|
|
|
mcall 12,2
|
|
|
|
|
|
|
|
still:
|
|
|
|
mcall 10
|
|
|
|
cmp eax,1
|
|
|
|
je red
|
|
|
|
cmp eax,2
|
|
|
|
jne .nokey
|
|
|
|
mcall 2
|
|
|
|
cmp ah,27 ;Esc
|
|
|
|
je start.close
|
|
|
|
cmp ah,'a'
|
|
|
|
jb still
|
|
|
|
cmp ah,'a'+FILECOUNT
|
|
|
|
jae still
|
|
|
|
jmp .cxax
|
|
|
|
.nokey:
|
|
|
|
mcall 17
|
|
|
|
cmp ah,1
|
|
|
|
je start.close
|
|
|
|
sub ah,10-'a'
|
|
|
|
.cxax:
|
|
|
|
movzx ecx,ah
|
|
|
|
jmp start.open
|
|
|
|
|
|
|
|
fileinfo:
|
|
|
|
dd 7
|
|
|
|
dd 0
|
|
|
|
dd param
|
2006-10-12 01:19:10 +02:00
|
|
|
dd 0 ,0
|
2007-06-08 17:54:05 +02:00
|
|
|
db '/sys/TINYPAD',0
|
2006-08-14 14:52:07 +02:00
|
|
|
|
|
|
|
param db '*'
|
|
|
|
fsize:
|
|
|
|
times 10 db '0'
|
|
|
|
db 0
|
|
|
|
|
2014-03-30 01:12:52 +01:00
|
|
|
embedded:
|
2006-08-14 14:52:07 +02:00
|
|
|
|
|
|
|
; Please use only filenames w/o path!
|
|
|
|
|
|
|
|
; -- Start of embedding area ------
|
2023-10-01 23:53:34 +02:00
|
|
|
embed_docdir_file 'CREDITS.TXT' ;a
|
2011-01-17 12:10:41 +01:00
|
|
|
if lang eq ru
|
2014-09-12 17:15:23 +02:00
|
|
|
embed_docdir_file 'GNU.TXT' ;b
|
2011-01-17 12:10:41 +01:00
|
|
|
else
|
2014-09-12 17:15:23 +02:00
|
|
|
embed_docdir_file 'COPYING.TXT' ;b
|
2011-01-17 12:10:41 +01:00
|
|
|
end if
|
2014-09-12 17:15:23 +02:00
|
|
|
embed_docdir_file 'HOT_KEYS.TXT' ;c
|
|
|
|
embed_local_file 'FASM.TXT' ;d
|
|
|
|
embed_docdir_file 'MTDBG.TXT' ;e
|
2011-01-17 12:10:41 +01:00
|
|
|
if lang eq ru
|
2014-09-12 17:15:23 +02:00
|
|
|
embed_local_file 'SYSFUNCR.TXT' ;f
|
2011-01-17 12:10:41 +01:00
|
|
|
else
|
2014-09-12 17:15:23 +02:00
|
|
|
embed_local_file 'SYSFUNCS.TXT' ;f
|
2011-01-17 12:10:41 +01:00
|
|
|
end if
|
2020-01-14 22:23:09 +01:00
|
|
|
embed_local_file 'STACK.TXT' ;g
|
2014-09-12 17:15:23 +02:00
|
|
|
embed_docdir_file 'KFAR_KEYS.TXT' ;h
|
|
|
|
embed_docdir_file 'INI.TXT' ;i
|
|
|
|
embed_docdir_file 'OPENDIAL.TXT' ;j
|
2006-08-14 14:52:07 +02:00
|
|
|
; -- End of embedding area -------
|
|
|
|
|
|
|
|
dd 0
|
|
|
|
FILECOUNT = FILE_COUNT
|
|
|
|
|
|
|
|
if ~ FILECOUNT>0
|
|
|
|
error 'No embedded files'
|
|
|
|
end if
|
|
|
|
|
|
|
|
my_param db 0
|
|
|
|
rb 256
|
|
|
|
I_END:
|
2006-10-12 01:19:10 +02:00
|
|
|
|
2012-05-28 08:46:50 +02:00
|
|
|
title db 'Doc Pack',0
|
|
|
|
|
2006-10-12 01:19:10 +02:00
|
|
|
sc system_colors
|