Hex Viewer in Python (viewing binary files)

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.พ. 2025
  • Hex Viewer in Python (viewing binary files) -
    This video will walk you through all the code you need to write your own program to view the contents of binary files. The format is similar to what you would see if you download a Hex Editor.

ความคิดเห็น • 26

  • @mrprezident0
    @mrprezident0 ปีที่แล้ว +1

    Hey Heather! I just searched for "python hex editor" and this was the first thing that came up! Very cool. I didn't even know you were a computer science teacher.

    • @PainlessProgramming
      @PainlessProgramming  ปีที่แล้ว +1

      it's a small world! Thanks for checking out my channel. Happy Juggling.

  • @RetroEcoChicken
    @RetroEcoChicken ปีที่แล้ว +2

    thank you, finally a tutorial that explains and is also not SUPER outdated.

  • @brewhog
    @brewhog 2 ปีที่แล้ว +2

    What a wonderfully simple, yet effective video. Thank you so much! I love that you did this on the command line so that the logic could basically be applied to any framework and/or language. Thank you!

  • @johnstroll1
    @johnstroll1 2 หลายเดือนก่อน

    That was exactly what i needed thank you.

  • @SquirrelTheorist
    @SquirrelTheorist 3 ปีที่แล้ว +2

    Wow! This is so interesting! I didn't realize I could make a hex editor that quickly in python. Thank you!

  • @robertbatista50
    @robertbatista50 2 ปีที่แล้ว

    This video should have more 👍. I’m new to Python programming and I am going to use this for the interfacing world of Arduino, rPi and RS-232/422/485 data capture.

  • @peter-william
    @peter-william 3 ปีที่แล้ว +1

    you're a lifesaver, thank you

  • @JohannesDavidsen2024
    @JohannesDavidsen2024 8 หลายเดือนก่อน

    Can python script use this as sector writer ? As hard drive manipulation it would be helpful if this can be used as output writer into hard drive sector 😅

  • @musicmanual-x7c
    @musicmanual-x7c หลายเดือนก่อน +1

    Wow !this is a great news for reverse engineering! By the way, is this method restricted to files? Can it apply to disc? Which I insert a disc, and it read the binary from the disc drive?

    • @PainlessProgramming
      @PainlessProgramming  หลายเดือนก่อน +1

      Thanks for watching. There are more sophisticated tools for reverse engineering. For example if you want to analyze an executable file, there are tools like Ghidra and Binary Ninja. To analyze a jump drive/disc there are tools like Autopsy. There are better hex editors out there. My program is just a teaching example to show my students more about binary.

  • @matoxetu
    @matoxetu 2 ปีที่แล้ว

    ty

  • @bejoapp
    @bejoapp 2 ปีที่แล้ว

    Can we convert the hex code we received from png back to png from hex code?

    • @PainlessProgramming
      @PainlessProgramming  2 ปีที่แล้ว +1

      Yes. It would be possible to read the file, change something (ex. change colors of some pixels), and then write to an output file. When writing back to a file, you would open it for 'wb' and select a file name with a .png extension at the end so programs that can open a png will recognize it as an image.

    • @bejoapp
      @bejoapp 2 ปีที่แล้ว

      @@PainlessProgramming can you make a video about it

    • @PainlessProgramming
      @PainlessProgramming  2 ปีที่แล้ว +2

      @@bejoapp This is a video on how to write bytes to a file. th-cam.com/video/SYsADSPHTnA/w-d-xo.html It may not exactly be what you are looking for because you mentioned specifically editing image files. With the image files, there is metadata and the image's own format. Using a library especially made for image processing would be very useful so you don't accidentally overwrite the wrong part of the image file. Plus there are functions to do standard image processing features. I have heard good things about Pillow module. Hope that answers your question.

    • @bejoapp
      @bejoapp 2 ปีที่แล้ว +1

      @@PainlessProgramming Thank you for your video, I wish you continued success :)))

  • @techatival
    @techatival 2 ปีที่แล้ว

    bytes is a built in global python function. Never overwrite a built in function like this: bytes=0

  • @hamzah274
    @hamzah274 ปีที่แล้ว

    I have a question

  • @knodesec
    @knodesec 11 หลายเดือนก่อน

    Python is really slow for this simple task 😅

    • @tria9
      @tria9 2 หลายเดือนก่อน

      What do you recommend? (Genuinely asking)