Retrieve Microsoft Windows Product Key From ACPI Firmware
You will need the acpica-tools package. Install it with pkg install acpica-tools. Then, run the following command as root:
1 /usr/local/bin/acpidump | awk '/MSDM/,/^$/' | cut -c 60- | tr -d '\n' | grep -Eo '.{29}$'