Open source Windows 7 product key checker

Discussion in 'MDL Projects and Applications' started by Daz, Oct 15, 2009.

  1. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,523
    4,112
    270
  2. urie

    urie retired mod

    May 21, 2007
    8,996
    3,380
    300
    Links are not dead i just tried them do you get to the 2shared web page, look for Save file to your PC: click here
     
  3. kdo2milger

    kdo2milger MDL Senior Member

    Jan 5, 2010
    371
    25
    10
    #163 kdo2milger, Jul 9, 2010
    Last edited: Jul 9, 2010

    Attached Files:

  4. kdo2milger

    kdo2milger MDL Senior Member

    Jan 5, 2010
    371
    25
    10
    uploaded screenshot
     
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,523
    4,112
    270
    lol..But there's no key to check and I was going to try avoid testing all the ultimate keys ;)
     
  6. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Just used it to see if it worked and everything because normally I would use the Magic Jelly Bean but this works fine...
    Validated a Enterprise GVLK key....
     
  7. kdo2milger

    kdo2milger MDL Senior Member

    Jan 5, 2010
    371
    25
    10
    sob!

    nm

    im a tard...

    i thought it would pull up the key you have loaded in the os lol

    its basically a key checker like the link in my sig
     
  8. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,523
    4,112
    270
    Like Smorgan said magic bean works good but it will set off AV's bigtime...lol

    Better to use MasterDisaster's OEm dump tool of which I have no idea it's location ;)
     
  9. kdo2milger

    kdo2milger MDL Senior Member

    Jan 5, 2010
    371
    25
    10
    i just tested a few MAK keys and it worked.

    I tested a Windows Embedded Standard 7 sn and got the invalid serial error.
     
  10. Daz

    Daz MDL Developer

    Jul 31, 2009
    9,523
    67,291
    300
    Some keys work and some don't, it also comes down to the pkeyconfig file your system is using.

    This project was made as an example since the freeware one didn't ever provide it's source. It was easy enough to make so I figured id share the project, it seems like it was of use to a few people too as the code has since been converted and gone into some other peoples projects as well as the really good web based version.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,523
    4,112
    270
    @kdo2milger

    I just tried the OEMdump and it actually dumped my default key so I think it just find keys that are installed ;)
     
  12. kdo2milger

    kdo2milger MDL Senior Member

    Jan 5, 2010
    371
    25
    10
    ya it did the same for me, it dumped my key to a txt file and the cert and bin and put them all in a folder.

    still a nifty tool...
     
  13. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,523
    4,112
    270
    Yea Master D is definitely one of the most gifted and helpful expert programmers here ;)

    Thanks MD for all you help with everyone and even many other developers and their projects.

    Model MDL Citizen ;)
     
  14. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Funny it didn't set of any of my stuff then again I already knew that Magic Jelly Bean key finder was safe anyway...
    Heck that thing works with everything known to man but it doesn't mean I'm gonna praise it as the answer to everything...
    I will give this key finder a chance and i did think it detected the key automatically too ur not the only one...
     
  15. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,523
    4,112
    270

    I didn't say it was unsafe...lol

    Yea it set's Avira on fire...lol

    Key Dump not finder :p
     
  16. qewlpal

    qewlpal MDL Addicted

    Jun 25, 2010
    576
    2,026
    30
    #179 qewlpal, Aug 18, 2010
    Last edited: Aug 18, 2010
    Thanks for pid checker Daz
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. janek2012

    janek2012 MDL Member

    Dec 29, 2008
    214
    996
    10
    #180 janek2012, Oct 23, 2010
    Last edited by a moderator: Apr 20, 2017
    In C++:
    Code:
    // Note that TCHAR map should be set to "wchar_t" or you can change all "WCHAR" instances in code to "wchar_t"
    
    typedef HRESULT (__stdcall *PidGenXFn)
    (
    WCHAR* szProductKey, // Product Key to decode
    WCHAR* szPKeyConfigPath, // Path to "pkeyconfig.xrm-ms"
    WCHAR* szPID, // Microsoft Product ID Family (use "55041")
    void* pUnknown1, // Unknown (use NULL)
    WCHAR* szProductId, // Calculated Product ID ("55041-XXX-XXXXXXX-XXXXX")
    struct DigitalProductId* pDigPid, // Calculated DigitalProductId structure
    struct DigitalProductId4* pDigPid4 // Calculated DigitalProductId4 structure
    );
    
    struct DigitalProductId {
    unsigned int uiSize;
    BYTE bUnknown1[4];
    char szProductId[28];
    char szEditionId[16];
    BYTE bUnknown2[112];
    };
    
    struct DigitalProductId4 {
    unsigned int uiSize;
    BYTE bUnknown1[4];
    WCHAR szAdvancedPid[64];
    WCHAR szActivationId[72];
    WCHAR szEditionType[256];
    BYTE bUnknown2[96];
    WCHAR szEditionId[64];
    WCHAR szKeyType[64];
    WCHAR szEULA[64];
    };
    WCHAR* g_szPKeyConfigPath;
    PidGenXFn g_pPidGenX;
    
    HRESULT __fastcall DecodeKey(String szKey)
    {
    Memo1->Lines->Append("Product Key: " + szKey);
    WCHAR *pkeyconfig;
    WCHAR *lib;
    pkeyconfig = L"pkeyconfig.xrm-ms";
    lib = L"pidgenx.dll";
    // start load
    HMODULE hPidGenX = LoadLibrary(lib);
    if(hPidGenX == NULL)
    {
    Memo1->Lines->Append("Error: Could not load library - file not found?");
    return -1;
    }
    // assuming load succeeded, get the Memo1->Lines->Appendction pointer
    g_pPidGenX = (PidGenXFn)GetProcAddress(hPidGenX, "PidGenX");
    if(g_pPidGenX == NULL)
    {
    Memo1->Lines->Append("Error: Could not load library - wrong file?");
    return -1;
    }
    bool bLastWasComment = false;
    // end load
    
    WCHAR szProductId[24];
    szProductId[0] = L'\0';
    // not really used, as everything is in DigitalProductId4,
    DigitalProductId sDPid;
    sDPid.uiSize = sizeof(DigitalProductId);
    // nearly all the information (apart from Product Id) gets put in this structure
    DigitalProductId4 sDPid4;
    sDPid4.uiSize = sizeof(DigitalProductId4);
    // and finally...
    HRESULT hResult = g_pPidGenX(
    szKey.w_str(), // wchar_t of String with key
    pkeyconfig,  // pkeyconfig file path
    L"XXXXX", // You can put anything here, but in most PID checkers it's "XXXXX"
    NULL, // Unknown (?)
    szProductId,
    &sDPid,
    &sDPid4
    );
    // now interpret the results...
    String szValid;
    switch(hResult)
    {
    case PGX_OK: szValid = "Valid"; break;
    case PGX_INVALIDKEY: szValid = "Invalid"; break;
    case PGX_MALFORMEDKEY: szValid = "Malformed"; break;
    default: szValid = "ERROR"; break;
    }
    Memo1->Lines->Append("Validity: " + szValid); //
    
    if(hResult == PGX_OK)
    {
    Memo1->Lines->Append("Product ID: " + (String)szProductId); // ^^
    Memo1->Lines->Append("AdvID: " + (String)sDPid4.szAdvancedPid);
    Memo1->Lines->Append("Activation ID: " + (String)sDPid4.szActivationId);
    Memo1->Lines->Append("Edition Type: " + (String)sDPid4.szEditionType);
    Memo1->Lines->Append("Edition ID: " + (String)sDPid4.szEditionId);
    Memo1->Lines->Append("Key Type: " + (String)sDPid4.szKeyType);
    Memo1->Lines->Append("EULA: " + (String)sDPid4.szEULA);
    
    // Crypto ID - this is the id of the public key used
    WCHAR szCryptoId[4];
    szCryptoId[0] = L'\0';
    swscanf_s(sDPid4.szAdvancedPid, L"XXXXX-00%3s-%*3s-%*6s-%*2s-%*4s-%*9s-%*7s", szCryptoId, 4);
    Memo1->Lines->Append()"Crypto ID: " + (String)szCryptoId);
    }
    //unload library
    FreeLibrary(hPidGenX);
    return hResult;
    }
    Usage:
    Code:
    String key = Edit1->Text; // where "Edit1->Text" is the key in unicode
    DecodeKey(key); // Show the magic
    // End of the magic
    
    You should change "Memo1->Lines->Append" to your function which will print results on output :)

    Also, remember to change TCHAR map in compiler to wchar_t.