21

I have a dual boot windows 8 and Ubuntu on my Laptop.

Is it possible to read the Windows licence key under ubuntu? (I guess it is hidden in the Windows registry somehow)

rubo77
  • 31,573
  • 49
  • 159
  • 281
  • Is it a UEFI system, If so, It's probably in the UEFT Key memory? – Amith KK Feb 22 '14 at 08:43
  • Yes, it is an UEFI System. I already found it and posted the ansewer below ;) – rubo77 Feb 22 '14 at 09:03
  • 2
    Reviewers: This is not off-topic. It is about using Ubuntu to find information in a Windows installation. Perfectly fine. – Seth Feb 22 '14 at 19:24
  • Agreed, this is on-topic, *especially* considering it appears that this may *really* be about reading ACPI information from firmware storage: this information isn't even stored inside what most of us would think of as the Windows system. – Eliah Kagan Feb 22 '14 at 23:31

4 Answers4

36

I found it here. The key seems to be stored in the ACPI-firmware:

sudo strings /sys/firmware/acpi/tables/MSDM

Which gave me the following results:

MSDMU
LENOVOCB-01   
ACPI
#####-#####-#####-#####-#####

(I replaced the product key with #)

pipe into | tail -n1 if you need only the key as output.

rubo77
  • 31,573
  • 49
  • 159
  • 281
3

If your HD is broken and need to install on a new HD or just want to know the key without an HD, this may help you:

sudo acpidump > myhiddenkey.txt

after that, search in your HOME folder the .txt file you just created. Press F3 to search within the file the word "MSDM" and bingo!

If you do not have acpmdump yet, time to install it using

sudo apt-get install acpidump

It worked on my Live pendrive of Ubuntu 14.04 LTS on Positivo notebook. The key was of a Windows 8 Single-language.

rubo77
  • 31,573
  • 49
  • 159
  • 281
  • Ops, i forgot. The reason to output on a txt file is because the terminal window may not support so many lines of text. – Paulo Sérgio Motoyama Jr. Sep 22 '15 at 16:09
  • The result is some 8 lines after the occurrrence of "MSDM" so this will show the key: `sudo acpidump|grep MSDM -A8` without using a textfile – rubo77 Sep 23 '15 at 22:32
  • 1
    `acpidump` has the option `-n` to select only one part. This will output the key in one line: `sudo acpidump -n msdm | cut -c58-|xargs|tr -d " " ` – rubo77 Sep 24 '16 at 08:31
  • is there a way to know which version of windows it belongs to? 8 or 8.1? or it doesn't matter? I don't want to use 3rd party checkers – Dreaded semicolon Nov 02 '16 at 08:57
  • any help doing this with acpidump in FreeBSD? the tool is quite different. – Hakim May 25 '21 at 13:25
1

Got another one to add on to the last command that helped me:

sudo acpidump|grep MSDM -A6|cut -c58- |xargs | tr -d " " | grep -oP '[^.]+$'

I'm not sure if the string is definitely at the end, but that's how I extracted the key itself.

edwinksl
  • 23,569
  • 16
  • 74
  • 100
Jeremy
  • 11
  • 1
  • Always treat your answer as the only true answer. – rubo77 Sep 24 '16 at 05:00
  • To make this a good answer, add that the exact position could differ on other systems. This will select exact 6 lines after finding MSDN in the output, which is in HEX – rubo77 Sep 24 '16 at 08:15
  • you can use `acpidump -n msdm` instead of `sudo acpidump|grep MSDM -A6` – rubo77 Sep 24 '16 at 08:31
1

A slight refinement on the accepted answer. This will only print the key:

sudo strings /sys/firmware/acpi/tables/MSDM | grep .*-.*-.*-.*-.*
freshnewpage
  • 111
  • 2
  • 1
    better use `sudo strings /sys/firmware/acpi/tables/MSDM |tail -n1` (in the rare case your vender name fits to your grep regex) – rubo77 Jul 02 '17 at 10:21