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 8035405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:17:53+00:00 2026-06-05T02:17:53+00:00

I am trying to search through a binary file. After reviewing the file via

  • 0

I am trying to search through a binary file. After reviewing the file via a hex editor I found patterns throughout the file. You can see them here. As you can see they are before and after the file listing.

/% ……C:\Users\\Desktop\test1.pdf..9

/% ……C:\Users\\Desktop\testtesttesttest.pdf..9

What I woudld like to do is find ..9 (HEX = 000039), and then “backup” until I find, /% …… (hex = 2F25A01C1000000000), then move forward x amount of bytes so I can get the complete path. The code I have now is below:

$file = 'C:\Users\<username>\Desktop\bc03160ee1a59fc1.automaticDestinations-ms'
$begin_pattern = '2F25A01C1000000000' #/% ......
$end_pattern = '000039' #..9
$prevBytes = '8'
$bytes = [string]::join('', (gc $file -en byte | % {'{0:x2}' -f $_}))
[regex]::matches($bytes, $end_pattern) |
% {
$i = $_.index - $prevBytes * 2
[string]::join('', $bytes[$i..($i + $prevBytes * 2 - 1)])
}

Some of the output roughly translates to this:

ffff2e0000002f000000300000003b0000003200000033000000340000003500000036000000370000003800
655c4465736b746f705c466f72656e7369635f426f6f6b735c5b656e5d646566745f6d616e75616c2e706466
0000000000000000000000000000010000000a00000000000000000020410a000000000000000a00000000

ÿÿ./0;2345678?e\Desktop\deft_manual.pdf?

?sic Science, Computers, and the Internet.pdf

?ware\Desktop\Dive Into Python 3.pdf?

  • 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-05T02:17:55+00:00Added an answer on June 5, 2026 at 2:17 am

    You can use the System.IO.BinaryReader class from PowerShell.

    $path = "<yourPathToTheBinaryFile>"
    
    $binaryReader = New-Object System.IO.BinaryReader([System.IO.File]::Open($path, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite))
    

    Then you have access to all the methods like:

    $binaryReader.BaseStream.Seek($pos, [System.IO.SeekOrigin]::Begin)
    

    AFAIK, no easy way to “find” a pattern without reading the bytes (using ReadBytes) and implementing the search yourself.

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

Sidebar

Related Questions

I am trying to use Perl to search through an html file, looking for
Im trying to search through a text file and find the valid email addresses.
I am trying to search through a binary search tree and store each node
I'm trying to write a perl script to search through a text file, find
I'm new to Python and I have been trying to search through html with
I'm trying to search Netflix through their API, but without logging anyone in (because
I am trying to use jQuery to search through a list of links and
I'm trying to do a partial search through a column family in Cassandra similar
I'm trying using NHibernate.Search to get Lucene.NET Score through projections. My domain object implements
I'm trying to search through this Json array using PHP: {count:2,items:{milestone:[{id:3107,username:TomSmith1,userid:1620602,date:2012-01-12 16:49:26,projectid:804,projectname:TEST PROJECT,reason:Partial payment

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.