View Issue Details

IDProjectCategoryView StatusLast Update
0000226fileGeneralpublic2021-02-05 21:55
Reportercatull Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status resolvedResolutionfixed 
Fixed in Version5.40 
Summary0000226: Add support for "Birtual Machine" (not a typo)
DescriptionThere is a stack-based VM called "Birtual Machine" being developed.
It comes with its own assembly language (BASM) and compiled image.

The image file has a header with magic marker 'bm', a version number and some size numbers.

This issue implements the magdir entries for reporting the meta information of Birtual Machine images.

More details are available here: https://github.com/tsoding/bm.
Tagsmagic, patch

Activities

catull

2021-01-08 17:59

reporter  

bm.patch (1,127 bytes)   
diff --git a/.gitignore b/.gitignore
index 2111f14d..054f574e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ Makefile.in
 /configure
 /depcomp
 /install-sh
+/libmagic.pc
 /libtool
 /ltmain.sh
 /m4
diff --git a/magic/Magdir/bm b/magic/Magdir/bm
new file mode 100644
index 00000000..e761f646
--- /dev/null
+++ b/magic/Magdir/bm
@@ -0,0 +1,10 @@
+#------------------------------------------------------------------------------
+# $File$
+# bm:  file(1) magic for "Birtual Machine", cf. https://github.com/tsoding/bm
+
+# marker is 'bm'
+0    string   bm  Birtual Machine
+>2   leshort  x   \b, version %d
+>4   lelong   x   \b, program size %u
+>12  lelong   x   \b, memory size %u
+>20  lelong   x   \b, memory capacity %u
diff --git a/magic/Makefile.am b/magic/Makefile.am
index a24c4460..6dc255a3 100644
--- a/magic/Makefile.am
+++ b/magic/Makefile.am
@@ -46,6 +46,7 @@ $(MAGIC_FRAGMENT_DIR)/blackberry \
 $(MAGIC_FRAGMENT_DIR)/blcr \
 $(MAGIC_FRAGMENT_DIR)/blender \
 $(MAGIC_FRAGMENT_DIR)/blit \
+$(MAGIC_FRAGMENT_DIR)/bm \
 $(MAGIC_FRAGMENT_DIR)/bout \
 $(MAGIC_FRAGMENT_DIR)/bsdi \
 $(MAGIC_FRAGMENT_DIR)/bsi \
bm.patch (1,127 bytes)   

christos

2021-02-05 21:55

manager   ~0003535

I added it, but the magic is really weak. It is 2021 and we are making 2 byte magic entries? Please let the developers know that they should have at least a 4 byte magic. If there are conflicts/complaints in the future it will be removed.

Issue History

Date Modified Username Field Change
2021-01-08 17:59 catull New Issue
2021-01-08 17:59 catull File Added: bm.patch
2021-01-08 17:59 catull Tag Attached: patch
2021-01-30 23:15 catull Tag Attached: magic
2021-02-05 21:53 christos Assigned To => christos
2021-02-05 21:53 christos Status new => assigned
2021-02-05 21:55 christos Status assigned => resolved
2021-02-05 21:55 christos Resolution open => fixed
2021-02-05 21:55 christos Fixed in Version => 5.40
2021-02-05 21:55 christos Note Added: 0003535