-
Member
Selecting target by GUID
I'm trying to target a unit by GUID using the following function:
Code:
00524BF0 CGGameUI__Target
I'm using the following code, based on some pieces of code I found on this forum:
Code:
public static void SelectTarget( ulong guid )
{
Wow.SuspendThread(Wow.ThreadHandle);
uint codecave = Wow.AllocateMemory(),
dwHiWord = (uint)(guid >> 32),
dwLoWord = (uint)guid;
Wow.Asm.Clear();
Wow.Asm.AddLine("MOV EAX, 0x{0}", dwHiWord.ToString("X"));
Wow.Asm.AddLine("PUSH EAX");
Wow.Asm.AddLine("MOV EAX, 0x{0}", dwLoWord.ToString("X"));
Wow.Asm.AddLine("PUSH EAX");
Wow.Asm.AddLine("CALL 0x00524BF0");
Wow.Asm.AddLine("ADD ESP, 0x08");
Wow.Asm.AddLine("RETN");
Wow.Asm.InjectAndExecute(codecave);
Wow.FreeMemory(codecave);
Wow.ResumeThread();
}
Wow throws a critical error when I call the SelectTarget function. I have verified that the GUID I pass to the function is a valid one. I'm still learning, and not really good on this topic yet. Could anyone point me to my mistake(s)? Thanks!
-
Elite User
You are not doing this in the main thread. That's your mistake.
[16:15:41] Cypher: caus the CPU is a dick
[16:16:07] kynox: CPU is mad
[16:16:15] Cypher: CPU is all like
[16:16:16] Cypher: whatever, i do what i want
-
Member
I'm using BlackMagic:
Code:
public bool OpenProcessAndThread(int dwProcessId)
Member of Magic.BlackMagic
Summary:
Opens a process and its main thread for manipulation.
Parameters:
dwProcessId: Id of the target process.
I assumed that I was already going from the main thread.
-
Active Member
Oh... It's "running" in the main thread, not just grab the handle of it...
You have to hook the EndScene and poke your code there to be executed by DX3D
-
Corporal
You should just create a delegate for the SelectTarget function and call it like a normal function instead of dealing with assembly imho.
-
Originally Posted by
RedArray
You should just create a delegate for the SelectTarget function and call it like a normal function instead of dealing with assembly imho.
I don't think he's inprocess
-
Post Thanks / Like - 1 Thanks
themaster (1 members gave Thanks to miceiken for this useful post)
-
Corporal
Originally Posted by
miceiken
I don't think he's inprocess

Oh thought BlackMagic was the in-process version. I dunno maybe not. If I recall there is two versions of basically the same thing. Ones in-process the other out.
-
Originally Posted by
RedArray
Oh thought BlackMagic was the in-process version. I dunno maybe not. If I recall there is two versions of basically the same thing. Ones in-process the other out.
Nah, BlackMagic is an oop memory reading library
-
Kynox's Sister's Pimp
Originally Posted by
RedArray
Oh thought BlackMagic was the in-process version. I dunno maybe not. If I recall there is two versions of basically the same thing. Ones in-process the other out.
You're thinking of WhiteMagic by Apoc.
-
Corporal
Originally Posted by
Cypher
You're thinking of WhiteMagic by Apoc.
Ah yeah that's what it was. My bad.