Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:10:45+00:00 2026-06-01T09:10:45+00:00

I want to be able to read bytes from a min and max hexadecimal

  • 0

I want to be able to read bytes from a min and max hexadecimal offset that is given through 2 strings string minO and string maxO. After that I just need to convert the bytes to a string.

//Setup byte reader.
FileStream fs = new FileStream(EditOpen.FileName, FileMode.Open);
BinaryReader br = new BinaryReader(fs);
long length = fs.Length;
//Read bytes to textBox1.
string minO = 0x00001844;
string maxO = ???
br.BaseStream.Position = minO;
byte[] example = br.ReadBytes(0x000003FC);
textBox1.Text = BitConverter.ToString(example);

0x00001844 is the min value and 0x00001C3F is the max value and 0x000003FC is the difference in hex.

This is the output:

73-20-67-6C-61-73-73-5F-62-72-65-61-6B-20-22-30-22-2E-2E-00-73-20-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-20-73-20-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-2E-73-20-70-65-72-6B-5F-65-78-74-72-61-42-72-65-61-74-68-20-22-39-39-39-22-2E-2E-2E-2E-2E-2E-2E-00-73-20-6D-6F-74-69-6F-6E-54-72-61-63-6B-65-72-52-61-6E-67-65-20-22-39-39-39-39-22-2E-2E-2E-2E-2E-2E-00-00-00-73-20-6C-6F-62-62-79-5F-61-6E-69-6D-61-74-69-6F-6E-53-70-65-65-64-20-22-36-30-22-2E-2E-2E-2E-2E-2E-2E-00-00-73-20-67-6C-61-73-73-5F-73-68-61-74-74-65-72-65-64-5F-73-63-61-6C-65-20-22-30-22-2E-2E-2E-2E-2E-2E-2E-00-00-73-20-67-6C-61-73-73-5F-66-72-69-6E-67-65-5F-6D-61-78-73-69-7A-65-20-22-31-30-30-22-2E-2E-2E-2E-2E-2E-2E-00-73-20-75-69-5F-67-61-6D-65-74-79-70-65-20-22-73-64-22-00-00-73-20-67-5F-67-61-6D-65-74-79-70-65-20-22-73-64-22-00-00-00-73-20-70-61-72-74-79-5F-67-61-6D-65-74-79-70-65-20-22-73-64-22-00-00-00-73-20-67-61-6D-65-74-79-70-65-20-22-22-00-00-00-6D-61-70-6E-61-6D-65-00-56-41-5F-46-4F-52-57-41-52-44-00-00-73-20-61-63-74-69-76-65-61-63-74-69-6F-6E-20-22-70-65-72-6B-5F-62-75-6C-6C-65-74-50-65-6E-65-74-72-61-74-69-6F-6E-4D-75-6C-74-69-70-6C-69-65-72-20-33-30-3B-70-65-72-6B-5F-64-69-76-65-47-72-61-76-69-74-79-53-63-61-6C-65-20-2E-30-31-3B-70-65-72-6B-5F-64-69-76-65-56-65-6C-6F-63-69-74-79-20-30-3B-70-65-72-6B-5F-64-69-76-65-44-69-73-74-61-6E-63-65-43-68-65-63-6B-20-39-39-39-3B-70-65-72-6B-5F-65-78-74-65-6E-64-65-64-4D-65-6C-65-65-52-61-6E-67-65-20-39-39-39-3B-70-65-72-6B-5F-67-72-65-6E-61-64-65-44-65-61-74-68-20-61-63-31-33-30-5F-31-30-35-6D-6D-5F-6D-70-3B-70-65-72-6B-5F-77-65-61-70-52-61-74-65-4D-75-6C-74-69-70-6C-69-65-72-20-2E-30-31-3B-63-67-5F-67-75-6E-5F-78-20-36-3B-67-6C-61-73-73-5F-66-72-69-6E-67-65-5F-6D-61-78-63-6F-76-65-72-61-67-65-20-31-30-30-30-30-30-30-3B-6D-6F-74-64-20-5E-31-47-65-74-5E-35-53-68-69-69-74-5E-37-4F-6E-5E-31-4B-69-64-73-20-20-20-5E-39-42-79-20-5E-32-42-55-53-54-45-44-5E-33-54-57-49-4E-4B-49-45-20-20-5E-34-40-7B-3D-33-5E-32-3C-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-5E-31-4A-4F-49-4E-20-5E-35-77-77-77-2E-58-62-6F-78-5E-37-33-36-30-5E-31-44-65-76-65-6C-6F-70-65-72-73-2E-5E-35-63-6F-6D-5E-32-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-3D-38-3B-70-65-72-6B-5F-73-70-72-69-6E-74-4D-75-6C-74-69-70-6C-69-65-72-20-35-3B-70-6C-61-79-65-72-5F-6C-61-73-74-53-74-61-6E-64-43-72-61-77-6C-53-70-65-65-64-53-63-61-6C-65-20-32-3B-70-6C-61-79-65-72-2B-73-70-72-69-6E-74-54-69-6D-65-20-39-39-39

I would like to have the output as plain text instead of hex. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:10:47+00:00Added an answer on June 1, 2026 at 9:10 am

    Binary or Hexadecimal output:

    You can use Convert.ToString(byte, base) to convert a byte to a hex string without any separators. Base can be 2 for binary or 16 for hexadecimal.

    Use this in a for loop to convert all bytes:

    StringBuilder builder = new StringBuilder();
    foreach(byte b in example)
    {
        builder.Append(Convert.ToString(b, 16).PadLeft(2,'0'));
    }
    textBox1.Text = builder.ToString();
    

    Plain text encoding:

    If you want to have plain text, you have to know the encoding of the file. For UTF8 you would use:

    textBox1.Text = System.Text.Encoding.UTF8.GetString(example);
    

    Tell me if this works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to write bytes and read them from standard input/output
I want to be able to read from an unsorted source text file (one
I want to be able to read line by line from a pdf, compare
I want to be able to read any well-formed RSS/ATOM file. That would mean
I want to be able to split csv strings in Oracle 9i I've read
I want my Python script to be able to read Unicode command line arguments
Background: (Read before you flame...) I want a user to be able to SELECT
I want to be able to capture the exception that is thrown when a
I have a string value read in from a CSV file. The CSV file
I want to be able to read a file just as it is being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.