Solved

Find HexEdit Control C++

Posted on 2007-11-15
3
334 Views
Last Modified: 2013-12-04
Hello,

hope to get some help here. I am looking for a control (MFC) to view data in Hex format. Like a normal HexEditor will do. (Adress, Hex, ASCII).
The control i need must have following methods:

- Print (Printer/Paper) Text Formated as in the Control
- Save Data to textfile (Text Formated as in the Control).

Like I give of block of 128 Bytes to the Control. It shows me the 126 Bytes in 16 Byte rows.
Similar to : 000000 0x00 0x00 0x00 .... 0x00  0x00  .............
I want to receive the data as a string like formated above. Not the Byte array.

Freeware or Commercial. I have no problem to pay for those things.  I found some controls but none of the mcan print or save the data as viewed inside the control.

Thanks,

Ingo
0
Comment
Question by:Ocrana
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
Well, it is a very specific requirement, there are some commercial controls like this:
http://www.filedudes.com/Hex_Editor_ActiveX_Control-download-27563.html
it prints and copies to clipboard but doesn't save. You won't find any exact match.

There are lots of open-source hex controls at www.codeproject.com, just search there for the keywords: hex editor
0
 
LVL 40

Accepted Solution

by:
evilrix earned 500 total points
Comment Utility
Converting data bytes to hex isn't hard. Why not just write a converter and just display the output in your control of choice?
// Q&D example of hexing data

#include <iostream>

#include <sstream>

#include <iomanip>
 

char const DATA[] = "any old data";
 

int _tmain(int argc, _TCHAR* argv[])

{

	std::stringstream ss;
 

	for(char const * p = DATA; *p ; ++p)

	{

		ss << std::hex << static_cast<int>(*p);

	}
 

	std::cout << ss.str();

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
Comment Utility
I should point out that the point of the previous example was to show how to hex bytes not how to parse the aw data. My Q&D example will parse until I hits a NULL char. Obviously this won't work if your data contains NULLs. You should, of course, choose an appropriate 8-bit safe method for traversing your data. I kept it simple, on purpose, so as not to obfuscate the point I was making.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now