Thursday, November 13, 2008

A binary/hex file editor that helps you actually understand the binary file (Think formatted, template driven, hex file editor on steroids) – 010 Editor

010 Editor

“010 Editor is a professional-grade text editor and hex editor designed to quickly and easily edit any file or drive on your computer. Combining an easy-to-use interface with a whole range of editing tools, 010 Editor is a valuable tool for anyone working with text or binary files.

  • View and edit any binary file on your hard drive (unlimited file size) and text files including Unicode files, C/C++ source code, etc.
  • Unique Binary Templates technology allows you to understand any binary file format.
  • Find and fix problems with hard drives, floppy drives, memory keys, flash drives, CD-ROMs, processes, etc.
  • Analyze and edit binary data with powerful tools including Find, Replace, Find in Files, Binary Comparisons, Checksum/Hash Algorithms, Histograms, etc.
  • Powerful scripting engine allows automation of many tasks (language is very similar to C).
  • Import and export your binary data in a number of different formats.

Binary Templates - The Power Behind 010 Editor

One of the most powerful features of 010 Editor is the ability to parse virtually any binary file using a Binary Template. Instead of browsing through a long range of hex bytes as with traditional hex editors, Binary Templates allow a file to be understood. Templates are easy to write and can be used to completely parse any data format, such as BMP or ZIP files (Templates for reading these files are included with 010 Editor).

A Binary Template looks similar to a C/C++ structure, but is actually run as a program. Every time a variable is declared in a Template, that variable is mapped to a set of hex bytes in a file. Data in the file can then be read or written by modifying the variable. Because the Template is run as a program, if, for, or while statements as well as functions or complex expressions can be used. When a Template is run, the defined variables can be edited using the Template Results, as shown on the left. New Templates can be added to 010 Editor and can even be configured to run automatically when a file is loaded. For more information on Binary Templates see the Binary Templates page.

010EdTemplate3

…”

010 Editor - 010 Editor - Binary Template Archive

“This page contains a repository of Binary Templates for use with 010 Editor. Please feel free to submit any templates you have that may be useful to other people. For more information on templates, see the Binary Templates page. Please review the terms and conditions for using this archive.

image

…”

While not free, though there is a free 30 day trial version, this reasonably priced utility seems officially cool. It’s not the hex editing, but the templating that I find so cool. It adds an additional information layer on top of the raw data you usually see in a hex editor. Best of all, is that the templates are independent of the program. So you can write your own binary file templates.

How often have you written a “viewer/dumper/etc” for some sort of binary file just so you could spelunk its data? Yeah, me too… Now, with this utility, we can just focus on the file format and ignore the UI goo.

A co-worker pointed this out to me as something cool and I had to agree (how cool is that, that some of my co-workers are stumping for the Cool Thing of the Day?… Thanks Jim. ;)

Wednesday, November 12, 2008

RichText Builder – Think StringBuilder for RTF; build a RTF document just like you would build a StringBuilder string

CodeProject - RichText Builder (StringBuilder 4 rtf)

“…

Rich Text is ubiquitous in windows forms applications yet notoriously hard to manipulate programatically. Display of Rich Text is based on the RTF specification (an archaic format dating way back to early windows 3). Parsing Rich Text is beyond the scope of this article. If however you need to build up simple rich text with FontStyle, Font ,Font size Font Colour, Back Colour ,Tables , insert images and merge RTF documents then this little utility may help you.

It is based on the StringBuilder Class Design and Can be used in place of StringBuilder. It will output RTF when ToString() is Called.

Using the code

Create a new RTFBuilder and simply append text in a similar fashion to Stringbuilder usage.

Add Formatting Calls where necessary.

RTFBuilderbase sb = new RTFBuilder();
sb.AppendLine("AppendLine Basic Text");

sb.Append("append text1").Append("append text2").Append("append text3").Append("append text4").AppendLine();

sb.FStyle(FontStyle.Bold).AppendLine("Bold");

sb.FStyle(FontStyle.Italic).AppendLine("Italic");




Also included is a GDFBuilder class which can be used interchangeably with the RtfBuilder(base) in code and will generate Images that can be displayed in a paging image control(included.)



…”




Okay, that’s officially just very darn cool. What a great way to build/generate a RTF document/file.

Tuesday, November 11, 2008

From a Vet to Active Duty, Reserve, National Guard and Vet’s – Thank you

Just a quick note to say, thank you.

As a vet myself, I can’t say how proud I am of you, our American active duty, reserve, national guard and veterans. No matter the service (cough… Army rocks… cough ;) you know more than anyone that freedom is not free. No matter your MOS, every one of you are, or have been, on the front line protecting our freedom, our way of life and, in the end, my friends and family.

Thank you

Monday, November 10, 2008

Save yourself from a “Big R” CLM (Career Limiting Move) – Reply All Information and Confirmation Outlook Macro

Confessions of a Microsoft Consultant - Job/Life/Reputation protector 2.0

“Back in January I posted some simple VBA code for adding an “are you sure?” type question to the Reply To All button in Outlook.  Since then I have received a few suggestions for improving the code, one of the most common of which was to add to the question box the list of names that the mail will be sent to.  So, as requested, you can find below the updated code! 

image_6

Just place this code in a module in Outlook (you can get to the VBA editor by pressing ALT+F11) and then assign it a button on the toolbar

…”

Disabling Reply All can be overkill, but sometimes you also want to sanity check your Reply All too. This little macro/VBA snip can help you with that.

Mix this with a delay sending rule (Outlook's 1-Minute Rule [Auto Defer Email Send for 1 Minute Rule]) and you may save yourself a little future hassle.

 

For more information on “Big R” please see the The Microsoft Lexicon,

Sunday, November 09, 2008

NTrace 1.0 (Beta) Released - Event Tracing for Windows (ETW) for C# Developers

Andy Hopper's Blog - Announcing NTrace v1.0

“I’m pleased to announce the general availability of the NTrace library and preprocessor. NTrace is a combination of a runtime library and a preprocessor that enables you to incorporate the same kind of tracing flexibility and performance that was previously only available to the lucky folks still writing unmanaged code. There are a log of advantages to using NTrace/ETW: higher performance, flexibility, and zero-config tracing.

In terms of performance, we’re talking orders of magnitude faster when no tracing is being performed, and 2-3 faster when tracing is enabled. …

In terms of flexibility, you can configure ETW tracing to log in many different ways: real-time to a console (similar to listening to the OutputDebugString spew), logging to a flat binary file, logging to a binary circular log, and for those with intestinal fortitude, writing a custom ETW listener (we do plan to eventually surface this via the NTrace API as well).

However, I’ve saved the best for last: one of the best features of the ETW tracing APIs is the ability to turn tracing on in your applications without needing to modify any configuration files or restart it …

…”

CodePlexNTrace

“NTrace is a library that provides flexible, high-performance, and zero-config trace logging for your C# applications.

NTrace is currently 100% C#.

…”

NTrace - Using the ETW tracing preprocessor in your Application(PDF)

“What is this ETW thing?
Event Tracing for Windows is a kernel-level tracing service that has been around since Windows 2000. Since it’s baked right into the kernel, it is extremely fast. Most of the developers that use ETW are writing drivers, but why should they have all the fun?

Why should I use ETW?
ETW Tracing has several benefits over the tracing classes provided with the .NET Framework. Most importantly, ETW tracing can be turned on and off without having to restart the application, but it also has features like built-in high performance circular logging (a circular log is one that never grows above a specified size by flushing out older trace messages), and the ability for you to capture the logs from multiple sources into a single trace session.

What is this preprocessor and why do we need it?
Put simply, to maximize application performance when tracing is not enabled. In a perfect world, an application’s performance when tracing is disabled would be identical to one where tracing wasn’t included at all. The problem is that your code is only compiled once; if those trace calls are in there, they’re GOING to get called, and while the ETW functions return quickly when tracing is disabled, the runtime still has to evaluate trace arguments, allocate memory, construct method call stacks, and so on. The application performance would be even faster if the functions were never called in the first place.

…”

Sounds pretty cool. I’m a little bummed that this seems for C# development only (due to the changes in the build process). I’ll be keeping my eye on this anyway, as well as for a way where I can use this (since most of my projects are VB  ;)