volumeSerialNumber

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 5 Imported by: 0

README

Volume serial number changer

Changes volumes' serial numbers

Supported file systems

  • FAT12
  • FAT16
  • FAT32
  • exFAT
  • NTFS

Build

To build program change active directory to program and run go build

Short usage guide
Wrong number of arguments
Examples of usage to change volume serial number:
    VolumeID.exe C: 5678-9ABC
Above command changes volume serial number of drive C to 0000-0000-5678-9ABC if C is NTFS volume or to 5678-9ABC if C is FAT12/FAT16/FAT32/EXFAT volume
It's also possible to change NTFS volume serial number to full 8 byte value:
    VolumeID.exe C: 1234-CDEF-5678-9ABC
If C is FAT32 (or similar file system) volume, than it's serial will be changed to 5678-9ABC
Examples of usage to get volume serial number:
    VolumeID.exe C:
Possible output of above command is 1234-AB12

Documentation

Index

Constants

View Source
const (
	FAT_TYPE_UNKNOWN = iota
	FAT_TYPE_FAT12   = iota
	FAT_TYPE_FAT16   = iota
	FAT_TYPE_FAT32   = iota
	FAT_TYPE_EXFAT   = iota
)
View Source
const (
	FILE_SYSTEM_NTFS  = iota
	FILE_SYSTEM_FAT12 = FAT_TYPE_FAT12
	FILE_SYSTEM_FAT16 = FAT_TYPE_FAT16
	FILE_SYSTEM_FAT32 = FAT_TYPE_FAT32
	FILE_SYSTEM_EXFAT = FAT_TYPE_EXFAT
)

Variables

This section is empty.

Functions

func GetFileSystem

func GetFileSystem(firstDiskSector []byte) (file_system int, err error)

func GetVolumeSerialNumber

func GetVolumeSerialNumber(drive string) (volume_sn uint64, err error)

func GetVolumeSerialNumberAddr

func GetVolumeSerialNumberAddr(firstDiskSector []byte) (addr int64, err error)

func GetVolumeSerialNumberSize

func GetVolumeSerialNumberSize(firstDiskSector []byte) (size int64, err error)

func ReadDriveSector

func ReadDriveSector(
	drive string,
	offset int64,
	sectorSize uint64,
) (result []byte, err error)

func SetVolumeSerialNumber

func SetVolumeSerialNumber(drive string, volume_sn uint64) (err error)

func WriteDriveSector

func WriteDriveSector(drive string, offset int64, sector []byte) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL