jjhcctv 发表于 2019-7-13 02:25:48

HOOK GetAdaptersAddresses

// 拦截 GetAdaptersAddresses
function NewGetAdaptersAddresses(Family:Cardinal; Flags:Cardinal; Reserved:Pointer; pAdapterAddresses:PIP_ADAPTER_ADDRESSES; pOutBufLen: PULONG): THandle; stdcall;
type
TNewGetAdaptersAddresses = function(Family: Cardinal; Flags:Cardinal; Reserved:Pointer; pAdapterAddresses:PIP_ADAPTER_ADDRESSES; pOutBufLen: PULONG) : THandle; stdcall;
var
lodsiz: Integer;
IPAA: IP_ADAPTER_ADDRESSES;
MAC_S: array of string;
I: Integer;
str,str1:string;
begin
   MAC_S:='1C';
   MAC_S:='B7';
   MAC_S:='2C';
   MAC_S:='DD';
   MAC_S:='FF';
   MAC_S:='B1';
   CopyMemory(@IPAA, pAdapterAddresses, SizeOf(IPAA));
   for I := 0 to 5 do
       IPAA.PhysicalAddress := StrToInt('$' + MAC_S);
   CopyMemory(pAdapterAddresses,@IPAA, SizeOf(IPAA));
   Hook.UnHook;
   Result := TNewGetAdaptersAddresses(Hook.BaseAddr)(Family, Flags, Reserved,pAdapterAddresses, pOutBufLen);
   Hook.Hook;
end;

就大神指点那里写错了拦截到了为什么不能修改MAC返回值还是原来的没变




jjhcctv 发表于 2019-7-13 13:24:09

??????没有回我吗
页: [1]
查看完整版本: HOOK GetAdaptersAddresses