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

    Utility to change raw data?

    IT Discussion
    2
    5
    68
    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.
    • Pete.S
      Pete.S last edited by Pete.S

      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
      • scottalanmiller
        scottalanmiller last edited by

        I think what you want is a hex editor.

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

        Pete.S 1 Reply Last reply Reply Quote 0
        • Pete.S
          Pete.S @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
          • Pete.S
            Pete.S 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.

            scottalanmiller 1 Reply Last reply Reply Quote 0
            • scottalanmiller
              scottalanmiller @Pete.S 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
              • First post
                Last post