|
The Replace tool is used to search and replace a set of bytes within the file. Access the Replace tool from the 'Search > Replace...' menu option, or by pressing Ctrl+R.
Replace Dialog
Specify the data to find in the Find What box at the top of the dialog. The functionality of the Type, Value, and Hex Bytes fields are identical to that of the Find Dialog (see Using Find for more information). Enter the bytes to replace in the Replace With box using a similar method as the Find Dialog.
The button at the top right of the dialog will display Find Next if the Down toggle is selected, or Find Prev if the Up toggle is selected. Click this button to skip to the next occurrence of the Find value without any replacement. Clicking the Replace button will replace the selected bytes if they match, and search for the next occurrence of the target value. Clicking the Replace All button automatically replaces all occurrences of the target value in the file.
Pressing the Start... button begins an interactive replacement of all occurrences of the target value. When performing an interactive replacement, a dialog with the buttons Replace, Skip, Cancel, and Replace All will be displayed. Clicking Replace replaces the current occurrence, Skip skips to the next occurrence without replacing, Replace All replaces all occurrences in the file, and Cancel dismisses the dialog.
All options in the Replace dialog are identical to the Find dialog except for the Pad With Zeros toggle button. When this toggle is enabled, a set of zero bytes will be appended to the replaced hex bytes until the length is the same as the find hex bytes. This feature is useful to replace a string with a shorter string without changing the file length. The Range box is similar in functionality to the Range box of the Find dialog. The Options button is also documented in the Using Find help topic.
Replace Again
After a replacement has been performed, clicking the 'Search > Replace Again' menu option will perform the replacement again. This command, along with the 'Search > Find Next' menu option can be used to step through a file making replacements where necessary.
|