Changing volume's serial number - Code. Project. Introduction. This article will demonstrate how to change the drive's serial number on three different file systems: FAT, FAT3. NTFS. The article's source code files come with a home made Disk. Sector read/write class for Win.
Nt/2k/XP and Win. The article also comes with a handy dialog based application that allows you change the serial number visually. How it works. Usually, the serial number of a drive is generated every time you format your hard drive and there is no documented way to change it afterwards. It is worthwhile noting that the serial number returned by the "dir" command or the Get. Volume. Information() API is not the hardware serial number that comes from the manufacturer, instead this serial number is assigned and stored in the hard drive (mostly in the boot sector) by the file system and *can* be changed by software. Knowing that the serial number is stored in the hard drive, I started looking up information about the three different file systems: FAT, FAT3. NTFS. The most relevant part to look at was the boot sector format of each of the different file systems.
“Hard Disk Serial Number Changer” is a freeware utility to change the volume serial number of a hard drive. [The hard disk serial number is the volume serial.
There are tons of information about changing your hard disk volume serial number, but not the real one that is hard coded to the HDD. Here we show you that there are. An article showing how to change drive's serial number; Author. Changing volume's serial number. why will someone wanna change HDD serial number on first. Volume Serial Number Editor is a tool to change the hard drive volume serial number. Volume Serial Number Editor is a tool to change the hard drive volume serial number. A volume serial number is a serial number assigned to a disk volume or tape. a volume serial number is a feature used to determine if a disk is present in a.
Usually, the bootsector holds vital data for the integrity and the operation of the file system. Among these fields, we list this table with the fields names, file system and the corresponding offset (in hex) of the field in the boot sector: Table 1. Field/FSFATFAT3. 2NTFSVolume Label 0x. B0x. 47? File system ID0x. Serial number. 0x.
How to get the Hard Drive serial number. Getting HDD serial number. Related. Map Volume Serial Number to physical disk drive. Does anyone know how to change the serial number of. hard drive, serial number. Here is a link explaining exactly how to change the serial nimber of a volume. How to change HDD Volume Serial Number (VolumeID). Option 1: Using Sysinternals VolumeID changer.
For example, we can read an entry of this table as: "In the FAT file system, the 'Serial Number' is stored at offset 0x. It is important to know that the boot sector starts at sector zero and is 5. The next part will explain how the Change. Serial. Number() function can be written. Explaining the code. First, I will explain the code flow: Open the hard drive device in order to read/write sectors.
Read the boot sector. Identify the file system of the drive in question. Modify the serial number field according to the current file system (refer to table 1). Write back the modified boot sector. Close the hard drive device void CVolume. Serial. Dlg: :Change. Serial. Number(DWORD Drive, const DWORD new.
Serial). const max_pbsi = 3. LPSTR Fs; DWORD Fs. Offs; DWORD Serial. Offs; }. partial_boot_sector_info pbsi[max_pbsi] =.
FAT3. 2", 0x. 52, 0x. FAT", 0x. 36, 0x. NTFS", 0x. 03, 0x. TCHAR sz. Drive[1. Sector[5. 12]. sprintf(sz. Drive, "%c: \\", Drive & 0x.
FF). if (! disk. Open(sz. Drive)). Show. Error.
String("Could not open disk!"). Read. Sector(0, Sector)). Show. Error. String("Could not read sector!"). Fs, Sector+pbsi[i]. Fs. Offs, strlen(pbsi[i]. Fs)) == 0). // we found a valid signature. Message. Box(_T("Cannot change serial number of this file system!").
T("Error"), MB_ICONERROR). PDWORD)(Sector+pbsi[i]. Serial. Offs) = new. Serial. // write boot sector. Write. Sector(0, Sector)). Show. Error. String("Could not write sector!"). Show. Error. String("Volume serial number changed successfully!\r".
You might want to restart your system for changes to take effect!"). The core of this function is the 'partial_boot_sector_info/pbsi' table which is built from Table 1. This table will allow us to check what file system this boot sector belongs to and then it allows us to correctly patch the serial number field. It appears that if you change the serial number of an NTFS volume, changes won't take effect until you restart your system. Also note that changing the partition's serial number will render some licensed programs useless, therefore write down the original serial number before attempting to changing it, just in case you wanted to restore it back. Reference. Updatesv. Initial version: only Win.
NT support v. 1. 2. Win. 9x and Win. NT support added. Documented updated. Elias (aka lallousx.
His computer interests include system programming, reverse engineering, writing libraries, tutorials and articles. In his free time, and apart from researching, his favorite reading topics include: dreams, metaphysics, philosophy, psychology and any other human/mystical science. Former employee of Hex- Rays (the creators of IDA Pro), was responsible about many debugger plugins, IDAPython project ownership and what not. Elias currently works at Microsoft as a software security engineer. More articles and blog posts can be found here: - http: //lallousx.
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.