all Windows 8 OEM need UEFI ?

Discussion in 'Windows 8' started by B8, Oct 14, 2011.

Thread Status:
Not open for further replies.
  1. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    #321 Daz, Nov 14, 2011
    Last edited: Nov 14, 2011
    Yeah. I was able to simply copy code over from the loader, modify it a bit and then I compiled it as a console application.

    It's a test application and I don't know if it will work with all Windows 8 serials, especially ones that start with the letter N.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Jachra

    Jachra MDL Member

    Apr 5, 2010
    184
    55
    10
    Nice. Are you going to share one day how you did it?
     
  3. nononsence

    nononsence MDL Addicted

    Aug 18, 2009
    806
    826
    30
    #323 nononsence, Nov 14, 2011
    Last edited by a moderator: Apr 20, 2017
    @ Daz I was just going to post this
    Code:
    Set WshShell = CreateObject("WScript.Shell")
    MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
    
    Function ConvertToKey(Key)
        Const KeyOffset = 52
    Key(66) = Key(66) And 7
        i = 28
        Chars = "BCDFGHJKMPQRTVWXY2346789"
        Do
            Cur = 0
            x = 14
            Do
                Cur = Cur * 256
                Cur = Key(x + KeyOffset) + Cur
                Key(x + KeyOffset) = (Cur \ 24)
                Cur = Cur Mod 24
                x = x -1
            Loop While x >= 0
            i = i -1
            KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
    If (((29 - i) Mod 6) = 0) And (i <> -1) Then
                i = i -1
            End If
    If (i < 0) Then
    Last = Cur
    End If
        Loop While i >= 0
    keypart1 = Mid(KeyOutput, 2, Last)
    If (Last > 16) Then
    insert = "5"
    Else
    insert = "N"
    End If
    If (WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion") = "6.2") Then
    KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
    End If
    a = Mid(KeyOutput,1,5)
    b = Mid(KeyOutput,6,5)
    c = Mid(KeyOutput,11,5)
    d = Mid(KeyOutput,16,5)
    e = Mid(KeyOutput,21,5)
        ConvertToKey = a & "-" & b & "-" & c & "-" & d & "-" & e
    End Function
    
     
  4. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. nononsence

    nononsence MDL Addicted

    Aug 18, 2009
    806
    826
    30
    #325 nononsence, Nov 14, 2011
    Last edited: Nov 14, 2011
    I broke cleaning out all the MsgBox stuff I added for debugging, updated my post with the fixed code
     
  6. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    #326 Daz, Nov 14, 2011
    Last edited: Nov 14, 2011
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,228
    1,817
    90
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    #328 Daz, Nov 14, 2011
    Last edited: Nov 14, 2011
    @ Stannieman
    This is edited, but I'm not sure. I don't have the other serial in use to test with.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. nononsence

    nononsence MDL Addicted

    Aug 18, 2009
    806
    826
    30
    #329 nononsence, Nov 14, 2011
    Last edited by a moderator: Apr 20, 2017
    I'm not using the value assigned to the key output, I'm using the raw value from the calculation for the position of N or 5.

    added support for pre Win 8 and possibly for adding 5 to the last two blocks of the key (unsure about that tho)
    Code:
    Set WshShell = CreateObject("WScript.Shell")
    MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
    
    Function ConvertToKey(Key)
        Const KeyOffset = 52
    Key(66) = Key(66) And 7
        i = 24
        Chars = "BCDFGHJKMPQRTVWXY2346789"
        Do
            Cur = 0
            x = 14
            Do
                Cur = Cur * 256
                Cur = Key(x + KeyOffset) + Cur
                Key(x + KeyOffset) = (Cur \ 24)
                Cur = Cur Mod 24
                x = x -1
            Loop While x >= 0
            i = i -1
            KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
    If (i < 0) Then
    Last = Cur
    End If
        Loop While i >= 0
    If (WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion") = "6.2") Then
    keypart1 = Mid(KeyOutput, 2, Last)
    If (Last > 15) Then
    insert = "5"
    Else
    insert = "N"
    End If
    KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
    End If
    a = Mid(KeyOutput,1,5)
    b = Mid(KeyOutput,6,5)
    c = Mid(KeyOutput,11,5)
    d = Mid(KeyOutput,16,5)
    e = Mid(KeyOutput,21,5)
        ConvertToKey = a & "-" & b & "-" & c & "-" & d & "-" & e
    End Function
    
     
  10. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    Intesting :g: I think the results could be more accurate than what I was playing with too.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. nononsence

    nononsence MDL Addicted

    Aug 18, 2009
    806
    826
    30
    #331 nononsence, Nov 14, 2011
    Last edited by a moderator: Apr 20, 2017
    Thanks! I'm not sure about the insert 5 thing it seemed natural to assume that if the insert position fell in the range of numbers
    in this line
    Code:
    Chars = "BCDFGHJKMPQRTVWXY2346789"
    
    that a number should be inserted, of course this could be totally wrong.
     
  12. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,228
    1,817
    90
    @ Daz: Where did you get that code from winsetup.dll from? I have a similar problem that could be easily solved by knowing the algorithm.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    #334 Daz, Nov 14, 2011
    Last edited: Nov 15, 2011
    The code I got was from MGADiag. For winsetup.dll it was noticed that it contained "23456789BCDFGHJKMNPQRTVWXYbcdfghjkmnpqrtvwxy" from a hex editor.

    You should be able to drop the DLL into IDA Pro + Hex-Rays.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,228
    1,817
    90
    Ok but wouldn't give IDA me ASM instead of something readable?
    I'll search for a C decompiler, that's going to look a bit better I think?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. Jachra

    Jachra MDL Member

    Apr 5, 2010
    184
    55
    10
    #336 Jachra, Nov 14, 2011
    Last edited by a moderator: Apr 20, 2017
  17. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    #338 CODYQX4, Nov 15, 2011
    Last edited by a moderator: Apr 20, 2017
  18. Jachra

    Jachra MDL Member

    Apr 5, 2010
    184
    55
    10
    @CODYQX4

    Then you use the range 'BCDFGHJKMPQRTVWXY' instead of the range 'ABCDEFGHIJKLMNOPQRSTUVQXYZ'. The last one was what DAZ mentioned in his post. And you subtract 1 from the position?

    I already was thinking about that when I changed nononsence's code.
     
  19. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,282
    300
    #340 Daz, Nov 15, 2011
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...