Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Summpot committed Mar 24, 2024
1 parent 2498677 commit 76114b0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tests/MinHook.Tests/DnsHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ public struct NativeOverlapped
{
if (pName.Contains("pixiv"))
{
var addressInfoEx = new AddressInfoEx();
addressInfoEx.ai_addr->sa_data[0] = 210;
addressInfoEx.ai_addr->sa_data[1] = 140;
addressInfoEx.ai_addr->sa_data[2] = 92;
addressInfoEx.ai_addr->sa_data[3] = 183;
*ppResult = &addressInfoEx;
(*ppResult)->ai_addr->sa_data[0] = 210;
(*ppResult)->ai_addr->sa_data[1] = 140;
(*ppResult)->ai_addr->sa_data[2] = 92;
(*ppResult)->ai_addr->sa_data[3] = 183;
return 0;
}
}
Expand All @@ -107,6 +105,18 @@ public struct NativeOverlapped
void OnComplete(uint error, uint bytes, NativeOverlapped* overlapped)
{
var complete = Marshal.GetDelegateForFunctionPointer<CompletionRoutineDelegate>(lpCompletionRoutine);
if (error != 0)
{
if (pName.Contains("pixiv"))
{
(*ppResult)->ai_addr->sa_data[0] = 210;
(*ppResult)->ai_addr->sa_data[1] = 140;
(*ppResult)->ai_addr->sa_data[2] = 92;
(*ppResult)->ai_addr->sa_data[3] = 183;
overlapped->Pointer = ppResult;
complete(0, 0, overlapped);
}
}
complete(error, bytes, overlapped);
}
}
Expand Down

0 comments on commit 76114b0

Please sign in to comment.