Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. uncategorized
  3. "Big endian"

"Big endian"

Scheduled Pinned Locked Moved uncategorized
14 Posts 3 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Guest

    "Big endian"

    ​​ What it suggests (⚠️DON'T read this):
    "
    The big (most significant) byte is at the end"

    ​​ What it actually means (explained to humans):
    "The starting extreme of the number is the big (most significant byte) one"

    Convention perpetrated by the utterly deranged
    ​​

    ? Offline
    ? Offline
    Guest
    wrote last edited by
    #2

    @cinnamon little endian exists and it sucks

    ? 1 Reply Last reply
    0
    • ? Guest

      @cinnamon little endian exists and it sucks

      ? Offline
      ? Offline
      Guest
      wrote last edited by
      #3

      @ity@estradiol.city ...except if you're implementing a compiler and want to support safe casts from larger to smaller kinds of integers pointed by a pointer, apparently.

      ? 1 Reply Last reply
      0
      • ? Guest

        @ity@estradiol.city ...except if you're implementing a compiler and want to support safe casts from larger to smaller kinds of integers pointed by a pointer, apparently.

        ? Offline
        ? Offline
        Guest
        wrote last edited by
        #4

        @cinnamon I don't follow

        ? 1 Reply Last reply
        0
        • ? Guest

          @cinnamon I don't follow

          ? Offline
          ? Offline
          Guest
          wrote last edited by
          #5

          @ity@estradiol.city Nina has explained it better than I could.

          RE: https://gts.q66.moe/users/q66/statuses/01JY22XV9NX7CD856X3NE1476B

          ? 1 Reply Last reply
          0
          • ? Guest

            @ity@estradiol.city Nina has explained it better than I could.

            RE: https://gts.q66.moe/users/q66/statuses/01JY22XV9NX7CD856X3NE1476B

            ? Offline
            ? Offline
            Guest
            wrote last edited by
            #6

            @cinnamon hhhhhh not q66

            ? 1 Reply Last reply
            0
            • ? Guest

              @cinnamon hhhhhh not q66

              ? Offline
              ? Offline
              Guest
              wrote last edited by
              #7

              @cinnamon (and no even independent of that I don't really get what she is on about)

              ? 1 Reply Last reply
              0
              • ? Guest

                @cinnamon (and no even independent of that I don't really get what she is on about)

                ? Offline
                ? Offline
                Guest
                wrote last edited by
                #8

                @ity@estradiol.city Assuming you're acquainted with the concept of pointer (I hope not to insult you by thinking that you might not be), if you have a 32 bit integer in little endian encoding, like this:

                0x00000003
                It would be mapped to memory as this sequence of bytes. And if you had pointers pointing to these integers, they would point to these addresses:
                Little endian:      Big endian:
                03 00 00 00         00 00 00 03
                 ^                   ^
                 int *p              int *p
                Now, if you (by mistake or on purpose) miscast these int * pointers as char *, what happens?
                Little endian: *((char *)p) is 0x3
                Big endian: *((char *)p) is 0x0
                So... big endian is more legible, but little endian is more robust to miscasts.

                ? 1 Reply Last reply
                0
                • ? Guest

                  @ity@estradiol.city Assuming you're acquainted with the concept of pointer (I hope not to insult you by thinking that you might not be), if you have a 32 bit integer in little endian encoding, like this:

                  0x00000003
                  It would be mapped to memory as this sequence of bytes. And if you had pointers pointing to these integers, they would point to these addresses:
                  Little endian:      Big endian:
                  03 00 00 00         00 00 00 03
                   ^                   ^
                   int *p              int *p
                  Now, if you (by mistake or on purpose) miscast these int * pointers as char *, what happens?
                  Little endian: *((char *)p) is 0x3
                  Big endian: *((char *)p) is 0x0
                  So... big endian is more legible, but little endian is more robust to miscasts.

                  ? Offline
                  ? Offline
                  Guest
                  wrote last edited by
                  #9

                  @cinnamon the formatting seemed to have broken, mew

                  ? 1 Reply Last reply
                  0
                  • ? Guest

                    @cinnamon the formatting seemed to have broken, mew

                    ? Offline
                    ? Offline
                    Guest
                    wrote last edited by
                    #10

                    @ity@estradiol.city

                    a1ba@suya.placeA 1 Reply Last reply
                    0
                    • ? Guest

                      @ity@estradiol.city

                      a1ba@suya.placeA This user is from outside of this forum
                      a1ba@suya.placeA This user is from outside of this forum
                      a1ba@suya.place
                      wrote last edited by a1ba@suya.place
                      #11
                      @cinnamon @ity big endian turned out to have an advantage in reverse engineering. Why?

                      If your CPU is big endian and doesn't like unaligned access (which most of them do iirc, even if they pretend otherwise), compiler can't do smaller access, so you know the actual size of memory being read or written to, even if it needs just one byte.
                      ? 1 Reply Last reply
                      0
                      • a1ba@suya.placeA a1ba@suya.place
                        @cinnamon @ity big endian turned out to have an advantage in reverse engineering. Why?

                        If your CPU is big endian and doesn't like unaligned access (which most of them do iirc, even if they pretend otherwise), compiler can't do smaller access, so you know the actual size of memory being read or written to, even if it needs just one byte.
                        ? Offline
                        ? Offline
                        Guest
                        wrote last edited by
                        #12

                        @a1ba@suya.place @ity@estradiol.city Reading this post has brought memories of MS-DOS era code with "anti-disassembling protection" which had jumps to the middle of multi-byte instructions that the Borland Turbo Pascal/Turbo C couldn't disassemble because they were misaligned to the word size.

                        ? 1 Reply Last reply
                        0
                        • ? Guest

                          @a1ba@suya.place @ity@estradiol.city Reading this post has brought memories of MS-DOS era code with "anti-disassembling protection" which had jumps to the middle of multi-byte instructions that the Borland Turbo Pascal/Turbo C couldn't disassemble because they were misaligned to the word size.

                          ? Offline
                          ? Offline
                          Guest
                          wrote last edited by
                          #13

                          @cinnamon @a1ba lmao that reminds me of the x86 challenge I made

                          To try to ram as many nested instructions into each other as possible

                          a1ba@suya.placeA 1 Reply Last reply
                          0
                          • ? Guest

                            @cinnamon @a1ba lmao that reminds me of the x86 challenge I made

                            To try to ram as many nested instructions into each other as possible

                            a1ba@suya.placeA This user is from outside of this forum
                            a1ba@suya.placeA This user is from outside of this forum
                            a1ba@suya.place
                            wrote last edited by
                            #14
                            @ity @cinnamon ngl sounds fun
                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Login or register to search.
                            Powered by NodeBB Contributors
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups