bYesNo := FALSE;
while pImportDesc^.Name <> 0 do
begin
pCode := Pointer(dword(pDosHdr) + pImportDesc^.FirstThunk);
while pCode^ <> nil do
begin
if (pCode^ = pProtoFill) then
begin
VirtualProtect(pCode, 4, PAGE_EXECUTE_READWRITE, @dwOld);
dwAdz := dword(pCode^);
bYesNo := TRUE;
pCode^ := pCallbackFunc;
Result := dwAdz;
end;
pCode := Pointer(dword(pCode) + 4);
end;
pImportDesc := Pointer(dword(pImportDesc) + 20);
end;
if (bYesNo = FALSE) then
begin
Result := 0;
end else
begin
Result := dwAdz;
end;
end;