MAC网卡HOOK操作工具支持多网卡

易语言 2020-03-20 13:36:05

MAC网卡HOOK操作工具支持多网卡

ret = Call (hook_GetAdaptersAddresses.Func (), Family, Flags, Reserved, AdapterAddresses, SizePointer, , , , , , , , , , )
new_mac = { 102, 102, 102, 102, 102, 102 } ' 新的MAC
.如果真 (ret = #ERROR_SUCCESS)
pAda = AdapterAddresses
nSize = Len_IP_ADAPTER (IPAA)
.判断循环首 (pAda ≠ 0)
RtlMoveMemory_IP_ADAPTER (IPAA, pAda, Len_IP_ADAPTER (IPAA))
' 调试输出 (IPAA.PhysicalAddress)
' Only Feature 这里筛选要修改的网卡
' 如果真 (指针到文本 (IPAA.AdapterName) = “{6C63C579-D84D-4DBC-AB62-31AADE576CDD}”)
.如果真 (IPAA.PhysicalAddressLength = 6)
addr_new_mac = GetPtr_Bin (new_mac, new_mac, 0)
_RtlMoveMemory (pAda + 44, addr_new_mac, 6)
.如果真结束
pAda = IPAA.pNext
.判断循环尾 ()
' 调试输出 (IPAA.PhysicalAddress)