Windows 7 / Getting Started

Using Debugging Utilities

The command line is an admittedly simple place to work from a programming perspective. In fact, using batch files is more along the lines of working with a very simple kind of script, rather than a complex application. Even so, you'll eventually need to perform some kind of debugging. The debugging may involve checking inside a file to ensure you aren't going to execute a virus. You may also have to perform some low-level tasks with very old applications to get them to run in the Server Core environment. The following sections describe the debugging utilities that Server Core makes available for your use.

Examining, Modifying, and Debugging Files with the Debug Utility

Microsoft originally intended the Debug utility to help developers debug assembly language applications. You can still use the utility for that purpose, but the number of assembly language programs still in use is very small. In fact, it's likely that you'll never see an application originally written in assembler.

Fortunately, the Debug utility does have other purposes. For example, you can use it to view hidden information in executable files. Application developers leave many notes inside applications and it's often helpful to view these messages when deciding on the alternative uses of a utility. You can also locate copyright information in files when you want to know more about the file. Sometimes, you can also use the Debug utility to locate information in data files or make quick fixes to damaged data files. Most people refer to this other use for Debug as hex (short for hexadecimal) editing. However, the Debug utility interface is archaic and many people find it hard to use. If you need low-level access to files regularly, you might want to invest in a third-party utility for the task such as XVI32. This utility uses the following syntax:

DEBUG [[drive:][path]filename [testfile-parameters]]

The following list describes each of the command line arguments.

[drive:][path]filename Specifies the name of the file that you want to view, edit, or debug.

testfile-parameters Specifies the command line arguments required by the application you want to test. You never use this second argument to simply view or edit a file.

Converting Executables with the Exe2Bin Utility

The Exe2Bin utility converts an application from the Portable Executable (PE) format to the binary format. The main difference is in how the executable loads. At some time in the past, you needed to use this utility quite often to convert executable files because the linkers of the time didn't provide the required functionality, but now it's a relic that you might never use. The resulting binary file is smaller than the executable and may execute slightly faster. At a time when developers counted individual bits, this utility served an important purpose. This utility uses the following syntax:

EXE2BIN [drive1:][path1]input-file [[drive2:][path2]output-file]

The following list describes each of the command line arguments.

[drive1:][path1]input-file Specifies the location and name of the EXE file you want to convert. If you don't provide drive and path information, the utility assumes that you want to use the current drive and path.

[drive1:][path1]output-file Specifies the location and name of the binary file (usually with a COM extension) that you want to output. If you don't provide drive and path information, the utility assumes that you want to use the current drive and path.

[Previous] [Contents] [Next]