RedDragon2kx
January 6th, 2005, 09:01 AM
Hi
I've a DLL that gets injectet into another Process by using WriteProcessMemory & CreateRemoteThread. When i inject the DLL into some process (i use calc.exe) the DLL gets connected to the Server. But after connecting no functions are called.
BOOL CDllApp::InitInstance()
{
CWinApp::InitInstance();
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
MessageBox(NULL,"InitInstance","DLL",MB_OK); // Everything works fine and the MessageBox shows up
Connect("192.168.2.244",1400);
....
}
bool CLockDllApp::Connect(CString strHostName, UINT nPort)
{
MessageBox(NULL,"Connect","DLL",MB_OK); //still shows up
m_pClientSocket = new CRescueSocket(this);
m_pClientSocket->Create();
m_pSocketFile = new CSocketFile(m_pClientSocket);
m_pArchiveIn = new CArchive(m_pSocketFile,CArchive::load);
m_pArchiveOut = new CArchive(m_pSocketFile,CArchive::store);
m_pClientSocket->Connect(strHostName,nPort);
MessageBox(NULL,"Connect succed","DLL",MB_OK); // ERROR nothing happens and don't shows up
return true;
}
Here is the code. Has anyone any clue ? Thanks
MFG
RedDragon2kx
I've a DLL that gets injectet into another Process by using WriteProcessMemory & CreateRemoteThread. When i inject the DLL into some process (i use calc.exe) the DLL gets connected to the Server. But after connecting no functions are called.
BOOL CDllApp::InitInstance()
{
CWinApp::InitInstance();
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
MessageBox(NULL,"InitInstance","DLL",MB_OK); // Everything works fine and the MessageBox shows up
Connect("192.168.2.244",1400);
....
}
bool CLockDllApp::Connect(CString strHostName, UINT nPort)
{
MessageBox(NULL,"Connect","DLL",MB_OK); //still shows up
m_pClientSocket = new CRescueSocket(this);
m_pClientSocket->Create();
m_pSocketFile = new CSocketFile(m_pClientSocket);
m_pArchiveIn = new CArchive(m_pSocketFile,CArchive::load);
m_pArchiveOut = new CArchive(m_pSocketFile,CArchive::store);
m_pClientSocket->Connect(strHostName,nPort);
MessageBox(NULL,"Connect succed","DLL",MB_OK); // ERROR nothing happens and don't shows up
return true;
}
Here is the code. Has anyone any clue ? Thanks
MFG
RedDragon2kx