Hello tp!
I really need some from you guys.
I have a project a .net program that uses a injected.dll(c++)
I have tested out 2 diffrent ways of sending pipedata to my .net app.
Code:
//method1
inline void PipeWrite(Packet* p)
{
CreateThread(NULL, NULL,(LPTHREAD_START_ROUTINE) PipeWriteProc ,(LPVOID)p,0,NULL);
//PipeWriteProc((LPVOID)p);
}
void PipeWriteProc(LPVOID lpParameter)
{
EnterCriticalSection(&PipeWriteCriticalSection);
Packet* packet=(Packet*)lpParameter;
WriteFileEx(pipe, packet->GetPacket(), packet->GetSize(), &overlapped, NULL);
LeaveCriticalSection(&PipeWriteCriticalSection);
}
This method works good, besides it misses hooked packets sometimes.
Code:
inline void PipeWrite(Packet* packet){
//Method from tugbot
if ((*(DWORD*)Consts::Connection) != 8) return;
WriteFileEx(pipe, packet->GetPacket(), packet->GetSize() + 2, &overlapped, NULL);
delete packet;
}
This method is a ripoff from Tugbot. And works well until I relog. Then the client crashes. I Cannot understand why.
I know that Darkstar has encountered this problem before, I can see that in his code.
This project is for an old client version.