Tuesday, October 4, 2016

How to Find the Windows Product Key

After entering a product key when installing Windows, Microsoft doesn't show it again. We know the product key is stored in the registry at:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId
 
The problem is the product key has to be converted for us to compare it to the original product key on the Windows software package.
This solution will allow you to obtain the product key by creating and executing VB script.
 
1.  Copy and paste the following script into WordPad or NotePad.
(if NotePad removes the hard returns, you may want to use WordPad)
 
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
 
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
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
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function

 

2. Save the document as plain text with a .vbs extension. (very important!)

3. After saving the .vbs script, double click to run or execute the script.

(The product key will display in a pop-up box.)

 

Sunday, May 24, 2015

Data Runs and Signed Integers

After many difficult hours trying to understand this concept, I summarized it in a way I believe will be helpful to others.

Data runs are signed numbers, thus they can take both positive and negative values.  A negative value is determined by the most significant bit (MSB) which is the leftmost bit after a hex number has been converted to binary.  If the MSB is 1, that bit’s value is negative.  If the MSB is 0, the value is positive (or actually zero). 

The offset for the first run will be relative to the start of the file system (sector 0 offset 0), but all subsequent offsets (jump values) will be relative to the previous offset.  The polarity of the jump value ( + or - ) will determine the specific location of the fragment or data run on the disk.  The result is that the disk read and write head may jump forward and backwards to the different file fragments or data runs.  See the image below.
The chart below gives the full explanation.

Best ways to Format an External Drive for Windows and Mac

http://www.cnet.com/how-to/the-best-ways-to-format-an-external-drive-for-windows-and-mac/