Open source Windows 7 product key checker

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

  1. janek2012

    janek2012 MDL Member

    Dec 29, 2008
    214
    996
    10
    #181 janek2012, Sep 19, 2011
    Last edited by a moderator: Apr 20, 2017
    Sorry for the new post but I think it is major update for you.

    I have reflected VAMT 2.0 and updated the DigitalProductId3 and DigitalProductId4 structures as follows:

    Code:
    struct DigitalProductId {
        unsigned int uiSize;
        unsigned short MajorVersion;
        unsigned short MinorVersion;
        char szProductId[24];
        unsigned int uiKeyIdx;
        char szEditionId[16];
        BYTE bCdKey[16];
        unsigned int uiCloneStatus;
        unsigned int uiTime;
        unsigned int uiRandom;
        unsigned int uiLt;
        unsigned int uiLicenseData[2];
        char sOemId[8];
        unsigned int uiBundleId;
        char sHardwareIdStatic[8];
        unsigned int uiHardwareIdTypeStatic;
        unsigned int uiBiosChecksumStatic;
        unsigned int uiVolSerStatic;
        unsigned int uiTotalRamStatic;
        unsigned int uiVideoBiosChecksumStatic;
        char sHardwareIdDynamic[8];
        unsigned int uiHardwareIdTypeDynamic;
        unsigned int uiBiosChecksumDynamic;
        unsigned int uiVolSerDynamic;
        unsigned int uiTotalRamDynamic;
        unsigned int uiVideoBiosChecksumDynamic;
        unsigned int uiCRC32;
    
    };
    
    
    struct DigitalProductId4 {
        unsigned int uiSize;
        unsigned short MajorVersion;
        unsigned short MinorVersion;
        WCHAR szAdvancedPid[64];
        WCHAR szActivationId[64];
        WCHAR szOemID[8];
        WCHAR szEditionType[260];
        BYTE bIsUpgrade;
        BYTE bReserved[7];
        BYTE bCDKey[16];
        BYTE bCDKey256Hash[32];
        BYTE b256Hash[32];
        WCHAR szEditionId[64];
        WCHAR szKeyType[64];
        WCHAR szEULA[64];
    };
    Now all the bytes of these structures are known but some of them are always just NULL so they are not that important.
    I hope you like it

    What is more, PidgenX's 4th argument is known now:
    Code:
    int PidGenX(string productKey, string configFile, string mpc, string oemId, [Out] DigitalProductId2 productId2, [In, Out] DigitalProductId3 productId3, [In, Out] DigitalProductId4 productId4);
    where DigitalProductId2 is just a structure of one String so can be simply replaced with String.
     
  2. ChouseCall

    ChouseCall MDL Novice

    Dec 30, 2011
    1
    1
    0
  3. Daz

    Daz MDL Developer

    Jul 31, 2009
    9,523
    67,291
    300
    Thanks for sharing :)

    When I originally created this thread there were key checkers, although none of them were open source and most of the code floating around was either messy or incomplete. It's been great to see others posting their version of the code and the applications that have been developed in the process.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. FreeStyler

    FreeStyler MDL Guru

    Jun 23, 2007
    3,566
    3,876
    120
  5. Daz

    Daz MDL Developer

    Jul 31, 2009
    9,523
    67,291
    300
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    815
    10
    @FreeStyler Basically you set "magicbyte" nr 42h in the buffer that return DigitalProductId,
    loop decode and append N char if "magicbyte" is set.
     
  7. FreeStyler

    FreeStyler MDL Guru

    Jun 23, 2007
    3,566
    3,876
    120
  8. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,777
    150
    #189 CODYQX4, Apr 25, 2012
    Last edited: Apr 12, 2019
    .
     
  9. FreeStyler

    FreeStyler MDL Guru

    Jun 23, 2007
    3,566
    3,876
    120
  10. janek2012

    janek2012 MDL Member

    Dec 29, 2008
    214
    996
    10
    #191 janek2012, Apr 25, 2012
    Last edited by a moderator: Apr 20, 2017
    My code is way more complicated but this is the most important thing I changed after Windows 8 CP release:
    Code:
    String prefix = StringReplace(Form5->XMLDocument1->DocumentElement->ChildNodes->First()->GetNodeName(), "Configurations", "", TReplaceFlags() << rfReplaceAll << rfIgnoreCase);
    
     //where `Form5->XMLDocument1->DocumentElement->ChildNodes->First()->GetNodeName()` is "pkc:Configurations" or "Configurations"
    
    String configurations = prefix + "Configurations";
    String actconfigid = prefix + "ActConfigId";
    String editionid = prefix + "EditionId";
    String productdescription = prefix + "ProductDescription";
    Note that this is C++ VCL code.

    The idea is simple:
    Let's make a string named prefix. The prefix is everything that stays before "Configurations", "ActConfigId", etc. To check which prefix you should use, open the first node (named for ex. "pkc:Configurations") and assign to prefix its name with replaced "Configurations" with empty string -> prefix == "pkc:" for win7 or "" for win8.
    Use prefix+your_node_name to open next XML nodes.
    I hope you understand what I mean :)
     
  11. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,034
    1,063
    60
    Freestyler,

    in my pidchecker i found that when using the build 8250 xrm-ms along with pidgenx.dll from that build i get the error.
    if using the pidgenx.dll from build 8102 with the Win8CP xrm-ms there is no error.
     
  12. FreeStyler

    FreeStyler MDL Guru

    Jun 23, 2007
    3,566
    3,876
    120
  13. FreeStyler

    FreeStyler MDL Guru

    Jun 23, 2007
    3,566
    3,876
    120
  14. janek2012

    janek2012 MDL Member

    Dec 29, 2008
    214
    996
    10
    #196 janek2012, Apr 28, 2012
    Last edited: Apr 28, 2012
    I think we should create a single post with all the informations needed for coders - reading the whole topic may be a bit difficult, dont you think? :p

    @FreeStyler, yep, I have done it just after the Windows 8 CP release :)
     
  15. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,777
    150
    #197 CODYQX4, Apr 28, 2012
    Last edited: Apr 12, 2019
    .
     
  16. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,034
    1,063
    60
    would be nice in the realm of open source that maybe a few start posting some completed projects of the PID checkers.

    opinions ?
     
  17. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    815
    10
    Or why not just create a wrapper around pidgenx with a defined structure.
    That is if the point is to simplify.
     
  18. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,034
    1,063
    60
    anyone PLEASE care to post the latest win8_8400 + server 2012 pkeyconfig.xrm-ms & pidgenx.dll files for me ?

    :help2: