[File] [PATCH] AppImage

Martin Jansche mjansche at gmail.com
Mon Oct 11 16:43:31 UTC 2021


Per the AppImageSpec
<ttps://github.com/AppImage/AppImageSpec/blob/master/draft.md>, an AppImage
is an ELF binary with the additional magic string "AI" at offset 8. More
precisely, the spec gives the optional 3-byte hex sequence 0x414901 for
type 1 AppImages and the mandatory sequence 0x414902 for type 2 AppImages.
>From the discussion referenced in the spec it's clear that issues of byte
ordering are not relevant, as the intention is to match the byte value 0x41
('A') at offset 8 and 0x49 ('I') at offset 9, followed by a single non-null
byte indicating the AppImage type, which is currently either 1 or 2, but
could be higher if additional types were to be defined in the future. Hence
the following thought of reporting AppImage as part of the general ELF
magic:

diff --git a/magic/Magdir/elf b/magic/Magdir/elf
index 93abdc38..86b57b6d 100644
--- a/magic/Magdir/elf
+++ b/magic/Magdir/elf
@@ -369,3 +369,6 @@
 >7     byte            97              (ARM)
 >7     byte            202             (Cafe OS)
 >7     byte            255             (embedded)
+>8     string          AI
+>>10   byte            >0              \b, AppImage type %d

On an unrelated side note, on Ubuntu 18 I had to run libtoolize before
autoreconf in order to build:

diff --git a/README.DEVELOPER b/README.DEVELOPER
index dfe27b97..69f49425 100644
--- a/README.DEVELOPER
+++ b/README.DEVELOPER
@@ -6,6 +6,7 @@

 After checking out the source, run the following:

+       libtoolize
        autoreconf -f -i
        make distclean  # this can fail if you have not built before
        ./configure --disable-silent-rules
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20211011/318374ee/attachment.htm>


More information about the File mailing list