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

  • Home
  • SEARCH
  • 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 6862627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:41:03+00:00 2026-05-27T02:41:03+00:00

I am trying to extract some information from a binary file. It looks like

  • 0

I am trying to extract some information from a binary file. It looks like this:

AUTHCODE(here goes 3 bytes, that I don't need)part_that_i_need(here goes a NULL byte).

enter image description here

How to I match the portion of alpha-numeric characters qszjlbnkmctkkezgd_qyzkyptqigudilzpkp_qgetefvmigwimrihudk that is between bytes {11} {00} {38} and {00}.

Here’s what I’ve done so far:

            string ReadFileMF;
            using (StreamReader reader = new StreamReader(pathCopy))
            {
                ReadFileMF = reader.ReadToEnd();
            }

            ///match the whole string
            Match passMF = Regex.Match(ReadFileMF, @"(AUTHCODE).+?(www)");
            String passMFs = passMF.Value;

            //convert to array of bytes
            byte[] bpass = StrToByteArray(passMFs);

            //replace the 3 bytes after AUTHCODE with spaces
            bpass[8] = 0x20;
            bpass[9] = 0x20;
            bpass[10] = 0x20;

Ok, so now I have just to match the nullbyte at the end. Somthing like (AUTHCODE).+?(NULL_BYTE). Any ideas?

  • 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-05-27T02:41:03+00:00Added an answer on May 27, 2026 at 2:41 am

    This might be easiest with a few simple for-loops or Copy() actions over the byte data. Too few specs to be exact. Like:

    // untested, I could be off-by-1 somewhere
    int start = "AUTHCODE".Length + 3;
    int end = text.Indexof('\0', start);
    string result = text.SubString(start, end-start);
    

    If you do want/need Regex, you’ll have to turn it into a string first. Your only safe bet seems to be ASCII encoding.

     string text = Encoding.ASCII.GetString(data);
    

    and then (untested)

     Regex.Match(text, "AUTHCODE.{3}([^\0x00]+)\0x00);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey Im trying to extract certain information from a string. The String looks like
I'm trying to extract some textual data from a PDF file. To do this,
I'm trying to write some code to extract Exif information from a JPG. Exif
I'm trying to extract some information from a webpage using php cURL+preg_match or any
I'm trying to use Selenium (in Python) to extract some information from a website.
I am trying to extract the mp3 header from a file. This is different
I'm trying to extract some extra information from a location using google map api.
I'm trying to extract some string from a file using python re, then MD5ing
I'm trying to use WWW::Mechanize to extract some links from the HTML page using
Trying to extract strings that are wrapped in double brackets. For example [[this is

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.