0
나는 C#에서 dll injection soft로 작업 중이다. 주입 된 dll은 또한 C#에 있으며 특정 시스템 기능을 위해 pinvoke를 사용하고있다.hooking extTextOut problems
extTextOut을 사용할 때 문자열에 스크램블이 생기고 선이 서로 섞이도 록 무엇이 잘못 되었나요? 또 다른 질문 내가 수도 경우
try
{
CreateFileHook = LocalHook.Create(
LocalHook.GetProcAddress("gdi32.dll", "ExtTextOutW"),
new DExtTextOutW(ExtTextOutW_Hooked),
this);
CreateFileHook.ThreadACL.SetExclusiveACL(new Int32[1]);
}
내 extTextOut 방법은
[DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
static extern bool ExtTextOutW(IntPtr hdc,
int X,
int Y,
uint fuOptions,
[In] ref RECT lprc,
string lpString,
uint cbCount,
[In] IntPtr lpDx);
static bool ExtTextOutW_Hooked(
IntPtr hdc,
int X,
int Y,
uint fuOptions,
[In] ref RECT lprc,
string lpString,
uint cbCount,
[In] IntPtr lpDx)
{
try
{
DemoInjection This = (DemoInjection)HookRuntimeInfo.Callback;
lock (This.Queue)
{
This.Queue.Push(lpString);
}
}
catch
{
}
return ExtTextOutW(
hdc,
X,
Y,
fuOptions,
ref lprc,
lpString,
cbCount,
lpDx
);
}
되고 :
나는 extTextOut이 같은 codeplex.com에서 EasyHook를 사용하여 중독. 어떻게하면 초점이 맞지 않거나 최소화 된 창을 지속적으로 모니터링 할 수 있습니까? (이 방법을 사용하면 올바르게 작동하지 않습니다)고마워요!
지금은 동일한 문제가 만료되었습니다. ExtTextOutW 함수에 매개 변수를 전달하는 경우에도 hooked 프로그램에 여전히 문제가 있습니다 - 라틴 텍스트 대신 몇 가지 상형 문자가 표시됩니다. 물론, 문제는 MarshalAs가 CLR 문자열로 변환하는 동안 소스 데이터에서 무언가를 변경한다는 것입니다. Glyphs 플래그가 설정되어있을 때만 문제가 발생합니다. 그렇지 않으면 훅이 제대로 작동하고 훅으로 연결된 텍스트가 손상되지 않습니다. –