Need some advice - Bios / UEFI

Discussion in 'HW Helpdesk' started by korgh, Nov 25, 2016.

  1. korgh

    korgh Registered User

    Joined:
    May 20, 2009
    Messages:
    134
    Likes Received:
    1,068
    Hi all,

    I need to build an app to read info on some Bios with UEFI and other data liike OEM windows keys (very important) and put the data into DB.
    Basicallly, what is your suggestion: Begin using some VCL (if exist) to do the job or do it coding with WMI calls?
    All help will be appreciated.

    Thanks in advance.


    Cheers
     
  2. Gary

    Gary Moderator Staff Member Moderator V.I.P

    Joined:
    Sep 4, 2009
    Messages:
    11,962
    Likes Received:
    31,601
    As per the Microsoft Windows Desktop licensing terms and conditions, the Retail Product License will be given to the person whereas the OEM Product Key is attached to the machine.
    It is to be noted that the manufactures had stopped pasting their Certificate of Authenticity (COA) sticker, which shows the Windows Product Key on the machine. Now this Product Key is stored in the BIOS/UEFI.

    But, when we activate our windows copy using a product key, the information will be stored inside the Windows Registry.

    Let's get started with Command prompt.

    Run the Command Prompt as Administrator, type the following code snippet and hit Enter.

    Code:
     wmic path softwarelicensingservice get OA3xOriginalProductKey
    Let's try the same with Windows PowerShell.

    Run the Windows PowerShell as Administrator, type the following code snippet and hit Enter.

    Code:
    powershell "(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey"
    You can view the Windows Product Key.
    This will successfully work on Windows 10/ 8.1/ 7/ Vista.

    In Windows 10 the Product key is encrypted and attached to your Microsoft Account and stored in cloud by Microsoft.

    Here is the code in C# how to decode product key in Windows :

    Code:
    https://github.com/mrpeardotnet/WinProdKeyFinder
    Also don't forget that Windows 10 upgrade from previous version of Windows 7/8/8.1 has generic product key that looks like this:
    • Windows 10 Home - YTMG3-N6DKC-DKB77-7M9GH-8HVX7
    • Windows 10 Pro - VK7JG-NPHTM-C97JM-9MPGT-3V66T
    • Windows 10 Home SL- BT79Q-G7N6G-PGBYW-4YWX6-6F4BT
    • Windows 10 Pro VL-MAK - QJNXR-7D97Q-K7WH4-RYWQ8-6MT6Y
    These codes are quite useless because you don't need to enter them. Windows 10 upgraded from previous version are activated using hardware keys and can be clean installed and activated without entering any key during installation process.

    This is the first iteration of my attempt to help you !
     
    Last edited: Nov 26, 2016
    maxibit, Markat, Challenger and 2 others like this.
  3. korgh

    korgh Registered User

    Joined:
    May 20, 2009
    Messages:
    134
    Likes Received:
    1,068
    Thank you, Gary for your fast and usefull reply.
    My main problem is develop a simple application to get BIOS/UEFI info using a USB and record onto DB (for inventary) and later to another main DB. I cannot do it by network because we have many unit offices around the country, so the work will be hard without this. I wrote years ago a similar program using MiTec and D7 but nowadays i've been coding with XE2 and no updated Mitec VCL to this version.
    About Windows Keys: there are some workarounds to get it when exists the registry key and is quite simple to catch but the result show two different keys when there is a BIOS embedded key.
    Using a simple keyfinder and a handy application called RWEverything
    Code:
    http://rweverything.com/
    to open MSDM table we can see how things goes different. The first result using a keyfinder return the same generic key (tested in 4 machines with same manufacturer and different models) but with the MSDM table opened with RWE the real key is shown for each one.
    That is my real problem ...I consider me myself as an "old school" coder but not enough to get back to my old assembler books :)
    Any advice about updated VCL like Mitec for XE2?

    Thanks again for your support

    Cheers
     
    Last edited: Nov 26, 2016
  4. Gary

    Gary Moderator Staff Member Moderator V.I.P

    Joined:
    Sep 4, 2009
    Messages:
    11,962
    Likes Received:
    31,601
    Try this:

    Code:
    https://github.com/christian-korneck/get_win8key
    There is script written in Python to read a preinstalled Windows 8.x OEM license key from a PC's firmware.

    This script tries to read the Windows 8.x key from the PC firmware. (from ACPI -> MSDM table -> byte offset 56 to end).

    Are you exclusively tied to Delphi?
     
    Last edited by a moderator: Nov 26, 2016
    Challenger and korgh like this.
  5. korgh

    korgh Registered User

    Joined:
    May 20, 2009
    Messages:
    134
    Likes Received:
    1,068
    Thanks again, Gary.
    Delphi is my main plataform to coding because i've built my libraries a long time around that IDE and just ported when necesary but i'm not totally tied.
    I will analyse the script and try to tranfer to Delphi. I will post the results soon.
    Thanks again for your support.

    Cheers
     
    Gary likes this.
  6. Gary

    Gary Moderator Staff Member Moderator V.I.P

    Joined:
    Sep 4, 2009
    Messages:
    11,962
    Likes Received:
    31,601
    If you do not have the result I can write functions from scratch in C or C# , but I need a few days because now I have a lot of obligations.

    B4A is a place where we try to help our members in every sense!
     
    maxibit, Markat, Challenger and 2 others like this.
  7. korgh

    korgh Registered User

    Joined:
    May 20, 2009
    Messages:
    134
    Likes Received:
    1,068
    Thank you very much, Gary.
    I don't want overload you but i will really appreciate your help. Take your time whatever you need for it. Your obligations are in #1st place. Also, i will explore some codes and alternatives to do the job and share the results here.
    BA4 is the best place to learn, help each others and meet good people. That is the spirit.
    If i could be usefull in anything, just ask.
    Thanks again.

    Cheers!
     
    Last edited: Nov 26, 2016
    Markat, Challenger and Gary like this.

Share This Page