Lab-Project 5: Viewing Segments and Clusters With A Hex Editor
Lab-Project 5: Viewing Segments and Clusters With A Hex Editor
Lab-Project 5: Viewing Segments and Clusters With A Hex Editor
In the "Specify a Disk File" box, accept the default selection and click Finish. In the "Virtual
Machine Settings" box, click OK.
Starting Your Virtual Machine
In the VMware Player window, on the right side, click the "Play virtual machine" link.
Downloading and Installing HxD
In your virtual machine, start a Web browser and go to http://mh-nexus.de/en/hxd
Scroll down and click the "Download page" link. Download and install the English version
of HxD. Accept the default options.
Examining a New Disk
In your virtual machine, if HxD is not open, click Start, "All Programs", "HxD Hex
Editor", HxD.
In HxD, click Extras, "Open disk...".
In the "Open disk" box, in the "Physical disks" section, click "Hard Disk 2", as shown, e.g.
below. Click OK.
HxD shows the contents of the disk, as shown, e.g. below on this page.
Find these things:
• Each horizontal row shows 16 bytes, labeled with the Offset (h) value in hexadecimal
at the top.
• On the left, the byte value is shown in hexadecimal. On the right, it's shown in ASCII.
• Because this is a new hard disk, every byte is zero. There is no information at all on
this disk.
• In the upper right, notice that you are viewing "Sector 0 of 208656". Each sector
contains 512 bytes, so that is a total of 208,656 x 512 bytes = 106,831,872 bytes. This
is approximately 100 million bytes, or 0.1 GB.
Initializing the Disk
In your virtual machine, click Start. Point to "My Computer" and right-click.
Click Manage. In the left pane of "Computer Management", click "Disk Management". The
"Initialize and Convert Disk Wizard" pops up. Click Next, Next, Next, and Finish. This
writes a Master Boot Record to the disk.
The disk should now appear in Disk Management as "Disk 1", containing approximately 100
MB of Unallocated space, as shown, e.g. below.
Scroll down to the end of the first sector, locations 1FE and 1FF, and note that the last two
bytes are 55 and AA, as shown below. Bytes 200 and above still contain zeroes.
The chart below shows the main features of the MBR (from Wikipedia).
In the "Assign Drive Letter or Path" box, accept the default selection of E and click Next.
In the "Format Partition" box, set the "Allocation unit size" to 4096, as shown, e.g. below,
and click Next.
Tap the PageDown key on the keyboard until you reach the end of the SPAM text in this file.
When it was done, the text ended in sector 714, as shown, e.g. in the image below on this
page.
The partition is formatted with 4096-byte clusters, each containing eight 512-byte sectors.
The spam files contain 10,000 characters each, so they occupy three clusters, as shown
below. Look at these clusters and verify that they contain the expected data. Your Sector
numbers might be different, but you should see this pattern of data in 24 sequential sectors.
Reflection
This single image shows three essential concepts:
• Active data: the EGGS text is part of a file referenced in the Master File Table
• RAM Slack: The 22 Zeroes at the end of the EGGS data contain zeroes when written
by modern operating systems. However, in Windows versions prior to Win 95
Version B, this area contained data from RAM, which could potentially contain
passwords or other confidential information.
• File Slack: the SPAM text at the end of the "eggs" file is old data, left within active
clusters
Saving a Screen Image
Make sure your screen shows the three essential items: the EGGS text, the Zeroes, and the
SPAM text.
Click the taskbar at the bottom of your host Windows 7 desktop, to make the host machine
listen to the keyboard, instead of the virtual machine.
Press the PrintScrn key in the upper-right portion of the keyboard. That will copy the whole
desktop to the clipboard.
YOU MUST SUBMIT A FULL-SCREEN IMAGE TO GET FULL CREDIT!
On the host machine, not the virtual machine, open Paint and paste in the image.
Save the image with the filename "Your Name Lab-Proj 5a". Use your real name.
Observing the Sectors
Scroll through the sectors, and make sure they show the pattern shown in the chart below.
Your Sector numbers may be different, but there should be three sequential sectors with these
contents.
Make sure you understand the Terms for each type of data.
Zeroing the Disk
Now we will use a tool that can really erase the disk: DISKPART.
In the Windows XP virtual machine, close all windows, except the HxD window.
Click Start, Run.
In the Run box, type CMD and press the Enter key.
In the Command Prompt window, type this command and then press the Enter key:
DISKPART
In the Command Prompt window, type this command and then press the Enter key:
LIST DISK
You should see two disks, as shown below on this page. Disk 0 is the system disk containing
Windows XP. Disk 1 is the 100 MB disk we want to erase.
In the Command Prompt window, type this command and then press the Enter key:
SELECT DISK 1
Verify that the message says "Disk 1 is now the selected disk." BE CAREFUL when using
this tool--if you erase the wrong disk, it's GAME OVER. In the Command Prompt window,
type this command and then press the Enter key:
CLEAN ALL
Viewing the Zeroed Disk
In HxD, click View, Refresh.
All the SPAM and EGGS text is now gone.
Scroll to the top and observe that the whole disk is empty--even the MBR is gone.
Turning in your Project
Email the image to the instructor as an attachment to an e-mail message.
Send it to: [email protected] with a subject line of "Lab-Proj 5 From Your Name", replacing
"Your Name" with your own first and last name.
Send a Cc to yourself.