From 9a784f35ed6bc7913f1f62f9dba4ddcf5e454ba9 Mon Sep 17 00:00:00 2001 From: Max Logaev Date: Sun, 23 Mar 2025 19:27:42 +0300 Subject: [PATCH] Added KolibriOS/Menuet32 magic for file utility Signed-off-by: Max Logaev --- .gitignore | 4 +++- tools/file/README.md | 9 +++++++++ tools/file/kolibrios | 31 +++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tools/file/README.md create mode 100644 tools/file/kolibrios diff --git a/.gitignore b/.gitignore index eab534a4e..c3b9aeab6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,6 @@ sdk # Downloaded KolibriOS artifacts kolibrios-img.7z -kolibri.img \ No newline at end of file +kolibri.img + +tools/file/kolibrios.mgc diff --git a/tools/file/README.md b/tools/file/README.md new file mode 100644 index 000000000..3b3795579 --- /dev/null +++ b/tools/file/README.md @@ -0,0 +1,9 @@ +# KolibriOS/Menuet32 magic + +Support for KolibriOS and Menuet32 executable files for the [file](https://www.darwinsys.com/file/) utility. + +## Build and install +```sh +file -C -m kolibrios +install -D kolibrios.mgc ~/.magic/magic.mgc +``` diff --git a/tools/file/kolibrios b/tools/file/kolibrios new file mode 100644 index 000000000..3455cb523 --- /dev/null +++ b/tools/file/kolibrios @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0 +# KolibriOS and Menuet32 executable formats +# Copyright (C) 2025 KolibriOS team + +0 string MENUET00 Old Menuet32 executable: MENUET00 +>0x8 ulelong x \b, Version: %u +>0xC ulelong x \b, Entry: 0x%x +>0x10 ulelong x \b, Image end: 0x%x +>0x14 ulelong x \b, Memory end: 0x%x +>0x18 ulelong x \b, Stack top: 0x%x +>0x1C ulelong x \b, Command line: 0x%x + +0 string MENUET01 KolibriOS/Menuet32 executable: MENUET01 +>0x8 ulelong x \b, Version: %u +>0xC ulelong x \b, Entry: 0x%x +>0x10 ulelong x \b, Image end: 0x%x +>0x14 ulelong x \b, Memory end: 0x%x +>0x18 ulelong x \b, Stack top: 0x%x +>0x1C ulelong x \b, Command line: 0x%x +>0x20 ulelong x \b, App name: 0x%x + +0 string MENUET02 KolibriOS executable: MENUET02 (TLS, HEAP init) +>0x8 ulelong x \b, Version: %u +>0xC ulelong x \b, Entry: 0x%x +>0x10 ulelong x \b, Image end: 0x%x +>0x14 ulelong x \b, Memory end: 0x%x +>0x18 ulelong x \b, Stack top: 0x%x +>0x1C ulelong x \b, Command line: 0x%x +>0x20 ulelong x \b, App name: 0x%x +>0x24 ulelong 2 \b, Subsystem: GUI +>0x24 ulelong 3 \b, Subsystem: CUI