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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:00:08+00:00 2026-05-16T06:00:08+00:00

I want to take a binary file (exe, msi, dll, whatever) and be able

  • 0

I want to take a binary file (exe, msi, dll, whatever) and be able to actually “see” the binary code or whatever base I’d like (hexadecimal whatever). Figured the easiest way would be just to output the code into a txt so I can examine it.

Whats the best and easiest way to do this? Basically I am looking to convert the binary code into a picture for a project of mine.

Similarly, it would be nice if I could take some binary code, and then convert it into a binary file.

What are your methods for doing this, I listed C, C++, and C# because these seem to be the fastest programming languages and I figured this may take some time. I guess I am more interested in an answer in C, but I am mostly looking for some logic behind 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-05-16T06:00:09+00:00Added an answer on May 16, 2026 at 6:00 am

    Here’s a way to pack the bytes into an image… the fun part is if you record the original file length and use a lossless image format you could safely extract the binary data later.

    Packed as ARGB…

    var exefile = Directory.GetFiles(".", "*.exe").First();
    var fi = new FileInfo(exefile);
    
    var dimension = (int)Math.Sqrt((fi.Length + 1d) / 4);
    
    using (var bitmap = new Bitmap(dimension, dimension + 2))
    {
        //store the file length in the first pixel.
        bitmap.SetPixel(0, 0, Color.FromArgb((int)fi.Length));
    
        var buffer = new byte[fi.Length + 4 - fi.Length % 4];
        Array.Copy(File.ReadAllBytes(exefile), buffer, fi.Length);
    
        int x = 1, y = 0;
        for (var offset = 0; offset < buffer.Length; offset += 4)
        {
            var colorValue = BitConverter.ToInt32(buffer, offset);
            bitmap.SetPixel(x, y, Color.FromArgb(colorValue));
    
            x++;
            if (x >= dimension)
            {
                x = 0;
                y++;
            }
        }
    
        bitmap.Save(Path.ChangeExtension(exefile, ".png"), ImageFormat.Png);
    }
    

    Packed as Black & White Binary…

    var width = (int)Math.Sqrt(fi.Length * 8);
    width = width + 8 - (width % 8);
    var length = (int)(fi.Length * 8 / width);
    
    Func<byte, int, Color> getcolor =
            (b, m) => (b & m) == m ? Color.Black : Color.White;
    
    using (var bitmap = new Bitmap(width, length + 1))
    {
        var buffer = File.ReadAllBytes(exefile);
    
        int x = 0, y = 0;
        foreach (var @byte in buffer)
        {
            bitmap.SetPixel(x + 0, y, getcolor(@byte, 0x80));
            bitmap.SetPixel(x + 1, y, getcolor(@byte, 0x40));
            bitmap.SetPixel(x + 2, y, getcolor(@byte, 0x20));
            bitmap.SetPixel(x + 3, y, getcolor(@byte, 0x10));
    
            bitmap.SetPixel(x + 4, y, getcolor(@byte, 0x8));
            bitmap.SetPixel(x + 5, y, getcolor(@byte, 0x4));
            bitmap.SetPixel(x + 6, y, getcolor(@byte, 0x2));
            bitmap.SetPixel(x + 7, y, getcolor(@byte, 0x1));
    
            x += 8;
            if (x >= width)
            {
                x = 0;
                y++;
            }
        }
    
        bitmap.Save(Path.ChangeExtension(exefile, ".tif"), ImageFormat.Tiff);
    }
    

    … and yeah, it looks like noise

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

Sidebar

Related Questions

I want to do the following in Python: Take a binary (executable) file Turn
So, I am having trouble with some code. I want this function to take
I want to convert binary data to hexadecimal, just that, no fancy formatting and
I want to decompile iOS Twitter framework, if fact I take twitterd file from
I want to take a floating point number in C++, like 2.25125, and a
I want to be able to take, as input, a character pointer to a
I am going to store 350M pre-calculated double numbers in a binary file, and
I want to run an import of a large file into MySQL. However, I
I have one binary file which I have created. In it, data is stored
Here's the current situation I'm in: I want to distribute a binary app on

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.