|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
// 拦截 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[0..5] of string;
I: Integer;
str,str1:string;
begin
MAC_S[0]:='1C';
MAC_S[1]:='B7';
MAC_S[2]:='2C';
MAC_S[3]:='DD';
MAC_S[4]:='FF';
MAC_S[5]:='B1';
CopyMemory(@IPAA, pAdapterAddresses, SizeOf(IPAA));
for I := 0 to 5 do
IPAA.PhysicalAddress[I] := StrToInt('$' + MAC_S[I]);
CopyMemory(pAdapterAddresses,@IPAA, SizeOf(IPAA));
Hook[3].UnHook;
Result := TNewGetAdaptersAddresses(Hook[3].BaseAddr)(Family, Flags, Reserved,pAdapterAddresses, pOutBufLen);
Hook[3].Hook;
end;
就大神指点那里写错了拦截到了为什么不能修改MAC返回值还是原来的没变
|
|