everything was going fine, I made it C#,thing is the msg is not received by my Form's WndProc.
Here's how I find the HWND for my main form:
Code:
MyGlobalStuff.botwindow = (uint)this.Handle;
here's the Form's WndProc(seems to receive all other Msgs all-right)
Code:
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
int i = 0;
if (m.Msg == 0xADDF)
i = 1; //here I put a break-point just for testing
else
base.WndProc(ref m);
}
Target's asm:
Code:
Memory.Asm.AddLine("MOV EAX,[0x{0}]", (codeCave + 0x100 + 0x4).ToString("X"));
Memory.Asm.AddLine("PUSH EAX");
Memory.Asm.AddLine("MOV EAX,[0x{0}]", (codeCave + 0x100 + 0x0).ToString("X"));
Memory.Asm.AddLine("PUSH EAX");
Memory.Asm.AddLine("CALL 0x004C4940", mem_target.ToString("X"));
Memory.Asm.AddLine("ADD ESP, 0x8");
SendResumeMessage();
Memory.Asm.AddLine("RETN");
SendMsg:
Code:
private void SendResumeMessage()
{
Memory.Asm.AddLine("push eax");
Memory.Asm.AddLine("push {0}", 0x10);
Memory.Asm.AddLine("push {0}", 0x10);
Memory.Asm.AddLine("push {0}", 0xADDF);
Memory.Asm.AddLine("push {0}", MyGlobalStuff.botwindow);
Memory.Asm.AddLine("mov eax, {0}", sendmessage);
Memory.Asm.AddLine("call eax");
Memory.Asm.AddLine("pop eax");
}