Two Ways to View a Binary File on Windows Without Installing Anything https://epicentreconcerts.org

Two Ways to View a Binary File on Windows Without Installing Anything

There are times when you may need to view the contents of a binary star charge, such as, a file that is either a calculator broadcast or a data file. While you can of course search for a release binary or hexadecimal viewer, such a route requires you to download and install a third-party program on the system, something that you may either not want to do ( eg, you have limited magnetic disk outer space, or you do n’t want to take the risk of installing a platform from an unknown source ) or can not do ( eg, this is a party or client ‘s calculator, so you ca n’t just go around installing programs on a caprice ) .
The good newsworthiness is that you do n’t actually need to install any third-party platform to view binary files. Windows already comes with programs that can take a file ( binary or otherwise ), and translate it to show hexadecimal code along with its printable ( displayable ) ASCII equivalent ( if any ) side-by-side. ( Scroll down to see the screenshots if you do n’t know what I mean. )

Method 1 (Windows 10): Using PowerShell’s Format-Hex Cmdlet

This method requires PowerShell 5.0 or above, which comes preinstalled on Windows 10. If you use an earlier version of Windows, see method acting 2 alternatively. ( You can of course install PowerShell 5+ on those versions excessively, but that defeats the purpose of not installing anything. )

  1. Click the Start menu release and type “ powershell ” ( without the quotation marks ). The words “ Windows PowerShell ” will appear at the top of the menu. Click it.
  2. A window will open, leaving you at a command prompt with something like ” PS C:\Users\christopherheng> “ just before your text cursor. The actual words following “ Users\ ” will differ, depending on your Windows report name .
  3. Go to the directory containing the charge you want to view. You can change directories by typing “ candle ” followed by the full directory appoint. For model, if you want to view a file in the “ c : \Program Files\Windows Mail ” directory, type
    cadmium “ vitamin c : \Program Files\Windows Mail ”
    If you want to return to the default directory you were in when you first base opened PowerShell, character :
    compact disk $ Env : USERPROFILE
    In all cases, after typing the command, you will have to hit the ENTER key ahead PowerShell will act on your instructions .
  4. In general the command to view a file called ( say ) “ file.exe ” is ” format-hex file.exe ” ( without the citation marks ). however, if you do that, and your file is larger than a few bytes or so, the contents will be dumped in one fell swoop onto the screen, scrolling off at capital speed, until the entire file has been displayed .
    As such, you will credibly want to send the output to a program called ” more ” which will let you see the contents one screenful at a clock. To do that, type the follow alternatively :
    format-hex file.exe | more
    As always, when working on the command line, you will need to type the ENTER key after the command before PowerShell will act on your instructions. If your filename has spaces in it, put quotation marks around it, like this :
    format-hex “ c : \Program Files\My Stuff\file to view.exe ” | more
    The “ | ” character, called a “ pipe ” in this context, sends the end product of format-hex as though through a pipe ( hence the name ) to another program called “ more ”. The latter lets you page advancing through the file, one screenful or one line at a clock .
    Output of format-hex of a binary file as viewed in more
    To see the adjacent screenful, type the space bar on your keyboard. To scroll up only one cable, use the ENTER key. There is no way to scroll back. If you actually need to go back to an earlier screen, one way is to quit the broadcast and redo the instruction again. To terminate the platform before you reach the end of the file ( eg, if you have already found what you were looking for, or if you incidentally paged ahead past the character you wanted to see and needed to start again ), type “ q ” ( without the quotation marks ) to quit .
  5. When you are done, close PowerShell by typing “ die ” ( without the quotation marks ), followed by the ENTER key. alternatively, you can besides click the “ x ” push button on the top right pass side of the window in the usual manner .

If “More” is Too Limited for Your Needs

While “ more ” is by and large useful for viewing a file one screenful at a time, if you need to page up and down repeatedly, its inability to scroll back can be identical frustrating .
In such a case, it may be worth the attempt to save the output that “ format-hex ” produces as a text file, so that you can use a normal complain textbook editor program like Notepad to view it .
To do this, use the adopt command trace alternatively :
format-hex file.exe > file.txt
This produces a charge called “ file.txt ”, which you can open with any text editor. The greater-than sign, “ > “, causes the output of format-hex to be redirected ( i, saved ) into a file named ( in our lawsuit ) “ file.txt ”. You can of course name the file anything you want. Both “ file.exe ” and “ file.txt ” are just examples .
then open “ file.txt ” ( or whatever you called it ) in Notepad or another plain text editor program. This allows you to page up and down through the output american samoa much as you like .

Method 2 (Windows 7, 8, 8.1, 10): Using Certutil

Windows 7, 8, 8.1, and 10 ( I do n’t know about earlier versions ) come with a versatile command line platform called certutil which can be used to create a textbook charge containing hexadecimal code alongside their ASCII text equivalent, if any .
such a text file can then be viewed in any plain textbook editor, including Notepad, which comes with Windows.

  1. Click the Start menu and character “ cmd ”. The words “ Command Prompt ” should appear at the lead. Click it .
  2. This opens a dominate prompt window. You should be able to see a blinking text cursor on a line that says something like “ C:\Users\christopherheng> “. The accurate words will be different on your computer, since you are improbable to have the same Windows account name as me .
  3. Go to the directory containing the file you want to view. You can change directories by typing “ four hundred ” followed by the entire directory name. For exemplar, if you want to view a file in the “ c : \Program Files\Windows Mail ” directory, type
    compact disk “ c : \Program Files\Windows Mail ”
    If you want to return to the default directory you were in when you first opened Command Prompt, character :
    certificate of deposit % USERPROFILE %
    In all cases, after typing the command, you will have to hit the ENTER cardinal before Command Prompt will run the program .
  4. To view the contents of ( say ) “ file.exe ”, we will first get certutil to generate a temp text file called “ file.txt ”. actually, you can name the impermanent text file anything you want. Just do n’t give it the like name as an existing file, or certutil will happily overwrite that file with its output .
    The command to do this is :
    certutil -encodehex file.exe file.txt
    As common, tap the ENTER key after typing the above channel, or nothing will happen. If any of your filenames contain spaces, encose them in quotation marks, like this :
    certutil -encodehex “ c : \Program Files\My Stuff\filename.exe ” “ irregular end product file.txt ”
  5. The course of study “ certutil ” will then proceed to create the output signal charge. When it ‘s done, you will be deposited back at the control line. now open that file in Notepad or another plain text editor program .
    You can do this either by starting notepad the usual way ( eg, typing “ Notepad ” into the Start menu and clicking the “ Notepad ” line that appears ), then navigating to the localization of “ file.txt ” and opening it, or you can besides do it from the command line with :
    notepad file.txt
  6. Since you are viewing it in a text editor program, you can scroll up and down the file the normal way you are used to, either with the PgUp and PgDn keys, the scroll legal profession, or the coil bicycle on your mouse. note that this is a temp file that you are viewing, so there ‘s no point trying to edit it or change it. You ‘re going to delete it once you are done viewing it ( in the following step ) .
    Output of certutil of a binary file as viewed in Notepad
  7. When you are done, delete the temp file if you do n’t want it any more. You can do this in the usual manner with Explorer, or even from the dominate line by typing “ del file.txt “ .
  8. close the Command Prompt window by clicking the “ x ” in the lead correctly hand recess, or by typing “ passing ” ( followed by the ENTER identify ) on the dominate line .

Copyright © 2021 by Christopher Heng. All rights reserved. Get more “ How To ” guides and tutorials from hypertext transfer protocol : //epicentreconcerts.org/ .
This article can be found at hypertext transfer protocol : //epicentreconcerts.org/system/view-binary-file-on-windows.shtml

howtohaven™ RSS Site Feed

Do you find this article useful ? You can learn of new articles and scripts that are published on howtohaven.com by subscribing to the RSS fertilize. Simply point your RSS run subscriber or a browser that supports RSS feeds at hypertext transfer protocol : //epicentreconcerts.org/howtohaven.xml .

Please Do Not Reprint This Article

This article is copyrighted. Please do not reproduce this article in whole or part, in any class, without obtaining my written permission.

Related Pages

Newest Pages

How to Link to This Page

To link to this page from your web site, just cut and paste the comply code to your world wide web page .
It will appear on your page as :
Two Ways to View a Binary File on Windows Without Installing Anything

Related Posts

Leave a Reply

Your email address will not be published.