• appimage magic

    From fxkl47BF@protonmail.com@21:1/5 to All on Tue Nov 12 03:50:01 2024
    i down loaded super_program.appimage
    on the command line i type ./super_program.appimage
    how does my debian powered device know what to do

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to fxkl47BF@protonmail.com on Tue Nov 12 04:20:01 2024
    On Tue 12 Nov 2024 at 02:47:21 (+0000), fxkl47BF@protonmail.com wrote:
    i down loaded super_program.appimage
    on the command line i type ./super_program.appimage
    how does my debian powered device know what to do

    It looks at the file signature, or "magic number", in the first few
    bytes of the file. For example, type:

    $ hexdump -C /bin/cat | head -n 1
    00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
    $

    and the 7f 45 4c 46 sequence means Executable and Linkable Format.
    OTOH, in:

    $ hexdump -C /bin/firefox | head -n 1
    00000000 23 21 2f 62 69 6e 2f 73 68 0a 0a 46 49 52 45 46 |#!/bin/sh..FIREF|
    $

    the first two bytes, 23 21, indicate that the file should be passed
    to the program whose name immediately follows, ie /bin/sh, which is
    normally the dash shell in Debian.

    See https://en.wikipedia.org/wiki/List_of_file_signatures for
    loads more magic numbers.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fxkl47BF@protonmail.com@21:1/5 to David Wright on Tue Nov 12 06:20:01 2024
    On Mon, 11 Nov 2024, David Wright wrote:

    On Tue 12 Nov 2024 at 02:47:21 (+0000), fxkl47BF@protonmail.com wrote:
    i down loaded super_program.appimage
    on the command line i type ./super_program.appimage
    how does my debian powered device know what to do

    It looks at the file signature, or "magic number", in the first few
    bytes of the file. For example, type:

    $ hexdump -C /bin/cat | head -n 1
    00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
    $

    and the 7f 45 4c 46 sequence means Executable and Linkable Format.
    OTOH, in:

    $ hexdump -C /bin/firefox | head -n 1
    00000000 23 21 2f 62 69 6e 2f 73 68 0a 0a 46 49 52 45 46 |#!/bin/sh..FIREF|
    $

    the first two bytes, 23 21, indicate that the file should be passed
    to the program whose name immediately follows, ie /bin/sh, which is
    normally the dash shell in Debian.

    See https://en.wikipedia.org/wiki/List_of_file_signatures for
    loads more magic numbers.

    Cheers,
    David.


    i don't see anything in that about appimage

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to fxkl47BF@protonmail.com on Tue Nov 12 07:00:01 2024
    On Tue, Nov 12, 2024 at 05:14:50AM +0000, fxkl47BF@protonmail.com wrote:
    On Mon, 11 Nov 2024, David Wright wrote:

    On Tue 12 Nov 2024 at 02:47:21 (+0000), fxkl47BF@protonmail.com wrote:
    i down loaded super_program.appimage
    on the command line i type ./super_program.appimage
    how does my debian powered device know what to do

    It looks at the file signature, or "magic number", in the first few
    bytes of the file. For example, type:

    $ hexdump -C /bin/cat | head -n 1
    00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
    $

    and the 7f 45 4c 46 sequence means Executable and Linkable Format.
    OTOH, in:

    $ hexdump -C /bin/firefox | head -n 1
    00000000 23 21 2f 62 69 6e 2f 73 68 0a 0a 46 49 52 45 46 |#!/bin/sh..FIREF|
    $

    the first two bytes, 23 21, indicate that the file should be passed
    to the program whose name immediately follows, ie /bin/sh, which is normally the dash shell in Debian.

    See https://en.wikipedia.org/wiki/List_of_file_signatures for
    loads more magic numbers.

    Cheers,
    David.


    i don't see anything in that about appimage

    There are more of those patterns. Try "file":

    file super_proram.appimage

    pattern pattern patternsss

    ...what does it tell you?

    Perhaps the binfmt_misc entry in the Wikipedia gives you a starting point
    on how the Linux kernel decides what to do when it is told to "run" (aka "exec") a file.

    Cheers

    [1] https://en.wikipedia.org/wiki/Binfmt_misc
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZzLtXQAKCRAFyCz1etHa Rr58AJ0cLOkk2ePIpEFurGw9yXpVa3hMzQCeNNNhE/fjTs70be440JJNCxYrwNU=
    =eKvc
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anssi Saari@21:1/5 to fxkl47BF@protonmail.com on Tue Nov 12 10:10:01 2024
    fxkl47BF@protonmail.com writes:

    i don't see anything in that about appimage

    AppImages are ELF binaries. So the answer to your question "how does my
    debian powered device know what to do", is that it knows how to run ELF
    format binaries. I'd assume there are technical descriptions available
    on how that works exactly, my seat of the pants feeling it's not much
    more than loading the binary into RAM and jumping to the binary's start address.

    As to how AppImages work, they seem to mount the AppImage file itself
    while running, presumably to gain access to more ELF binaries or other executables within. I don't really know, just an observation from the
    few occasions I've actually run an AppImage.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to fxkl47BF@protonmail.com on Tue Nov 12 21:20:01 2024
    On Tue 12 Nov 2024 at 05:14:50 (+0000), fxkl47BF@protonmail.com wrote:
    On Mon, 11 Nov 2024, David Wright wrote:
    On Tue 12 Nov 2024 at 02:47:21 (+0000), fxkl47BF@protonmail.com wrote:
    i down loaded super_program.appimage
    on the command line i type ./super_program.appimage
    how does my debian powered device know what to do

    It looks at the file signature, or "magic number", in the first few
    bytes of the file. For example, type:

    $ hexdump -C /bin/cat | head -n 1
    00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
    $

    and the 7f 45 4c 46 sequence means Executable and Linkable Format.
    OTOH, in:

    $ hexdump -C /bin/firefox | head -n 1
    00000000 23 21 2f 62 69 6e 2f 73 68 0a 0a 46 49 52 45 46 |#!/bin/sh..FIREF|
    $

    the first two bytes, 23 21, indicate that the file should be passed
    to the program whose name immediately follows, ie /bin/sh, which is normally the dash shell in Debian.

    See https://en.wikipedia.org/wiki/List_of_file_signatures for
    loads more magic numbers.

    i don't see anything in that about appimage

    That's because the last component of the filename (aka extension) is
    not important in what happens when you type that command. Assuming
    you don't want to hear next that the device will know what to do by
    executing the instructions contained in the file, I'll just say that
    I know nothing about your appimage, so I don't know what it will
    cause your device to do.

    If you want to read about appimages and what they are in general,
    perhaps start at:

    https://en.wikipedia.org/wiki/AppImage

    If you want to know what super_program.appimage in particular does
    when you execute it, look for some documentation wherever you got
    it from. I would have assumed you'd already found some, which led
    to your downloading the file in the first place.

    I've written and/or used programs named super… in the dim and distant
    past. Typically the … bit gave /some/ indication of what the program
    was designed to do, like supermix and supermap. However, super_program
    means nothing at all to me. It sounds more like a placeholder for a
    program in search of a name.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)