def _netbios_getnode():
 import win32wnet, netbios
 ncb = netbios.NCB()
 ncb.Command = netbios.NCBENUM
 ncb.Buffer = adapters = netbios.LANA_ENUM()
 adapters._pack()
 if (win32wnet.Netbios(ncb) != 0):
  return
 adapters._unpack()
 for i in range(adapters.length):
  ncb.Reset()
  ncb.Command = netbios.NCBRESET
  ncb.Lana_num = ord(adapters.lana[i])
  if (win32wnet.Netbios(ncb) != 0):
   continue
  ncb.Reset()
  ncb.Command = netbios.NCBASTAT
  ncb.Lana_num = ord(adapters.lana[i])
  ncb.Callname = '*'.ljust(16)
  ncb.Buffer = status = netbios.ADAPTER_STATUS()
  if (win32wnet.Netbios(ncb) != 0):
   continue
  status._unpack()
  bytes = status.adapter_address
  return ((((((bytes[0] << 40) + (bytes[1] << 32)) + (bytes[2] << 24)) + (bytes[3] << 16)) + (bytes[4] << 8)) + bytes[5])

def _netbios_getnode ( ) : import win32wnet , netbios ncb = netbios . NCB ( ) ncb . Command = netbios . NCBENUM ncb . Buffer = adapters = netbios . LANA_ENUM ( ) adapters . _pack ( ) if ( win32wnet . Netbios ( ncb ) != 0 ) : return adapters . _unpack ( ) for i in range ( adapters . length ) : ncb . Reset ( ) ncb . Command = netbios . NCBRESET ncb . Lana_num = ord ( adapters . lana [ i ] ) if ( win32wnet . Netbios ( ncb ) != 0 ) : continue ncb . Reset ( ) ncb . Command = netbios . NCBASTAT ncb . Lana_num = ord ( adapters . lana [ i ] ) ncb . Callname = '*' . ljust ( 16 ) ncb . Buffer = status = netbios . ADAPTER_STATUS ( ) if ( win32wnet . Netbios ( ncb ) != 0 ) : continue status . _unpack ( ) bytes = status . adapter_address return ( ( ( ( ( ( bytes [ 0 ] << 40 ) + ( bytes [ 1 ] << 32 ) ) + ( bytes [ 2 ] << 24 ) ) + ( bytes [ 3 ] << 16 ) ) + ( bytes [ 4 ] << 8 ) ) + bytes [ 5 ] )
get the hardware address on windows using netbios calls .