From 7920032ceb6a2701a785114230e73cd00d2d1e0b Mon Sep 17 00:00:00 2001 From: Yogev Ezra Date: Sun, 30 Jan 2011 15:54:21 +0000 Subject: [PATCH] Added sources of 'kerpack', 'MyKey', '@notify', 'spanel', 'test'. git-svn-id: svn://kolibrios.org@1815 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/MyKey/trunk/ASPAPI.INC | 149 ++++ programs/system/MyKey/trunk/MyKey.asm | 697 ++++++++++++++++++ programs/system/MyKey/trunk/ReadMe.txt | 51 ++ programs/system/MyKey/trunk/config.inc | 1 + programs/system/MyKey/trunk/debug.inc | 162 ++++ programs/system/MyKey/trunk/editbox_ex.mac | 79 ++ programs/system/MyKey/trunk/load_lib.mac | 634 ++++++++++++++++ programs/system/MyKey/trunk/macros.inc | 543 ++++++++++++++ programs/system/MyKey/trunk/proc32.inc | 268 +++++++ programs/system/MyKey/trunk/struct.inc | 180 +++++ programs/system/kerpack/trunk/calltrick2.asm | 32 + programs/system/kerpack/trunk/doexe2.asm | 68 ++ programs/system/kerpack/trunk/kerpack.asm | 232 ++++++ programs/system/kerpack/trunk/kerpack.bat | 7 + programs/system/kerpack/trunk/loader_lzma.asm | 404 ++++++++++ programs/system/kerpack/trunk/lzmapack.lib | Bin 0 -> 82830 bytes programs/system/kerpack/trunk/memset.asm | 11 + programs/system/notify/trunk/@notify.asm | 149 ++++ programs/system/notify/trunk/@notify.c-- | 45 ++ programs/system/spanel/trunk/build.bat | 1 + programs/system/spanel/trunk/spanel.asm | 265 +++++++ programs/system/test/trunk/build.bat | 1 + programs/system/test/trunk/test.asm | 200 +++++ 23 files changed, 4179 insertions(+) create mode 100644 programs/system/MyKey/trunk/ASPAPI.INC create mode 100644 programs/system/MyKey/trunk/MyKey.asm create mode 100644 programs/system/MyKey/trunk/ReadMe.txt create mode 100644 programs/system/MyKey/trunk/config.inc create mode 100644 programs/system/MyKey/trunk/debug.inc create mode 100644 programs/system/MyKey/trunk/editbox_ex.mac create mode 100644 programs/system/MyKey/trunk/load_lib.mac create mode 100644 programs/system/MyKey/trunk/macros.inc create mode 100644 programs/system/MyKey/trunk/proc32.inc create mode 100644 programs/system/MyKey/trunk/struct.inc create mode 100644 programs/system/kerpack/trunk/calltrick2.asm create mode 100644 programs/system/kerpack/trunk/doexe2.asm create mode 100644 programs/system/kerpack/trunk/kerpack.asm create mode 100644 programs/system/kerpack/trunk/kerpack.bat create mode 100644 programs/system/kerpack/trunk/loader_lzma.asm create mode 100644 programs/system/kerpack/trunk/lzmapack.lib create mode 100644 programs/system/kerpack/trunk/memset.asm create mode 100644 programs/system/notify/trunk/@notify.asm create mode 100644 programs/system/notify/trunk/@notify.c-- create mode 100644 programs/system/spanel/trunk/build.bat create mode 100644 programs/system/spanel/trunk/spanel.asm create mode 100644 programs/system/test/trunk/build.bat create mode 100644 programs/system/test/trunk/test.asm diff --git a/programs/system/MyKey/trunk/ASPAPI.INC b/programs/system/MyKey/trunk/ASPAPI.INC new file mode 100644 index 0000000000..74f9e9e29f --- /dev/null +++ b/programs/system/MyKey/trunk/ASPAPI.INC @@ -0,0 +1,149 @@ +include 'proc32.inc' + +macro start_draw_window x,y,xsize,ysize,areacolor,caption,capsize +{ + ;pusha + mov eax, 12 ; function 12:tell os about windowdraw + mov ebx, 1 ; 1, start of draw + int 0x40 + ; DRAW WINDOW + mov eax, 0 ; function 0 : define and draw window + mov ebx, x*65536+xsize ; [x start] *65536 + [x size] + mov ecx, y*65536+ysize ; [y start] *65536 + [y size] + mov edx, areacolor ; color of work area RRGGBB + mov esi, 0x00334455 ; color of grab bar RRGGBB + mov edi, 0x00ddeeff ; color of frames RRGGBB + int 0x40 + ; WINDOW LABEL + mov eax, 4 ; function 4 : write text to window + mov ebx, 8*65536+8 ; [x start] *65536 + [y start] + mov ecx, 0x00ffffff ; color of text RRGGBB + mov edx, caption ; pointer to text beginning + mov esi, capsize ; text length + int 0x40 + ;popa +} + +macro end_draw_window +{ + mov eax, 12 ; end of redraw + mov ebx, 2 + int 0x40 +} + +macro change_window_place_size x,y,xsize,ysize +{ + mov eax, 67 ; function 67 : replace and/or resize window + mov ebx, x + mov ecx, y + mov edx, xsize + mov esi, ysize + int 0x40 +} + +proc draw_button stdcall, x:dword, y:dword, xsize:dword, ysize:dword, \ + id:dword, butcolor:dword, text:dword, textlen:byte, textcolor:dword + + pusha + mov ebx, dword [x] + shl ebx, 16 + add ebx, dword [xsize] ; [x start] *65536 + [x size] + + mov ecx, dword [y] + shl ecx, 16 + add ecx, dword [ysize] ; [y start] *65536 + [y size] + + mov edx, dword [id] ; button id + mov esi, dword [butcolor] ; button color RRGGBB + mov eax, 8 ; function 8 : define and draw button + int 0x40 + + mov ebx, dword [x] + add ebx, 5 + shl ebx, 16 + mov eax, dword [ysize] + sub eax, 5 + shr eax, 1 + add ebx, eax + add ebx, dword [y] ;mov ebx, (x+5)*65536+y+(ysize-5)/2 ; Draw button text + + mov ecx, dword [textcolor] + mov edx, dword [text] + xor eax, eax + mov al, byte [textlen] + mov esi, eax + mov eax, 4 + int 0x40 + popa +ret +endp + +;macro outtextxy x,y,prompt,prompt_len,color +;{ +proc outtextxy stdcall, x:dword, y:dword, prompt:dword, prompt_len:dword, color:dword + pusha + mov eax, 4 + mov ebx, dword [x] ; draw info text with function 4 + shl ebx, 16 + or ebx, dword [y] + mov ecx, dword [color] + mov edx, dword [prompt] + mov esi, dword [prompt_len] + int 0x40 + popa +ret +endp +;} + +;proc bar x:dword, y:dword, xsize:dword, ysize:dword, color:dword +macro bar x, y, xsize, ysize, color +{ + pusha + mov eax, 13 + ;mov ebx, [x] + ;shl ebx, 16 + ;add ebx, [xsize] + ;mov ecx, [y] + ;shl ecx, 16 + ;add ecx, [ysize] + ;mov edx, [color] + mov ebx, x*65536+xsize + mov ecx, y*65536+ysize + mov edx, color + + int 0x40 + popa +;ret +;endp +} + +macro line x1,y1,x2,y2,color +{ + pusha + mov eax, 38 + mov ebx, x1*65536+x2 + mov ecx, y1*65536+y2 + mov edx, color + int 0x40 + popa +} + +macro rectangle x,y,xsize,ysize,color +{ + x2=x+xsize + y2=y+ysize + line x,y,x2,y,color + line x,y,x,y2,color + line x,y2,x2,y2,color + line x2,y,x2,y2,color +} + +macro putpixel x,y,color +{ + mov eax, 1 + mov ebx, x + mov ecx, y + mov edx, color + int 0x40 +} + diff --git a/programs/system/MyKey/trunk/MyKey.asm b/programs/system/MyKey/trunk/MyKey.asm new file mode 100644 index 0000000000..69ae486c91 --- /dev/null +++ b/programs/system/MyKey/trunk/MyKey.asm @@ -0,0 +1,697 @@ +; +; MyKey. Version 0.1. +; +; Author: Asper +; Date of issue: 04.12.2009 +; Compiler: FASM +; Target: KolibriOS +; + +use32 + org 0x0 + + db 'MENUET00' ; 8 byte id + dd 38 ; required os + dd STARTAPP ; program start + dd I_END ; program image size + dd 0x1000000 ; required amount of memory + dd 0x00000000 ; reserved=no extended header + +include "aspAPI.inc" +include 'macros.inc' +include 'editbox_ex.mac' +include 'load_lib.mac' + +include 'debug.inc' +DEBUG equ 0;1 + +N_KEYCOLOR equ 0x00EEEEEE ; Normal button color +C_KEYCOLOR equ 0x00CBE1E1 ; Control button color +A_KEYCOLOR equ 0x000099BB;258778 ; Active button color +C_TEXTCOLOR equ 0x80000000 ; Button caption color +CA_TEXTCOLOR equ 0x80FFFFFF ; Active button caption color + +WIN_X equ 265 +WIN_Y equ 50;175 +WIN_W equ 595 +WIN_H equ 415 ;570 +WIN_COLOR equ 0x04EEEEEE + +BUT_W equ 192;100 +BUT_H equ 23 +BUT_SPACE equ 0 + +MAX_HOTKEYS_NUM equ 15 ; Bad bounding :/. Until we have normal listbox control. +PATH_MAX_CHARS equ 255 + +@use_library + +STARTAPP: + sys_load_library boxlib_name, sys_path, boxlib_name, system_dir0, err_message_found_lib, head_f_l, myimport,err_message_import, head_f_i + cmp eax,-1 + jz close_app + ;mcall 68,11 + ;or eax,eax + ;jz close_app + + mcall 66, 1, 1 ; Set keyboard mode to get scancodes. + mcall 26, 2, 1, ascii_keymap + +;get_mykey_window_slot_number: +; mcall 5, 10 ;wait +; mcall 18, 7 +; mov [mykey_window], eax + +set_event_mask: + mcall 40, 39 + +red: +; .test_slot: +; mov eax, [mykey_window] ; Test is receiver MyKey window +; mov ecx, [it_window] +; cmp eax, ecx +; je @f;still ; if yes still. +; .activate_it_window: +; mov eax, 18 +; mov ebx, 3 +; int 0x40 +; @@: + call draw_window + +still: + call reset_modifiers + + mov eax, 10 ; Wait for an event in the queue. + int 0x40 + + cmp al,1 ; redraw request ? + jz red + cmp al,2 ; key in buffer ? + jz key + cmp al,3 ; button in buffer ? + jz button + cmp al,6 + jz mouse + + jmp still + +key: + mov eax, 2 + int 0x40 + + push eax + mcall 66, 3 + mov edx, eax + and edx, 0x00000FFF + mov dword [modifiers], edx + pop eax + + test word [edit1.flags], 10b;ed_focus ; ᫨ 䮪, 室 + jnz .editbox_input + test word [edit2.flags], 10b;ed_focus ; ᫨ 䮪, 室 + jz @f + .editbox_input: + cmp ah, 0x80 ;if key up + ja still + cmp ah, 42 ;LShift + je still + cmp ah, 54 ;RShift + je still + cmp ah, 56 ;Alt + je still + cmp ah, 29 ;Ctrl + je still + cmp ah, 69 ;Pause/Break + je still + +; cmp [keyUpr],0 +; jne still + + call Scan2ASCII + + push dword edit1 + call [edit_box_key] + + push dword edit2 + call [edit_box_key] + jmp still + @@: + + ;------------------------ + mov cl, byte [hotkeys_num] + .test_next_hotkey: + dec cl + mov bl, cl + and ebx, 0xFF + shl ebx, 5 + mov esi, ebx + add ebx, dword Hotkeys.codes + + cmp ah, byte [ebx] + jne @f + + mov edx, dword [ebx] + shr edx, 8 + cmp edx, dword [modifiers] + jne @f + + push eax + mov eax, PATH_MAX_CHARS + mul cl + mov edx, eax + add edx, dword buf_cmd_params + add eax, dword buf_cmd_line + mov esi, eax + pop eax + call RunProgram + jmp .end_test + @@: + or cl, cl ;cmp cl, 0 + jnz .test_next_hotkey ;jge .test_next_hotkey + .end_test: + ;------------------------ + + jmp still + +button: + mov eax, 17 ; Get pressed button code + int 0x40 + cmp ah, 1 ; Test x button + je close_app + + cmp ah, 2 + jne @f + call AddHotKey + jmp red + @@: + + cmp ah, 5 ; Test if pressed buttons + jb still ; is a HotKey button... + mov al, ah + sub al, 5 + cmp al, byte [hotkeys_num] + jnb still ; ...so, if not then still, + + + mov byte [butt], ah ; if yes then save pressed button ID + and eax, 0xFF;shr ax, 8 + if DEBUG + dps "Button = " + dph eax + end if + mov cl, byte PATH_MAX_CHARS + mul cl + if DEBUG + dps " offset = " + dph eax + end if + mov ebx, eax + add ebx, dword buf_cmd_params + add eax, dword buf_cmd_line + + mov dword [edit1.text], eax + mov dword [edit2.text], ebx + + mov esi, eax + call strlen + if DEBUG + dps " len = " + dph ecx + newline + end if + mov dword [edit1.size], ecx + mov dword [edit1.pos], ecx + + mov esi, ebx + call strlen + mov dword [edit2.size], ecx + mov dword [edit2.pos], ecx + + jmp red ;still + +mouse: + push dword edit1 + call [edit_box_mouse] + + push dword edit2 + call [edit_box_mouse] + + ;test word [edit1.flags],10b;ed_focus ; ᫨ 䮪, 室 + ;jne still + jmp still + + +close_app: + mov eax,-1 ; close this program + int 0x40 + + +draw_window: + start_draw_window WIN_X,WIN_Y,WIN_W,WIN_H,WIN_COLOR,labelt, 11;labellen-labelt + + push dword edit1 + call [edit_box_draw] + + push dword edit2 + call [edit_box_draw] + + stdcall draw_button, 7,WIN_H-30,80,20,2,C_KEYCOLOR,AddKeyText, 0,C_TEXTCOLOR ; Add Hot key. + if 0 + stdcall draw_button, 90,WIN_H-30,80,20,3,C_KEYCOLOR,DeleteKeyText,0,C_TEXTCOLOR ; Delete Hot key. + stdcall draw_button, 173,WIN_H-30,80,20,4,C_KEYCOLOR,ManageKeyText,0,C_TEXTCOLOR ; Manage Hot key. + end if + + movzx ecx, byte [hotkeys_num] + cmp ecx, MAX_HOTKEYS_NUM + jng @f + mov ecx, MAX_HOTKEYS_NUM + @@: + mov eax, 30 + mov ebx, 5 + @@: + or cl, cl + jz @f + + mov edx, ebx + sub edx, 5 + shl edx, 5; edx=edx*32 + add edx, dword Hotkeys + + cmp bl, byte [butt] + jne .l1 + stdcall draw_button, 7,eax,BUT_W,BUT_H,ebx,A_KEYCOLOR,edx,0,CA_TEXTCOLOR ; F5 + jmp .l2 + .l1: + stdcall draw_button, 7,eax,BUT_W,BUT_H,ebx,N_KEYCOLOR,edx,0,C_TEXTCOLOR ; F5 + .l2: + + add eax, BUT_H+BUT_SPACE + inc ebx + dec cl + jmp @b + @@: + end_draw_window +ret + + +AddHotKey: + mov al, byte [hotkeys_num] + cmp al, MAX_HOTKEYS_NUM + jge .end + inc al + mov byte [hotkeys_num], al + + mov eax, 51 + mov ebx, 1 + mov ecx, start_input_thread + mov edx, dword input_thread_stack_top + mcall + + .end: + ret + + +reset_modifiers: + pusha + mov esi, dword [it_hotkey_addr] + test esi, esi + jz .end_set_mods + + lodsd + + mov cl, al ; set new hotkey + shr eax, 8 + + xor edx, edx + push cx + mov cl, 3 + .next_pair: + shl edx, 4 + mov bl, al + and bl, 3 + + or bl, bl + jz .l1 + + cmp bl, 3 ; both? + jne @f + or dl, 2 + jmp .l1 + @@: + add bl, 2 + or dl, bl + .l1: + shr eax, 2 + dec cl + test cl, cl + jnz .next_pair + + mov bx, dx + and bx, 0xF0F + xchg bl, bh + and dx, 0x0F0 + or dx, bx + pop cx + + mcall 66, 4 + .end_set_mods: + popa +ret + + +;######################## Input Thread code start ########################## + +start_input_thread: + +;get_it_window_slot_number: +; mcall 5, 10 ;wait +; mcall 18, 7 +; mov [it_window], eax + mov ecx, 1 ; to get scancodes. + mov eax, 66 + mov ebx, 1 ; Set keyboard mode + int 0x40 + mcall 26, 2, 1, ascii_keymap + mov dword [it_hotkey_addr], 0 + +it_set_editbox: + mov al, byte [hotkeys_num] + sub al, 1 + and eax, 0xFF + shl eax, 5 + add eax, dword Hotkeys.names + mov dword [it_edit.text], eax + + mov esi, eax + call strlen + mov dword [it_edit.size], ecx + mov dword [it_edit.pos], ecx + + +it_set_event_mask: + mcall 40, 39 +it_red: + call it_draw_window + +it_still: + mov eax, 10 ; Wait for an event in the queue. + int 0x40 + + cmp al,1 ; redraw request ? + jz it_red + cmp al,2 ; key in buffer ? + jz it_key + cmp al,3 ; button in buffer ? + jz button + cmp al,6 + jz it_mouse + + jmp it_still + +it_key: + mov eax, 2 + int 0x40 + + mov byte [it_keycode], 0 + stdcall outtextxy, 10, 100, ctrl_key_names, 35, 0 + cmp ah, 0x80 ;if key up + ja .end + cmp ah, 42 ;[Shift] (left) + je .end + cmp ah, 54 ;[Shift] (right) + je .end + cmp ah, 56 ;[Alt] + je .end + cmp ah, 29 ;[Ctrl] + je .end + cmp ah, 69 ;[Pause Break] + je .end + + + ;------------------------ + mov cl, byte [hotkeys_num] + .test_next_hotkey: + mov bl, cl + and ebx, 0xFF + shl ebx, 5 + mov esi, ebx + add ebx, dword Hotkeys.codes + cmp ah, byte [ebx] + jne @f + + push eax + mov eax, PATH_MAX_CHARS + mul cl + add eax, dword buf_cmd_line + mov esi, eax + pop eax + mov edx, 0 ; no parametrs yet <- change it! + call RunProgram + jmp .end_test + @@: + dec cl + cmp cl, 0 + jge .test_next_hotkey + .end_test: + ;------------------------ + + mov byte [it_keycode], ah + call Scan2ASCII + + test word [it_edit.flags], 10b;ed_focus ; ᫨ 䮪, 室 + jz .end + push dword it_edit + call [edit_box_key] + jmp it_still + .end: + + call it_test_key_modifiers + mov al, byte [it_keycode] + test al, al + jz @f + shl edx, 8 + mov dl, al + + mov eax, dword [it_hotkey_addr] + test eax, eax + jnz @f + mov al, byte [hotkeys_num] + sub al, 1 + and eax, 0xFF + shl eax, 5 + add eax, dword Hotkeys.codes + mov dword [eax], edx + mov dword [it_hotkey_addr], eax + + mov cl, dl ; finally set hotkey + shr edx, 8 + mcall 66, 4 + @@: + + jmp it_still + + +it_test_key_modifiers: + push eax + mcall 66, 3 ;get control keys state + mov edx, eax + and edx, 0x00000FFF + .lshift: + test al, 1 ; LShift ? + jz .rshift + stdcall outtextxy, 10, 100, ctrl_key_names, 6, 0x00FF0000 + .rshift: + test al, 2 ; RShift ? + jz .lctrl + stdcall outtextxy, 184, 100, ctrl_key_names+29, 6, 0x00FF0000 + .lctrl: + test al, 4 ; LCtrl ? + jz .rctrl + stdcall outtextxy, 52, 100, ctrl_key_names+7, 5, 0x00FF0000 + .rctrl: + test al, 8 ; RCtrl ? + jz .lalt + stdcall outtextxy, 148, 100, ctrl_key_names+23, 5, 0x00FF0000 + .lalt: + test al, 0x10 ; LAlt ? + jz .ralt + stdcall outtextxy, 88, 100, ctrl_key_names+13, 4, 0x00FF0000 + .ralt: + test al, 0x20 ; RAlt ? + jz @f + stdcall outtextxy, 118, 100, ctrl_key_names+18, 4, 0x00FF0000 + @@: + pop eax +ret + +it_mouse: + + push dword it_edit + call [edit_box_mouse] + + jmp it_still + +it_draw_window: + start_draw_window WIN_X,WIN_Y+250,225,70,WIN_COLOR,it_labelt, 26;labellen-labelt + + push dword it_edit + call [edit_box_draw] + + stdcall outtextxy, 10, 100, ctrl_key_names, 35, 0 + ;stdcall draw_button, 7,WIN_H-30,80,20,2,C_KEYCOLOR,AddKeyText, 0,C_TEXTCOLOR ; Add Hot key. + end_draw_window +ret + + +;######################## Input Thread code end ########################## + + +Scan2ASCII: + push esi + mov esi, ascii_keymap + shr eax, 8 + add esi, eax + lodsb + shl eax, 8 + pop esi +ret + + +;**************************************** +;* input: esi = pointer to string * +;* output: ecx = length of the string * +;**************************************** +strlen: + push eax + xor ecx, ecx + @@: + lodsb + or al, al + jz @f + inc ecx + jmp @b + @@: + pop eax + ret + +;******************************************** +;* input: esi = pointer to the file name * +;* edx = pointer to the parametrs * +;******************************************** + +RunProgram: + pusha + mov dword [InfoStructure], 7 ; run program + mov dword [InfoStructure+4], 0 ; flags + mov dword [InfoStructure+8], edx ; pointer to the parametrs + mov dword [InfoStructure+12], 0 ; reserved + mov dword [InfoStructure+16], 0 ; reserved + mov dword [InfoStructure+20], 0 ; reserved + mov dword [InfoStructure+21], esi ; pointer to the file name + mov eax, 70 + mov ebx, InfoStructure + int 0x40 + cmp eax, 0 + jl .err_out + .out: + popa + clc + ret + .err_out: + print "Can't load program" + popa + stc + ret + + +; DATA AREA + +; Application Title +labelt db 'MyKey v.0.1' +;mykey_window dd 0 ; Slot number of MyKey + + +;########### Input Thread data start ############ + +; Input Thread Title +it_labelt db "Input hotkey and it's name" +;labellen: +it_edit edit_box 180, 20, 30, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, 31, it_buf_cmd_line, 0, 0 +it_buf_cmd_line db MAX_HOTKEYS_NUM*32 dup(0) ; !Make it dinamyc!!! +;it_window dd 0 ; Slot number of Input thread +it_keycode db 0 +it_hotkey_addr dd 0 +;########### Input Thread data end ############ + +;Button names +AddKeyText db 'Add',0 +DeleteKeyText db 'Delete',0 +ManageKeyText db 'Manage',0 + + +hotkeys_num db 0;15 +;keyboard_mode db 0 ; Scan or ASCII keys to send ? 0 - ASCII , 1 - Scan +butt db 5 ; Pressed button ID +modifiers dd 0 + +;Data structures for loadlib.mac and editbox_ex.mac [ +edit1 edit_box 350, 220, 30, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, PATH_MAX_CHARS+1, buf_cmd_line, 0, 0 +edit2 edit_box 350, 220, 50, 0xffffff, 0xAA80, 0x0000ff, 0x0, 0x0, PATH_MAX_CHARS+1, buf_cmd_params, 0, 0 + +buf_cmd_line db MAX_HOTKEYS_NUM*PATH_MAX_CHARS dup(0) ; !Make it dinamyc!!! +buf_cmd_params db MAX_HOTKEYS_NUM*PATH_MAX_CHARS dup(0) ; !Make it dinamyc!!! + +sys_path: +system_dir0 db '/sys/lib/' +boxlib_name db 'box_lib.obj',0 + +err_message_found_lib db "Can't find box_lib.obj",0 +head_f_i: +head_f_l db 'System error',0 +err_message_import db 'Error on import box_lib.obj',0 + +align 4 +myimport: +edit_box_draw dd aEdit_box_draw +edit_box_key dd aEdit_box_key +edit_box_mouse dd aEdit_box_mouse +version_ed dd aVersion_ed + dd 0,0 + +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 +aEdit_box_mouse db 'edit_box_mouse',0 +aVersion_ed db 'version_ed',0 + +;] Data structures for loadlib.mac and editbox_ex.mac + +InfoStructure: + dd 0x0 ; subfunction number + dd 0x0 ; position in the file in bytes + dd 0x0 ; upper part of the position address + dd 0x0 ; number of bytes to read + dd 0x0 ; pointer to the buffer to write data + db 0 + dd 0 ; pointer to the filename + + +I_END: ; End of application code and data marker + + rb 300 ;input thread stack size +input_thread_stack_top: + +ascii_keymap: + db 128 dup(?) +ctrl_key_names db 'LShift LCtrl LAlt RAlt RCtrl RShift',0 + +Hotkeys: ;(name = 32 b) + (modifiers = 3 b) + (keycode = 1 b) = 36 byte for 1 hotkey + .names: + db 'My Favorite 1',0 + rb 18 + db 'My Favorite 2',0 + rb 18 + db 'My Favorite 3',0 + rb 18 + rb MAX_HOTKEYS_NUM*32-3 + .codes: + dd MAX_HOTKEYS_NUM dup (0) diff --git a/programs/system/MyKey/trunk/ReadMe.txt b/programs/system/MyKey/trunk/ReadMe.txt new file mode 100644 index 0000000000..ffdb0922e3 --- /dev/null +++ b/programs/system/MyKey/trunk/ReadMe.txt @@ -0,0 +1,51 @@ +== MyKey== + + MyKey - . + : +1. "Add" +2. + Ctrl, Alt, Shift. +3. . +4. + . +5. , + - . + + : +a. . +b. . +c. . + + : 0.1 + +==== +Asper + + + +==About program MyKey== + + MyKey - is intended to fast load applications by pressing key combinations +on the keyboard. + To add a new hotkey: +1. Press "Add" button. +2. In the appeared dialog window input a new key or a key combination + with Ctrl, Alt, Shift modifiers. +3. Input key name. +4. After that close the dialog window and in the main window select + added button. +5. In the upper text field input path and name of the program to be executed, + in the lower text field - parametrs have to be passed to program. + + ToDo: +a. Load and save of configuration file will be implemented in the next version. +b. Delete hotkeys. +c. Change hotkeys that are already set. + +Version number: 0.1 + +==Author== +Asper + + +mailto: asper.85@mail.ru diff --git a/programs/system/MyKey/trunk/config.inc b/programs/system/MyKey/trunk/config.inc new file mode 100644 index 0000000000..dc70bf9760 --- /dev/null +++ b/programs/system/MyKey/trunk/config.inc @@ -0,0 +1 @@ +__CPU_type fix p5 diff --git a/programs/system/MyKey/trunk/debug.inc b/programs/system/MyKey/trunk/debug.inc new file mode 100644 index 0000000000..8564deb889 --- /dev/null +++ b/programs/system/MyKey/trunk/debug.inc @@ -0,0 +1,162 @@ +;include 'kinc/imports.inc' + +macro debug_print str +{ + local ..string, ..label + + jmp ..label + ..string db str,0 + ..label: + + pushf + pushad + ;mov edx,..string + mov esi, ..string + ;call debug_outstr + call SysMsgBoardStr + popad + popf +} + +dps fix debug_print + +macro debug_print_dec arg +{ + pushf + pushad + if ~arg eq eax + mov eax,arg + end if + call debug_outdec + popad + popf +} + +dpd fix debug_print_dec + +;--------------------------------- +debug_outdec: ;(eax - num, edi-str) + push 10 ;2 + pop ecx ;1 + push -'0' ;2 + .l0: + xor edx,edx ;2 + div ecx ;2 + push edx ;1 + test eax,eax ;2 + jnz .l0 ;2 + .l1: + pop eax ;1 + add al,'0' ;2 + call debug_outchar ; stosb + jnz .l1 ;2 + ret ;1 +;--------------------------------- + +debug_outchar: ; al - char + pushf + pushad + ;mov cl,al + ;mov eax,63 + ;mov ebx,1 + ;int 0x40 + mov bl, al + mov eax, 1 + call SysMsgBoardChar + popad + popf +ret + +;debug_outstr: +; mov eax,63 +; mov ebx,1 +; @@: +; mov cl,[edx] +; test cl,cl +; jz @f +; int 40h +; inc edx +; jmp @b +; @@: +; ret + + +macro newline +{ + dps <13,10> +} + +macro print message +{ + dps message + newline +} + +macro pregs +{ + dps "EAX: " + dpd eax + dps " EBX: " + dpd ebx + newline + dps "ECX: " + dpd ecx + dps " EDX: " + dpd edx + newline +} + +macro debug_print_hex arg +{ + pushf + pushad + if ~arg eq eax + mov eax, arg + end if + call debug_outhex + popad + popf +} +dph fix debug_print_hex + +debug_outhex: + ; eax - number + pushf + pushad + mov edx, 8 + .new_char: + rol eax, 4 + movzx ecx, al + and cl, 0x0f + mov cl, [__hexdigits + ecx] + pushad + mcall 63, 1 + popad + dec edx + jnz .new_char + popad + popf +ret + +SysMsgBoardChar: + mov cl, al + mov eax, 63 + mov ebx, 1 + int 0x40 +ret + +SysMsgBoardStr: + push eax + @@: + lodsb + or al, al + jz @f + call SysMsgBoardChar + jmp @b + @@: + pop eax +ret + + +__hexdigits: + db '0123456789ABCDEF' \ No newline at end of file diff --git a/programs/system/MyKey/trunk/editbox_ex.mac b/programs/system/MyKey/trunk/editbox_ex.mac new file mode 100644 index 0000000000..5e85004670 --- /dev/null +++ b/programs/system/MyKey/trunk/editbox_ex.mac @@ -0,0 +1,79 @@ +ed_struc_size=72 +struc edit_box width,left,top,color,shift_color,focus_border_color,\ + blur_border_color,text_color,max,text,mouse_variable,flags,size,pos +{ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;Bit mask from editbox +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ed_figure_only= 1000000000000000b ; ᨬ +ed_always_focus= 100000000000000b +ed_focus= 10b ;䮪 ਫ +ed_shift_on= 1000b ;᫨ ⠭ - shift,᫨ ⠭, 㦥 - 㤥ন shift +ed_shift_on_off=1111111111110111b +ed_shift= 100b ;砥 ⨨ shift .. ᫨ +ed_shift_off= 1111111111111011b +ed_shift_bac= 10000b ; ⪨ 뤥 shift .. ⠭ 뤥 +ed_shift_bac_cl=1111111111101111b ;⪠ 㤠 뤥 +ed_shift_cl= 1111111111100011b +ed_shift_mcl= 1111111111111011b +ed_left_fl= 100000b +ed_right_fl= 1111111111011111b +ed_offset_fl= 1000000b +ed_offset_cl= 1111111110111111b +ed_insert= 10000000b +ed_insert_cl= 1111111101111111b +ed_mouse_on = 100000000b +ed_mous_adn_b= 100011000b +ed_mouse_on_off=1111111011111111b +ed_height=14 ; + +.width dd width +.left dd left +.top dd top +.color dd color +.shift_color dd shift_color +.focus_border_color dd focus_border_color +.blur_border_color dd blur_border_color +.text_color dd text_color +.max dd max +.text dd text +.mouse_variable dd mouse_variable +.flags dd flags+0 +.size dd size+0 +.pos dd pos+0 +.offset dd 0 +.cl_curs_x dd 0 +.cl_curs_y dd 0 +.shift dd 0 +.shift_old dd 0 +} +struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags +{ ; ࠬ஢ 祪 +ch_flag_en=10b +.left: dw left ;+0 ; +.top: dw top ; +.ch_text_margin: dd ch_text_margin ;ﭨ אַ㣮쭨 祪 +.ch_size: dd ch_size ;ࠧ 祪 , ਬ 12 +.color: dd color ;梥 祪 +.border_color: dd border_color ;梥 ࠬ +.text_color: dd text_color ;梥 +.text: dd text ; ணࠬ ᯮ ⥪ +.ch_text_length: dd ch_text_length ; ப ᨬ +.flags: dd flags+0 ; 䫠 +} +struc option_box point_gr,left,top,op_text_margin,op_size,color,border_color,text_color,text,op_text_length,flags +{ ; ࠬ஢ 祪 +op_flag_en=10b +.option_group: dd point_gr +.left: dw left ;+0 ; +.top: dw top ; +.ch_text_margin: dd op_text_margin ;ﭨ אַ㣮쭨 祪 +.ch_size: dd op_size ;ࠧ 祪 , ਬ 12 +.color: dd color ;梥 祪 +.border_color: dd border_color ;梥 ࠬ +.text_color: dd text_color ;梥 +.text: dd text ; ணࠬ ᯮ ⥪ +.ch_text_length: dd op_text_length ; ப ᨬ +.flags: dd flags+0 ; 䫠 +} + diff --git a/programs/system/MyKey/trunk/load_lib.mac b/programs/system/MyKey/trunk/load_lib.mac new file mode 100644 index 0000000000..bda5c92e2e --- /dev/null +++ b/programs/system/MyKey/trunk/load_lib.mac @@ -0,0 +1,634 @@ +;08.05.2009 - bugfix +;14.04.2009 - a macros for code load library the box_lib.obj from '/sys/lib/' or current dirrectory. +; The macros for load any library/libraries: +; Copyright (c) 2009, +; All rights reserved. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; * Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; * Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; * Neither the name of the nor the +; names of its contributors may be used to endorse or promote products +; derived from this software without specific prior written permission. +; +; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka ''AS IS'' AND ANY +; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;***************************************************************************** +; This macros based on source code: +; - Alexey Teplov / +; Mario79, Mario - Marat Zakiyanov / +; Diamondz - Evgeny Grechnikov / +;------------------------ +; DESCRIPTION +; Macro load_library +; Logick of work. +; A first time we must to check system path, where I belive find a system library. System path is "/sys/lib/". +; If I cannot found my library, i must to check second way. Second way is current dirrectory. +; If we cannot load library, we must show the error message: +; "I'm sorry,the programm cannot found system library box_lib.obj." +; "The find was make on 2 ways: /sys/lib/ and current dirrectory." +; +; +;--------------------------------------------------------------------- +; Macro sys_load_library +; A first time we must to check own path in current dirrectory the program, where I belive find a system library. +; If I cannot found my library, i must to check second way. Second way is system path a "/sys/lib/". +; If we cannot load library, we must show the error message: +; "I'm sorry,the programm cannot found system library box_lib.obj." +; "The find was make on 2 ways: /sys/lib/ and current dirrectory." +; +;--------------------------------------------------------------------- +; How can I use it? +;--------------------------------------------------------------------- +;-Example using single load library +;-universal load library/librarys +;load_library library_name__, cur_dir_path__, library_path__, system_path__, \ +;err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__ +;-if return code =-1 then exit, else normally work +; cmp eax,-1 +; jz exit +;- Well, if you get +; +;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +;DATA +; . +;system_path__ db '/sys/lib/' +;library_name__ db 'box_lib.obj',0 +; , +;system_path__ db '/sys/lib/box_lib.obj',0 +;... . +;library_name__ db 'box_lib.obj',0 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;err_message_found_lib__ db 'Sorry I cannot found library box_lib.obj',0 +;head_f_i__: +;head_f_l__ db 'System error',0 +;err_message_import__ db 'Error on load import library box_lib.obj',0 + +;myimport: +; +;edit_box_draw dd aEdit_box_draw +;edit_box_key dd aEdit_box_key +;edit_box_mouse dd aEdit_box_mouse +;version_ed dd aVersion_ed +; +;check_box_draw dd aCheck_box_draw +;check_box_mouse dd aCheck_box_mouse +;version_ch dd aVersion_ch +; +;option_box_draw dd aOption_box_draw +;option_box_mouse dd aOption_box_mouse +;version_op dd aVersion_op + +; dd 0 +; dd 0 +; +;aEdit_box_draw db 'edit_box',0 +;aEdit_box_key db 'edit_box_key',0 +;aEdit_box_mouse db 'edit_box_mouse',0 +;aVersion_ed db 'version_ed',0 + +;aCheck_box_draw db 'check_box_draw',0 +;aCheck_box_mouse db 'check_box_mouse',0 +;aVersion_ch db 'version_ch',0 + +;aOption_box_draw db 'option_box_draw',0 +;aOption_box_mouse db 'option_box_mouse',0 +;aVersion_op db 'version_op',0 + +;--------------------------------------------------------------------- +macro @use_library +{ + +local __sc +local lp +local lp1 +local correction +;local end_tr +local exit_ +;/equ +err_message1 equ dword [esp+8] +head1 equ dword [esp+4] + + +__sc.frame equ dword [__sc+0] +__sc.grab equ dword [__sc+4] +__sc.grab_button equ dword [__sc+8] +__sc.grab_button_text equ dword [__sc+12] +__sc.grab_text equ dword [__sc+16] +__sc.work equ dword [__sc+20] +__sc.work_button equ dword [__sc+24] +__sc.work_button_text equ dword [__sc+28] +__sc.work_text equ dword [__sc+32] +__sc.work_graph equ dword [__sc+36] + +;;;;;;;;;;;CALC WIDTH & HIGHT WINDOW & CENTER MONITOR POSITION;;;;;;;;;; +show_err_: +;check memory + push dword [arrea_xx] + pop eax + test eax,eax + jnz @f + + mcall 68,11 + mcall 68,12,4096 + push eax + pop dword [arrea_xx] + + push head1 + pop dword[eax] + + push 0x0 + pop dword[eax+4] + +@@: + mov eax,48 ;get system color + mov ebx,3 + mov ecx,__sc + mov edx,sizeof.system_colors + mcall +;----------------------------------- + xor eax,eax + mov esi,err_message1 + mov ecx,30 +align 4 +lp: add ecx,7 + lodsb + test eax,eax + jnz lp + + push dword [arrea_xx] + pop ebp + +align 4 +@@: add ebp,4 + mov eax,dword [ebp] + + test eax,eax + jnz @b + + push err_message1 + pop dword[ebp] + + mov dword [ebp+4],eax + + mcall 48,5 ;get system window + cmp word[on_x],cx + jae @f; + + sub eax,ecx + shl eax,15 + mov ax,cx + mov dword [on_x],eax + +@@: + add word [on_y],12 + sub bx,word [on_y] + shl ebx,15 + mov bx,word [on_y] + mov dword [on_y],ebx + + ret + + +;;;;;;;;;;;DRAW WINDOW;;;;;;;;;;;;;; +align 4 +start__: + mcall 40,0x5 ;set mask on events rewraw window and get id button. +.red_win: +;draw_window: + mcall 12,1 + + xor eax,eax + mov ebp,dword [arrea_xx] ; set point + mov ebx,dword [on_x] + mov ecx,dword [on_y] + mov edx,__sc.work + or edx,0x33000000 + mov esi,__sc.grab_text + xor edi,edi + mov edi,dword [ebp] ;head1 + mcall + + mov ebx,(10*65536+25-12) + add ebp,4 ;inc index + +@@: + mov eax,4 + add bx,12 + mov ecx,__sc.grab_text + or ecx,0x90000000 + mov edx,dword [ebp] ;err_message1 + mcall + + add ebp,4 ;inc index + + mov eax,dword [ebp] + test eax,eax + jnz @b + + mcall 12,2 +align 4 + +.still: ;main loop + mcall 10 ;wait event + dec eax + jz .red_win + sub eax,2 + jnz .still ;go to main loop +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +.button: + mcall 17 ;get id button + test ah,ah ;if in ah 0, then go to still + jz .still + mcall -1 + ret + +align 4 +__sc system_colors +on_x dd 0x0 +on_y dd 0x0000004E +arrea_xx dd 0x0 +rb 0x50 +end_tr: + +;--------------------------------------------------------------------- +@library_name equ dword [esp+12] +@cur_dir_path equ dword [esp+8] +@library_path equ dword [esp+4] + +align 4 +@copy_path: + mov ebx,@library_name + mov esi,@cur_dir_path + mov edi,@library_path + + xor eax,eax + cld +.lp1: + lodsb + stosb + test eax,eax + jnz .lp1 + mov esi,edi + + std +.lp2: + lodsb + cmp al,'/' + jnz .lp2 + mov edi,esi + mov esi,ebx + add edi,2 + + + cld +.lp3: + lodsb + stosb + test eax,eax + jnz .lp3 +;--------------------------------------------------------------------- + ret +} + + + +macro sys_load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__ +{ +local end_steep +local exit +;--------------------------------------------------------------------- +; loading Box_Lib library + + mcall 68,19,system_path__ ; load of sys directory + test eax,eax + jnz end_steep + + copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library + + mcall 68,19,library_path__ ; load of alternative + test eax,eax + jnz end_steep + show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window + jmp exit + + +align 4 +end_steep: + + import_boxlib myimport, err_message_import__, head_f_i__ ;import +exit: + test eax,eax + jz @f + + mcall 51,1,start__,end_tr ; + or eax,-1 +@@: + +;--------------------------------------------------------------------- +} + + +macro load_library library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, myimport, err_message_import__, head_f_i__ +{ +local end_steep +local exit +;--------------------------------------------------------------------- +; loading Box_Lib library + + copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library + + mcall 68,19,library_path__ ; load of alternative + test eax,eax + jnz end_steep + + mcall 68,19,system_path__ ; load of sys directory + test eax,eax + jnz end_steep + + show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window + jmp exit + +align 4 +end_steep: + + import_boxlib myimport, err_message_import__, head_f_i__ ;import +exit: + test eax,eax + jz @f + + mcall 51,1,start__,end_tr ; + or eax,-1 +@@: + +;--------------------------------------------------------------------- +} +macro sys_load_libraries _start,_end +{ +local exit_lp2 +local lp2 +local lp +local end_steep +local next +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +library_name__ equ [ebp] +cur_dir_path__ equ [ebp+4] +library_path__ equ [ebp+8] +system_path__ equ [ebp+12] +err_message_found_lib__ equ [ebp+16] +head_f_l__ equ [ebp+20] +my_import equ [ebp+24] +err_message_import__ equ [ebp+28] +head_f_i__ equ [ebp+32] +adr_load_lib equ dword [ebp+36] +status_lib equ dword [ebp+40] + + mov ebp,_start + mov ecx,((_end-_start)/ll_struc_size) + +align 4 +lp: push ecx + mcall 68,19,system_path__ ; load of sys directory + test eax,eax + jnz end_steep + + copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library + + mcall 68,19,library_path__ ; load of alternative + test eax,eax + jnz end_steep + + or status_lib,0x1 ; status of code - enable error - not found library + + show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window + jmp next + +align 4 +end_steep: + mov adr_load_lib,eax ;save adr lib in memory + import_boxlib my_import, err_message_import__, head_f_i__ ;import + + test eax,eax + jz next + + or status_lib,0x2 ; status of code - enable error - import error + +next: + pop ecx + add ebp,ll_struc_size + dec ecx + jnz lp + +;---------------------------------- + mov ebp,_start + mov ecx,((_end-_start)/ll_struc_size) + +align 4 +lp2: + mov eax,status_lib + test eax,eax + jz @f + + mcall 51,1,start__,end_tr ; + or eax,-1 + jmp exit_lp2 + +@@: + add ebp,ll_struc_size + dec ecx + jnz lp2 +exit_lp2: +} + +macro load_libraries _start,_end +{ +local lp2 +local exit_lp2 +local lp +local end_steep +local next +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +library_name__ equ [ebp] +cur_dir_path__ equ [ebp+4] +library_path__ equ [ebp+8] +system_path__ equ [ebp+12] +err_message_found_lib__ equ [ebp+16] +head_f_l__ equ [ebp+20] +my_import equ [ebp+24] +err_message_import__ equ [ebp+28] +head_f_i__ equ [ebp+32] +adr_load_lib equ dword [ebp+36] +status_lib equ dword [ebp+40] + + mov ebp,_start + mov ecx,((_end-_start)/ll_struc_size) + +align 4 +lp: push ecx + + copy_path library_name__, cur_dir_path__, library_path__ ;the macros making way /current pach a program/+ name system library + + mcall 68,19,library_path__ ; load of alternative + test eax,eax + jnz end_steep + + mcall 68,19,system_path__ ; load of sys directory + test eax,eax + jnz end_steep + + or status_lib,0x1 ; status of code - enable error - not found library + + show_error_window err_message_found_lib__, head_f_l__ ;show error message /create window + jmp next + +align 4 +end_steep: + mov adr_load_lib,eax ;save adr lib in memory + + import_boxlib my_import, err_message_import__, head_f_i__ ;import + + test eax,eax + jz next + + or status_lib,0x2 ; status of code - enable error - import error + +next: + pop ecx + add ebp,ll_struc_size + dec ecx + jnz lp + +;----------------------------------------------- + mov ebp,_start + mov ecx,((_end-_start)/ll_struc_size) + +align 4 +lp2: + mov eax,status_lib + test eax,eax + jz @f + + mcall 51,1,start__,end_tr ; + or eax,-1 + jmp exit_lp2 + +@@: + add ebp,ll_struc_size + dec ecx + jnz lp2 +exit_lp2: + +} + + +macro copy_path lib_name,dir_path,lib_path +{ + pushad ;save all registers + push dword lib_name + push dword dir_path + push dword lib_path + + call @copy_path + + add esp,12 + popad ;restore all registers +} + +macro show_error_window err_message, head +{ pushad ;save all registers + push dword err_message + push dword head + + call show_err_ + + add esp,8 + popad ;restore all registers + or eax,-1 ; +} + + +macro import_boxlib myimport, err_message_import__, head_f_i__ +{ +local import_loop +local import_find +local lp +local import_find_next +local import_found +local import_done +local exit +local e.exit +local import_not_found +; initialize import + + mov edx, eax + mov esi,myimport +import_loop: + lodsd + test eax, eax + jz import_done + push edx +import_find: + mov ebx, [ds:edx] + test ebx, ebx + jz import_not_found + push eax +lp: + mov cl, [ds:eax] + cmp cl, [ds:ebx] + jnz import_find_next + test cl, cl + jz import_found + inc eax + inc ebx + jmp lp +import_find_next: + pop eax + add edx, 8 + jmp import_find +import_found: + pop eax + mov eax, [ds:edx+4] + mov [esi-4], eax + pop edx + jmp import_loop +import_not_found: + add esp,4 + show_error_window err_message_import__, head_f_i__ ;show error message /create window + jmp e.exit +import_done: + xor eax,eax +e.exit: +;--------------------------------------------------------------------- +} +ll_struc_size = 44;($-library_name__) ; constant size of struct +struc l_libs library_name__, cur_dir_path__, library_path__, system_path__, err_message_found_lib__, head_f_l__, my_import, err_message_import__, head_f_i__; struct for loading libraries +{ +.library_name__ dd library_name__ ; +.cur_dir_path__ dd cur_dir_path__ ; + +.library_path__ dd library_path__ ; , , , , +.complete_path dd system_path__ ; + +.err_message_found_lib__ dd err_message_found_lib__ +.head_f_l__ dd head_f_l__ +.my_import dd my_import +.err_message_import__ dd err_message_import__ +.head_f_i__ dd head_f_i__ + +.adr_load_lib dd 0x0 +.status_lib dd 0x0 ;status of load library +; +} diff --git a/programs/system/MyKey/trunk/macros.inc b/programs/system/MyKey/trunk/macros.inc new file mode 100644 index 0000000000..d4689a5d31 --- /dev/null +++ b/programs/system/MyKey/trunk/macros.inc @@ -0,0 +1,543 @@ +@^ fix macro comment { +^@ fix } + +; ------------------------- +macro library [lname,fname] +{ + forward + dd __#lname#_library_table__,__#lname#_library_name__ + common + dd 0 + forward + align 4 + __#lname#_library_name__ db fname,0 +} + +macro import lname,[name,sname] +{ + common + align 4 + __#lname#_library_table__: + forward + if used name + name dd __#name#_import_name__ + end if + common + dd 0 + forward + if used name + align 4 + __#name#_import_name__ db sname,0 + end if +} + +macro export [name,sname] +{ + forward + dd __#name#_export_name__,name + common + dd 0 + forward + align 4 + __#name#_export_name__ db sname,0 +} +; ------------------------- + +macro m2m dest,src { + push src + pop dest +} + + +macro iglobal { + IGlobals equ IGlobals, + macro __IGlobalBlock { } + +macro uglobal { + UGlobals equ UGlobals, + macro __UGlobalBlock { } + +endg fix } ; Use endg for ending iglobal and uglobal blocks. + + +macro IncludeIGlobals{ + macro IGlobals dummy,[n] \{ __IGlobalBlock + purge __IGlobalBlock \} + match I, IGlobals \{ I \} } + +macro IncludeUGlobals{ + macro UGlobals dummy,[n] \{ + \common + \local begin, size + begin = $ + virtual at $ + \forward + __UGlobalBlock + purge __UGlobalBlock + \common + size = $ - begin + end virtual + rb size + \} + match U, UGlobals \{ U \} } + +uglobal +endg + +iglobal +endg + + +; new application structure +macro meos_app_start + { + use32 + org 0x0 + + db 'MENUET01' + dd 0x01 + dd __start + dd __end + dd __memory + dd __stack + + if used __params & ~defined __params + dd __params + else + dd 0x0 + end if + + dd 0x0 + } +MEOS_APP_START fix meos_app_start + +macro code + { + __start: + } +CODE fix code + +macro data + { + __data: + IncludeIGlobals + } +DATA fix data + +macro udata + { + if used __params & ~defined __params + __params: + db 0 + __end: + rb 255 + else + __end: + end if + __udata: + IncludeUGlobals + } +UDATA fix udata + +macro meos_app_end + { + align 32 + rb 2048 + __stack: + __memory: + } +MEOS_APP_END fix meos_app_end + + +; macro for defining multiline text data +struc mstr [sstring] + { + forward + local ssize + virtual at 0 + db sstring + ssize = $ + end virtual + dd ssize + db sstring + common + dd -1 + } + +; macro for defining multiline text data +struc mls [sstring] + { + forward + local ssize + virtual at 0 + db sstring ; mod + ssize = $ + end virtual + db ssize + db sstring + common + db -1 ; mod + } + + + +; strings +macro sz name,[data] { ; from MFAR [mike.dld] + common + if used name + name db data + .size = $-name + end if +} + +macro lsz name,[lng,data] { ; from MFAR [mike.dld] + common + if used name + label name + forward + if lang eq lng + db data + end if + common + .size = $-name + end if +} + +macro szc name,elsz,[data] { ; from MFAR [mike.dld] + common + local s,m + m = 0 + if used name + label name + forward + virtual at 0 + db data + s = $ + end virtual + d#elsz s + if m < s + m = s + end if + db data + common + .size = $-name + .maxl = m + end if +} + +macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld] + common + local s,m,c + m = 0 + c = 0 + if used name + label name + forward + if lang eq lng + virtual at 0 + db data + s = $ + end virtual + d#elsz s + if m < s + m = s + end if + db data + c = c+1 + end if + common + .size = $-name + .maxl = m + .count = c + end if +} + + +; easy system call macro +macro mpack dest, hsrc, lsrc +{ + if (hsrc eqtype 0) & (lsrc eqtype 0) + mov dest, (hsrc) shl 16 + lsrc + else + if (hsrc eqtype 0) & (~lsrc eqtype 0) + mov dest, (hsrc) shl 16 + add dest, lsrc + else + mov dest, hsrc + shl dest, 16 + add dest, lsrc + end if + end if +} + +macro __mov reg,a,b { ; mike.dld + if (~a eq)&(~b eq) + mpack reg,a,b + else if (~a eq)&(b eq) + mov reg,a + end if +} + + +include 'config.inc' +;__CPU_type equ p5 +SYSENTER_VAR equ 0 + +macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls + local ..ret_point + __mov eax,a + __mov ebx,b + __mov ecx,c + __mov edx,d + __mov esi,e + __mov edi,f + + if __CPU_type eq p5 + int 0x40 + else + if __CPU_type eq p6 + push ebp + mov ebp, esp + push ..ret_point ; it may be 2 or 5 byte + sysenter + ..ret_point: + pop edx + pop ecx + + else + if __CPU_type eq k6 + push ecx + syscall + pop ecx + else + display 'ERROR : unknown CPU type (set to p5)', 10, 13 + __CPU_type equ p5 + int 0x40 + end if + end if + end if +} + + +; ------------------------- +macro header a,[b] { + common + use32 + org 0 + db 'MENUET',a + forward + if b eq + dd 0 + else + dd b + end if } +macro section name { align 16 + label name } +macro func name { + if ~used name + display 'FUNC NOT USED: ',`name,13,10 + else + align 4 + name: + ;diff16 `name,0,name +;pushad +;pushfd +;dps `name +;newline +;mcall 5,1 +;popfd +;popad +} +macro endf { end if } + +macro diff16 title,l1,l2 + { + local s,d + s = l2-l1 + display title,': 0x' + repeat 8 + d = '0' + s shr ((8-%) shl 2) and $0F + if d > '9' + d = d + 'A'-'9'-1 + end if + display d + end repeat + display 13,10 + } + +macro diff10 title,l1,l2 + { + local s,d,z,m + s = l2-l1 + z = 0 + m = 1000000000 + display title,': ' + repeat 10 + d = '0' + s / m + s = s - (s/m)*m + m = m / 10 + if d <> '0' + z = 1 + end if + if z <> 0 + display d + end if + end repeat + display 13,10 + } + +; optimize the code for size +__regs fix + +macro add arg1,arg2 + { + if (arg2 eqtype 0) + if (arg2) = 1 + inc arg1 + else + add arg1,arg2 + end if + else + add arg1,arg2 + end if + } + +macro sub arg1,arg2 + { + if (arg2 eqtype 0) + if (arg2) = 1 + dec arg1 + else + sub arg1,arg2 + end if + else + sub arg1,arg2 + end if + } + +macro mov arg1,arg2 + { + if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0')) + if (arg2) = 0 + xor arg1,arg1 + else if (arg2) = 1 + xor arg1,arg1 + inc arg1 + else if (arg2) = -1 + or arg1,-1 + else if (arg2) > -128 & (arg2) < 128 + push arg2 + pop arg1 + else + mov arg1,arg2 + end if + else + mov arg1,arg2 + end if + } + + +macro RGB [a] { + common + match (r=,g=,b),a \{ + \dd ((r) shl 16) or ((g) shl 8) or (b) + \} +} + + +struc POINT _t,_dx,_dy { + .x _t _dx + .y _t _dy +} + +; structure definition helper +include 'struct.inc' + +struct RECT + left dd ? + top dd ? + right dd ? + bottom dd ? +ends + +struct BOX + left dd ? + top dd ? + width dd ? + height dd ? +ends + +; structures used in MeOS +struct process_information + cpu_usage dd ? ; +0 + window_stack_position dw ? ; +4 + window_stack_value dw ? ; +6 + dw ? ; +8 + process_name rb 12 ; +10 + memory_start dd ? ; +22 + used_memory dd ? ; +26 + PID dd ? ; +30 + box BOX ; +34 + slot_state dw ? ; +50 + dw ? ; +52 + client_box BOX ; +54 + wnd_state db ? ; +70 + rb (1024-71) +ends + +struct system_colors + frame dd ? + grab dd ? + grab_button dd ? + grab_button_text dd ? + grab_text dd ? + work dd ? + work_button dd ? + work_button_text dd ? + work_text dd ? + work_graph dd ? +ends + +struct FILEDATE + Second db ? + Minute db ? + Hour db ? + db ? + Day db ? + Month db ? + Year dw ? +ends + +struct FILEINFO + Attributes dd ? + IsUnicode db ? + db 3 dup(?) + DateCreate FILEDATE + DateAccess FILEDATE + DateModify FILEDATE + Size dq ? +ends + +; constants + +; events +EV_IDLE = 0 +EV_TIMER = 0 +EV_REDRAW = 1 +EV_KEY = 2 +EV_BUTTON = 3 +EV_EXIT = 4 +EV_BACKGROUND = 5 +EV_MOUSE = 6 +EV_IPC = 7 +EV_STACK = 8 + +; event mask bits for function 40 +EVM_REDRAW = 1b +EVM_KEY = 10b +EVM_BUTTON = 100b +EVM_EXIT = 1000b +EVM_BACKGROUND = 10000b +EVM_MOUSE = 100000b +EVM_IPC = 1000000b +EVM_STACK = 10000000b diff --git a/programs/system/MyKey/trunk/proc32.inc b/programs/system/MyKey/trunk/proc32.inc new file mode 100644 index 0000000000..23c56b03c1 --- /dev/null +++ b/programs/system/MyKey/trunk/proc32.inc @@ -0,0 +1,268 @@ + +; Macroinstructions for defining and calling procedures + +macro stdcall proc,[arg] ; directly call STDCALL procedure + { common + if ~ arg eq + reverse + pushd arg + common + end if + call proc } + +macro invoke proc,[arg] ; indirectly call STDCALL procedure + { common + if ~ arg eq + reverse + pushd arg + common + end if + call [proc] } + +macro ccall proc,[arg] ; directly call CDECL procedure + { common + size@ccall = 0 + if ~ arg eq + reverse + pushd arg + size@ccall = size@ccall+4 + common + end if + call proc + if size@ccall + add esp,size@ccall + end if } + +macro cinvoke proc,[arg] ; indirectly call CDECL procedure + { common + size@ccall = 0 + if ~ arg eq + reverse + pushd arg + size@ccall = size@ccall+4 + common + end if + call [proc] + if size@ccall + add esp,size@ccall + end if } + +macro proc [args] ; define procedure + { common + match name params, args> + \{ define@proc name, \{ prologue name,flag,parmbytes,localbytes,reglist \} + macro locals + \{ virtual at ebp-localbytes+current + macro label . \\{ deflocal@proc .,:, \\} + struc db [val] \\{ \common deflocal@proc .,db,val \\} + struc dw [val] \\{ \common deflocal@proc .,dw,val \\} + struc dp [val] \\{ \common deflocal@proc .,dp,val \\} + struc dd [val] \\{ \common deflocal@proc .,dd,val \\} + struc dt [val] \\{ \common deflocal@proc .,dt,val \\} + struc dq [val] \\{ \common deflocal@proc .,dq,val \\} + struc rb cnt \\{ deflocal@proc .,rb cnt, \\} + struc rw cnt \\{ deflocal@proc .,rw cnt, \\} + struc rp cnt \\{ deflocal@proc .,rp cnt, \\} + struc rd cnt \\{ deflocal@proc .,rd cnt, \\} + struc rt cnt \\{ deflocal@proc .,rt cnt, \\} + struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \} + macro endl + \{ purge label + restruc db,dw,dp,dd,dt,dq + restruc rb,rw,rp,rd,rt,rq + restruc byte,word,dword,pword,tword,qword + current = $-(ebp-localbytes) + end virtual \} + macro ret operand + \{ match any, operand \\{ retn operand \\} + match , operand \\{ match epilogue:reglist, epilogue@proc: + \\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \} + macro finish@proc \{ localbytes = (((current-1) shr 2)+1) shl 2 + end if \} } + +macro defargs@proc [arg] + { common + if ~ arg eq + forward + local ..arg,current@arg + match argname:type, arg + \{ current@arg equ argname + label ..arg type + argname equ ..arg + if dqword eq type + dd ?,?,?,? + else if tbyte eq type + dd ?,?,? + else if qword eq type | pword eq type + dd ?,? + else + dd ? + end if \} + match =current@arg,current@arg + \{ current@arg equ arg + arg equ ..arg + ..arg dd ? \} + common + args@proc equ current@arg + forward + restore current@arg + common + end if } + +macro deflocal@proc name,def,[val] + { common + match vars, all@vars \{ all@vars equ all@vars, \} + all@vars equ all@vars name + forward + local ..var,..tmp + ..var def val + match =?, val \{ ..tmp equ \} + match any =dup (=?), val \{ ..tmp equ \} + match tmp : value, ..tmp : val + \{ tmp: end virtual + initlocal@proc ..var,def value + virtual at tmp\} + common + match first rest, ..var, \{ name equ first \} } + +macro initlocal@proc name,def + { virtual at name + def + size@initlocal = $ - name + end virtual + position@initlocal = 0 + while size@initlocal > position@initlocal + virtual at name + def + if size@initlocal - position@initlocal < 2 + current@initlocal = 1 + load byte@initlocal byte from name+position@initlocal + else if size@initlocal - position@initlocal < 4 + current@initlocal = 2 + load word@initlocal word from name+position@initlocal + else + current@initlocal = 4 + load dword@initlocal dword from name+position@initlocal + end if + end virtual + if current@initlocal = 1 + mov byte [name+position@initlocal],byte@initlocal + else if current@initlocal = 2 + mov word [name+position@initlocal],word@initlocal + else + mov dword [name+position@initlocal],dword@initlocal + end if + position@initlocal = position@initlocal + current@initlocal + end while } + +macro endp + { purge ret,locals,endl + finish@proc + purge finish@proc + restore regs@proc + match all,args@proc \{ restore all \} + restore args@proc + match all,all@vars \{ restore all \} } + +macro local [var] + { common + locals + forward done@local equ + match varname[count]:vartype, var + \{ match =BYTE, vartype \\{ varname rb count + restore done@local \\} + match =WORD, vartype \\{ varname rw count + restore done@local \\} + match =DWORD, vartype \\{ varname rd count + restore done@local \\} + match =PWORD, vartype \\{ varname rp count + restore done@local \\} + match =QWORD, vartype \\{ varname rq count + restore done@local \\} + match =TBYTE, vartype \\{ varname rt count + restore done@local \\} + match =DQWORD, vartype \\{ label varname dqword + rq count+count + restore done@local \\} + match , done@local \\{ virtual + varname vartype + end virtual + rb count*sizeof.\#vartype + restore done@local \\} \} + match :varname:vartype, done@local:var + \{ match =BYTE, vartype \\{ varname db ? + restore done@local \\} + match =WORD, vartype \\{ varname dw ? + restore done@local \\} + match =DWORD, vartype \\{ varname dd ? + restore done@local \\} + match =PWORD, vartype \\{ varname dp ? + restore done@local \\} + match =QWORD, vartype \\{ varname dq ? + restore done@local \\} + match =TBYTE, vartype \\{ varname dt ? + restore done@local \\} + match =DQWORD, vartype \\{ label varname dqword + dq ?,? + restore done@local \\} + match , done@local \\{ varname vartype + restore done@local \\} \} + match ,done@local + \{ var + restore done@local \} + common + endl } diff --git a/programs/system/MyKey/trunk/struct.inc b/programs/system/MyKey/trunk/struct.inc new file mode 100644 index 0000000000..947a84e89a --- /dev/null +++ b/programs/system/MyKey/trunk/struct.inc @@ -0,0 +1,180 @@ + +; Macroinstructions for defining data structures + +macro struct name + { fields@struct equ name + match child parent, name \{ fields@struct equ child,fields@\#parent \} + sub@struct equ + struc db [val] \{ \common fields@struct equ fields@struct,.,db, \} + struc dw [val] \{ \common fields@struct equ fields@struct,.,dw, \} + struc du [val] \{ \common fields@struct equ fields@struct,.,du, \} + struc dd [val] \{ \common fields@struct equ fields@struct,.,dd, \} + struc dp [val] \{ \common fields@struct equ fields@struct,.,dp, \} + struc dq [val] \{ \common fields@struct equ fields@struct,.,dq, \} + struc dt [val] \{ \common fields@struct equ fields@struct,.,dt, \} + struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \} + struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \} + struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \} + struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \} + struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \} + struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \} + macro db [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,db, \} + macro dw [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,dw, \} + macro du [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,du, \} + macro dd [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,dd, \} + macro dp [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,dp, \} + macro dq [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,dq, \} + macro dt [val] \{ \common \local anonymous + fields@struct equ fields@struct,anonymous,dt, \} + macro rb count \{ \local anonymous + fields@struct equ fields@struct,anonymous,db,count dup (?) \} + macro rw count \{ \local anonymous + fields@struct equ fields@struct,anonymous,dw,count dup (?) \} + macro rd count \{ \local anonymous + fields@struct equ fields@struct,anonymous,dd,count dup (?) \} + macro rp count \{ \local anonymous + fields@struct equ fields@struct,anonymous,dp,count dup (?) \} + macro rq count \{ \local anonymous + fields@struct equ fields@struct,anonymous,dq,count dup (?) \} + macro rt count \{ \local anonymous + fields@struct equ fields@struct,anonymous,dt,count dup (?) \} + macro union \{ fields@struct equ fields@struct,,union,< + sub@struct equ union \} + macro struct \{ fields@struct equ fields@struct,,substruct,< + sub@struct equ substruct \} + virtual at 0 } + +macro ends + { match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt + restruc rb,rw,rd,rp,rq,rt + purge db,dw,du,dd,dp,dq,dt + purge rb,rw,rd,rp,rq,rt + purge union,struct + match name=,fields,fields@struct \\{ fields@struct equ + make@struct name,fields + fields@\\#name equ fields \\} + end virtual \} + match any, sub@struct \{ fields@struct equ fields@struct> \} + restore sub@struct } + +macro make@struct name,[field,type,def] + { common + if $ + display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah + err + end if + local define + define equ name + forward + local sub + match , field \{ make@substruct type,name,sub def + define equ define,.,sub, \} + match any, field \{ define equ define,.#field,type, \} + common + match fields, define \{ define@struct fields \} } + +macro define@struct name,[field,type,def] + { common + local list + list equ + forward + if ~ field eq . + name#field type def + sizeof.#name#field = $ - name#field + else + rb sizeof.#type + end if + local value + match any, list \{ list equ list, \} + list equ list + common + sizeof.#name = $ + restruc name + match values, list \{ + struc name value \\{ + match any, fields@struct \\\{ fields@struct equ fields@struct,.,name, \\\} + match , fields@struct \\\{ label . + forward + match , value \\\\{ field type def \\\\} + match any, value \\\\{ field type value + if ~ field eq . + rb sizeof.#name#field - ($-field) + end if \\\\} + common \\\} \\} \} } + +macro enable@substruct + { macro make@substruct substruct,parent,name,[field,type,def] + \{ \common + \local define + define equ parent,name + \forward + \local sub + match , field \\{ match any, type \\\{ enable@substruct + make@substruct type,name,sub def + purge make@substruct + define equ define,.,sub, \\\} \\} + match any, field \\{ define equ define,.\#field,type, \\} + \common + match fields, define \\{ define@\#substruct fields \\} \} } + +enable@substruct + +macro define@union parent,name,[field,type,def] + { common + virtual at 0 + forward + if ~ field eq . + virtual at 0 + parent#field type def + sizeof.#parent#field = $ - parent#field + end virtual + if sizeof.#parent#field > $ + rb sizeof.#parent#field - $ + end if + else if sizeof.#type > $ + rb sizeof.#type - $ + end if + common + sizeof.#name = $ + end virtual + struc name [value] \{ \common + label .\#name + last@union equ + forward + match any, last@union \\{ virtual at .\#name + field type def + end virtual \\} + match , last@union \\{ match , value \\\{ field type def \\\} + match any, value \\\{ field type value \\\} \\} + last@union equ field + common rb sizeof.#name - ($ - .\#name) \} } + +macro define@substruct parent,name,[field,type,def] + { common + virtual at 0 + forward + if ~ field eq . + parent#field type def + sizeof.#parent#field = $ - parent#field + else + rb sizeof.#type + end if + local value + common + sizeof.#name = $ + end virtual + struc name value \{ + label .\#name + forward + match , value \\{ field type def \\} + match any, value \\{ field type value + if ~ field eq . + rb sizeof.#parent#field - ($-field) + end if \\} + common \} } diff --git a/programs/system/kerpack/trunk/calltrick2.asm b/programs/system/kerpack/trunk/calltrick2.asm new file mode 100644 index 0000000000..36b04430ca --- /dev/null +++ b/programs/system/kerpack/trunk/calltrick2.asm @@ -0,0 +1,32 @@ + pop esi + push esi +loader_patch4: + mov ecx, 0 ; will be patched: number of calltrick entries +ctrloop: + lodsb +@@: + cmp al, 0xF + jnz .f + lodsb + cmp al, 80h + jb @b + cmp al, 90h + jb @f +.f: + sub al, 0E8h + cmp al, 1 + ja ctrloop +@@: + cmp byte [esi], 0 ; will be patched: code in calltrick entries +loader_patch5: + jnz ctrloop + lodsd +; "bswap eax" is not supported on i386 +; mov al,0/bswap eax = 4 bytes, following instructions = 9 bytes + shr ax, 8 + ror eax, 16 + xchg al, ah + sub eax, esi + add eax, [esp] + mov [esi-4], eax + loop ctrloop diff --git a/programs/system/kerpack/trunk/doexe2.asm b/programs/system/kerpack/trunk/doexe2.asm new file mode 100644 index 0000000000..072f90a716 --- /dev/null +++ b/programs/system/kerpack/trunk/doexe2.asm @@ -0,0 +1,68 @@ +filename equ 'kerpack.exe' + +virtual at 0 +file filename:3Ch,4 +load pehea dword from 0 +file filename:pehea,0F8h+28h*3 +load NumberOfSections word from 4+6 +load SizeOfOptionalHeader word from 4+14h +if NumberOfSections<>3 +error Expected three sections, .text, .bss and .reloc +end if +if SizeOfOptionalHeader<>0E0h +error Nonstandard PE header +end if +load RelocsRVA dword from 4+0A0h +load RelocsSize dword from 4+0A4h +load ImageBase dword from 4+34h +load TextRVA dword from 4+0F8h+0Ch +load TextSize dword from 4+0F8h+8 +load TextOffs dword from 4+0F8h+14h +load BSSSize dword from 4+0F8h+28h+10h +load RelocRVA dword from 4+0F8h+28h*2+0Ch +load RelocOffs dword from 4+0F8h+28h*2+14h +if BSSSize +error Second section expected to be .bss +end if +if RelocRVA<>RelocsRVA +error Third section expected to be .reloc +end if +;file 'test.exe':pehea+0F8h,28h +;load physofs dword from 4+14h +;load mem dword from 4+8 +;file 'test.exe':physofs+16,4 +;load sz dword from $-4 +end virtual + +file filename:TextOffs,TextSize + +while RelocsSize>8 +virtual at 0 +file filename:RelocOffs,8 +load CurRelocPage dword from 0 +load CurRelocChunkSize dword from 4 +end virtual +RelocsSize=RelocsSize-CurRelocChunkSize +CurRelocChunkSize = CurRelocChunkSize-8 +RelocOffs=RelocOffs+8 +while CurRelocChunkSize +virtual at 0 +file filename:RelocOffs,2 +RelocOffs=RelocOffs+2 +CurRelocChunkSize=CurRelocChunkSize-2 +load s word from 0 +end virtual +CurRelocType = s shr 12 +RelocItem = CurRelocPage + (s and 0xFFF) +if CurRelocType=0 +else if CurRelocType=3 +load z dword from RelocItem-TextRVA +store dword z-(TextRVA+ImageBase) at RelocItem-TextRVA +else +error Unexpected relocation type +end if +end while +end while + +store dword TextSize at 10h +store dword RelocRVA-TextRVA at 14h diff --git a/programs/system/kerpack/trunk/kerpack.asm b/programs/system/kerpack/trunk/kerpack.asm new file mode 100644 index 0000000000..90568284c5 --- /dev/null +++ b/programs/system/kerpack/trunk/kerpack.asm @@ -0,0 +1,232 @@ +; Kolibri kernel packer +; (C) copyright diamond 2006, 2007 +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. + +; Uses LZMA compression library by Igor Pavlov +; (for more information on LZMA and 7-Zip visit http://www.7-zip.org) +; (plain-C packer is ported by diamond) + +format MS COFF + +extrn '_lzma_compress@16' as lzma_compress +extrn '_lzma_set_dict_size@4' as lzma_set_dict_size + +section '.text' code executable readable + +die_with_err: + pop esi +@@: + lodsb + test al, al + jz @f + mov cl, al + push 63 + pop eax + push 1 + pop ebx + int 40h + jmp @b +@@: + mov al, 63 + mov cl, 13 + int 40h + mov cl, 10 + int 40h + or eax, -1 + int 40h + +public _start +_start: + push 70 + pop eax + mov ebx, fn70_read + int 40h + cmp eax, 6 + jz read_ok +read_err: + call die_with_err + db 'KerPack: cannot load kernel.mnt',0 +read_ok: + push 18 + call lzma_set_dict_size +; find jump to 32-bit code + mov edi, infile - 1 +@@: + inc edi + cmp dword [edi], 0E88EE08Eh ; mov fs,ax/mov gs,ax + jnz @b + cmp dword [edi+4], 00BCD08Eh ; mov ss,ax/mov esp,00xxxxxx + jnz @b + add edi, 11 + mov [inptr], edi + sub edi, infile + mov [indelta], edi + lea eax, [ebx+0x10000] + mov [..loader_patch3+2], eax + sub ebx, edi + mov [insize], ebx + call preprocess_calltrick2 + mov al, [cti] + mov [loader_patch5-1], al + mov eax, [ctn] + mov [loader_patch4+1], eax + mov eax, [inptr] + add eax, outfile - infile + loader_size - 5 + push workmem + push [insize] + push eax + push [inptr] + call lzma_compress + add eax, loader_size-5 + mov [loader_patch1+6], eax + add eax, [indelta] + mov [outsize], eax + mov eax, [indelta] + mov ecx, dword [eax + outfile + loader_size - 4] + bswap ecx + mov [loader_patch2+4], ecx + add eax, 0x10000 + mov [loader_patch1+1], eax + mov esi, infile + mov edi, outfile + mov ecx, [indelta] + rep movsb + mov esi, loader_start + mov ecx, loader_size + rep movsb + push 70 + pop eax + mov ebx, fn70_write + int 40h + test eax, eax + jz @f + call die_with_err + db 'KerPack: cannot save kernel.mnt',0 +@@: + call die_with_err + db 'KerPack: all is OK',0 + +preprocess_calltrick2: +; input preprocessing + mov edi, ct1 + xor eax, eax + push edi + mov ecx, 256/4 + rep stosd + pop edi + mov ecx, ebx + mov esi, [inptr] + mov ebx, inbuftmp + xchg eax, edx +input_pre2: + lodsb +@@: + cmp al, 0Fh + jnz ip1 + dec ecx + jz input_pre_done2 + lodsb + cmp al, 80h + jb @b + cmp al, 90h + jb @f +ip1: + sub al, 0E8h + cmp al, 1 + ja input_pre_cont2 +@@: + cmp ecx, 5 + jb input_pre_done2 + lodsd + add eax, esi + sub eax, [inptr] + cmp eax, [insize] + jae xxx2 + cmp eax, 1000000h + jae xxx2 + sub ecx, 4 + xchg al, ah + rol eax, 16 + xchg al, ah + mov [esi-4], eax + inc edx + mov [ebx], esi + add ebx, 4 + jmp input_pre_cont2 +xxx2: sub esi, 4 + movzx eax, byte [esi] + mov byte [eax+edi], 1 +input_pre_cont2: + loop input_pre2 +input_pre_done2: + mov [ctn], edx + xor eax, eax + mov ecx, 256 + repnz scasb + jnz pack_calltrick_done + not cl + mov [cti], cl +@@: + cmp ebx, inbuftmp + jz pack_calltrick_done + sub ebx, 4 + mov eax, [ebx] + mov [eax-4], cl + jmp @b +pack_calltrick_done: + ret + +include 'loader_lzma.asm' + +section '.data' data readable writeable + db 'MENUET01' + dd 1 + dd _start + dd bss_start ; i_end + dd bss_end ; memory + dd mtstack_end ; esp + dd 0 ; params + dd 0 ; icon +fn70_read: + dd 0 + dd 0 + dd 0 + dd 200*1024 + dd infile +filename db '/rd/1/kernel.mnt',0 +fn70_write: + dd 2 + dd 0 + dd 0 +outsize dd ? + dd outfile + db 0 + dd filename +section '.bss' readable writeable +bss_start: + align 4 +inptr dd ? +indelta dd ? +insize dd ? +ct1 rb 256 +ctn dd ? +cti db ? + +align 4 +mtstack rb 1000h +mtstack_end: + +infile rb 200*1024 +inbuftmp rb 200*1024 +outfile rb 200*1024 +workmem rb 6A8000h +bss_end: diff --git a/programs/system/kerpack/trunk/kerpack.bat b/programs/system/kerpack/trunk/kerpack.bat new file mode 100644 index 0000000000..6e887f371e --- /dev/null +++ b/programs/system/kerpack/trunk/kerpack.bat @@ -0,0 +1,7 @@ +del kerpack +del kerpack.obj +del kerpack.exe +fasm memset.asm +fasm kerpack.asm +"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\link.exe" /section:.bss,E /fixed:no /subsystem:native /merge:.data=.text /merge:.rdata=.text /nologo /entry:start /out:kerpack.exe /ltcg kerpack.obj /nodefaultlib lzmapack.lib memset.obj +fasm doexe2.asm kerpack diff --git a/programs/system/kerpack/trunk/loader_lzma.asm b/programs/system/kerpack/trunk/loader_lzma.asm new file mode 100644 index 0000000000..3c4ab5b3b7 --- /dev/null +++ b/programs/system/kerpack/trunk/loader_lzma.asm @@ -0,0 +1,404 @@ +loader_start: +; start address; this code will be injected after the init code +; (some commands below "B32" in the kernel) + mov edi, 0x280000 + lea ebx, [edi+loader_size1+16] + lea edx, [ebx+4] +loader_patch1: + mov esi, 0 ; will be patched: start address to copy + mov ecx, 0 ; will be patched: size of data to copy + push esi + rep movsb + jmp edx +loader_size1 = $ - loader_start + +loader_patch2: + dd 0x280000 + loader_size + dd 0 ; will be patched: start value for code + ; (LZMA-specific) + dd -1 + dd _RangeDecoderBitDecode_edx - loader_start + 0x280000 + dd _RangeDecoderBitDecode - loader_start + 0x280000 +RangeDecoderBitDecode equ dword [ebx] +RangeDecoderBitDecode_edx equ dword [ebx-4] +code_ equ ebx-12 +range equ ebx-8 + +rep1 equ ebx-28 +rep2 equ ebx-24 +rep3 equ ebx-20 +inptr_ldr equ ebx-16 + +pb equ 0 ; pos state bits +lp equ 0 ; literal pos state bits +lc equ 3 ; literal context bits +posStateMask equ ((1 shl pb)-1) +literalPosMask equ ((1 shl lp)-1) + +kNumPosBitsMax = 4 +kNumPosStatesMax = (1 shl kNumPosBitsMax) + +kLenNumLowBits = 3 +kLenNumLowSymbols = (1 shl kLenNumLowBits) +kLenNumMidBits = 3 +kLenNumMidSymbols = (1 shl kLenNumMidBits) +kLenNumHighBits = 8 +kLenNumHighSymbols = (1 shl kLenNumHighBits) + +LenChoice = 0 +LenChoice2 = 1 +LenLow = 2 +LenMid = (LenLow + (kNumPosStatesMax shl kLenNumLowBits)) +LenHigh = (LenMid + (kNumPosStatesMax shl kLenNumMidBits)) +kNumLenProbs = (LenHigh + kLenNumHighSymbols) + +kNumStates = 12 +kNumLitStates = 7 +kStartPosModelIndex = 4 +kEndPosModelIndex = 14 +kNumFullDistances = (1 shl (kEndPosModelIndex/2)) +kNumPosSlotBits = 6 +kNumLenToPosStates = 4 +kNumAlignBits = 4 +kAlignTableSize = (1 shl kNumAlignBits) +kMatchMinLen = 2 + +IsMatch = 0 +IsRep = 0xC0 ; (IsMatch + (kNumStates shl kNumPosBitsMax)) +IsRepG0 = 0xCC ; (IsRep + kNumStates) +IsRepG1 = 0xD8 ; (IsRepG0 + kNumStates) +IsRepG2 = 0xE4 ; (IsRepG1 + kNumStates) +IsRep0Long = 0xF0 ; (IsRepG2 + kNumStates) +PosSlot = 0x1B0 ; (IsRep0Long + (kNumStates shl kNumPosBitsMax)) +SpecPos = 0x2B0 ; (PosSlot + (kNumLenToPosStates shl kNumPosSlotBits)) +Align_ = 0x322 ; (SpecPos + kNumFullDistances - kEndPosModelIndex) +Lencoder = 0x332 ; (Align_ + kAlignTableSize) +RepLencoder = 0x534 ; (Lencoder + kNumLenProbs) +Literal = 0x736 ; (RepLencoder + kNumLenProbs) + +LZMA_BASE_SIZE = 1846 ; must be ==Literal +LZMA_LIT_SIZE = 768 + +kNumTopBits = 24 +kTopValue = (1 shl kNumTopBits) + +kNumBitModelTotalBits = 11 +kBitModelTotal = (1 shl kNumBitModelTotalBits) +kNumMoveBits = 5 + +uninit_base = 2C0000h + +p = uninit_base + +unpacker: + xor ebp, ebp + xor eax, eax + dec eax + lea edi, [rep1] + stosd + stosd + stosd + xchg eax, esi +; mov ecx, Literal + (LZMA_LIT_SIZE shl (lc+lp)) + mov ch, (Literal + (LZMA_LIT_SIZE shl (lc+lp)) + 0xFF) shr 8 + mov eax, kBitModelTotal/2 + mov edi, p + rep stosd + pop edi + push edi +.main_loop: +..loader_patch3: + cmp edi, dword 0 ; will be patched: end of data to unpack + jae .main_loop_done +if posStateMask + mov edx, edi + and edx, posStateMask +else + xor edx, edx +end if + push eax ; al = previous byte + lea eax, [ebp + ((p+IsMatch*4) shr (kNumPosBitsMax+2))] + shl eax, kNumPosBitsMax+2 +if posStateMask + call RangeDecoderBitDecode_edx +else + call RangeDecoderBitDecode +end if + pop eax + jc .1 + movzx eax, al +if literalPosMask + mov ah, dl + and ah, literalPosMask +end if +if ((LZMA_LIT_SIZE*4) and ((1 shl (8-lc)) - 1)) <> 0 + shr eax, 8-lc + imul eax, LZMA_LIT_SIZE*4 +else + and al, not ((1 shl (8-lc)) - 1) + imul eax, (LZMA_LIT_SIZE*4) shr (8-lc) +end if + add eax, p+Literal*4 + mov dl, 1 + cmp ebp, kNumLitStates + jb .literal + mov cl, [edi + esi] +.lx0: + add cl, cl + adc dh, 1 + call RangeDecoderBitDecode_edx + adc dl, dl + jc .lx1 + xor dh, dl + test dh, 1 + mov dh, 0 + jnz .lx0 +.literal: +@@: + call RangeDecoderBitDecode_edx + adc dl, dl + jnc @b +.lx1: + mov eax, ebp + cmp al, 4 + jb @f + cmp al, 10 + mov al, 3 + jb @f + mov al, 6 +@@: sub ebp, eax + xchg eax, edx +.stosb_main_loop: + stosb + jmp .main_loop +.1: + lea eax, [p + IsRep*4 + ebp*4] + call RangeDecoderBitDecode + jnc .10 + add eax, (IsRepG0 - IsRep)*4 ;lea eax, [p + IsRepG0*4 + ebp*4] + call RangeDecoderBitDecode + jc .111 + mov eax, ebp + shl eax, kNumPosBitsMax+2 + add eax, p + IsRep0Long*4 + call RangeDecoderBitDecode_edx + jc .1101 + cmp ebp, 7 + sbb ebp, ebp + lea ebp, [ebp+ebp+11] + mov al, [edi + esi] + jmp .stosb_main_loop +.111: + add eax, (IsRepG1 - IsRepG0) * 4 ;lea eax, [p + IsRepG1*4 + ebp*4] + call RangeDecoderBitDecode + xchg esi, [rep1] + jnc @f + add eax, (IsRepG2 - IsRepG1) * 4 ;lea eax, [p + IsRepG2*4 + ebp*4] + call RangeDecoderBitDecode + xchg esi, [rep2] + jnc @f + xchg esi, [rep3] +@@: +.1101: + mov eax, p + RepLencoder*4 + call LzmaLenDecode + push 8 + jmp .rmu +.10: + xchg esi, [rep1] + xchg esi, [rep2] + mov [rep3], esi + mov eax, p + Lencoder*4 + call LzmaLenDecode + push kNumLenToPosStates-1 + pop edx + cmp edx, ecx + jb @f + mov edx, ecx +@@: + push ecx + push kNumPosSlotBits + pop ecx + mov eax, p+PosSlot*4 + shl edx, cl + call RangeDecoderBitTreeDecode + mov esi, ecx + cmp ecx, kStartPosModelIndex + jb .l6 + mov edx, ecx + xor eax, eax + shr ecx, 1 + adc al, 2 + dec ecx + shl eax, cl + mov esi, eax + sub eax, edx + lea eax, [p + (SpecPos - 1)*4 + eax*4] + cmp edx, kEndPosModelIndex + jb .l59 +; call RangeDecoderDecodeDirectBits +;RangeDecoderDecodeDirectBits: + xor eax, eax +.l: + shr dword [range], 1 + add eax, eax + mov edx, [code_] + sub edx, [range] + jb @f + mov [code_], edx + add al, 1 shl kNumAlignBits +@@: + call update_decoder + dec ecx + cmp ecx, kNumAlignBits + jnz .l +; ret + add esi, eax + mov eax, p+Align_*4 +.l59: +; call RangeDecoderReverseBitTreeDecode_addesi +;_RangeDecoderReverseBitTreeDecode_addesi: +; in: eax->probs,ecx=numLevels +; out: esi+=length; destroys edx + push edi + xor edx, edx + inc edx + mov edi, edx +@@: + call RangeDecoderBitDecode_edx + jnc .591 + add esi, edi + stc +.591: + adc edx, edx + add edi, edi + loop @b + pop edi +; ret +.l6: + pop ecx + not esi + push 7 +.rmu: + cmp ebp, 7 + pop ebp + jb @f + add ebp, 3 +@@: +.repmovsb: + inc ecx + push esi + add esi, edi + rep movsb + lodsb + pop esi + jmp .stosb_main_loop +.main_loop_done: +include 'calltrick2.asm' + ret + +_RangeDecoderBitDecode: +; in: eax->prob +; out: CF=bit + push edx + mov edx, [range] + shr edx, kNumBitModelTotalBits + imul edx, [eax] + cmp [code_], edx + jae .ae + mov [range], edx + mov edx, kBitModelTotal + sub edx, [eax] + shr edx, kNumMoveBits + add [eax], edx +.n: + pushfd + call update_decoder + popfd + pop edx + ret +.ae: + sub [range], edx + sub [code_], edx + mov edx, [eax] + shr edx, kNumMoveBits + sub [eax], edx + stc + jmp .n + +update_decoder: + cmp byte [range+3], 0 ;cmp dword [range], kTopValue + jnz @f ;jae @f + shl dword [range], 8 + shl dword [code_], 8 + push eax + mov eax, [inptr_ldr] + mov al, [eax] + inc dword [inptr_ldr] + mov byte [code_], al + pop eax +@@: ret + +_RangeDecoderBitDecode_edx: + push eax + lea eax, [eax+edx*4] + call RangeDecoderBitDecode + pop eax + ret + +LzmaLenDecode: +; in: eax->prob, edx=posState +; out: ecx=len + +; LenChoice==0 +; add eax, LenChoice*4 +if kLenNumMidBits <> kLenNumLowBits +error in optimization +end if + mov cl, kLenNumMidBits + call RangeDecoderBitDecode + jnc .0 + add eax, (LenChoice2-LenChoice)*4 + call RangeDecoderBitDecode + jc @f +if (kLenNumMidBits <> 3) | (LenMid-LenChoice2 > 0x7F + kLenNumMidBits) + shl edx, cl + add edx, LenMid-LenChoice2 +else + lea edx, [ecx + edx*8 - kLenNumMidBits + LenMid-LenChoice2] +end if + push kLenNumLowSymbols + jmp RangeDecoderBitTreeDecode.1 +@@: + mov edx, LenHigh-LenChoice2 + mov cl, kLenNumHighBits + push kLenNumLowSymbols + kLenNumMidSymbols + jmp RangeDecoderBitTreeDecode.1 +.0: + shl edx, cl +if LenLow = 2 + inc edx + inc edx +else + add edx, LenLow +end if +RangeDecoderBitTreeDecode: +; in: eax+edx*4->probs,ecx=numLevels +; out: ecx=length; destroys edx + push 0 +.1: + lea eax, [eax+edx*4] + xor edx, edx + inc edx + push ecx +@@: + call RangeDecoderBitDecode_edx + adc edx, edx + loop @b + pop ecx + btc edx, ecx + pop ecx + add ecx, edx + ret + +loader_size = $ - loader_start diff --git a/programs/system/kerpack/trunk/lzmapack.lib b/programs/system/kerpack/trunk/lzmapack.lib new file mode 100644 index 0000000000000000000000000000000000000000..3f2c501144040323dfb8cd8e2822fbb221353fd6 GIT binary patch literal 82830 zcmeFa2b>f|`aj&=)x9h%$u&oY1xH&QB#FbA$f$sDf_f?*F3SL`3yT{Nj3X$9Gv_m7 zygNO^8QYxGnX{*!o@cyMPftBP6Yux?RCQ1H%q-yk?)U!x@8@Orvs>L&Pp+q)s;;i8 z?z>}sOT*lqyKS3F{tOzt-N5a$gR;X0CiBDF;RC~~1G`z4)z7lJyxIA`?QgTJ)%iR0 zkCwISzY(KHHMUJ_$>+z;Z)l#CZ<(Rf5m~FOWPHADN=suyzEat4^BdbLf?Ad@HvHIkw+?epd>p4bctTiYhpw>8Wq zAwcXle^!3csKsr0>W2FSh|Uu5iTU|L2OxX2&l|b0zOku(W>cP+t%lT;=EnJL`Ic$T zquX0r^7GrKG)sw~k81>#M)HbyZbX$=pBoaA$<`*RHr_OC|X)DQWI&5D3jE3fU3tIB6 zts@2vvt~$6Yrbv9tj3168Lf?n(Lgg6)HfVFqbWasPTO2_v!J=v`nl~lJ9L<7*avn~ zXuxlFv8>y+x2!)NDvjB)%YGfJ^fwNptmLmF_hs$v|35A9|HIDye{~f3zn}$%v7m#N zSke?%)st?&eb~bu*lob{J@ZZZ`qun(3FM>Mdktuwd5~2sh{dOpl8O6G8fkhMDe1Ot z*hL!#lw|03+YK4AUC2?Vg9Z*9HVoll(BMJCH46Lm6)S9OqP<1)3A<;1y1DyRuU|Xq zx(i>qtu8(F!K1ddthKv$u~@d>0L$u)_`#n6v)I!t%=R~)15y2rUhd(5>ao6xprx9F!QB?5y#+J27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B7Rx9xynTGkk1$4OTLn z1r=zPk%jw@{=p}(WwF_0Yfc;wIBYlCw#DWWeqIs0naN@M=M#Q`!Bc+V;UK_qb^+lQ z1vu4TwVFa-ml!^b1NsE&{+KNb$#9IyAm7w#NU>ZBa%>M{Z`#H0WnkrEkm1fr!n4{r z;SLv`F-G`YMLR3RD>>KlOGyqU6yC@i3BS_Ft*Cr>3_mz#AO0)Lh&?C>>UoW^SFWE0 zJ=fI4@VNTcT6I{J&|f>Rj#a&7bxvN+mNVr-d8u3_?~xD6_vJ@2KMOEctsIo=nN_~J z{Oj^>%JXstz-G%ia;}^w=Yzr`xmYfd%jAXfVtI*NE?0nw%j8Nhvqr9!>*RWQmApn? zE3cE+%Nyj4@+NtUyj9*NZ`L=vVzAN7YH$RXcf~z0PPvmFvbNQwGN^X%`&@}b^X7T;y#?MvZ;`jyTk0+IF7z()F7cLoE4<6R z%e^bSRo-gvN^h;V&Rg$o*VvNonp~f1?K5o_+qMk`gf+G$6S?}qgEntRxE{tIOmvHH zR^P+F6b9Zt;twwU7T;sGdIZ`)EPE_CF1sGuF^^IfDhl>9I DCr0lU literal 0 HcmV?d00001 diff --git a/programs/system/kerpack/trunk/memset.asm b/programs/system/kerpack/trunk/memset.asm new file mode 100644 index 0000000000..1774128c90 --- /dev/null +++ b/programs/system/kerpack/trunk/memset.asm @@ -0,0 +1,11 @@ +format MS COFF +section '.text' code readable executable +public _memset +_memset: + push edi + mov edi, [esp+8] + mov al, [esp+12] + mov ecx, [esp+16] + rep stosb + pop edi + ret diff --git a/programs/system/notify/trunk/@notify.asm b/programs/system/notify/trunk/@notify.asm new file mode 100644 index 0000000000..5ea061706f --- /dev/null +++ b/programs/system/notify/trunk/@notify.asm @@ -0,0 +1,149 @@ + +; +; @notify, pop-up windows +; by Sourcerer, 20.01.2011 +; +;--------------------------------------------------------------------- + + use32 ; включить 32-битный режим ассемблера + org 0x0 ; адресация с нуля + + db 'MENUET01' ; 8-байтный идентификатор MenuetOS + dd 0x01 ; версия заголовка (всегда 1) + dd START ; адрес первой команды + dd I_END ; размер программы + dd 0x1000 ; количество памяти + dd 0x1000 ; адрес вершины стэка + dd I_PARAM ; адрес буфера для параметров + dd 0x0 ; зарезервировано + + +include 'macros.inc' ; + +;--------------------------------------------------------------------- +;--- НАЧАЛО ПРОГРАММЫ ---------------------------------------------- +;--------------------------------------------------------------------- + +START: + +red: ; перерисовать окно + + call draw_window ; вызываем процедуру отрисовки окна + +;--------------------------------------------------------------------- +;--- ЦИКЛ ОБРАБОТКИ СОБЫТИЙ ---------------------------------------- +;--------------------------------------------------------------------- + + + + still: ; main cycle + mov eax, 23 + mov ebx, 500 + mcall + + cmp eax, 0 + je exit + cmp eax, 1 + je red + cmp eax, 2 + je key + cmp eax, 3 + je button + + + + + + button: ; button event handler + mov al, 17 ; get button identifier + mcall + + cmp ah, 1 + jne still ; return if button id != 1 + + or eax, -1 ; exit application + mcall + + key: ; key event handler + mov al, 2 ; get key code + mcall + + jmp still + + exit: + mcall -1 + +;--------------------------------------------------------------------- +;--- ОПРЕДЕЛЕНИЕ И ОТРИСОВКА ОКНА ---------------------------------- +;--------------------------------------------------------------------- + +draw_window: + +mcall 12, 1 ; функция 12: сообщить ОС об отрисовке окна + +mov eax,14 ;получим ширину экрана +mov ebx, 4 +mcall +shr eax, 16 +and eax,0x0000FFFF +sub eax,300 ;отнимем от нее 300 +shl eax, 16 ;и превратим в координаты окна по оси X +add eax,300 +mov ebx, eax + +mov eax, 0 ;и выведем это окно +mov ecx, 30 ;высотой 25 пикс +mov edx, 0x41000000 ;черного цвета и без заголовка +mov esi, 0x01000000 +mcall + +;вывод сеточки +mov eax, 1 ;функция вывода точки +mov edx, 0 ;черного цвета +mov ecx, 30 ;высота окна - 30 пкс +mov esi, 0 ;счетчик сдвига сетки + +drawx: ;рисование линии +sub ecx, 1 ;уменьшаем счетчик линий +cmp ecx, 0 ;закончились линии? +je fin ;значит, хватит рисовать +mov ebx, 300 ;иначе - у нас ширина сетки 300 пкс +cmp esi,1 ;имелся ли сдвиг сетки в прошлой линии? +je sw;если да, то перейдем к sw +mov esi,1 ;иначе - сдвиг был выключен, включим сдвиг +jmp drawy ;перейдем к рисованию + +sw: +mov esi,0 ;выключаем сдвиг сетки + +drawy: ;рисование +sub ebx, 2 ;ставить точки будем через одну +cmp ebx, 0 ;дорисовали ли мы линию? +je drawx ;если да, то переходим к новой +sub ebx, esi ;применяем сдвиг +mcall ;рисуем +add ebx, esi ;возвращаем счетчик на место +jmp drawy ;рисуем новую точку + +fin: ;дорисовали + +mcall 4, <3, 12>, 0x80000000, I_PARAM, 0 ;тень за текстом +mcall 4, <5, 12>, 0x80000000, I_PARAM, 0 ; +mcall 4, <4, 11>, 0x80000000, I_PARAM, 0 ; +mcall 4, <4, 13>, 0x80000000, I_PARAM, 0 ; + mcall 4, <4, 12>, 0x80EFEFEF, I_PARAM, 0 ;текст + + + mcall 12, 2 ; конец рисования + + + ret ; выходим из процедуры + + +;--------------------------------------------------------------------- +;--- ДАННЫЕ ПРОГРАММЫ ---------------------------------------------- +;--------------------------------------------------------------------- + +I_PARAM rb 256 + +I_END: ; метка конца программы diff --git a/programs/system/notify/trunk/@notify.c-- b/programs/system/notify/trunk/@notify.c-- new file mode 100644 index 0000000000..c2df829e2d --- /dev/null +++ b/programs/system/notify/trunk/@notify.c-- @@ -0,0 +1,45 @@ +#include "..\lib\kolibri.h--" +#include "..\lib\memory.h--" +// Kolibri Notify Daemon. v0.1 by SoUrcerer + +dword id; +void main() +{ + + word key; +id=GetScreenWidth(); + +loop() + { + switch(WaitEvent()) + { + case evButton: + id=GetButtonID(); + ExitProcess(); + break; + + case evKey: + key = GetKey(); + ExitProcess(); + break; + + case evReDraw: + draw_window(); + break; + } + Pause (500); + ExitProcess(); + } +} + +void draw_window() +{ + WindowRedrawStatus(1); + DefineAndDrawWindow(id-300,0,300,44,0x30000000,0x1012141F,0,0,"Kolibri Notify"); +// DefineButton(0,300,0,96,0x30000001,0x0) ; + WriteText(7,7,0x80,0xFFFFFF,"Kolibri Notify",0); + WriteText(7,25,0x80,0xEFEFEF,I_Param,0); + WindowRedrawStatus(2); +} + +stop: diff --git a/programs/system/spanel/trunk/build.bat b/programs/system/spanel/trunk/build.bat new file mode 100644 index 0000000000..7e0d468c20 --- /dev/null +++ b/programs/system/spanel/trunk/build.bat @@ -0,0 +1 @@ +fasm spanel.asm spanel \ No newline at end of file diff --git a/programs/system/spanel/trunk/spanel.asm b/programs/system/spanel/trunk/spanel.asm new file mode 100644 index 0000000000..84485b04c1 --- /dev/null +++ b/programs/system/spanel/trunk/spanel.asm @@ -0,0 +1,265 @@ +; +; PANEL SETUP +; +; Compile with FASM for Menuet +; + +use32 + + org 0x0 + + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd 0x8000 ; memory for app + dd 0x8000 ; esp + dd 0x0 , 0x0 ; I_Param , I_Icon + +include '..\..\macros.inc' + +START: ; start of execution + + call draw_window + +still: + + mov eax,10 ; wait here for event + int 0x40 + + cmp eax,1 ; redraw request ? + je red + cmp eax,2 ; key in buffer ? + je key + cmp eax,3 ; button in buffer ? + je button + + jmp still + + red: ; redraw + call draw_window + jmp still + + key: ; key + mov eax,2 ; just read it and ignore + int 0x40 + + shr eax,8 + cmp eax,'0' + jb still + cmp eax,'9' + jg still + + mov edi,[ent] + add edi,text + mov esi,edi + inc esi + mov ecx,3 + cld + rep movsb + + mov [edi],al + + call draw_window + jmp still + + button: ; button + mov eax,17 ; get id + int 0x40 + + cmp ah,1 ; button id=1 ? + jne noclose + mov eax,-1 ; close this program + int 0x40 + noclose: + + cmp ah,10 + jne no_apply + + mov esi,text+17 + mov edi,I_END+10 + mov ecx,12 + newfe: + mov ebx,[esi] + mov [edi],ebx + mov [edi+4],byte ';' + add edi,5 + add esi,55 + loop newfe + mov [edi],byte 'x' + + mov eax,70 + mov ebx,dat_write + int 0x40 + + + mov esi,1 + newread: + inc esi + mov eax,9 + mov ebx,I_END + mov ecx,esi + int 0x40 + cmp esi,eax + jg all_terminated + + mov eax,[ebx+10] + and eax,not 0x20202000 + cmp eax,'@PAN' + jne newread + mov eax,[ebx+14] + and eax,not 0x2020 + cmp eax,'EL ' + jne newread + + mov eax,18 + mov ebx,2 + mov ecx,esi + int 0x40 + + mov eax,5 + mov ebx,5 + int 0x40 + + mov esi,1 + + jmp newread + + all_terminated: + + mov eax,5 + mov ebx,25 + int 0x40 + + mov eax, 70 + mov ebx, panel_start + int 0x40 + + no_apply: + + cmp ah,11 + jb no_entry + shr eax,8 + sub eax,11 + imul eax,55 + add eax,17 + mov [ent],eax + mov [text+eax],dword '0000' + call draw_window + jmp still + no_entry: + + + jmp still + + +ent dd 17 + +panel_start: + dd 7 + dd 0 + dd 0 + dd 0 + dd 0 + db '/RD/1/@PANEL',0 + +dat_write: + dd 2 + dq 0 + dd 5*12+1 + dd I_END+10 + db 'PANEL.DAT',0 + +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* + + +draw_window: + + + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,1 ; 1, start of draw + int 0x40 + + ; DRAW WINDOW + mov eax,0 ; function 0 : define and draw window + mov ebx,100*65536+385 ; [x start] *65536 + [x size] + mov ecx,100*65536+190 ; [y start] *65536 + [y size] + mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl + mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl + mov edi,0x005080d0 ; color of frames RRGGBB + int 0x40 + + ; WINDOW LABEL + mov eax,4 ; function 4 : write text to window + mov ebx,8*65536+8 ; [x start] *65536 + [y start] + mov ecx,0x10ddeeff ; color of text RRGGBB + mov edx,labelt ; pointer to text beginning + mov esi,labellen-labelt ; text length + int 0x40 + + mov eax,8 + mov ebx,25*65536+335 ;160 + mov ecx,162*65536+12 + mov edx,10 + mov esi,0x80a0c0 ;0x6677cc + int 0x40 + + mov eax,8 + mov ebx,340*65536+20 + mov ecx,34*65536+10 + mov edx,11 + newb: + int 0x40 + add ecx,10*65536 + inc edx + cmp edx,23 + jb newb + + mov ebx,25*65536+35 ; draw info text with function 4 + mov ecx,0x224466 + mov edx,text + mov esi,55 + newline: + mov eax,4 + int 0x40 + add ebx,10 + add edx,55 + cmp [edx],byte 'x' + jne newline + + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,2 ; 2, end of draw + int 0x40 + + ret + + +; DATA AREA + + +text: + +db 'width 0000 : 0 for full screen width <' +db 'buttons 0000 : 0 no frames , 1 frames <' +db 'soften_up 0001 : 0 no , 1 yes <' +db 'soften_down 0001 : 0 no , 1 yes <' +db 'minimize_left 0001 : 0 no , 1 yes <' +db 'minimize_right 0001 : 0 no , 1 yes <' +db 'icons_position 0100 : position in pixels <' +db 'menu_enable 0001 : 0 no , 1 yes <' +db 'setup_enable 0001 : 0 no , 1 yes <' +db 'graph_text 0001 : 0 graphics , 1 text <' +db 'soften_middle 0001 : 0 no , 1 yes <' +db 'icons 0001 : 0 start , 1 activate <' +db ' ' +db ' APPLY ' +db 'x' + + +labelt: + db 'PANEL SETUP' +labellen: + +I_END: diff --git a/programs/system/test/trunk/build.bat b/programs/system/test/trunk/build.bat new file mode 100644 index 0000000000..304c33de37 --- /dev/null +++ b/programs/system/test/trunk/build.bat @@ -0,0 +1 @@ +fasm test.asm test \ No newline at end of file diff --git a/programs/system/test/trunk/test.asm b/programs/system/test/trunk/test.asm new file mode 100644 index 0000000000..6554d17db0 --- /dev/null +++ b/programs/system/test/trunk/test.asm @@ -0,0 +1,200 @@ +; +; PROTECTION TEST +; + +use32 + + org 0x0 + + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd 0x10000 ; memory for app + dd 0xfff0 ; esp + dd 0x0 , 0x0 ; I_Param , I_Icon + +include '..\..\macros.inc' + +START: ; start of execution + + call draw_window ; at first, draw the window + +still: + + mov eax,10 ; wait here for event + int 0x40 + + cmp eax,1 ; redraw request ? + jz red + cmp eax,2 ; key in buffer ? + jz key + cmp eax,3 ; button in buffer ? + jz button + + jmp still + + red: ; redraw + call draw_window + + jmp still + + key: ; key + mov eax,2 ; just read it and ignore + int 0x40 + + jmp still + + button: ; button + mov eax,17 + int 0x40 + + cmp ah,1 ; button id=1 ? + jnz noclose + mov eax,0xffffffff ; close this program + int 0x40 + noclose: + + cmp ah,2 + jnz notest2 + cli + notest2: + + cmp ah,3 + jnz notest3 + sti + notest3: + + cmp ah,4 + jnz notest4 + mov [0x10000],byte 1 + notest4: + + cmp ah,5 + jnz notest5 + jmp dword 0x10000 + notest5: + + cmp ah,6 + jnz notest6 + mov esp,0 + push eax + notest6: + + cmp ah,7 + jnz notest7 + in al,0x60 + notest7: + + cmp ah,8 + jnz notest8 + out 0x60,al + notest8: + + + + + jmp still + + +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* + + +draw_window: + + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,1 ; 1, start of draw + int 0x40 + + ; DRAW WINDOW + mov eax,0 ; function 0 : define and draw window + mov ebx,100*65536+300 ; [x start] *65536 + [x size] + mov ecx,100*65536+240 ; [y start] *65536 + [y size] + mov edx,0x02ffffff ; color of work area RRGGBB + mov esi,0x80597799 ; color of grab bar RRGGBB,8->color glide + mov edi,0x00597799 ; color of frames RRGGBB + int 0x40 + + ; WINDOW LABEL + mov eax,4 ; function 4 : write text to window + mov ebx,8*65536+8 ; [x start] *65536 + [y start] + mov ecx,0x00ffffff ; color of text RRGGBB + mov edx,tlabel ; pointer to text beginning + mov esi,labellen-tlabel ; text length + int 0x40 + + ; CLOSE BUTTON + mov eax,8 ; function 8 : define and draw button + mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size] + mov ecx,5*65536+12 ; [y start] *65536 + [y size] + mov edx,1 ; button id + mov esi,0x5977bb ; button color RRGGBB + int 0x40 + + + mov eax,8 ; function 8 : define and draw button + mov ebx,25*65536+9 ; [x start] *65536 + [x size] + mov ecx,74*65536+9 ; [y start] *65536 + [y size] + mov edx,2 ; button id + mov esi,0x5977bb ; button color RRGGBB + newb: + int 0x40 + add ecx,20*65536 + inc edx + cmp edx,9 + jb newb + + cld + mov ebx,25*65536+36 ; draw info text with function 4 + mov ecx,0x000000 + mov edx,text + mov esi,40 + newline: + mov eax,4 + int 0x40 + add ebx,10 + add edx,40 + cmp [edx],byte 'x' + jnz newline + + + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,2 ; 2, end of draw + int 0x40 + + ret + + +; DATA AREA + + +text: + + db 'APPLICATION USES 0x10000 BYTES OF MEMORY' + db ' ' + db 'OPEN DEBUG BOARD FOR PARAMETERS ' + db ' ' + db ' CLI ' + db ' ' + db ' STI ' + db ' ' + db ' MOV [0x10000],BYTE 1 ' + db ' ' + db ' JMP DWORD 0x10000 ' + db ' ' + db ' MOV ESP,0 & PUSH EAX ' + db ' ' + db ' IN Al,0x60 ' + db ' ' + db ' OUT 0x60,AL ' + db 'x ' + + + +tlabel: + db 'MENUET PROTECTION TEST' +labellen: + +I_END: