[Release] Advanced hooking

03/27/2012 09:42 kudo2002#166
how can i send packet to the Client ...

when i do this the client crash

Code:
                int packetAddr = (int)m_dbg.AllocateMemory((uint)packet.Length);
                m_dbg.WriteByteArray(packet, packetAddr);

                using (MemoryStream ms = new MemoryStream())
                using (BinaryWriter writer = new BinaryWriter(ms))
                {
                    // push packet size
                    writer.Write((byte)0x68);
                    writer.Write(packet.Length);

                    // push packet address
                    writer.Write((byte)0x68);
                    writer.Write(packetAddr);
                    
                    // store NetWorkClass address in ESI
                    // ESI 0xBE
                    writer.Write((byte)0xBE);
                    writer.Write(NetworkClass);

                    // store RecvPacket() address in EAX                    
                    writer.Write((byte)0xB8);
                    writer.Write(0x71422F);

                    // call function stored in EAX
                    writer.Write(new byte[] { 0xFF, 0xD0 });

                    // return
                    writer.Write((byte)0xC3);

                    m_dbg.ExecuteCode(ms.ToArray());
                }

                m_dbg.FreeMemory(packetAddr);
03/27/2012 20:52 -Shunsui-#167
Quote:
Originally Posted by kudo2002 View Post
how can i send packet to the Client ...

when i do this the client crash
im trying to figure out the same thing.
#Also does anyone know if when doing something on the client do i have to forward the packets to the server?
03/27/2012 22:42 ruievmonteiro#168
Quote:
Originally Posted by { Angelius } View Post
Happens when you hook Conquer.exe not all the time but it does happen, Conquer starts to run really slow and the cpu usage jumps up.

I`m not sure but i think its related to the AdvancedHooking Library it self So many Exceptions/access validations/etc

And the only way to fix that is by making some changes to the debug loop inside the dll.

Not sure its just a theory. it happens that i`m coding my own hooker lib and same thing happened cept that after handling those Exceptions it went away.
How would I handle these exceptions???
I'm trying to recompile de debug_loop function but I get lots of undefined references for the other functions. What can be the problem?

I'm using Reflector with reflexil plugin
03/27/2012 23:06 { Angelius }#169
@kudo2002
What you posted should send packets to the Server not to the client and to send packets to the client you should look into the receive loop in the client, understand how it works, and then think about sending packets i guess.

@-Shunsui-
I Don't understand your question, are you talking about blocking packets from being sent to the server?

@ruievmonteiro
Handling those exceptions is something that you should be looking up online google it or something.

And the reflector job is to give you an idea of whats going on in side that dll not a copy paste source code.
03/28/2012 01:18 -Shunsui-#170
@Angelius im talking about, When catching the packets that are sent to the server
and recieved from the server, do i have to forward them using SendPacket function.
03/28/2012 05:11 Belth#171
Quote:
Originally Posted by -Shunsui- View Post
@Angelius im talking about, When catching the packets that are sent to the server
and recieved from the server, do i have to forward them using SendPacket function.
No. If you are not blocking packets you do not need to call SendPacket().
03/29/2012 11:39 kudo2002#172
Quote:
Originally Posted by { Angelius } View Post
@kudo2002
What you posted should send packets to the Server not to the client and to send packets to the client you should look into the receive loop in the client, understand how it works, and then think about sending packets i guess.
thank you, could you help I'm still nop in assmebly i can't fully understand those

LOCAL.1
LOCAL.3
what LOCAL mean i can't understand, i googled but with no result .
04/08/2012 19:33 -Shunsui-#173
so how exactly does this loop packet receive work?
04/10/2012 02:34 Belth#174
Quote:
Originally Posted by -Shunsui- View Post
so how exactly does this loop packet receive work?
Check [Only registered and activated users can see links. Click Here To Register...].

For client 5580 the address is 713A7E.
04/14/2012 02:02 xmen01235#175
what is now the new address for send and receive?
04/21/2012 13:06 ruievmonteiro#176
I've been away for a while and now I've noticed that the send and receive functions do not work the same way as before. TQ may have updated the communications module inside the client. Am I right? Does anyone know how these functions work now?
04/21/2012 19:13 { Angelius }#177
The send function is still the same. only its address has changed.
The receive loop has been changed for sure.

private const int SendPacketAddress = 0x6C0A81;
private const int NetworkClass = 0x96FC78;
private const int RecvLoopAddress = 0x6C05E8;

Some of the receive loop:

Ps: the addresses i provided are not an actual calls i only breakpoint at those addresses to pull whatever data i need. but i think its enough to get you started.
04/23/2012 20:29 PKDemon#178
how do you get the address as i have asked but no one has answered me about it an i have been trying to figure it out how to do it but cant figure it out
04/24/2012 21:22 { Angelius }#179
There is a lot of ways to got those addresses and i believe that a few pages back in this thread Belth mentioned a way or 2 on how to find them.

As for how I find them i breakpoint on certain addresses near the win_sock Send/rec calls and trace them back to where they were called from (call stack/call tree) makes it easy as finding a string name.
04/25/2012 05:43 chrisSch#180
I really like this dll, but the "advanced hooking" doesn't attach to new threads, why not ?
Can you add it please, IAmHawtness ?? Or can't you just post the sourcecode please ? with reflector its possible to get it out anyway, but the formatting is lost, also some variable names are missing :/

It's a very important feature for me!

Sorry if i didn't see it, if you already released it :)