Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
tjfromparis
y'a ca (pas testé) : faut juste faire la conversion :)
ManagementObjectSearcher mos = null; // WHERE Manufacturer!='Microsoft' removes all of the // Microsoft provided virtual adapters like tunneling, miniports, and Wide Area Network adapters. mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft'");
// Trying the ConfigManagerErrorCode and NetConnectionStatus variations // proved to still not be enough and it returns adapters installed by // the virtualization software like VMWare and VirtualBox // ConfigManagerErrorCode = 0 -> Device is working properly. This covers enabled and/or disconnected devices // ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0 -> Device is disabled and Disconnected. // Some virtual devices report ConfigManagerErrorCode = 22 (disabled) and some other NetConnectionStatus than 0 mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft' AND (ConfigManagerErrorCode = 0 OR (ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0))");
// Final solution with filtering on the Manufacturer and PNPDeviceID not starting with "ROOT" // Physical devices have PNPDeviceID starting with "PCI" or something else besides "ROOT" mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft' AND NOT PNPDeviceID LIKE 'ROOT%'"); // Get the physical adapters and sort them by their index. // This is needed because they're not sorted by default IList<ManagementObject> managementObjectList = mos.Get() .Cast<ManagementObject>() .OrderBy(p => Convert.ToUInt32(p.Properties["Index"].Value)) .ToList();
// Let's just show all the properties for all physical adapters. foreach (ManagementObject mo in managementObjectList) { foreach (PropertyData pd in mo.Properties) Console.WriteLine(pd.Name + ": " + (pd.Value ?? "N/A")); }
On 14 déc, 09:48, Dexw wrote:
Bonjour,
Est-il possible avec Windev ou une API de contrôler si l'adresse MAC est physique ou virtuelle ?
Le but étant de protéger un programme contre la copie.
Merci.
y'a ca (pas testé) :
faut juste faire la conversion :)
ManagementObjectSearcher mos = null;
// WHERE Manufacturer!='Microsoft' removes all of the
// Microsoft provided virtual adapters like tunneling, miniports, and
Wide Area Network adapters.
mos = new ManagementObjectSearcher(@"SELECT *
FROM Win32_NetworkAdapter
WHERE Manufacturer !=
'Microsoft'");
// Trying the ConfigManagerErrorCode and NetConnectionStatus
variations
// proved to still not be enough and it returns adapters installed by
// the virtualization software like VMWare and VirtualBox
// ConfigManagerErrorCode = 0 -> Device is working properly. This
covers enabled and/or disconnected devices
// ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0 -> Device
is disabled and Disconnected.
// Some virtual devices report ConfigManagerErrorCode = 22 (disabled)
and some other NetConnectionStatus than 0
mos = new ManagementObjectSearcher(@"SELECT *
FROM Win32_NetworkAdapter
WHERE Manufacturer !=
'Microsoft'
AND
(ConfigManagerErrorCode = 0
OR
(ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0))");
// Final solution with filtering on the Manufacturer and PNPDeviceID
not starting with "ROOT"
// Physical devices have PNPDeviceID starting with "PCI" or something
else besides "ROOT"
mos = new ManagementObjectSearcher(@"SELECT *
FROM Win32_NetworkAdapter
WHERE Manufacturer !=
'Microsoft'
AND NOT PNPDeviceID LIKE
'ROOT\%'");
// Get the physical adapters and sort them by their index.
// This is needed because they're not sorted by default
IList<ManagementObject> managementObjectList = mos.Get()
.Cast<ManagementObject>()
.OrderBy(p =>
Convert.ToUInt32(p.Properties["Index"].Value))
.ToList();
// Let's just show all the properties for all physical adapters.
foreach (ManagementObject mo in managementObjectList)
{
foreach (PropertyData pd in mo.Properties)
Console.WriteLine(pd.Name + ": " + (pd.Value ?? "N/A"));
}
On 14 déc, 09:48, Dexw <d.lave...@posilog.fr> wrote:
Bonjour,
Est-il possible avec Windev ou une API de contrôler si l'adresse MAC
est physique ou virtuelle ?
Le but étant de protéger un programme contre la copie.
y'a ca (pas testé) : faut juste faire la conversion :)
ManagementObjectSearcher mos = null; // WHERE Manufacturer!='Microsoft' removes all of the // Microsoft provided virtual adapters like tunneling, miniports, and Wide Area Network adapters. mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft'");
// Trying the ConfigManagerErrorCode and NetConnectionStatus variations // proved to still not be enough and it returns adapters installed by // the virtualization software like VMWare and VirtualBox // ConfigManagerErrorCode = 0 -> Device is working properly. This covers enabled and/or disconnected devices // ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0 -> Device is disabled and Disconnected. // Some virtual devices report ConfigManagerErrorCode = 22 (disabled) and some other NetConnectionStatus than 0 mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft' AND (ConfigManagerErrorCode = 0 OR (ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0))");
// Final solution with filtering on the Manufacturer and PNPDeviceID not starting with "ROOT" // Physical devices have PNPDeviceID starting with "PCI" or something else besides "ROOT" mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft' AND NOT PNPDeviceID LIKE 'ROOT%'"); // Get the physical adapters and sort them by their index. // This is needed because they're not sorted by default IList<ManagementObject> managementObjectList = mos.Get() .Cast<ManagementObject>() .OrderBy(p => Convert.ToUInt32(p.Properties["Index"].Value)) .ToList();
// Let's just show all the properties for all physical adapters. foreach (ManagementObject mo in managementObjectList) { foreach (PropertyData pd in mo.Properties) Console.WriteLine(pd.Name + ": " + (pd.Value ?? "N/A")); }
On 14 déc, 09:48, Dexw wrote:
Bonjour,
Est-il possible avec Windev ou une API de contrôler si l'adresse MAC est physique ou virtuelle ?
Le but étant de protéger un programme contre la copie.
Merci.
Fredo
Le 14/12/2011 11:54, a écrit :
y'a ca (pas testé) : faut juste faire la conversion :)
ManagementObjectSearcher mos = null; // WHERE Manufacturer!='Microsoft' removes all of the // Microsoft provided virtual adapters like tunneling, miniports, and Wide Area Network adapters. mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer ! > 'Microsoft'");
// Trying the ConfigManagerErrorCode and NetConnectionStatus variations // proved to still not be enough and it returns adapters installed by // the virtualization software like VMWare and VirtualBox // ConfigManagerErrorCode = 0 -> Device is working properly. This covers enabled and/or disconnected devices // ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0 -> Device is disabled and Disconnected. // Some virtual devices report ConfigManagerErrorCode = 22 (disabled) and some other NetConnectionStatus than 0 mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer ! > 'Microsoft' AND (ConfigManagerErrorCode = 0 OR (ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0))");
// Final solution with filtering on the Manufacturer and PNPDeviceID not starting with "ROOT" // Physical devices have PNPDeviceID starting with "PCI" or something else besides "ROOT" mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer ! > 'Microsoft' AND NOT PNPDeviceID LIKE 'ROOT%'"); // Get the physical adapters and sort them by their index. // This is needed because they're not sorted by default IList<ManagementObject> managementObjectList = mos.Get() .Cast<ManagementObject>() .OrderBy(p => Convert.ToUInt32(p.Properties["Index"].Value)) .ToList();
// Let's just show all the properties for all physical adapters. foreach (ManagementObject mo in managementObjectList) { foreach (PropertyData pd in mo.Properties) Console.WriteLine(pd.Name + ": " + (pd.Value ?? "N/A")); }
On 14 déc, 09:48, Dexw wrote:
Bonjour,
Est-il possible avec Windev ou une API de contrôler si l'adresse MAC est physique ou virtuelle ?
Le but étant de protéger un programme contre la copie.
Merci.
Dans le même sujet, qu'en est-il des utilitaires qui permettent de changer l'adresse Mac d'une carte réseau à la volé (trouvé en 30secondes sur le net)
Nous ne nous sommes pas basés sur l'adresse mac pour calculer notre clé de protection car nous n'arrivons pas à lire l'adresse "réelle" de la carte mais uniquement celle "édité" ... elle doit pourtant toujours être la car on peut remettre l'adresse d'origine.
Bon dev,
Fred
Le 14/12/2011 11:54, tjfromparis@gmail.com a écrit :
y'a ca (pas testé) :
faut juste faire la conversion :)
ManagementObjectSearcher mos = null;
// WHERE Manufacturer!='Microsoft' removes all of the
// Microsoft provided virtual adapters like tunneling, miniports, and
Wide Area Network adapters.
mos = new ManagementObjectSearcher(@"SELECT *
FROM Win32_NetworkAdapter
WHERE Manufacturer ! > 'Microsoft'");
// Trying the ConfigManagerErrorCode and NetConnectionStatus
variations
// proved to still not be enough and it returns adapters installed by
// the virtualization software like VMWare and VirtualBox
// ConfigManagerErrorCode = 0 -> Device is working properly. This
covers enabled and/or disconnected devices
// ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0 -> Device
is disabled and Disconnected.
// Some virtual devices report ConfigManagerErrorCode = 22 (disabled)
and some other NetConnectionStatus than 0
mos = new ManagementObjectSearcher(@"SELECT *
FROM Win32_NetworkAdapter
WHERE Manufacturer ! > 'Microsoft'
AND
(ConfigManagerErrorCode = 0
OR
(ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0))");
// Final solution with filtering on the Manufacturer and PNPDeviceID
not starting with "ROOT"
// Physical devices have PNPDeviceID starting with "PCI" or something
else besides "ROOT"
mos = new ManagementObjectSearcher(@"SELECT *
FROM Win32_NetworkAdapter
WHERE Manufacturer ! > 'Microsoft'
AND NOT PNPDeviceID LIKE
'ROOT\%'");
// Get the physical adapters and sort them by their index.
// This is needed because they're not sorted by default
IList<ManagementObject> managementObjectList = mos.Get()
.Cast<ManagementObject>()
.OrderBy(p =>
Convert.ToUInt32(p.Properties["Index"].Value))
.ToList();
// Let's just show all the properties for all physical adapters.
foreach (ManagementObject mo in managementObjectList)
{
foreach (PropertyData pd in mo.Properties)
Console.WriteLine(pd.Name + ": " + (pd.Value ?? "N/A"));
}
On 14 déc, 09:48, Dexw<d.lave...@posilog.fr> wrote:
Bonjour,
Est-il possible avec Windev ou une API de contrôler si l'adresse MAC
est physique ou virtuelle ?
Le but étant de protéger un programme contre la copie.
Merci.
Dans le même sujet, qu'en est-il des utilitaires qui permettent de
changer l'adresse Mac d'une carte réseau à la volé (trouvé en 30secondes
sur le net)
Nous ne nous sommes pas basés sur l'adresse mac pour calculer notre clé
de protection car nous n'arrivons pas à lire l'adresse "réelle" de la
carte mais uniquement celle "édité" ... elle doit pourtant toujours être
la car on peut remettre l'adresse d'origine.
y'a ca (pas testé) : faut juste faire la conversion :)
ManagementObjectSearcher mos = null; // WHERE Manufacturer!='Microsoft' removes all of the // Microsoft provided virtual adapters like tunneling, miniports, and Wide Area Network adapters. mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer ! > 'Microsoft'");
// Trying the ConfigManagerErrorCode and NetConnectionStatus variations // proved to still not be enough and it returns adapters installed by // the virtualization software like VMWare and VirtualBox // ConfigManagerErrorCode = 0 -> Device is working properly. This covers enabled and/or disconnected devices // ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0 -> Device is disabled and Disconnected. // Some virtual devices report ConfigManagerErrorCode = 22 (disabled) and some other NetConnectionStatus than 0 mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer ! > 'Microsoft' AND (ConfigManagerErrorCode = 0 OR (ConfigManagerErrorCode = 22 AND NetConnectionStatus = 0))");
// Final solution with filtering on the Manufacturer and PNPDeviceID not starting with "ROOT" // Physical devices have PNPDeviceID starting with "PCI" or something else besides "ROOT" mos = new ManagementObjectSearcher(@"SELECT * FROM Win32_NetworkAdapter WHERE Manufacturer ! > 'Microsoft' AND NOT PNPDeviceID LIKE 'ROOT%'"); // Get the physical adapters and sort them by their index. // This is needed because they're not sorted by default IList<ManagementObject> managementObjectList = mos.Get() .Cast<ManagementObject>() .OrderBy(p => Convert.ToUInt32(p.Properties["Index"].Value)) .ToList();
// Let's just show all the properties for all physical adapters. foreach (ManagementObject mo in managementObjectList) { foreach (PropertyData pd in mo.Properties) Console.WriteLine(pd.Name + ": " + (pd.Value ?? "N/A")); }
On 14 déc, 09:48, Dexw wrote:
Bonjour,
Est-il possible avec Windev ou une API de contrôler si l'adresse MAC est physique ou virtuelle ?
Le but étant de protéger un programme contre la copie.
Merci.
Dans le même sujet, qu'en est-il des utilitaires qui permettent de changer l'adresse Mac d'une carte réseau à la volé (trouvé en 30secondes sur le net)
Nous ne nous sommes pas basés sur l'adresse mac pour calculer notre clé de protection car nous n'arrivons pas à lire l'adresse "réelle" de la carte mais uniquement celle "édité" ... elle doit pourtant toujours être la car on peut remettre l'adresse d'origine.