欢迎访问 生活随笔!

凯发k8官方网

当前位置: 凯发k8官方网 > 编程语言 > c/c >内容正文

c/c

qqkey获取原理-凯发k8官方网

发布时间:2024/10/8 c/c 0 豆豆
凯发k8官方网 收集整理的这篇文章主要介绍了 qqkey获取原理_获取qqkey源码[c 版] 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

前几天有个人找我用e源码转成c 的   现在共享给大家。

原理很简单  我也是照着别人给我的e源码改的  就是利用iwebbrowser2没什么难度

getqqkeydlg  用qqkey的结构体  里面有qq和key信息

核心代码

typedef struct _qqkey

{

cstring qq;

cstring key;

}qqkey;

bool  cgetqqkeydlg::getqqkeydlg(carray *parray)

{

::coinitialize(null);

hmodule hmodule = loadlibrary(l"atl");

void *funaddr = getprocaddress(hmodule, "atlaxwininit");

_asm call funaddr;

tchar szurl[255] = l"http://xui.ptlogin2.qq.com/cgi-bin/qlogin?domain=qq.com&lang=2052&qtarget=0&jumpname=&ptcss=¶m=u1%3dhttp%253a%252f%252fwww.qq.com%252fqq2012%252floginsuccess.htm&css=&mibao_css=&low_login=0";

hwnd hwnd = createwindowex(512, l"atlaxwin", szurl, 107374182, 10, 10, 300, 100, 0, 0, 0, 0);

if (null == hwnd)

{

::couninitialize();

return false;

}

ccomptr piunknown = null;

int ppiunknown = (int)&piunknown;

hresult hresult;

funaddr = getprocaddress(hmodule, "atlaxgetcontrol");

_asm push ppiunknown;

_asm push hwnd;

_asm call funaddr;

_asm mov hresult, eax;

if (!succeeded(hresult))

{

piunknown.release();

piunknown = null;

::couninitialize();

return false;

}

ccomptr pwebbrowser2 = null;

piunknown->queryinterface(iid_iwebbrowser2, (void **)&pwebbrowser2);

pwebbrowser2->put_silent(true);

readystate readystate;

do

{

pwebbrowser2->get_readystate(&readystate);

processmessagesx();

} while (readystate_complete != readystate);

ccomptr pidispatch = null;

pwebbrowser2->get_document(&pidispatch);

ccomptr pihtmldocument2 = null;

pidispatch->queryinterface(iid_ihtmldocument2, (void **)&pihtmldocument2);

ccomptr phtmlwindow2 = null;

pihtmldocument2->get_parentwindow(&phtmlwindow2);

cstring strjs = l"javascript:for(var c=0;c

variant  ret = { 0 };

ret.vt = vt_empty;

phtmlwindow2->execscript(ccombstr(strjs), l"javascript", &ret);

ccomptr phtmlelement = null;

pihtmldocument2->get_body(&phtmlelement);

ccombstr ccombstr;

phtmlelement->get_innerhtml(&ccombstr);

cstring strtext, strtemptext;

strtext = ccombstr;

qqkey subkey = { 0 };

int npos, nsubpos;

do

{

npos = strtext.find(l"[分]");

strtemptext = strtext.mid(0, npos);

if (!strtemptext.isempty())

{

nsubpos = strtemptext.find(l",");

subkey.qq = strtemptext.left(nsubpos);

subkey.key = strtemptext.mid(nsubpos 1, strtemptext.getlength() - nsubpos);

parray->add(subkey);

}

strtext.delete(0, npos wcslen(l"[分]"));

} while (-1 != strtext.find(l"[分]"));

phtmlelement = null;

phtmlwindow2 = null;

pihtmldocument2 = null;

pidispatch = null;

pwebbrowser2 = null;

piunknown = null;

::sendmessage(hwnd, wm_close, 0, 0);

::couninitialize();

return true;

}

bool  cgetqqkeydlg::processmessagesx(void)

{

msg       msg;

bool   wm_quit = false;

while (::peekmessage(&msg, null, 0, 0, pm_remove))

{

if ((msg.message == wm_quit) || (msg.message == wm_close))

{

wm_quit = true;

break;

}

translatemessage(&msg);

dispatchmessage(&msg);

}

return   wm_quit;

};

总结

以上是凯发k8官方网为你收集整理的qqkey获取原理_获取qqkey源码[c 版]的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得凯发k8官方网网站内容还不错,欢迎将凯发k8官方网推荐给好友。

  • 上一篇:
  • 下一篇:
网站地图