diff --git a/Tupfile b/Tupfile index bfc4fc2..e69de29 100644 --- a/Tupfile +++ b/Tupfile @@ -1 +0,0 @@ -: |> license -out hackmii |> LICENSE diff --git a/src/productkey.nim b/src/productkey.nim new file mode 100644 index 0000000..82da359 --- /dev/null +++ b/src/productkey.nim @@ -0,0 +1,18 @@ +import os, posix, streams, strutils + +const fileName = "/sys/firmware/acpi/tables/MSDM" + +if getuid() != 0: + quit "run me as root" + +if not fileName.existsFile: + quit "System has no product key" + +var + fin = fileName.newFileStream fmRead + +discard fin.readAll + +let keyData = fin.readAll + +echo keyData