Compare commits

..
10 Commits
Author SHA1 Message Date
Matou1306 e9e9ebb4c8 Implemented wrapper for @open (#344)
Fixed #336

Implemented a wrapper for placing the path to a file in quotes.
This corrects the problem of handling paths containing spaces in C programs such as `DGEN`,
 since the space is the argument delimiter.

The wrapper should have the name `<app>_open`. Wrapper trims the `_open` postfix and launches the `<app>`.

Reviewed-on: KolibriOS/kolibrios#344
Reviewed-by: Ivan B <dunkaist@noreply.localhost>
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: Matou <mathieubotros@gmail.com>
Co-committed-by: Matou <mathieubotros@gmail.com>
2026-03-23 14:34:07 +00:00
YVishereandAditya Yellapuntula Venkata 4c359e42ce loaddrv: Updated error message on invalid args passed (#364)
Added a usage line and changed the wording slightly to be more clear in the expected arguments.

Co-authored-by: Aditya Yellapuntula Venkata <aditya.yellapuntulavenkata@doosan.com>
Reviewed-on: KolibriOS/kolibrios#364
Reviewed-by: Burer <burer@noreply.localhost>
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: Aditya Yellapuntula Venkata <adityayv802@gmail.com>
Co-committed-by: Aditya Yellapuntula Venkata <adityayv802@gmail.com>
2026-03-14 16:49:33 +00:00
jaskaran-singh-77 3238f9f485 apps/cedit: use numeric version instead of date (fix #329) (#361)
Replace hardcoded date "CEdit (11-jan-2026)" with version "CEdit 1.0"

Add separate VERSION and APPNAME constants for better maintainability

Fixes issue [#329](KolibriOS/kolibrios#329)

Reviewed-on: KolibriOS/kolibrios#361
Reviewed-by: Burer <burer@noreply.localhost>
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: jaskaran-singh-77 <jassijatt951@gmail.com>
Co-committed-by: jaskaran-singh-77 <jassijatt951@gmail.com>
2026-03-14 10:46:08 +00:00
Igor Shutrov 289eabf8a4 cedit: add Shift+Tab shortcut (#318)
Add Shift+Tab shortcut to decrease indentation

Reviewed-on: KolibriOS/kolibrios#318
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Reviewed-by: Burer <burer@noreply.localhost>
Co-authored-by: Igor Shutrov <kolibridev@inbox.ru>
Co-committed-by: Igor Shutrov <kolibridev@inbox.ru>
2026-03-12 13:47:42 +00:00
Burerandrgimad e818e2167f apps/reshare: rewrite to fasm (#305)
- Rewritten to FASM (rgimad);
- Refactored code;
- Tweaked UX/UI;
- Fit program RAM usage into 1 MB (#make_8mb_great_again):
  https://wiki.kolibrios.org/wiki/SystemRequirements;
- Fit program window with default skin into 800x600;
- Use proper prefixes for debug messages.

Reviewed-on: KolibriOS/kolibrios#305
Reviewed-by: Ivan B <dunkaist@noreply.localhost>
Co-authored-by: Burer <burer@kolibrios.org>
Co-authored-By: rgimad <rgimad@kolibrios.org>
Co-committed-by: Burer <burer@kolibrios.org>
2026-03-11 20:59:35 +03:00
Igor Shutrov 42c205be32 heed: Add exit by ESC (#345)
Reviewed-on: KolibriOS/kolibrios#345
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: Igor Shutrov <kolibridev@inbox.ru>
Co-committed-by: Igor Shutrov <kolibridev@inbox.ru>
2026-03-11 12:21:47 +00:00
hrigar 0253ec8753 Rename icons16.png to icons18.png and update all refs (#350)
Fixed #349.

Reviewed-on: KolibriOS/kolibrios#350
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Reviewed-by: Burer <burer@noreply.localhost>
Co-authored-by: hrigar <h4gar02@protonmail.com>
Co-committed-by: hrigar <h4gar02@protonmail.com>
2026-03-11 13:12:31 +03:00
Egor00f 91dc4d8cad libc.obj: Added strtok_r (#341)
Reviewed-on: KolibriOS/kolibrios#341
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-03-08 00:36:53 +03:00
mxlgv 6f2a947deb Remove broken unused and unfinished apps and libs
- TEAtool: A useless utility for encryption with the TEA algorithm,
  written for fun by me during my school years;
- GameHack: not a working prototype of a program like Cheat Engine;
- microtar: port of a portable library with a reduced functionality
  for working with TAR in C that is not used

Signed-off-by: Max Logaev <maxlogaev@proton.me>
2026-03-07 20:19:00 +00:00
735b86c476 piano: refactoring and improvement (#302)
- Refactored source code;
- Added Spanish translation;
- Updated UX / UI;
- Updated keyboard layout (fix #25);
- Added keymap configuration via separate binary file.

Reviewed-on: KolibriOS/kolibrios#302
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: Burer <burer@kolibrios.org>
Co-authored-by: Doczom <mixa.frolov2003@gmail.com>
Co-authored-by: qullarwee <unknown@domain.local>
Co-committed-by: Burer <burer@kolibrios.org>
2026-03-07 23:13:08 +03:00
44 changed files with 1039 additions and 1609 deletions

No files matched your search

+4 -5
View File
@@ -28,7 +28,7 @@ img_files = {
{"ALLGAMES", "common/allgames"},
{"HOME.PNG", "common/wallpapers/T_Home.png"},
{"ICONS32.PNG", "common/icons32.png"},
{"ICONS16.PNG", "common/icons16.png"},
{"ICONS18.PNG", "common/icons18.png"},
{"INDEX.HTM", "common/index_htm"},
{"KUZKINA.MID", "common/kuzkina.mid"},
{"SINE.MP3", "common/sine.mp3"},
@@ -405,8 +405,9 @@ tup.append_table(img_files, {
{"@MENU", VAR_PROGS .. "/system/menu/trunk/menu"},
{"@NOTIFY", VAR_PROGS .. "/system/notify3/notify"},
{"@OPEN", VAR_PROGS .. "/system/open/open"},
{"@TASKBAR", VAR_PROGS .. "/system/taskbar/trunk/TASKBAR"},
{"@RESHARE", VAR_PROGS .. "/system/reshare/reshare"},
{"@SS", VAR_PROGS .. "/system/scrsaver/scrsaver"},
{"@TASKBAR", VAR_PROGS .. "/system/taskbar/trunk/TASKBAR"},
{"@VOLUME", VAR_PROGS .. "/media/volume/volume"},
{"HACONFIG", VAR_PROGS .. "/other/ha/HACONFIG"},
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
@@ -665,7 +666,6 @@ end -- tup.getconfig('NO_JWASM') ~= 'full'
-- Programs that require C-- to compile.
if tup.getconfig('NO_CMM') ~= 'full' then
tup.append_table(img_files, {
{"@RESHARE", VAR_PROGS .. "/cmm/misc/reshare.com"},
{"APP_PLUS", VAR_PROGS .. "/cmm/app_plus/app_plus.com"},
{"EASYSHOT", VAR_PROGS .. "/cmm/misc/easyshot.com"},
{"MOUSECFG", VAR_PROGS .. "/cmm/mousecfg/mousecfg.com"},
@@ -735,7 +735,6 @@ tup.append_table(extra_files, {
{"kolibrios/develop/TinyBasic/TinyBasic", VAR_PROGS .. "/develop/tinybasic-1.0.4/tinybasic"},
{"kolibrios/develop/TinyBasic/bas/", SRC_PROGS .. "/develop/tinybasic-1.0.4/bas/*"},
{"kolibrios/develop/TinyBasic/TinyBasic.man", SRC_PROGS .. "/develop/tinybasic-1.0.4/doc/tinybasic.man"},
-- {"kolibrios/utils/teatool", VAR_PROGS .. "/other/TEAtool/teatool"},
{"kolibrios/utils/passwordgen", VAR_PROGS .. "/other/PasswordGen/passwordgen"},
{"kolibrios/utils/kruler", VAR_PROGS .. "/other/kruler/kruler"},
{"kolibrios/media/qr_tool", SRC_PROGS .. "/media/qr_tool/qr_tool"},
@@ -759,7 +758,6 @@ tup.append_table(img_files, {
{"GAMES/REVERSI", VAR_PROGS .. "/games/reversi/reversi"},
{"LIB/BASE64.OBJ", VAR_PROGS .. "/develop/libraries/base64/base64.obj"},
{"LIB/ICONV.OBJ", VAR_PROGS .. "/develop/libraries/iconv/iconv.obj"},
-- {"LIB/MTAR.OBJ", VAR_PROGS .. "/develop/libraries/microtar/mtar.obj"},
})
tup.append_table(extra_files, {
-- {"kolibrios/3D/cubeline", VAR_PROGS .. "/demos/cubeline/trunk/cubeline"},
@@ -802,6 +800,7 @@ if tup.getconfig('NO_NASM') ~= 'full' then
{"kolibrios/games/wolf3d/", VAR_CONTRIB .. "/games/wolf3d/wolf3d"},
{"kolibrios/games/wolf3d/", "common/games/wolf3d/*"},
{"kolibrios/emul/dgen/dgen", VAR_PROGS .. "/emulator/dgen-sdl-1.33/dgen"},
{"kolibrios/emul/dgen/dgen_open", VAR_PROGS .. "/fs/wrap_open/wrap_open"},
{"kolibrios/emul/dgen/dgen.html", SRC_PROGS .. "/emulator/dgen-sdl-1.33/dgen.html"},
{"kolibrios/emul/dgen/dgenrc.html", SRC_PROGS .. "/emulator/dgen-sdl-1.33/dgenrc.html"},
})
+1 -1
View File
@@ -1,4 +1,4 @@
[icons16]
[icons18]
<dir>=0
<up>=1
<lot>=20
File renamed without changes.
+2 -2
View File
@@ -190,8 +190,8 @@ gbc=/kolibrios/emul/gameboy
min=/kolibrios/emul/pokemini
nc=/kolibrios/utils/cnc_editor/cnc_editor
ch8=/kolibrios/emul/chip8/chip8
md=/kolibrios/emul/dgen/dgen
gen=/kolibrios/emul/dgen/dgen
md=/kolibrios/emul/dgen/dgen_open
gen=/kolibrios/emul/dgen/dgen_open
rom=/kolibrios/emul/uxn
zip=$Unz
+2 -2
View File
@@ -101,8 +101,8 @@ dword waves_pal[256];
collection_int selected0, selected1;
dword selected_count[PANES_COUNT]=0;
libimg_image icons16_default;
libimg_image icons16_selected;
libimg_image icons18_default;
libimg_image icons18_selected;
libimg_image icons32_default;
libimg_image icons32_selected;
@@ -103,7 +103,7 @@ void CopyFilesListToClipboard(bool _cut_active)
if (cut_active) {
if (i>=files.first) && (i<files.first+files.visible)
PutShadow(files.x+4,i-files.first*files.item_h+files.y,icons16_default.w,files.item_h,1,-3);
PutShadow(files.x+4,i-files.first*files.item_h+files.y,icons18_default.w,files.item_h,1,-3);
}
}
}
+3 -3
View File
@@ -25,7 +25,7 @@ int ICONS_INI::get(dword _file_path, _ext, int size)
else if (size == 32) return i32.get(ext_pos);
} else {
exts.add(#ext);
icons_ini.section = "icons16";
icons_ini.section = "icons18";
i18.set(exts.count-1, icons_ini.GetInt(#ext, 2));
icons_ini.section = "icons32";
@@ -60,8 +60,8 @@ void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
selected_image = icons32_selected.image;
default_image = icons32_default.image;
} else {
selected_image = icons16_selected.image;
default_image = icons16_default.image;
selected_image = icons18_selected.image;
default_image = icons18_default.image;
}
if (fairing_color==col.selec) {
+5 -5
View File
@@ -184,11 +184,11 @@ void LoadIcons()
icons32_default.replace_color(0x00000000, col.list_bg);
icons32_selected.replace_color(0x00000000, col.selec);
} else {
icons16_default.load("/sys/icons16.png");
icons16_selected.load("/sys/icons16.png");
icons16_selected.replace_2colors(0xffFFFfff, col.selec, 0xffCACBD6, selected_shadow);
icons18_default.load("/sys/icons18.png");
icons18_selected.load("/sys/icons18.png");
icons18_selected.replace_2colors(0xffFFFfff, col.selec, 0xffCACBD6, selected_shadow);
if (col.list_bg!=0xFFFfff) {
icons16_default.replace_2colors(0xffFFFfff, col.list_bg, 0xffCACBD6, non_white_shadow);
icons18_default.replace_2colors(0xffFFFfff, col.list_bg, 0xffCACBD6, non_white_shadow);
}
}
@@ -260,7 +260,7 @@ void BigIconsSwitch()
icon_size = 32;
LoadIcons();
} else {
icon_size = icons16_default.w;
icon_size = icons18_default.w;
}
BigFontsChange();
}
+1 -1
View File
@@ -220,7 +220,7 @@ void SelectList_DrawLine(dword i)
} else {
strcpy(#tname, results.name.get(select_list.first + i));
strlwr(#tname);
icons_ini.section = "icons16";
icons_ini.section = "icons18";
icon = icons_ini.GetInt(#tname + strrchr(#tname, '.'), 2);
}
+14 -14
View File
@@ -160,7 +160,7 @@ _ActionsHistory actionsHistory;
// //
//===================================================//
libimg_image icons16;
libimg_image icons18;
void main()
{
@@ -170,18 +170,18 @@ void main()
load_dll(libimg, #libimg_init, 1);
load_dll(boxlib, #box_lib_init,0);
icons16.load("/sys/icons16.png");
leftbar_w = icons16.w + 16;
icons18.load("/sys/icons18.png");
leftbar_w = icons18.w + 16;
sc.get();
bg_dark = skin_is_dark();
semi_white = MixColors(sc.work, 0xFFFfff, bg_dark*90 + 96);
icons16.replace_color(0xffFFFfff, sc.work);
icons16.replace_color(0xffCACBD6, MixColors(sc.work, 0, 200));
icons18.replace_color(0xffFFFfff, sc.work);
icons18.replace_color(0xffCACBD6, MixColors(sc.work, 0, 200));
//fix line and rectandle color for dark skins
if (bg_dark) icons16.replace_color(0xff545454, 0xffD3D3D4);
if (bg_dark) icons18.replace_color(0xff545454, 0xffD3D3D4);
EventSetActiveColor(1, color1);
@@ -301,7 +301,7 @@ void DrawTopPanelButton1(dword _event, _hotkey, _x, _icon_n)
#define ISIZE 18
#define YPOS 6
DefineHiddenButton(_x-4, YPOS-4, ISIZE+7, ISIZE+7, button.add(_event));
img_draw stdcall(icons16.image, _x, YPOS, ISIZE, ISIZE, 0, _icon_n*ISIZE);
img_draw stdcall(icons18.image, _x, YPOS, ISIZE, ISIZE, 0, _icon_n*ISIZE);
if (_hotkey) key.add_n(_hotkey, _event);
}
@@ -323,10 +323,10 @@ int DrawFlatPanelButton(dword _id, _x, _y, _text)
void DrawLeftPanelButton(dword _event, _hotkey, _y, _icon_n)
{
int x = 5;
DrawRectangle(x, _y, icons16.w + 5, icons16.w + 5, sc.work);
DefineHiddenButton(x, _y, icons16.w + 5, icons16.w + 5, button.add(_event));
img_draw stdcall(icons16.image, x+3, _y+3, icons16.w,
icons16.w, 0, _icon_n*icons16.w);
DrawRectangle(x, _y, icons18.w + 5, icons18.w + 5, sc.work);
DefineHiddenButton(x, _y, icons18.w + 5, icons18.w + 5, button.add(_event));
img_draw stdcall(icons18.image, x+3, _y+3, icons18.w,
icons18.w, 0, _icon_n*icons18.w);
key.add_n(_hotkey, _event);
}
void DrawStatusBar()
@@ -419,8 +419,8 @@ void DrawWindow()
void DrawLeftPanelSelection()
{
if (previousTool!=-1) DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, icons16.w+5, icons16.w+5, sc.work, sc.work);
DrawRectangle3D(5, currentTool*GAPV+right_bar.y-2, icons16.w+5, icons16.w+5, 0x333333, 0x777777);
if (previousTool!=-1) DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, icons18.w+5, icons18.w+5, sc.work, sc.work);
DrawRectangle3D(5, currentTool*GAPV+right_bar.y-2, icons18.w+5, icons18.w+5, 0x333333, 0x777777);
}
void DrawEditArea()
@@ -429,7 +429,7 @@ void DrawEditArea()
int top_side;
int left_side;
wrapper.x = icons16.w + 16;
wrapper.x = icons18.w + 16;
wrapper.w = Form.cwidth - right_bar.w - 10 - wrapper.x;
wrapper.h = Form.cheight - TOPBAR_H - 35;
+2 -2
View File
@@ -44,9 +44,9 @@ void main()
OpenDialog_init stdcall (#o_dialog);
/* Init UI */
icons18.load("/sys/icons16.png");
icons18.load("/sys/icons18.png");
icons18.replace_2colors(0xffFFFfff, COL_LIGHT, 0xffCACBD6, COL_LIGHT-0x080808);
icons18a.load("/sys/icons16.png");
icons18a.load("/sys/icons18.png");
icons18a.replace_2colors(0xffFFFfff, COL_BUTTON, 0xffCACBD6, 0);
pixie_skin.load("/sys/media/pixieskn.png");
Form.width = screen.w/6*5;
+14 -14
View File
@@ -21,8 +21,8 @@
//===================================================//
libimg_image icons32;
libimg_image icons16;
libimg_image icons16w;
libimg_image icons18;
libimg_image icons18w;
unsigned int size32;
unsigned int size16;
@@ -73,7 +73,7 @@ void main()
load_dll(libimg, #libimg_init, 1);
icons32.load("/SYS/ICONS32.PNG"); size32 = icons32.h * 32 * 4;
icons16.load("/SYS/ICONS16.PNG"); size16 = icons16.h * 18 * 4;
icons18.load("/SYS/ICONS18.PNG"); size16 = icons18.h * 18 * 4;
if (GetProcessesCount("@RESHARE")>1) {
start_ui();
@@ -103,8 +103,8 @@ void start_daemon()
img_destroy stdcall(icons32.image);
shared_i16 = memopen("ICONS18", size16, SHM_CREATE + SHM_WRITE);
memmov(shared_i16, icons16.imgsrc, size16);
//img_destroy stdcall(icons16.image);
memmov(shared_i16, icons18.imgsrc, size16);
//img_destroy stdcall(icons18.image);
shared_i16w = memopen("ICONS18W", size16, SHM_CREATE + SHM_WRITE);
@@ -114,7 +114,7 @@ void start_daemon()
sc.get();
$pop eax
if (sc.work != EAX) {
memmov(shared_i16w, icons16.imgsrc, size16);
memmov(shared_i16w, icons18.imgsrc, size16);
replace_2cols(shared_i16w, size16, 0xffFFFfff, sc.work, 0xffCACBD6, sc.dark);
}
} while(WaitEvent()==evDesktop);
@@ -133,7 +133,7 @@ void start_daemon()
#define BTNH 24
#define RESY PAD+30+BTNH+BTNH
enum { ACTIVE_ICONS32=1, ACTIVE_ICONS16=2, ACTIVE_ICONS16W=4, ACTIVE_CHECKBOX=8 };
enum { ACTIVE_ICONS32=1, ACTIVE_ICONS18=2, ACTIVE_ICONS18W=4, ACTIVE_CHECKBOX=8 };
int active_tab = ACTIVE_ICONS32;
void start_ui()
@@ -190,8 +190,8 @@ void draw_tabs()
{
#define TABX WINW-BTNW-PAD-BTNW-PAD-BTNW-PAD-BTNW/2
DrawFlatButton( TABX, PAD+30, "ICONS32", 10+ACTIVE_ICONS32, active_tab & ACTIVE_ICONS32);
DrawFlatButton(PAD+BTNW*1+TABX, PAD+30, "ICONS16", 10+ACTIVE_ICONS16, active_tab & ACTIVE_ICONS16);
DrawFlatButton(PAD+BTNW*2+TABX, PAD+30, "ICONS16W", 10+ACTIVE_ICONS16W, active_tab & ACTIVE_ICONS16W);
DrawFlatButton(PAD+BTNW*1+TABX, PAD+30, "ICONS18", 10+ACTIVE_ICONS18, active_tab & ACTIVE_ICONS18);
DrawFlatButton(PAD+BTNW*2+TABX, PAD+30, "ICONS18W", 10+ACTIVE_ICONS18W, active_tab & ACTIVE_ICONS18W);
DrawFlatButton(PAD+BTNW*3+TABX, PAD+30, "CHECKBOX", 10+ACTIVE_CHECKBOX, active_tab & ACTIVE_CHECKBOX);
draw_tab_icons32();
}
@@ -209,14 +209,14 @@ void draw_tab_icons32()
iconimg = icons32.imgsrc;
iconw = 32;
iconh = icons32.h;
} else if (active_tab & ACTIVE_ICONS16) {
iconimg = icons16.imgsrc;
} else if (active_tab & ACTIVE_ICONS18) {
iconimg = icons18.imgsrc;
iconw = 18;
iconh = icons16.h;
} else if (active_tab & ACTIVE_ICONS16W) {
iconh = icons18.h;
} else if (active_tab & ACTIVE_ICONS18W) {
iconimg = memopen("ICONS18W", NULL, SHM_READ);
iconw = 18;
iconh = icons16.h;
iconh = icons18.h;
} else {
PutImage(WINW-13/2, WINH-RESY-13/2+RESY, 13, 13, #checkbox_flag);
return;
+55
View File
@@ -0,0 +1,55 @@
Keyboard Shortcuts:
ctrl+A Select all
ctrl+C Copy
ctrl+V Paste
ctrl+X Cut
ctrl+L Convert to lowercase
ctrl+U Convert to uppercase
ctrl+F,
ctrl+H Show search/replace panel
Esc Close search panel; Close menu
shift+Esc Hide (Minimize) search panel
F10 Open main menu
shift+F10 Open context menu
F3 Find next
shift+F3 Find previous
ctrl+Z Undo
ctrl+Y Redo
ctrl+G Go to line...
ctrl+Del Delete line
ctrl+D Duplicate line
ctrl+Up Move text up
ctrl+Down Move text down
ctrl+E Select word
Tab Increase indent for text
shift+
Backspace Decrease indent for selected text
shift+Tab Decrease indent for text
ctrl+F2 Set/Remove bookmark
F2 Go to next bookmark
shift+F2 Go to previous bookmark
ctrl+S Save
ctrl+O Open
ctrl+N,
ctrl+T Create new
ctrl+W Close File
ctrl+Tab Switch to Next Tab
ctrl+F9 Compile
F9 Run
ctrl+F8 Debug
shift+wheel Horizontal scrolling
Navigating text:
(ctrl+)Home, (ctrl+)End, (ctrl+)PageUp, (ctrl+)PageDown
ctrl+Left, ctrl+Right
Navigating in search panel:
Tab Move to next input field
shift+Tab Move to previous input field
Enter Find next occurrence
@@ -1,55 +1,55 @@
Горячие клавиши:
ctrl+A выделить всё
ctrl+C копировать
ctrl+V вставить
ctrl+X вырезать
ctrl+L преобразовать в нижний регистр
ctrl+U преобразовать в верхний регистр
ctrl+F,
ctrl+H показать панель поиска/замены
Esc закрыть панель поиска; закрыть меню
shift+Esc скрыть (свернуть) панель поиска
F10 открыть главное меню
shift+F10 открыть контекстное меню
F3 найти следующий
shift+F3 найти предыдущий
ctrl+Z отменить
ctrl+Y вернуть
ctrl+G перейти на строку...
ctrl+Del удалить строку
ctrl+D дублировать строку
ctrl+Up переместить текст вверх
ctrl+Down переместить текст вниз
ctrl+E выделить слово
Tab увеличить отступ для выделенного текста
shift+
Backspace уменьшить отступ для выделенного текста
ctrl+F2 установить/снять метку
F2 перейти к метке ниже
shift+F2 перейти к метке выше
ctrl+S сохранить
ctrl+O открыть
ctrl+N,
ctrl+T создать новый
ctrl+W закрыть файл
ctrl+Tab переключиться на следующую вкладку
ctrl+F9 компилировать
F9 выполнить
ctrl+F8 отладка
shift+wheel горизонтальная прокрутка
перемещение по тексту:
(ctrl+)Home, (ctrl+)End, (ctrl+)PageUp, (ctrl+)PageDown
ctrl+Left, ctrl+Right
перемещение в панели поиска:
Tab к следующему полю ввода
Shift-Tab к предыдущему полю ввода
Enter поиск следующего вхождения
Горячие клавиши:
ctrl+A выделить всё
ctrl+C копировать
ctrl+V вставить
ctrl+X вырезать
ctrl+L преобразовать в нижний регистр
ctrl+U преобразовать в верхний регистр
ctrl+F,
ctrl+H показать панель поиска/замены
Esc закрыть панель поиска; закрыть меню
shift+Esc скрыть (свернуть) панель поиска
F10 открыть главное меню
shift+F10 открыть контекстное меню
F3 найти следующий
shift+F3 найти предыдущий
ctrl+Z отменить
ctrl+Y вернуть
ctrl+G перейти на строку...
ctrl+Del удалить строку
ctrl+D дублировать строку
ctrl+Up переместить текст вверх
ctrl+Down переместить текст вниз
ctrl+E выделить слово
Tab увеличить отступ для текста
shift+
Backspace уменьшить отступ для выделенного текста
shift+Tab уменьшить отступ для текста
ctrl+F2 установить/снять метку
F2 перейти к метке ниже
shift+F2 перейти к метке выше
ctrl+S сохранить
ctrl+O открыть
ctrl+N,
ctrl+T создать новый
ctrl+W закрыть файл
ctrl+Tab переключиться на следующую вкладку
ctrl+F9 компилировать
F9 выполнить
ctrl+F8 отладка
shift+wheel горизонтальная прокрутка
перемещение по тексту:
(ctrl+)Home, (ctrl+)End, (ctrl+)PageUp, (ctrl+)PageDown
ctrl+Left, ctrl+Right
перемещение в панели поиска:
Tab к следующему полю ввода
Shift-Tab к предыдущему полю ввода
Enter поиск следующего вхождения
+8 -4
View File
@@ -28,7 +28,9 @@ IMPORT
RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar;
CONST
HEADER = "CEdit (11-jan-2026)";
APPNAME = "CEdit";
VERSION = "1.0";
HEADER = APPNAME + " " + VERSION;
ShellFilter = "";
EditFilter = "sh|inc|txt|asm|ob07|c|cpp|h|pas|pp|lua|ini|json";
@@ -1575,7 +1577,7 @@ VAR
BEGIN
menu := List.create(NIL);
Menu.AddMenuItem(menu, menuIncInd, "increase Tab");
Menu.AddMenuItem(menu, menuDecInd, "decrease shift-Bksp");
Menu.AddMenuItem(menu, menuDecInd, "decrease shift-Tab");
RETURN Menu.create(menu, mainTID)
END CreateMenuIndent;
@@ -1686,6 +1688,8 @@ BEGIN
ELSE
IF keyCode = -1 THEN
key := -1
ELSIF (keyCode = 15) & shift THEN (* Shift-Tab *)
T.Indent(text, FALSE)
ELSIF keyCode = 61 THEN (* F3 *)
key := -1;
IF search & (searchText # "") THEN
@@ -1755,7 +1759,7 @@ BEGIN
ELSE
SetFocus(ReplaceEdit, TRUE)
END
ELSIF keyCode = 28 THEN (* Enter *)
ELSIF keyCode = 28 THEN (* Enter *)
IF searchOpened & (searchText # "") THEN
notFound := ~T.findNext(text, BKW.value)
END
@@ -1774,7 +1778,7 @@ BEGIN
ELSE
SetFocus(GotoEdit, TRUE)
END
ELSIF keyCode = 28 THEN (* Enter *)
ELSIF keyCode = 28 THEN (* Enter *)
IF searchOpened & (searchText # "") THEN
notFound := ~T.findNext(text, BKW.value)
END
+1 -1
View File
@@ -23,7 +23,7 @@ IMPORT
Graph, File, SYSTEM, KOSAPI;
CONST
fileName = "/sys/Icons16.png";
fileName = "/sys/Icons18.png";
libName = "libimg.obj";
SIZE* = 18;
+5 -4
View File
@@ -24,7 +24,7 @@
; Ctrl+F - поиск (+Tab для OptionBox)
; Ctrl+G - переход на смещение (+Tab для OptionBox)
; Ctrl+B - выделить блок
; ESC - снять выделение
; ESC - снять выделение/выход
; Ctrl+C - копировать блок
; Ctrl+V - вставить в выделенную область
; Ctrl+X - вырезать выделенную область (в буфер)
@@ -2699,7 +2699,8 @@ Ctrl_END:
jmp red
;--------------------------------------------------------------------
ESC:
btr [flags],8
btr [flags], 8
jnc close_prog
jmp red
;--------------------------------------------------------------------
copy_to_buf:
@@ -3236,7 +3237,7 @@ if lang eq ru_RU
db 'Ctrl+F - поиск '
db 'Ctrl+G - переход на смещение '
db 'Ctrl+B - выделить блок '
db 'ESC - снять выделение '
db 'ESC - снять выделение/выход '
db 'Ctrl+C - копировать блок '
db 'Ctrl+V - вставить в выделенную область'
db 'Ctrl+X - вырезать в буфер '
@@ -3258,7 +3259,7 @@ else ; Default to en_US
db 'Ctrl+F - find '
db 'Ctrl+G - go to offset '
db 'Ctrl+B - select area '
db 'ESC - deselect area '
db 'ESC - deselect area/exit '
db 'Ctrl+C - copy area '
db 'Ctrl+V - past into area from buf '
db 'Ctrl+X - cut area into buffer '
@@ -32,6 +32,7 @@ DLLAPI char* strrchr(const char* s, int c);
DLLAPI size_t strspn(const char* s1, const char* s2);
DLLAPI char* strstr(const char* s1, const char* s2);
DLLAPI char* strtok(char* s1, const char* s2);
DLLAPI char* strtok_r(char* s1, const char* s2, char** saveptr);
DLLAPI char* strerror(int errnum);
DLLAPI size_t strlen(const char* s);
DLLAPI char* strrev(char* str);
@@ -203,6 +203,7 @@ ksys_dll_t EXPORTS[] = {
{ "strspn", &strspn },
{ "strstr", &strstr },
{ "strtok", &strtok },
{ "strtok_r", &strtok_r },
{ "strxfrm", &strxfrm },
{ "strpbrk", &strpbrk },
{ "__errno", &__errno },
@@ -1,14 +1,12 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <string.h>
char* strtok(char* s, const char* delim)
char* strtok_r(char* s, const char* delim, char** last)
{
const char* spanp;
char *spanp, *tok;
int c, sc;
char* tok;
static char* last;
if (s == NULL && (s = last) == NULL)
if (s == NULL && (s = *last) == NULL)
return (NULL);
/*
@@ -16,13 +14,13 @@ char* strtok(char* s, const char* delim)
*/
cont:
c = *s++;
for (spanp = delim; (sc = *spanp++) != 0;) {
for (spanp = (char*)delim; (sc = *spanp++) != 0;) {
if (c == sc)
goto cont;
}
if (c == 0) { /* no non-delimiter characters */
last = NULL;
*last = NULL;
return (NULL);
}
tok = s - 1;
@@ -33,17 +31,24 @@ cont:
*/
for (;;) {
c = *s++;
spanp = delim;
spanp = (char*)delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = 0;
last = s;
s[-1] = '\0';
*last = s;
return (tok);
}
} while (sc != 0);
}
/* NOTREACHED */
}
char *strtok(char *s, const char *delim)
{
static char *last;
return (strtok_r(s, delim, &last));
}
@@ -1,19 +0,0 @@
Copyright (c) 2017 rxi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,99 +0,0 @@
# microtar
A lightweight tar library written in ANSI C
## Basic Usage
The library consists of `microtar.c` and `microtar.h`. These two files can be
dropped into an existing project and compiled along with it.
#### Reading
```c
mtar_t tar;
mtar_header_t h;
char *p;
/* Open archive for reading */
mtar_open(&tar, "test.tar", "r");
/* Print all file names and sizes */
while ( (mtar_read_header(&tar, &h)) != MTAR_ENULLRECORD ) {
printf("%s (%d bytes)\n", h.name, h.size);
mtar_next(&tar);
}
/* Load and print contents of file "test.txt" */
mtar_find(&tar, "test.txt", &h);
p = calloc(1, h.size + 1);
mtar_read_data(&tar, p, h.size);
printf("%s", p);
free(p);
/* Close archive */
mtar_close(&tar);
```
#### Writing
```c
mtar_t tar;
const char *str1 = "Hello world";
const char *str2 = "Goodbye world";
/* Open archive for writing */
mtar_open(&tar, "test.tar", "w");
/* Write strings to files `test1.txt` and `test2.txt` */
mtar_write_file_header(&tar, "test1.txt", strlen(str1));
mtar_write_data(&tar, str1, strlen(str1));
mtar_write_file_header(&tar, "test2.txt", strlen(str2));
mtar_write_data(&tar, str2, strlen(str2));
/* Finalize -- this needs to be the last thing done before closing */
mtar_finalize(&tar);
/* Close archive */
mtar_close(&tar);
```
## Error handling
All functions which return an `int` will return `MTAR_ESUCCESS` if the operation
is successful. If an error occurs an error value less-than-zero will be
returned; this value can be passed to the function `mtar_strerror()` to get its
corresponding error string.
## Wrapping a stream
If you want to read or write from something other than a file, the `mtar_t`
struct can be manually initialized with your own callback functions and a
`stream` pointer.
All callback functions are passed a pointer to the `mtar_t` struct as their
first argument. They should return `MTAR_ESUCCESS` if the operation succeeds
without an error, or an integer below zero if an error occurs.
After the `stream` field has been set, all required callbacks have been set and
all unused fields have been zeroset the `mtar_t` struct can be safely used with
the microtar functions. `mtar_open` *should not* be called if the `mtar_t`
struct was initialized manually.
#### Reading
The following callbacks should be set for reading an archive from a stream:
Name | Arguments | Description
--------|------------------------------------------|---------------------------
`read` | `mtar_t *tar, void *data, unsigned size` | Read data from the stream
`seek` | `mtar_t *tar, unsigned pos` | Set the position indicator
`close` | `mtar_t *tar` | Close the stream
#### Writing
The following callbacks should be set for writing an archive to a stream:
Name | Arguments | Description
--------|------------------------------------------------|---------------------
`write` | `mtar_t *tar, const void *data, unsigned size` | Write data to the stream
## License
This library is free software; you can redistribute it and/or modify it under
the terms of the MIT license. See [LICENSE](LICENSE) for details.
@@ -1,8 +0,0 @@
if tup.getconfig("NO_GCC") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../" or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_gcc.lua")
CFLAGS = " -c -w -nostdinc -DGNUC -DMTAR_OBJ -Os -fno-common -fno-builtin -fno-leading-underscore -fno-pie"
INCLUDES = " -I../include -I../../ktcc/trunk/libc.obj/include"
tup.rule("microtar.c", "kos32-gcc" .. CFLAGS .. INCLUDES .. " -o %o %f " .. tup.getconfig("KPACK_CMD"), "mtar.obj")
@@ -1,78 +0,0 @@
format binary as "kex"
use32
org 0x0
db 'MENUET01'
dd 0x01
dd START
dd IM_END
dd MEM
dd MEM
dd 0
dd 0
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../KOSfuncs.inc'
include '../../../../dll.inc'
include '../mtar.inc'
;include '../../../../debug-fdo.inc'
;__DEBUG__ = 1
;__DEBUG_LEVEL__ = 2
START:
stdcall dll.Load, @IMPORT ; Имортироуем функции из mtar.obj
test eax, eax
jnz exit
ccall [mtar_init] ; Инициализируем библиотеку (на самом деле подгружается libc.obj
ccall [mtar_open], tar, tar_fname, tar_fmode ; Открываем для чтения файл 'test.tar'
; DEBUGF 2, "%d", eax
print_next:
ccall [mtar_read_header], tar, header ; Читаем заголовок
cmp eax, MTAR_ENULLRECORD ; Если заголовок не был прочитан (return -7) выходим из цикла
je exit
ccall [printf], format_str, header+mtar_header_t.name, dword[header+mtar_header_t.size] ; Выводим в консоль имя файла и размер в байтах
ccall [mtar_next], tar ; Переходим к следующему заголовку
jmp print_next ; прыгаем в начало цикла
exit:
ccall [mtar_close], tar ; Закрываем 'test.tar'
mcall SF_TERMINATE_PROCESS ; Выходим из программы
; data
tar_fname db 'test.tar', 0
tar_fmode db 'r', 0
tar rb sizeof.mtar_t
header rb sizeof.mtar_header_t
format_str db '%-10s (%-4d bytes)', 0x0A,0
align 4
@IMPORT:
library mtar, 'mtar.obj', libc , 'libc.obj'
import mtar, \
mtar_init, 'mtar_init', \
mtar_open, 'mtar_open', \
mtar_next, 'mtar_next', \
mtar_strerror, 'mtar_strerror', \
mtar_read_header, 'mtar_read_header', \
mtar_write_data, 'mtar_write_data', \
mtar_finalize, 'mtar_finalize', \
mtar_close, 'mtar_close'
import libc, \
printf, 'printf'
IM_END:
align 4
rb 4096 ; stack
MEM:
@@ -1,70 +0,0 @@
format binary as "kex"
use32
org 0x0
db 'MENUET01'
dd 0x01
dd START
dd IM_END
dd MEM
dd MEM
dd 0
dd 0
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../KOSfuncs.inc'
include '../../../../dll.inc'
include '../mtar.inc'
;include '../../../../debug-fdo.inc'
;__DEBUG__ = 1
;__DEBUG_LEVEL__ = 2
START:
stdcall dll.Load, @IMPORT ; Имортироуем функции из mtar.obj
test eax, eax
jnz exit
ccall [mtar_init] ; Инициализируем библиотеку (на самом деле подгружается libc.obj
ccall [mtar_open], tar, tar_fname, tar_fmode ; Создаём новый файл 'test.tar'
ccall [mtar_write_file_header], tar, test1_txt , str1_len ; Создаём внутри 'test.tar' пустрой файл 'test1.txt'
ccall [mtar_write_data], tar, str1, str1_len ; Записываем данныев в этот файл
ccall [mtar_finalize], tar ; Указываем что больше с tar работать не будем
ccall [mtar_close], tar ; Закрываем 'test.tar'
exit:
mcall SF_TERMINATE_PROCESS ; Выходим из программы
; data
str1 db 'Hello world!', 0
str1_len = $ - str1
str2 db 'Goodbye world!', 0
tar_fname db 'test.tar', 0
tar_fmode db 'w', 0
test1_txt db 'test1.txt', 0
tar rb 32
align 4
@IMPORT:
library mtar, 'mtar.obj'
import mtar, \
mtar_init, 'mtar_init', \
mtar_open, 'mtar_open', \
mtar_write_file_header, 'mtar_write_file_header', \
mtar_write_data, 'mtar_write_data', \
mtar_finalize, 'mtar_finalize', \
mtar_close, 'mtar_close'
IM_END:
align 4
rb 4096 ; stack
MEM:
@@ -1,450 +0,0 @@
/*
* Copyright (c) 2017 rxi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <sys/ksys.h>
#include "microtar.h"
typedef struct {
char name[100];
char mode[8];
char owner[8];
char group[8];
char size[12];
char mtime[12];
char checksum[8];
char type;
char linkname[100];
char _padding[255];
} mtar_raw_header_t;
static void * mtar_memset( void * s, int c, size_t n ){
unsigned char * p = ( unsigned char * ) s;
while ( n-- ){
*p++ = ( unsigned char ) c;
}
return s;
}
#ifdef MTAR_OBJ
// All pointers was changed for compatible to latest version tcc and the libc.obj headers
size_t (*_fread)(void *restrict, size_t size, size_t count, FILE *restrict)=NULL;
size_t (*_fwrite)(const void *restrict, size_t size, size_t count, FILE *restrict)=NULL;
int (*_fclose)(FILE *)=NULL;
FILE* (*_fopen)(const char *restrict, const char *restrict)=NULL;
int (*_fseek)(FILE *, long, int)=NULL;
long (*_ftell)(FILE *)=NULL;
int (*_sprintf)(char* buffer, const char* format, ...)=NULL;
int (*_sscanf)(const char*, const char *restrict, ...)=NULL;
int (*_strcmp)(const char * s1, const char* s2)=NULL;
char* (*_strchr)(const char* s, int c)=NULL;
char* (*_strcpy)(char* s1, const char* s2)=NULL;
#endif
static unsigned round_up(unsigned n, unsigned incr) {
return n + (incr - n % incr) % incr;
}
static unsigned checksum(const mtar_raw_header_t* rh) {
unsigned i;
unsigned char *p = (unsigned char*) rh;
unsigned res = 256;
for (i = 0; i < offsetof(mtar_raw_header_t, checksum); i++) {
res += p[i];
}
for (i = offsetof(mtar_raw_header_t, type); i < sizeof(*rh); i++) {
res += p[i];
}
return res;
}
static int tread(mtar_t *tar, void *data, unsigned size) {
int err = tar->read(tar, data, size);
tar->pos += size;
return err;
}
static int twrite(mtar_t *tar, const void *data, unsigned size) {
int err = tar->write(tar, data, size);
tar->pos += size;
return err;
}
static int write_null_bytes(mtar_t *tar, int n) {
int i, err;
char nul = '\0';
for (i = 0; i < n; i++) {
err = twrite(tar, &nul, 1);
if (err) {
return err;
}
}
return MTAR_ESUCCESS;
}
static int raw_to_header(mtar_header_t *h, const mtar_raw_header_t *rh) {
unsigned chksum1, chksum2;
/* If the checksum starts with a null byte we assume the record is NULL */
if (*rh->checksum == '\0') {
return MTAR_ENULLRECORD;
}
/* Build and compare checksum */
chksum1 = checksum(rh);
_sscanf(rh->checksum, "%o", &chksum2);
if (chksum1 != chksum2) {
return MTAR_EBADCHKSUM;
}
/* Load raw header into header */
_sscanf(rh->mode, "%o", &h->mode);
_sscanf(rh->owner, "%o", &h->owner);
_sscanf(rh->size, "%o", &h->size);
_sscanf(rh->mtime, "%o", &h->mtime);
h->type = rh->type;
_strcpy(h->name, rh->name);
_strcpy(h->linkname, rh->linkname);
return MTAR_ESUCCESS;
}
static int header_to_raw(mtar_raw_header_t *rh, const mtar_header_t *h) {
unsigned chksum;
/* Load header into raw header */
mtar_memset(rh, 0, sizeof(*rh));
_sprintf(rh->mode, "%o", h->mode);
_sprintf(rh->owner, "%o", h->owner);
_sprintf(rh->size, "%o", h->size);
_sprintf(rh->mtime, "%o", h->mtime);
rh->type = h->type ? h->type : MTAR_TREG;
_strcpy(rh->name, h->name);
_strcpy(rh->linkname, h->linkname);
/* Calculate and write checksum */
chksum = checksum(rh);
_sprintf(rh->checksum, "%06o", chksum);
rh->checksum[7] = ' ';
return MTAR_ESUCCESS;
}
const char* mtar_strerror(int err) {
switch (err) {
case MTAR_ESUCCESS : return "success";
case MTAR_EFAILURE : return "failure";
case MTAR_EOPENFAIL : return "could not open";
case MTAR_EREADFAIL : return "could not read";
case MTAR_EWRITEFAIL : return "could not write";
case MTAR_ESEEKFAIL : return "could not seek";
case MTAR_EBADCHKSUM : return "bad checksum";
case MTAR_ENULLRECORD : return "null record";
case MTAR_ENOTFOUND : return "file not found";
}
return "unknown error";
}
static int file_write(mtar_t *tar, const void *data, unsigned size) {
unsigned res = _fwrite(data, 1, size, tar->stream);
return (res == size) ? MTAR_ESUCCESS : MTAR_EWRITEFAIL;
}
static int file_read(mtar_t *tar, void *data, unsigned size) {
unsigned res = _fread(data, 1, size, tar->stream);
return (res == size) ? MTAR_ESUCCESS : MTAR_EREADFAIL;
}
static int file_seek(mtar_t *tar, unsigned offset) {
int res = _fseek(tar->stream, offset, SEEK_SET);
return (res == 0) ? MTAR_ESUCCESS : MTAR_ESEEKFAIL;
}
static int file_close(mtar_t *tar) {
_fclose(tar->stream);
return MTAR_ESUCCESS;
}
int mtar_open(mtar_t *tar, const char *filename, const char *mode) {
int err;
mtar_header_t h;
/* Init tar struct and functions */
mtar_memset(tar, 0, sizeof(*tar));
tar->write = file_write;
tar->read = file_read;
tar->seek = file_seek;
tar->close = file_close;
/* Assure mode is always binary */
if ( _strchr(mode, 'r') ) mode = "rb";
if ( _strchr(mode, 'w') ) mode = "wb";
if ( _strchr(mode, 'a') ) mode = "ab";
/* Open file */
tar->stream = _fopen(filename, mode);
if (!tar->stream) {
return MTAR_EOPENFAIL;
}
/* Read first header to check it is valid if mode is `r` */
if (*mode == 'r') {
err = mtar_read_header(tar, &h);
if (err != MTAR_ESUCCESS) {
mtar_close(tar);
return err;
}
}
/* Return ok */
return MTAR_ESUCCESS;
}
int mtar_close(mtar_t *tar) {
return tar->close(tar);
}
int mtar_seek(mtar_t *tar, unsigned pos) {
int err = tar->seek(tar, pos);
tar->pos = pos;
return err;
}
int mtar_rewind(mtar_t *tar) {
tar->remaining_data = 0;
tar->last_header = 0;
return mtar_seek(tar, 0);
}
int mtar_next(mtar_t *tar) {
int err, n;
mtar_header_t h;
/* Load header */
err = mtar_read_header(tar, &h);
if (err) {
return err;
}
/* Seek to next record */
n = round_up(h.size, 512) + sizeof(mtar_raw_header_t);
return mtar_seek(tar, tar->pos + n);
}
int mtar_find(mtar_t *tar, const char *name, mtar_header_t *h) {
int err;
mtar_header_t header;
/* Start at beginning */
err = mtar_rewind(tar);
if (err) {
return err;
}
/* Iterate all files until we hit an error or find the file */
while ( (err = mtar_read_header(tar, &header)) == MTAR_ESUCCESS ) {
if ( !_strcmp(header.name, name) ) {
if (h) {
*h = header;
}
return MTAR_ESUCCESS;
}
mtar_next(tar);
}
/* Return error */
if (err == MTAR_ENULLRECORD) {
err = MTAR_ENOTFOUND;
}
return err;
}
int mtar_read_header(mtar_t *tar, mtar_header_t *h) {
int err;
mtar_raw_header_t rh;
/* Save header position */
tar->last_header = tar->pos;
/* Read raw header */
err = tread(tar, &rh, sizeof(rh));
if (err) {
return err;
}
/* Seek back to start of header */
err = mtar_seek(tar, tar->last_header);
if (err) {
return err;
}
/* Load raw header into header struct and return */
return raw_to_header(h, &rh);
}
int mtar_read_data(mtar_t *tar, void *ptr, unsigned size) {
int err;
/* If we have no remaining data then this is the first read, we get the size,
* set the remaining data and seek to the beginning of the data */
if (tar->remaining_data == 0) {
mtar_header_t h;
/* Read header */
err = mtar_read_header(tar, &h);
if (err) {
return err;
}
/* Seek past header and init remaining data */
err = mtar_seek(tar, tar->pos + sizeof(mtar_raw_header_t));
if (err) {
return err;
}
tar->remaining_data = h.size;
}
/* Read data */
err = tread(tar, ptr, size);
if (err) {
return err;
}
tar->remaining_data -= size;
/* If there is no remaining data we've finished reading and seek back to the
* header */
if (tar->remaining_data == 0) {
return mtar_seek(tar, tar->last_header);
}
return MTAR_ESUCCESS;
}
int mtar_write_header(mtar_t *tar, const mtar_header_t *h) {
mtar_raw_header_t rh;
/* Build raw header and write */
header_to_raw(&rh, h);
tar->remaining_data = h->size;
return twrite(tar, &rh, sizeof(rh));
}
int mtar_write_file_header(mtar_t *tar, const char *name, unsigned size) {
mtar_header_t h;
/* Build header */
mtar_memset(&h, 0, sizeof(h));
_strcpy(h.name, name);
h.size = size;
h.type = MTAR_TREG;
h.mode = 0664;
/* Write header */
return mtar_write_header(tar, &h);
}
int mtar_write_dir_header(mtar_t *tar, const char *name) {
mtar_header_t h;
/* Build header */
mtar_memset(&h, 0, sizeof(h));
_strcpy(h.name, name);
h.type = MTAR_TDIR;
h.mode = 0775;
/* Write header */
return mtar_write_header(tar, &h);
}
int mtar_write_data(mtar_t *tar, const void *data, unsigned size) {
int err;
/* Write data */
err = twrite(tar, data, size);
if (err) {
return err;
}
tar->remaining_data -= size;
/* Write padding if we've written all the data for this file */
if (tar->remaining_data == 0) {
return write_null_bytes(tar, round_up(tar->pos, 512) - tar->pos);
}
return MTAR_ESUCCESS;
}
int mtar_finalize(mtar_t *tar) {
/* Write two NULL records */
return write_null_bytes(tar, sizeof(mtar_raw_header_t) * 2);
}
/* Load libc.obj */
#ifdef MTAR_OBJ
#include <sys/ksys.h>
int mtar_init(){
ksys_dll_t *libc = _ksys_dlopen("/sys/lib/libc.obj");
if(!libc){
_ksys_debug_puts("mtar.obj: libc.obj not loaded!");
return 1;
}
_fread = _ksys_dlsym(libc, "fread");
_fwrite = _ksys_dlsym(libc, "fwrite");
_fclose = _ksys_dlsym(libc, "fclose");
_fopen = _ksys_dlsym(libc, "fopen");
_fseek = _ksys_dlsym(libc, "fseek");
_ftell = _ksys_dlsym(libc, "ftell");
_sprintf= _ksys_dlsym(libc, "sprintf");
_sscanf = _ksys_dlsym(libc, "sscanf");
_strcmp = _ksys_dlsym(libc, "strcmp");
_strchr = _ksys_dlsym(libc, "strchr");
_strcpy = _ksys_dlsym(libc, "strcpy");
return 0;
}
ksys_dll_t EXPORTS[] = {
{"mtar_init", mtar_init},
{"mtar_open", mtar_open},
{"mtar_close", mtar_close},
{"mtar_seek", mtar_seek},
{"mtar_rewind", mtar_rewind},
{"mtar_next", mtar_next},
{"mtar_find", mtar_find},
{"mtar_read_header", mtar_read_header},
{"mtar_read_data", mtar_read_data},
{"mtar_write_header", mtar_write_header},
{"mtar_write_file_header", mtar_write_file_header},
{"mtar_write_dir_header", mtar_write_dir_header},
{"mtar_write_data",mtar_write_data},
{"mtar_finalize", mtar_finalize},
{"mtar_strerror", mtar_strerror},
NULL
};
#endif
@@ -1,91 +0,0 @@
/**
* Copyright (c) 2017 rxi
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MIT license. See `microtar.c` for details.
*/
#ifndef MICROTAR_H
#define MICROTAR_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#define MTAR_VERSION "0.1.0"
enum {
MTAR_ESUCCESS = 0,
MTAR_EFAILURE = -1,
MTAR_EOPENFAIL = -2,
MTAR_EREADFAIL = -3,
MTAR_EWRITEFAIL = -4,
MTAR_ESEEKFAIL = -5,
MTAR_EBADCHKSUM = -6,
MTAR_ENULLRECORD = -7,
MTAR_ENOTFOUND = -8
};
enum {
MTAR_TREG = '0',
MTAR_TLNK = '1',
MTAR_TSYM = '2',
MTAR_TCHR = '3',
MTAR_TBLK = '4',
MTAR_TDIR = '5',
MTAR_TFIFO = '6'
};
typedef struct {
unsigned mode;
unsigned owner;
unsigned size;
unsigned mtime;
unsigned type;
char name[100];
char linkname[100];
} mtar_header_t;
typedef struct mtar_t mtar_t;
#pragma pack(push,1)
struct mtar_t {
int (*read)(mtar_t *tar, void *data, unsigned size);
int (*write)(mtar_t *tar, const void *data, unsigned size);
int (*seek)(mtar_t *tar, unsigned pos);
int (*close)(mtar_t *tar);
void *stream;
unsigned pos;
unsigned remaining_data;
unsigned last_header;
};
#pragma pack(pop)
const char* mtar_strerror(int err);
int mtar_open(mtar_t *tar, const char *filename, const char *mode);
int mtar_close(mtar_t *tar);
int mtar_seek(mtar_t *tar, unsigned pos);
int mtar_rewind(mtar_t *tar);
int mtar_next(mtar_t *tar);
int mtar_find(mtar_t *tar, const char *name, mtar_header_t *h);
int mtar_read_header(mtar_t *tar, mtar_header_t *h);
int mtar_read_data(mtar_t *tar, void *ptr, unsigned size);
int mtar_write_header(mtar_t *tar, const mtar_header_t *h);
int mtar_write_file_header(mtar_t *tar, const char *name, unsigned size);
int mtar_write_dir_header(mtar_t *tar, const char *name);
int mtar_write_data(mtar_t *tar, const void *data, unsigned size);
int mtar_finalize(mtar_t *tar);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,38 +0,0 @@
MTAR_ESUCCESS = 0
MTAR_EFAILURE = -1
MTAR_EOPENFAIL = -2
MTAR_EREADFAIL = -3
MTAR_EWRITEFAIL = -4
MTAR_ESEEKFAIL = -5
MTAR_EBADCHKSUM = -6
MTAR_ENULLRECORD = -7
MTAR_ENOTFOUND = -8
MTAR_TREG = '0'
MTAR_TLNK = '1'
MTAR_TSYM = '2'
MTAR_TCHR = '3'
MTAR_TBLK = '4'
MTAR_TDIR = '5'
MTAR_TFIFO = '6'
struct mtar_header_t
mode dd ?
owner dd ?
size dd ?
mtime dd ?
type dd ?
name rb 100
linkname rb 100
ends
struct mtar_t
read_func dd ?
write_func dd ?
seek_func dd ?
close_func dd ?
stream dd ?
pos dd ?
remaining_data dd ?
last_header dd ?
ends
+2 -2
View File
@@ -1971,7 +1971,7 @@ calc_ini:
add edi,[img_size]
dec edi
mov esi,eax
add esi,9 ; after [icons16]
add esi,9 ; after [icons18]
cld
@@:
lodsb
@@ -2871,7 +2871,7 @@ root_pach:
db '/',0
icons_file_name_2 db 'buttons/'
icons_path db '/sys/icons16.png',0
icons_path db '/sys/icons18.png',0
ini_file_name db '/sys/File managers/icons.ini',0
;---------------------------------------------------------------------
+3
View File
@@ -0,0 +1,3 @@
if tup.getconfig("NO_FASM") ~= "" then return end
tup.include("../../use_fasm.lua")
tup.rule("wrap_open.asm", FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "wrap_open")
+63
View File
@@ -0,0 +1,63 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2013-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License. ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; wraps command line arguments in quotes and launches a target.
include 'KOSfuncs.inc'
include 'macros.inc'
org 0x0
use32
db 'MENUET01'
dd 1
dd start
dd i_end
dd m_end
dd m_end
dd path
dd target_path
start:
mov edi, target_path
or ecx, -1
xor al, al
repne scasb
sub edi, 6
mov byte [edi], 0
cmp byte [path], 0
je .launch
mov byte [q_path], '"'
mov edi, path
or ecx, -1
xor al, al
repne scasb
mov word [edi-1], '"'
mov dword [fi + 8], q_path
.launch:
mcall SF_FILE, fi
mcall SF_TERMINATE_PROCESS
fi:
dd SSF_START_APP, 0, 0, 0, 0
db 0
dd target_path
i_end:
q_path rb 1
path rb 255
target_path rb 1024
m_end:
-16
View File
@@ -1,16 +0,0 @@
KTCC_DIR=../../develop/ktcc/trunk
NAME=gamehack
KTCC=$(KTCC_DIR)/bin/kos32-tcc
KPACK=kpack
SRC=gh_shell.c
CFLAGS=-I $(KTCC_DIR)/libc/include
LIBS = -lck
all:
$(KTCC) $(CFLAGS) $(SRC) $(LIBS) -o $(NAME)
$(KPACK) $(NAME)
clean:
rm $(NAME)
-72
View File
@@ -1,72 +0,0 @@
int PID=-1;
int kdebugger_write(unsigned ID, unsigned n, unsigned addr, unsigned* buff)
{
int num;
__asm__ __volatile__(
"int $0x40"
:"=a"(num)
:"a"(69), "b"(7), "c"(ID), "d"(n),"S"(addr),"D"(buff)
);
return num;
}
int kdebugger_read(unsigned ID, unsigned n, unsigned addr, unsigned* buff)
{
int num;
__asm__ __volatile__(
"int $0x40"
:"=a"(num)
:"a"(69), "b"(6), "c"(ID), "d"(n),"S"(addr),"D"(buff)
);
return num;
}
void kdebugger_pause(unsigned ID)
{
__asm__ __volatile__(
"int $0x40"
::"a"(69), "b"(4), "c"(ID)
);
}
void kdebugger_play(unsigned ID)
{
__asm__ __volatile__(
"int $0x40"
::"a"(69), "b"(5), "c"(ID)
);
}
void kdebugger_disconnect(unsigned ID)
{
__asm__ __volatile__(
"int $0x40"
::"a"(69), "b"(3), "c"(ID)
);
}
int load_game(char *app_name, char *args)
{
#pragma pack(push, 1)
struct file_op_t
{
unsigned fn;
unsigned flags;
char* args;
unsigned res1, res2;
char zero;
char* app_name __attribute__((packed));
} file_op;
#pragma pack(pop)
memset(&file_op, 0, sizeof(file_op));
file_op.fn = 7;
file_op.flags = 1;
file_op.args = args;
file_op.app_name = app_name;
register int val;
asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op));
return val;
}
-96
View File
@@ -1,96 +0,0 @@
#include <conio.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <kos32sys1.h>
#include "gh_core.c"
#define CMD_LEN 255
#define TITLE "GameHack 1.0 ALPHA "
char cmd_line[CMD_LEN];
char cmd_line_tmp[CMD_LEN];
void notify_show(char *text)
{
start_app("/sys/@notify", text);
}
void cmd_processing()
{
strcpy(cmd_line_tmp, cmd_line);
char *cmd = strtok(cmd_line_tmp, " \n");
if(!strcmp(cmd, "pause")){
kdebugger_pause(PID);
}
else if(!strcmp(cmd, "play")){
kdebugger_play(PID);
}
else if(!strcmp(cmd, "exit")){
exit(0);
}
else if(!strcmp(cmd, "write")){
unsigned addr=0;
int val =0;
if(sscanf(cmd_line, "%s %x %d %d",cmd_line, &addr, &val, &val)==3){
if(kdebugger_write(PID, sizeof(int), addr, &val)==-1){
puts("Memory write error!");
}
}else{
puts("Invalid arguments!");
}
}
else if(!strcmp(cmd, "read")){
unsigned addr=0;
int val =0;
if(sscanf(cmd_line, "%s %x %x",cmd_line, &addr, &addr)==2){
if(kdebugger_read(PID, sizeof(int), addr, &val)==-1){
puts("Memory read error!");
}
printf("0x%.8X: %d\n", addr, val);
}else{
puts("Invalid arguments!");
}
}
else if(!strcmp(cmd, "help"))
{
puts("Commands:");
puts(" write [addres] [value] - Write DWORD value by address.");
puts(" read [addres] [value] - Read DWORD value by address.");
puts(" pause - Suspend the game (process)." );
puts(" play - Resume running the game(process).");
puts(" find [value] - Search for DWORD value in memory(VIP).");
}
else if(!strcmp(cmd, "find"))
{
puts("Not yet implemented ...");
}
else if(cmd != NULL){
puts("Unknown command!");
}
}
int main(int argc, char* argv[])
{
if (argc!=2 ){
notify_show("'No game selected!' -E");
exit(0);
}
con_init_console_dll();
con_set_title(TITLE);
PID = load_game(argv[1], NULL);
PID = 2;
if(PID<0){
notify_show("'Game not loaded!' -E");
exit(0);
}
kdebugger_play(PID);
while (1){
printf("GameHack> ");
con_gets(cmd_line, CMD_LEN);
cmd_processing();
memset(cmd_line, '\n', CMD_LEN);
}
}
-18
View File
@@ -1,18 +0,0 @@
KTCC_DIR=../../develop/ktcc/trunk
NAME=teatool
KTCC=$(KTCC_DIR)/bin/kos32-tcc
KPACK=kpack
SRC=teatool.c
CFLAGS=-nostdinc -I $(KTCC_DIR)/libc/include
LFLAGS=-nostdlib -L $(KTCC_DIR)/bin/lib $(KTCC_DIR)/bin/lib/start.o
LIBS = -lck
all:
$(KTCC) $(CFLAGS) $(LFLAGS) $(SRC) $(LIBS) -o $(NAME)
$(KPACK) $(NAME)
clean:
rm $(NAME)
-49
View File
@@ -1,49 +0,0 @@
#include <stdio.h>
#define INVALID_ARG "Invalid arguments! Use the help: -h!\n"
#define KEY_RECORD_IN_FILE "The key is recorded in file: %s\n"
#define INCORRECT_FILE "Error! Incorrect file:'%s'\n"
#define NO_KEY_OR_KEYFILE "No key or key file!\n"
#define INVALID_KEY_FORMAT "Invalid key format!\n"
#define FILE_NOT_FOUND "File '%s' not found!\n"
#define DATA_DECRYPT "Data from file: %s successfully DECRYPTED to file: %s\n"
#define DATA_ENCRYPT "Data from file: %s successfully ENCRYPTED to file: %s\n"
#define FILE_DECRYPTION "File decryption...\n"
#define FILE_ENCRYPTION "File encryption...\n"
#define RECORD_DECRYPT_DATA "Record decryped data...\n"
#define LOAD_IN_RAM "Loading a '%s' file in RAM...\n"
#define RECORD_ENCRYPT_DATA "Record encryped data...\n"
#define MEMORY_ERROR "To big file, not enough memory! Use normal mode."
void show_help()
{
puts("Usage: \nTEAtool [infile] [outfile] [arguments]\n");
puts("Arguments:");
puts("-e [mode] Encrypt file in 'speed' or 'normal' mode.");
puts("-d [mode] Decrypt file in 'speed' or 'normal' mode.");
puts(" In 'speed' mode, file is entirely loaded into RAM.");
puts(" In 'normal' mode, file is loaded with parts in RAM.");
puts("-k [key] 128bit-key in hex format.");
puts("-K [keyfile] Use key from file.");
puts("-r [key] [keyfile].key Key entry to key file.");
puts("-h This reference");
puts("-a About the program \n");
}
void show_about()
{
puts("\n");
puts("-----------TEAtool-ENG-----------\n");
printf(" ) ( Version: \n");
printf(" ( ) ) 1.8-stable \n");
printf(" ) ( ( \n");
printf(" _______)_ Author: \n");
printf(" .-'---------| turbocat2001 \n");
printf("( C|/////////| \n");
printf(" '-./////////| Tester: rgimad \n");
printf(" '_________' \n");
printf(" '-------'' License: GPLv3 \n\n");
printf(" Powered by: \n");
printf(" Tiny Encryption Algorithm. \n\n");
}
-9
View File
@@ -1,9 +0,0 @@
Encrypting the "in.file" file with the "FFAB1100C176001F1ADDB8E792001EA5" key in normal mode:
# teatool in.file out.file -k FFAB1100C176001F1ADDB8E792001EA5 -e normal
Encrypting the "in.file" file with the key-file "my.key" in speed mode:*
# teatool in.file out.file -K my.key -e speed
Writing the "FFAB1100C176001F1ADDB8E792001EA5" key to the key-file "my.key"*
# teatool -r FFAB1100C176001F1ADDB8E792001EA5 my
-62
View File
@@ -1,62 +0,0 @@
#include <stdint.h>
void TEA_encrypt (uint32_t block[2], uint32_t key[4])
{
/* set up */
uint32_t v0 = block[0];
uint32_t v1 = block[1];
uint32_t sum = 0;
uint32_t i;
/* a key schedule constant */
uint32_t delta = 0x9e3779b9;
/* cache key */
uint32_t k0 = key[0];
uint32_t k1 = key[1];
uint32_t k2 = key[2];
uint32_t k3 = key[3];
/* basic cycle start */
for (i = 0; i < 32; i++)
{
sum += delta;
v0 += ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
v1 += ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
}
/* end cycle */
block[0] = v0;
block[1] = v1;
}
void TEA_decrypt (uint32_t* block, uint32_t* key)
{
/* set up */
uint32_t v0 = block[0];
uint32_t v1 = block[1];
uint32_t sum = 0xC6EF3720;
uint32_t i;
/* a key schedule constant */
uint32_t delta = 0x9e3779b9;
/* cache key */
uint32_t k0 = key[0];
uint32_t k1 = key[1];
uint32_t k2 = key[2];
uint32_t k3 = key[3];
/* basic cycle start */
for (i = 0; i < 32; i++)
{
v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
sum -= delta;
}
/* end cycle */
block[0] = v0;
block[1] = v1;
}
-303
View File
@@ -1,303 +0,0 @@
/* Copyright (C) 2019-2021 Logaev Maxim (turbocat2001), GPLv2 */
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <conio.h>
#include "lang_en.c"
#include "tea.c"
#define ENCRYPT 1
#define DECRYPT 2
typedef unsigned char flag;
uint32_t key[4];
long size_orig_file(FILE* file)
{
fseek(file, 0, SEEK_END);
long size = ftell(file);
fseek(file, 0, SEEK_SET);
return size;
}
long size_xcrypt_file(FILE* file)
{
fseek(file, 0, SEEK_END);
long size = ftell(file);
fseek(file, 0, SEEK_SET);
if(size%8==0) {
return size;
}else{
return (size/8+1)*8;
}
}
void xcrypt_file_speed(char *in_file, char* out_file, char arg)
{
FILE *input, *output;
if((input = fopen(in_file,"rb"))==NULL){
printf(FILE_NOT_FOUND, in_file);
exit(1);
}
output = fopen(out_file,"wb");
long size_f=size_xcrypt_file(input);
uint8_t size_diff;
size_diff=(uint8_t)(size_f-size_orig_file(input));
uint32_t *buff;
buff=malloc(size_f);
if(!buff) {
puts(MEMORY_ERROR);
exit(-1);
}
if(arg==ENCRYPT){
printf(LOAD_IN_RAM,in_file);
fread(buff, 1,size_f, input);
printf(FILE_ENCRYPTION);
for(long i=0; i<(size_f/4); i=i+2)
{
TEA_encrypt(buff+i,key);
}
printf(RECORD_ENCRYPT_DATA);
fwrite(&size_diff,1, 1, output);
fwrite(buff,1,size_f, output);
fclose(input);
fclose(output);
printf(DATA_ENCRYPT,in_file,out_file);
exit(0);
}
else if(arg==DECRYPT){
long size_f=size_orig_file(input);
printf(LOAD_IN_RAM,in_file);
fread(&size_diff,1,1,input);
fread(buff,1,size_f-1, input);
printf(FILE_DECRYPTION);
for(long i=0; i<size_f/4; i=i+2)
{
TEA_decrypt(buff+i,key);
}
printf(RECORD_DECRYPT_DATA);
fwrite(buff,1,size_f-size_diff-1, output);
fclose(input);
fclose(output);
printf(DATA_DECRYPT,in_file,out_file);
exit(0);
}
}
void xcrypt_file(char *in_file, char* out_file, char arg)
{
uint32_t temp_block[2];
FILE *input, *output;
if((input = fopen(in_file,"rb"))==NULL){
printf(FILE_NOT_FOUND, in_file);
exit(1);
}
output = fopen(out_file,"wb");
register long size_f=size_xcrypt_file(input);
uint8_t size_diff=(uint8_t)(size_f-size_orig_file(input));
if(arg==ENCRYPT){
fwrite(&size_diff,1,1,output);
printf(FILE_ENCRYPTION);
while(!feof(input))
{
memset(temp_block, 0x00, 2);
fread(temp_block, sizeof(uint32_t), 2, input) ;
TEA_encrypt(temp_block,key);
fwrite(temp_block, sizeof(uint32_t),2, output);
}
fclose(input);
fclose(output);
printf(DATA_ENCRYPT,in_file,out_file);
exit(0);
}
else if(arg==DECRYPT){
size_f = size_orig_file(input);
fread(&size_diff,1,1,input);
size_f=size_f-size_diff-1;
printf(FILE_DECRYPTION);
while(!feof(input))
{
fread(temp_block, sizeof(uint32_t), 2, input);
TEA_decrypt(temp_block,key);
if(size_f>=8){
fwrite(temp_block,sizeof(uint32_t),2,output);
}else{
fwrite(temp_block,1,size_f,output);
}
size_f=size_f-8;
if(size_f<0){
size_f=0;
}
}
fclose(input);
fclose(output);
printf(DATA_DECRYPT,in_file,out_file);
exit(0);
}
}
void str_to_strkey(char *str, char str_key[4][9])
{
int count=0;
for(int i=0; i<4; i++)
{
int j=0;
while (j<8)
{
str_key[i][j]=str[count];
count++;
j++;
}
}
}
int valid_key(char *str)
{
int count=0;
char hex[]={"abcdefABCDEF0123456789"};
for(int i=0; i<32; i++)
{
if(strchr(hex,str[i])!=NULL){
count++;
}
}
if(count==32){return 1;}
else{ return 0;}
}
void key_con_read(char *str)
{
char str_key[4][9];
if(valid_key(str)&&(strlen(str)==32))
{
for(int i=0; i<4; i++){
str_to_strkey(str, str_key);
key[i]=(uint32_t)strtol(str_key[i],NULL,16);
}
}else{
printf(INVALID_KEY_FORMAT);
exit(-1);
}
}
void key_file_read(char *key_file)
{
FILE *keyfile;
if((keyfile = fopen(key_file,"rb"))==NULL){
printf(FILE_NOT_FOUND, key_file);
exit(-1);
}
if(size_orig_file(keyfile)==16) {
fread(key,sizeof(uint32_t),4, keyfile);
}else{
printf(INVALID_KEY_FORMAT);
exit(-1);
}
fclose(keyfile);
}
void findopt(int argc, char *argv[],char *in_file, char *out_file)
{
char found=0;
for(int j=3; j<argc; j++)
{
if(!strcmp(argv[j],"-k")){
found=1;
key_con_read(argv[j+1]);
break;
}
else if(!strcmp(argv[j],"-K")){
found=1;
key_file_read(argv[j+1]);
break;
}
}
if(!found){
printf(NO_KEY_OR_KEYFILE);
exit(-1);
}
for(int i=3;i<argc; i++){
if(!strcmp(argv[i],"-e"))
{
if(!strcmp(argv[i+1],"normal")){xcrypt_file(in_file, out_file, ENCRYPT);}
if(!strcmp(argv[i+1],"speed")){xcrypt_file_speed(in_file, out_file, ENCRYPT);}
}
if(!strcmp(argv[i],"-d"))
{
if(!strcmp(argv[i+1],"normal")){xcrypt_file(in_file, out_file, DECRYPT);}
if(!strcmp(argv[i+1],"speed")){xcrypt_file_speed(in_file, out_file, DECRYPT);}
}
}
printf(INVALID_ARG);
exit(0);
}
void key_write_in_file(char *keyfilename)
{
FILE *keyfile;
if((keyfile = fopen(strcat(keyfilename, ".key"), "wb"))==NULL){
printf(INCORRECT_FILE, keyfilename);
exit(-1);
}
fwrite(key,sizeof(uint8_t), 16, keyfile);
printf(KEY_RECORD_IN_FILE, keyfilename);
fclose(keyfile);
exit(0);
}
int main(int argc, char **argv)
{
con_init_console_dll();
con_set_title("TEAtool\0");
if(argc==7){
findopt(argc,argv, argv[1],argv[2]);
}
else if(argc==2 && !strcmp(argv[1],"-a")){
show_about();
exit(0);
}
else if(argc==2 && !strcmp(argv[1],"-h")){
show_help();
exit(0);
}
else if(argc==4 && !strcmp(argv[1],"-r")){
key_con_read(argv[2]);
key_write_in_file(argv[3]);
}
else{
printf(INVALID_ARG);
exit(0);
}
return 0;
}
+1 -1
View File
@@ -23,7 +23,7 @@ IMPORT
LibImg, K := SysUtils, Graph, File, KOSAPI, SYSTEM;
CONST
fileName = "/sys/Icons16.png";
fileName = "/sys/Icons18.png";
SIZE* = 18;
VAR
+5 -4
View File
@@ -27,13 +27,14 @@ start:
cmp eax, 0
jne ok
nok:
print 'LoadDrv: Error loading driver'
print 'Driver must be in /sys/drivers/ folder.'
print 'Its name must be w/o extension and it is case-sensitive'
print 'E: LoadDrv: Error loading driver'
print 'I: Usage: loaddrv <driver_name>'
print 'I: Driver must be stored as /sys/drivers/<driver_name>.sys'
print 'I: <driver_name> must be w/o extension and it is case-sensitive'
mov eax, -1
int 0x40
ok:
print 'LoadDrv: Driver loaded well'
print 'I: LoadDrv: Driver loaded well'
mov eax, -1
int 0x40
+4
View File
@@ -0,0 +1,4 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
tup.rule("reshare.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")
+72
View File
@@ -0,0 +1,72 @@
; SPDX-License-Identifier: GPL-2.0-only
;
; Reshare - Shared Resources Daemon
;
; Copyright (C) 2024-2026 KolibriOS Team
; Copyright (C) 2024-2026 KolibriOS-NG Team
; ====================================================================
CBOX_WIDTH = 13
CBOX_HEIGHT = 13
CBOX_PIXELS = CBOX_WIDTH * CBOX_HEIGHT
CBOX_IMG_SIZE = CBOX_PIXELS * 3 ; 24-bpp BGR, tight rows
; ====================================================================
; Palette entry: 4 bytes BGR0 (padded for dword-indexed lookup)
macro BGRA c
{
db (c) and 0xFF, (c shr 8) and 0xFF, (c shr 16) and 0xFF, 0
}
P00 = 0x04D4FC ; 0xRRGGBB
P01 = 0x04C8FC
P02 = 0x04DCFC
P03 = 0x04B4FC
P04 = 0x04BCFC
P05 = 0x04A9FC
P06 = 0x0498F9
P07 = 0xD2F2FC
P08 = 0x04A5FA
P09 = 0xFFFFFF
P10 = 0xF6FDFD
P11 = 0xAFF9FC
P12 = 0x95E0F7
P13 = 0x0464BC
P14 = 0x2CDCFC
P15 = 0x049FFA
cbox_palette:
BGRA P00
BGRA P01
BGRA P02
BGRA P03
BGRA P04
BGRA P05
BGRA P06
BGRA P07
BGRA P08
BGRA P09
BGRA P10
BGRA P11
BGRA P12
BGRA P13
BGRA P14
BGRA P15
; 4-bit palette indices, one byte per pixel (upper nibble unused — values 0..15)
cbox_indexed:
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ; row 1
db 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ; row 2
db 2, 1, 1, 1, 1, 4, 4, 4, 3, 5, 5, 3, 3 ; row 3
db 0, 1, 1, 1, 4, 4, 3, 3, 6, 7, 7, 8, 3 ; row 4
db 0, 3, 5, 5, 3, 3, 3, 6, 9,10,11, 6, 3 ; row 5
db 0, 5, 7, 7, 6, 3, 6, 9,10,12,13, 6, 5 ; row 6
db 0, 6,10, 9,14, 6, 9,10,12,13, 6,15, 5 ; row 7
db 0, 6,12,10, 9, 9,10,12,13, 6,15, 5, 5 ; row 8
db 0, 6,13,12,10,10,12,13, 6,15, 5, 5, 5 ; row 9
db 1, 8, 6,13,12,12,13, 6,15, 5, 5, 5,15 ; row 10
db 1, 5,15, 6,13,13, 6,15, 5, 5, 5,15,15 ; row 11
db 1, 5, 5,15, 6, 6,15, 5, 5, 5,15,15, 6 ; row 12
db 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 ; row 13
+699
View File
@@ -0,0 +1,699 @@
; SPDX-License-Identifier: GPL-2.0-only
;
; Reshare - Shared Resources Daemon
;
; Copyright (C) 2024-2026 KolibriOS Team
; Copyright (C) 2024-2026 KolibriOS-NG Team
; ====================================================================
use32
org 0
; ====================================================================
db "MENUET01"
dd 1
dd START
dd I_END
dd MEM
dd STACKTOP
dd 0
dd 0
; ====================================================================
include "../../macros.inc"
include "../../KOSfuncs.inc"
include "../../encoding.inc"
include "../../proc32.inc"
include "../../dll.inc"
include "../../debug-fdo.inc"
include "../../develop/libraries/libs-dev/libimg/libimg.inc"
include "checkbox.inc"
; ====================================================================
LIBS:
library img, "libimg.obj"
import img, img.destroy, "img_destroy", \
img.from_file, "img_from_file"
; ====================================================================
START:
mcall SF_SYS_MISC, SSF_HEAP_INIT
mcall SF_KEYBOARD, SSF_SET_INPUT_MODE, 1
; check if this is second instance of app. if so - run gui, else - run daemon
mcall SF_SYS_MISC, SSF_MEM_OPEN, meta_name, 0, SHM_READ
test eax, eax
jz MODE_DAEMON
mcall SF_SYS_MISC, SSF_MEM_CLOSE, meta_name
jmp MODE_GUI
.exit:
mcall SF_TERMINATE_PROCESS
; ====================================================================
MODE_GUI:
.event_loop:
mcall SF_WAIT_EVENT
cmp eax, EV_REDRAW
je .event_redraw
cmp eax, EV_KEY
je .event_key
cmp eax, EV_BUTTON
je .event_button
jmp .event_loop
.event_redraw:
mcall SF_REDRAW, SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
mcall , SSF_GET_SKIN_HEIGHT
add eax, WIN.H
mov esi, eax
mcall SF_GET_SCREEN_SIZE
movzx ecx, ax
shr eax, 16
sub eax, WIN.W
shr eax, 1
shl eax, 16
add eax, WIN.W
mov ebx, eax
sub ecx, esi
shr ecx, 1
shl ecx, 16
add ecx, esi
mov edx, [sc.work]
add edx, WIN_STYLE
mcall SF_CREATE_WINDOW, , , , , title
; visual dividers
mcall SF_DRAW_RECT, <PAD, GRID.W>, <BTN.Y + BTN.H + PAD, 1>, [sc.work_graph]
mcall , , <GRID.Y + GRID.H, 1>,
; info row
mov ecx, FONT_TYPE shl 24
add ecx, [sc.work_text]
mcall SF_DRAW_TEXT, <PAD, GRID.Y + GRID.H + PAD - 1>, , lb_info
; tabs labels
mov esi, tab_label_strs
xor edi, edi
.tab_label_loop:
mov ebx, edi
imul ebx, TAB_STEP
push ebx
add ebx, PAD * 2
shl ebx, 16
add ebx, BTN.Y
mov edx, [esi]
mcall SF_DRAW_TEXT
add ebx, 1 shl 16 ; bold: x+1, same string
mcall SF_DRAW_TEXT
pop ebx
add ebx, PAD * 11
shl ebx, 16
add ebx, BTN.Y
mov edx, [esi + 4]
mcall SF_DRAW_TEXT
add esi, 8
inc edi
cmp edi, TAB_COUNT
jb .tab_label_loop
; tabs buttons
mov ecx, BTN.Y shl 16 + BTN.H
mov esi, ACTIVE_ICONS32
xor edi, edi
.btn_loop:
mov ebx, edi
imul ebx, TAB_STEP
add ebx, PAD
shl ebx, 16
add ebx, BTN.W
lea edx, [esi + BTN_BASE + BTN_HIDE]
mcall SF_DEFINE_BUTTON
add esi, esi ; 1→2→4→8 (next ACTIVE bit)
inc edi
cmp edi, TAB_COUNT
jb .btn_loop
; tabs content
call draw_tabs
mcall SF_REDRAW, SSF_END_DRAW
jmp .event_loop
.event_key:
mcall SF_GET_KEY
cmp ah, KEY_TAB
jne .event_loop
shl [active_tab], 1 ; * 2
cmp [active_tab], ACTIVE_CHECKBOX
jbe .tab_draw
mov [active_tab], 1
.tab_draw:
call draw_tabs
jmp .event_loop
.event_button:
mcall SF_GET_BUTTON
cmp ah, 1
je .event_exit
movzx eax, ah
sub eax, BTN_BASE
mov [active_tab], eax
call draw_tabs
jmp .event_loop
.event_exit:
mcall SF_TERMINATE_PROCESS
; ====================================================================
draw_tabs:
; draw tab underlines; active tab gets highlight color
xor edi, edi
mov esi, 1 ; current tab bit (ACTIVE_ICONS32=1, then 2, 4, 8)
.loop:
mov edx, [sc.work_dark]
test [active_tab], esi
jz .color_ok
mov edx, [sc.work_button]
.color_ok:
mov eax, edi
imul eax, TAB_STEP
add eax, PAD
mpack ebx, eax, BTN.W
mpack ecx, PAD + BTN.H + 2, 2
mcall SF_DRAW_RECT, ebx, ecx, edx
inc edi
add esi, esi ; shift to next tab bit (1→2→4→8)
cmp edi, TAB_COUNT
jb .loop
; draw current tab content
mcall SF_DRAW_RECT, <GRID.X, GRID.W>, <GRID.Y, GRID.H>, [sc.work]
mov eax, [active_tab]
bsf eax, eax ; 0=i32, 1=i18, 2=i18w, 3=cbox
cmp eax, 3
je .cbox
lea esi, [tab_icon_args + eax * 8]
stdcall draw_tab_icons, [esi], [esi + 4]
ret
.cbox:
stdcall draw_tab_cbox
ret
proc draw_tab_icons stdcall, _shm_name, _meta_off
mcall SF_SYS_MISC, SSF_MEM_OPEN, meta_name, 0, SHM_READ
test eax, eax
jz .done
add eax, [_meta_off]
mov ecx, [eax] ; icon_c
mov edx, [eax + 4] ; icon_w (always next field: _meta_off + 4)
test ecx, ecx
jz .close_meta
test edx, edx
jz .close_meta
push ecx
push edx
mcall SF_SYS_MISC, SSF_MEM_OPEN, [_shm_name], 0, SHM_READ
pop edx
pop ecx
test eax, eax
jz .close_meta
stdcall draw_tab_icons_grid, eax, ecx, edx
mcall SF_SYS_MISC, SSF_MEM_CLOSE, [_shm_name]
.close_meta:
mcall SF_SYS_MISC, SSF_MEM_CLOSE, meta_name
.done:
ret
endp
proc draw_tab_icons_grid stdcall uses ebx esi edi, _icon_img, _icon_c, _icon_w
locals
x dd 0
x_off dd 0
y dd 0
icon_size dd 0
endl
; icon_bytes = icon_w * icon_w * 4
mov eax, [_icon_w]
imul eax, eax
shl eax, 2
mov [icon_size], eax
; x_off = (CELL.W - icon_w) / 2
mov eax, CELL.W
sub eax, [_icon_w]
shr eax, 1
mov [x_off], eax
; y_step = CELL.H
mov edi, CELL.H
xor ecx, ecx
.for_icons:
cmp ecx, [_icon_c]
jae .end_for_icons
push ecx
; SF_PUT_IMAGE_EXT _icon_img+icon_size*index, <_icon_w, _icon_w>, <x+x_off, y+GRID_Y>, 32, 0, 0
mov ebx, [icon_size]
imul ebx, ecx
add ebx, [_icon_img]
mov ecx, [_icon_w]
shl ecx, 16
add ecx, [_icon_w]
mov edx, [x]
add edx, [x_off]
shl edx, 16
add edx, [y]
add edx, GRID.Y
push edi
push ebp
mcall SF_PUT_IMAGE_EXT, , , , 32, 0, 0
pop ebp
pop edi
; draw number with no leading zeros, centered in CELL.W
mov edx, [x]
add edx, GAP
shl edx, 16
add edx, [y]
add edx, [_icon_w]
add edx, GRID.Y + 2
mov esi, DRAWNUM_NOZERO
add esi, [sc.work_graph]
pop ecx
mcall SF_DRAW_NUMBER, DRAWNUM_DEC3, , , ,
inc ecx
add [x], CELL.W
cmp [x], WIN.W - CELL.W
jle .for_icons
mov [x], 0
add [y], edi
jmp .for_icons
.end_for_icons:
ret
endp
proc draw_tab_cbox stdcall
mcall SF_SYS_MISC, SSF_MEM_OPEN, lb_tab_cbox, 0, SHM_READ
test eax, eax
jz .done
mov ebx, eax
mcall SF_PUT_IMAGE, , \
<CBOX_WIDTH, CBOX_HEIGHT>, \
<(WIN.W - CBOX_WIDTH)/2, (WIN.H - CBOX_HEIGHT)/2>
mcall SF_SYS_MISC, SSF_MEM_CLOSE, lb_tab_cbox
.done:
ret
endp
; ====================================================================
MODE_DAEMON:
stdcall dll.Load, LIBS
; load shared resources from files
DEBUGF DBG_INFO, "I: @reshare: loading resources...\n"
stdcall load_icons, icons32_path, icons32_image, size32
stdcall load_icons, icons18_path, icons18_image, size18
; publish meta
mcall SF_SYS_MISC, SSF_MEM_OPEN, meta_name, META_SIZE, SHM_CREATE + SHM_WRITE
test eax, eax
jz .meta_done
mov edi, eax
xor ebx, ebx
xor ecx, ecx
mov eax, [icons32_image]
test eax, eax
jz .i32_set
mov ebx, [eax + Image.Width]
mov eax, [eax + Image.Height]
test ebx, ebx
jz .i32_set
xor edx, edx
div ebx
mov ecx, eax
.i32_set:
mov [edi + META_I32_W], ebx
mov [edi + META_I32_C], ecx
xor ebx, ebx
xor ecx, ecx
mov eax, [icons18_image]
test eax, eax
jz .i18_set
mov ebx, [eax + Image.Width]
mov eax, [eax + Image.Height]
test ebx, ebx
jz .i18_set
xor edx, edx
div ebx
mov ecx, eax
.i18_set:
mov [edi + META_I18_W], ebx
mov [edi + META_I18_C], ecx
mov [edi + META_I18W_W], ebx
mov [edi + META_I18W_C], ecx
mov dword [edi + META_CBOX_W], CBOX_WIDTH
mov dword [edi + META_CBOX_H], CBOX_HEIGHT
mov dword [edi + META_CBOX_SIZE], CBOX_IMG_SIZE
.meta_done:
DEBUGF DBG_INFO, "I: @reshare: starting in daemon mode\n"
mcall SF_SYS_MISC, SSF_MEM_OPEN, lb_tab_cbox, CBOX_IMG_SIZE, SHM_CREATE + SHM_WRITE
test eax, eax
jz .skip_cbox
mov edi, eax
mov esi, cbox_indexed
mov ecx, CBOX_PIXELS
cld
.cbox_expand:
movzx ebx, byte [esi]
inc esi
mov eax, [cbox_palette + ebx * 4]
stosb ; B
shr eax, 8
stosb ; G
shr eax, 8
stosb ; R
dec ecx
jnz .cbox_expand
.skip_cbox:
cmp [icons32_image], 0
jz .skip_i32
stdcall copy_image_to_shm, lb_tab_i32, size32, icons32_image
test eax, eax
jz .skip_i32
invoke img.destroy, [icons32_image]
.skip_i32:
cmp [icons18_image], 0
jz .skip_i18
stdcall copy_image_to_shm, lb_tab_i18, size18, icons18_image
test eax, eax
jz .skip_i18
mov [shared_i18], eax
mcall SF_SYS_MISC, SSF_MEM_OPEN, lb_tab_i18w, [size18], SHM_CREATE + SHM_WRITE
test eax, eax
jz .skip_i18
mov [shared_i18w], eax
invoke img.destroy, [icons18_image]
mov dword [icons18_image], 0
.skip_i18:
mcall SF_SET_EVENTS_MASK, EVM_BACKGROUND
.event_loop:
push [sc.work]
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
pop eax
cmp eax, [sc.work]
je .wait_event
cmp [shared_i18], 0
jz .wait_event
cmp [shared_i18w], 0
jz .wait_event
mov esi, [shared_i18]
mov edi, [shared_i18w]
mov ecx, [size18]
shr ecx, 2 ; / 4 to get size in dwords
cld
rep movsd
stdcall replace_2cols, [shared_i18w], [size18], 0xFFFFFFFF, [sc.work], 0xFFCACBD6, [sc.work_dark]
.wait_event:
mcall SF_WAIT_EVENT
cmp eax, EV_BACKGROUND
je .event_loop
jmp .wait_event
proc load_icons stdcall uses ebx ecx, _path, _img_ptr, _size_ptr
invoke img.from_file, [_path]
test eax, eax
jz .fail
mov ebx, [_img_ptr]
mov [ebx], eax
mov ebx, [eax + Image.Width]
mov ecx, [eax + Image.Height]
imul ecx, ebx
shl ecx, 2
mov ebx, [_size_ptr]
mov [ebx], ecx
ret
.fail:
DEBUGF DBG_ERR, "E: @reshare: error loading icons from %s\n", [_path]
ret
endp
proc copy_image_to_shm stdcall uses ebx ecx edx esi edi, _shm_name, _size_ptr, _image_ptr
mov edx, [_size_ptr]
mov edx, [edx]
mcall SF_SYS_MISC, SSF_MEM_OPEN, [_shm_name], edx, SHM_CREATE + SHM_WRITE
test eax, eax
jz .done
mov ebx, [_image_ptr]
mov ebx, [ebx]
mov esi, [ebx + Image.Data]
mov edi, eax
mov ecx, [_size_ptr]
mov ecx, [ecx]
shr ecx, 2
cld
rep movsd
.done:
ret
endp
proc replace_2cols stdcall uses edi, _imgsrc, _imgsize, _col_old1, _col_new1, _col_old2, _col_new2
mov edx, [_imgsize]
add edx, [_imgsrc]
mov edi, [_imgsrc]
.loop:
cmp edi, edx
jae .done
mov eax, [edi]
cmp eax, [_col_old1]
jne .check2
mov eax, [_col_new1]
mov [edi], eax
jmp .next
.check2:
cmp eax, [_col_old2]
jne .next
mov eax, [_col_new2]
mov [edi], eax
.next:
add edi, 4
jmp .loop
.done:
ret
endp
; ====================================================================
BORD = 5
PAD = 8
GAP = 12
GRID_COLS = 16
GRID_ROWS = 9
GRID_Y = BTN.Y + BTN.H + PAD * 2 + 1
TAB_STEP = BTN.W + PAD * 2
WIN RECT 0, 0, GRID.W + PAD * 2 + BORD * 2, GRID.H + GRID_Y + 1 + PAD + 10 + GAP
BTN RECT 0, PAD + 4, CELL.W * 4 - PAD * 2 , 22
CELL RECT 0, 0, 32 + PAD * 2 , 32 + 4 + 10 + PAD
GRID RECT PAD, GRID_Y, CELL.W * GRID_COLS - PAD * 2, CELL.H * GRID_ROWS
FONT_TYPE = 0x90
WIN_STYLE = 0x34000000 ; skinned window, draws itself
BTN_HIDE = 0x60000000
BTN_BASE = 10 ; first user-defined button ID
DRAWNUM_DEC3 = 0x00030000 ; SF_DRAW_NUMBER: decimal, 3 digits
DRAWNUM_NOZERO = 0x10000000 ; SF_DRAW_NUMBER: no leading zeros
KEY_TAB = 15 ; Tab key scan code
; ====================================================================
if lang eq ru_RU
title cp866 "@RESHARE - Служба общих ресурсов", 0
lb_info cp866 "Имя каждой вкладки соответствует имени области памяти, доступной через сисфункцию 68.22.", 0
else if lang eq es_ES
title db "@RESHARE - Servicio de recursos compartidos", 0
lb_info db "Cada nombre de pestana corresponde al nombre de memoria accesible mediante sysfunc 68.22.", 0
else
title cp850 "@RESHARE - Shared resources service", 0
lb_info cp850 "Each tab name corresponds to shared memory page name that can be accessed via sysfunc 68.22.", 0
endf
lb_tab_i32 db "ICONS32", 0
lb_tab_i18 db "ICONS18", 0
lb_tab_i18w db "ICONS18W", 0
lb_tab_cbox db "CHECKBOX", 0
lb_tab_i32_res db "32x32x32bpp", 0
lb_tab_i18_res db "18x18x32bpp", 0
lb_tab_cbox_res db "13x13x24bpp", 0
; ====================================================================
DBG_ALL = 0 ; all messages
DBG_INFO = 1 ; info and errors
DBG_ERR = 2 ; only errors
__DEBUG__ = 1
__DEBUG_LEVEL__ = DBG_ERR
SHM_READ = 0x00
SHM_WRITE = 0x01
SHM_CREATE = 0x08
ACTIVE_ICONS32 = 1
ACTIVE_ICONS18 = 2
ACTIVE_ICONS18W = 4
ACTIVE_CHECKBOX = 8
TAB_COUNT = 4
META_I32_C = 0
META_I32_W = 4
META_I18_C = 8
META_I18_W = 12
META_I18W_C = 16
META_I18W_W = 20
META_CBOX_W = 24
META_CBOX_H = 28
META_CBOX_SIZE = 32
META_SIZE = 36
; ====================================================================
meta_name db "RESHARE_META", 0
icons32_path db "/SYS/ICONS32.PNG", 0
icons18_path db "/SYS/ICONS18.PNG", 0
; pointers to Image structures
icons32_image dd 0
icons18_image dd 0
; sizes of icons image data in bytes
size32 dd 0
size18 dd 0
; currenly selected i18w section
shared_i18 dd 0
shared_i18w dd 0
active_tab dd ACTIVE_ICONS32
tab_icon_args:
dd lb_tab_i32, META_I32_C ; META_I32_W = META_I32_C + 4
dd lb_tab_i18, META_I18_C ; META_I18_W = META_I18_C + 4
dd lb_tab_i18w, META_I18W_C ; META_I18W_W = META_I18W_C + 4
tab_label_strs:
dd lb_tab_i32, lb_tab_i32_res
dd lb_tab_i18, lb_tab_i18_res
dd lb_tab_i18w, lb_tab_i18_res
dd lb_tab_cbox, lb_tab_cbox_res
sc system_colors
include_debug_strings
; ====================================================================
I_END:
rb 4096
align 16
STACKTOP:
MEM: