Open source Windows 7 product key checker

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

  1. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    987
    60
  2. FreeStyler

    FreeStyler MDL Guru

    Jun 23, 2007
    3,513
    3,670
    120
    #222 FreeStyler, Aug 4, 2012
    Last edited by a moderator: Apr 20, 2017
  3. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    987
    60
  4. djvu61

    djvu61 MDL Novice

    Aug 9, 2012
    10
    2
    0
    thank youu
     
  5. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,814
    45,713
    150
    #225 CODYQX4, Aug 18, 2012
    Last edited: Apr 12, 2019
    .
     
  6. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    987
    60
    CODYQX4....see your PM
     
  7. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,814
    45,713
    150
    #227 CODYQX4, Aug 19, 2012
    Last edited: Apr 12, 2019
    .
     
  8. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,814
    45,713
    150
    #228 CODYQX4, Aug 29, 2012
    Last edited: Apr 12, 2019
    .
     
  9. janek2012

    janek2012 MDL Member

    Dec 29, 2008
    214
    986
    10
    For Windows Vista, 7 and 8, MAK's Edition type is almost (?) always null so my The Ultimate PID Checker (and VAMT too) is getting the Edition from pkconfig's xml data. The easiest way to do so is getting it while looking for product description (see codes posted earlier) and if it's found and your edition is = null, then assign the Edition value from pkconfig xml to your edition variable :)
     
  10. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,814
    45,713
    150
    #230 CODYQX4, Sep 1, 2012
    Last edited: Apr 12, 2019
    .
     
  11. janek2012

    janek2012 MDL Member

    Dec 29, 2008
    214
    986
    10
    #231 janek2012, Sep 2, 2012
    Last edited by a moderator: Apr 20, 2017
    Check the pkeyconfig file (after base64 decode).
    Here is a part of it:
    Code:
    <Configuration>
    <ActConfigId>{949d6b86-bfa7-4ff1-b4df-17e67bb6320d}</ActConfigId> --- Look for this value to get Description and Edition
    <RefGroupId>1785</RefGroupId>
    <EditionId>Professional;ProfessionalN;Enterprise;EnterpriseN</EditionId> --- Grab this value as Edition if it's null
    <ProductDescription>Win 8 RTM Professional;ProfessionalN;Enterprise;EnterpriseN Volume:MAK</ProductDescription> --- Grab this value as Desctiption
    <ProductKeyType>Volume:MAK</ProductKeyType>
    <IsRandomized>false</IsRandomized>
    </Configuration>
    Here is my code for GetDescription + Edition + RefGroupId:
    Code:
    String GetDescription(String aid, String &edi, String pkeyconfig, String &cid)
    {
    CoInitialize(NULL);
    Form5->XMLDocument1->XML->LoadFromFile(pkeyconfig);
    Form5->XMLDocument1->Active = true;
    
       IXMLNode *TempNode = NULL;
    UnicodeString prefix = "";
    aid = ("{"+aid+"}").LowerCase();
    UnicodeString configurations;
    UnicodeString actconfigid;
    UnicodeString editionid;
    UnicodeString productdescription;
    UnicodeString refgroupid;
       if(Form5->XMLDocument1->DocumentElement->ChildNodes->FindNode("r:license"))
       {
       TempNode = Form5->XMLDocument1->DocumentElement->ChildNodes->FindNode("r:license");
       if (TempNode->ChildNodes->FindNode("r:otherInfo")) {
    TempNode = TempNode->ChildNodes->FindNode("r:otherInfo");
    if (TempNode->ChildNodes->First()) {
       TempNode = TempNode->ChildNodes->First();
       if (TempNode->ChildNodes->First()) {
    TempNode = TempNode->ChildNodes->First();
    if (TempNode->ChildNodes->FindNode("tm:infoBin")) {
    TempNode = TempNode->ChildNodes->FindNode("tm:infoBin");
    Form5->XMLDocument1->XML->Text = Form5->IdDecoderMIME1->DecodeString(TempNode->Text);
    TempNode = NULL;
    Form5->XMLDocument1->Active = true;
    if(Form5->XMLDocument1->DocumentElement->ChildNodes->First())
    {
    prefix = StringReplace(Form5->XMLDocument1->DocumentElement->ChildNodes->First()->GetNodeName(), "Configurations", "", TReplaceFlags() << rfReplaceAll << rfIgnoreCase);
    configurations = prefix + "Configurations";
    actconfigid = prefix + "ActConfigId";
    editionid = prefix + "EditionId";
    productdescription = prefix + "ProductDescription";
    refgroupid = prefix + "RefGroupId";
    if (Form5->XMLDocument1->DocumentElement->ChildNodes->FindNode(configurations))
    {
       TempNode =  Form5->XMLDocument1->DocumentElement->ChildNodes->FindNode(configurations);
       int k = TempNode->ChildNodes->Count;
       for (int i = 0; i < k; i++) {
      if (TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(actconfigid))
      {
      if (TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(actconfigid)->Text.LowerCase() == aid) {
      if (TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(editionid))if (edi == "" || TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(editionid)->Text.Pos(edi)) {
    if (edi == "") edi = TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(editionid)->Text;
    if (TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(refgroupid)) {
      cid = TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(refgroupid)->Text;
    }
    return TempNode->ChildNodes->Get(i)->ChildNodes->FindNode(productdescription)->Text;
      }
      }
      } else return " Error - no '"+actconfigid+"'";
       } CoUninitialize(); return "Error - ActivationID Not found";
    } else CoUninitialize(); return "Error - no '"+configurations+"'";
    } else CoUninitialize(); return "Error - no '"+configurations+"' #2";
    } else CoUninitialize(); return "Error - no 'tm:infoBin'";
       } else CoUninitialize(); return "Error - no 'tm:infoList'";
    } else CoUninitialize(); return "Error - no 'tm:infoTables'";
       } else CoUninitialize(); return "Error - no 'r:otherInfo'";
       } else CoUninitialize(); return "Error - no r:license'";
    }
     
  12. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,814
    45,713
    150
    #232 CODYQX4, Sep 3, 2012
    Last edited: Apr 12, 2019
    .
     
  13. SysTec

    SysTec MDL Novice

    Nov 3, 2012
    2
    0
    0
    #233 SysTec, Nov 3, 2012
    Last edited by a moderator: Apr 20, 2017
  14. SysTec

    SysTec MDL Novice

    Nov 3, 2012
    2
    0
    0
    #235 SysTec, Nov 13, 2012
    Last edited by a moderator: Apr 20, 2017
    hi after some trial and error i managed to get most of the setup.exe file somewhat decompiled. but its in c++ and i dont have a lot of experience in it

    here are the segements i found with the word pidkey in it. its probably not enough but i dont know what is needed, i can probably upload the entire thing if someone wants to take a look.

    Code:
    line 130: extern wchar_t aPidkeyElementS[]; // idb
    
    Code:
    extern wchar_t aInvalidPidkeyS[]; // idb
    
    Code:
    extern const WCHAR aPidkey[]; // idb
    
    Code:
      }
    LABEL_46:
      OXmlNode::OXmlNode(&v222);
      LOBYTE(v281) = 99;
      v45 = OString::OString((int)&v247, (int)L"/Configuration/PIDKEY");
      LOBYTE(v281) = 100;
      v46 = OXmlNode::SelectSingleNode((int)&v232, v45, (int)&v222);
      LOBYTE(v281) = 99;
      OString::_OString((int)&v247);
      if ( v46 )
      {
        OString::OString((int)&v246);
        LOBYTE(v281) = 101;
        OString::OString((int)&v259);
        LOBYTE(v281) = 102;
        v47 = OString::OString((int)&v254, (int)L"OEM");
        LOBYTE(v281) = 103;
        v280 = 128;
    
    Code:
     if ( !OString::Empty((int)v270) )      {
            v50 = OString::OString((int)&v243, (int)&dword_3001246C);
            LOBYTE(v281) = 110;
            v51 = OString::OString((int)&v247, (int)L"-");
            LOBYTE(v281) = 111;
            OString::Replace(v270, v51, v50);
            LOBYTE(v281) = 110;
            OString::_OString((int)&v247);
            LOBYTE(v281) = 108;
            OString::_OString((int)&v243);
            v52 = OString::OString((int)&v239, (int)&dword_3001246C);
            LOBYTE(v281) = 112;
            v53 = OString::OString((int)&v247, (int)L" ");
            LOBYTE(v281) = 113;
            OString::Replace(v270, v53, v52);
            LOBYTE(v281) = 112;
            OString::_OString((int)&v247);
            LOBYTE(v281) = 108;
            OString::_OString((int)&v239);
            OString::ToUpper((int)v270, &v256);
            counted_ptr<OString>::_counted_ptr<OString>(&v256);
            v54 = *(_DWORD *)(v3 + 272);
            v273 = 4;
            v272 = (char *)v270;
            (*(void (__cdecl **)(_DWORD, signed int, char *, signed int, int, signed int, signed int, int))(v54 + 4))(
              v270,
              4,
              v274,
              v275,
              v276,
              v277,
              v278,
              v279);
            v55 = OString::Length((int)v270);
            v56 = v55 == 25;
            v57 = 0;
            if ( v55 != 25 )
              goto LABEL_296;
            do
            {
              if ( v57 >= OString::Length((int)v270) )
                break;
              v58 = OString::Char((int)v270, v57);
              v56 = OEnvironment::IsCDKeyDigitValid(v58);
              ++v57;
            }
            while ( v56 );
            if ( v56 )
            {
              v59 = OString::OString((int)&v239, (int)L"PIDKEY element successfully parsed in config.xml");
              LOBYTE(v281) = 114;
            }
            else
            {
    LABEL_296:
              v59 = OString::OString(
                      (int)&v239,
                      (int)L"Invalid pidkey specified in config.xml.  Ignoring value from config.xml");
              LOBYTE(v281) = 115;
            }
            LogLine(1, v59);
            LOBYTE(v281) = 108;
            OString::_OString((int)&v239);
          }
          LOBYTE(v281) = 107;
          OString::_OString((int)v270);
          LOBYTE(v281) = 102;
          OXmlElement::_OXmlElement((int)&v228);
        }
        LOBYTE(v281) = 101;
        OString::_OString((int)&v259);
        LOBYTE(v281) = 99;
        OString::_OString((int)&v246);
        v16 = 1;
      }
      if ( !(_BYTE)i )
      {
    Code:
          || !OString::CompareTo(a1, L"PIDKEY", 0)
    
    probably in this order,
     
  15. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    987
    60
    #236 user_hidden, Nov 24, 2012
    Last edited by a moderator: Apr 20, 2017
    any chance someone can convert this to VBnet ?



     
  16. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    987
    60
  17. PAYMYRENT

    PAYMYRENT MDL Developer

    Jul 28, 2009
    1,462
    419
    60
    cant you just run the main pidgenx function to get that information?
     
  18. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,814
    45,713
    150
    #239 CODYQX4, Nov 24, 2012
    Last edited: Apr 12, 2019
    .
     
  19. PAYMYRENT

    PAYMYRENT MDL Developer

    Jul 28, 2009
    1,462
    419
    60
    its always worked fine for me... but i do use prepackaged dlls from the iso images and also pkeyconfigs from the same sources