ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Utility to change raw data?

    Scheduled Pinned Locked Moved IT Discussion
    5 Posts 2 Posters 214 Views
    Loading More Posts
    • 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.
    • 1
      1337
      last edited by 1337

      Is there a linux tool I can use that can change raw data inside a file?

      For instance say I wanted to change byte 2345 and forward in the file raw.bin to something else.

      Something like:
      alter-data --pos=2345 --new_data="8718\r\n0x23abc\0x00" raw.bin

      Any suggestions on what to use?

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        I think what you want is a hex editor.

        https://www.tecmint.com/best-hex-editors-for-linux/

        1 1 Reply Last reply Reply Quote 0
        • 1
          1337 @scottalanmiller
          last edited by

          @scottalanmiller said in Utility to change raw data?:

          I think what you want is a hex editor.

          https://www.tecmint.com/best-hex-editors-for-linux/

          No, I don't want it to do it interactively. If it was text I don't want something like vim, I want something like sed, awk etc.

          1 Reply Last reply Reply Quote 0
          • 1
            1337
            last edited by

            I think I might have a solution with dd and printf.

            printf "8718\r\n0x23abc\0x00" | dd of=raw.bin seek=2345 oflag=seek_bytes

            Something like that.

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @1337
              last edited by

              @Pete-S said in Utility to change raw data?:

              I think I might have a solution with dd and printf.

              printf "8718\r\n0x23abc\0x00" | dd of=raw.bin seek=2345 oflag=seek_bytes

              Something like that.

              Interesting. Makes sense though.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post