As I see in the ASM code, I think we only need to patch at 005580F1, from JNZ MSN.005582AC to JMP MSN.005582AC.
The C pesudo-code can be:
Code:
HANDLE hEvent = CreateEvent(NULL, TRUE, FALSE, "MSNMSGR");
if (NULL == hEvent)
goto Error; // At addr 005582B3
else
{
if (ERROR_ALREADY_EXISTS /* = 0xB7 */ != GetLastError())
goto StartNewInstance; // At addr 005582AC
else
{
// Wait until the first instance of MSN exited
if (WAIT_FAILED /* = -1 */ == WaitForSingleObject(hEvent, INFINITE /* = -1 */))
goto Error; // addr 005582B3
FindWindow("MSNMSGRBlObj", NULL);
// ..............
// ..............
}
}
Regards,