Cannot read information from Windows Registry
<p>I would like to print the recent wireless network I used by reading from Windows Registry. I running windows 8. I have the following code but when I run it does not do anything! could you please help in this?</p>

<pre><code>from _winreg import *

def val2addr(val):

    addr = ''

    for ch in val:

        addr += '%02x '% ord(ch)

    addr = addr.strip(' ').replace(' ', ':')[0:17]

    return addr

def printNets():

    print '[+] '

    net = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"+\
          "\NetworkList\Signatures\Unmanaged"
    key = OpenKey(HKEY_LOCAL_MACHINE, net)

    print '\n[*] Networks You have Joined.'

    for i in range(100):
        try:
            guid = EnumKey(key, i)

            netKey = OpenKey(key, str(guid))

            (n, addr, t) = EnumValue(netKey, 5)

            (n, name, t) = EnumValue(netKey, 4)


            macAddr = val2addr(addr)

            netName = str(name)

            print '[+] ' + netName + ' ' + macAddr

            CloseKey(netKey)
        except:

            break

def main():

    printNets()

if __name__ == "__main__":

    main()
</code></pre>

<p>Please have a look here for more precise <a href="http://stackoverflow.com/questions/28128446/how-do-i-use-python-to-retrieve-registry-values">solution explication</a></p>

<pre><code>key = OpenKey(HKEY_LOCAL_MACHINE, net, 0, KEY_READ | KEY_WOW64_64KEY)
</code></pre>

<p>If my understanding is correct it's because you have 32bit Python on 64bit windows</p>

python windows security registry wireless