??xml version="1.0" encoding="utf-8" standalone="yes"?>久久人人超碰,国产精品成人一区,aaa日本高清在线播放免费观看http://www.aygfsteel.com/wintys/category/38355.htmlzh-cnMon, 12 Oct 2009 09:51:16 GMTMon, 12 Oct 2009 09:51:16 GMT60[原]易Windows密码查看?/title><link>http://www.aygfsteel.com/wintys/archive/2009/10/10/cpp_passwordviewer.html</link><dc:creator>天堂露珠</dc:creator><author>天堂露珠</author><pubDate>Fri, 09 Oct 2009 16:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/wintys/archive/2009/10/10/cpp_passwordviewer.html</guid><wfw:comment>http://www.aygfsteel.com/wintys/comments/297612.html</wfw:comment><comments>http://www.aygfsteel.com/wintys/archive/2009/10/10/cpp_passwordviewer.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wintys/comments/commentRss/297612.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wintys/services/trackbacks/297612.html</trackback:ping><description><![CDATA[<p>[标题]:易Windows密码查看?<br /> [旉]:2009-10-09 <br /> [摘要]:通过全局钩子获取当前鼠标处的H口控g句柄Q然后直接调用GetWindowText()获取密码文本?<br /> [关键字]:密码、查看、星受全局钩子、Hook、WM_COPYDATA、DLL、XP样式 <br /> [环境]:Visual Studio 2008、Visual C++ 6.0 <br /> [作者]:天堂露珠 (wintys@gmail.com) <a href="http://www.aygfsteel.com/wintys">http://www.aygfsteel.com/wintys</a> <br /> <br /> [正文]:</p> <p>    此密码查看器原理:通过全局钩子获取当前鼠标处的H口控g句柄Q然后直接调用GetWindowText()获取密码文本。工E在VC++6.0和VS2008中编译通过?</p> <h3>1、查看密码的DLL工程</h3> <p>    因ؓ查看密码功能要用到全局鼠标HookQ所以要把功能放C个DLL中?/p> <p>PasswordViewerMouseHookDLL.h:</p> <div id="wmqeeuq" class="mycode"> <p>#pragma once </p> <p>#ifdef PSWMOUSEHOOKDLL_API_EXPORTS <br /> #define PSWMOUSEHOOKDLL_API __declspec(dllexport) <br /> #else <br /> #define PSWMOUSEHOOKDLL_API __declspec(dllimport) <br /> #endif </p> <p>/* <br /> Winty:2009-09-29 <br /> 调用SetHook()讄HookQ但无需卸蝲HookQDLLMain中有清理?<br /> */ <br /> //My Declaration================================ <br /> #define MAXCOUNT 200 //密码最大长?<br /> #define DWDATA_PSW_NOTIFY 1 //COPYDATASTRUCT的dwData自定义?</p> <p>//密码信息l构体,用于发?<br /> typedef struct tagPswNotify <br /> { <br />     char psw[MAXCOUNT];//password/text <br />     POINT pt;//鼠标位置 <br />     HWND hWnd;//控g句柄 <br /> } PSWNOTIFY , *PPSWNOTIFY; </p> <p>/*extern表示q里只是变量声明Q变量定义在cpp文g?/ <br /> extern PSWMOUSEHOOKDLL_API BOOL g_bReadySend;//WM_COPYDATA互斥的标志,因ؓWM_COPYDATA不能重叠 <br /> extern PSWMOUSEHOOKDLL_API HWND g_hWnd; //接收消息的窗体句?<br /> extern PSWMOUSEHOOKDLL_API HHOOK g_hhk; //钩子句柄 <br /> extern PSWMOUSEHOOKDLL_API BOOL g_bView;//是否需要查看密?</p> <p>//鼠标钩子q程 <br /> PSWMOUSEHOOKDLL_API LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam ); <br /> //讄钩子(可在H口的OnInitDialog()中调? <br /> PSWMOUSEHOOKDLL_API void SetHook(HWND hWnd);</p> </div> <p>PasswordViewerMouseHookDLL.cpp:</p> <div id="wmqeeuq" class="mycode"> <p>#include "stdafx.h" </p> <p>#define PSWMOUSEHOOKDLL_API_EXPORTS <br /> #include "PasswordViewerMouseHookDLL.h" </p> <p>#include <stdio.h></p> <p>//q程间共享数?q要在链接器选项里添?"/SECTION:.MyShare,RWS" <br /> //? #pragma   comment(linker,"/SECTION:.MyShare,RWS")  <br /> //查看l果:dumpbin /headers *.DLL <br /> #pragma data_seg(".MyShare") <br /> HHOOK g_hhk = NULL;/*Hook句柄*/ <br /> HWND  g_hWnd = NULL;/*接收消息的窗口句?/ <br /> BOOL  g_bReadySend = TRUE;/*用于同步COPYDATA消息*/ <br /> #pragma data_seg() <br /> #pragma   comment(linker,"/SECTION:.MyShare,RWS") </p> <p>BOOL APIENTRY DllMain( HANDLE hModule, <br />                        DWORD  ul_reason_for_call, <br />                        LPVOID lpReserved <br />                      ) <br /> { <br />     switch (ul_reason_for_call) <br />     { <br />         case DLL_PROCESS_ATTACH: <br />             break; <br />         case DLL_PROCESS_DETACH: <br />             if(g_hhk != NULL) <br />             { <br />                 UnhookWindowsHookEx(g_hhk); <br />                 g_hhk = NULL; <br />                 g_hWnd = NULL; <br />             } <br />             break; <br />         case DLL_THREAD_ATTACH: <br />         case DLL_THREAD_DETACH: <br />             break; </p> <p>    } <br />     return TRUE; <br /> } </p> <p>LRESULT CALLBACK MouseProc( <br />                            int nCode,      // hook code <br />                            WPARAM wParam,  // message identifier <br />                            LPARAM lParam   // mouse coordinates <br /> ) <br /> { <br />     if(nCode == HC_ACTION) <br />     { <br />         PMOUSEHOOKSTRUCT pMouseHookStruct <br />             = reinterpret_cast<PMOUSEHOOKSTRUCT>(lParam); <br />         LONG x = pMouseHookStruct->pt.x; <br />         LONG y = pMouseHookStruct->pt.y; <br />         HWND hWnd = pMouseHookStruct->hwnd; </p> <p>        HWND hWndFromPoint = <strong>::WindowFromPoint</strong>(pMouseHookStruct->pt); </p> <p>        if(hWndFromPoint != g_hWnd  &&  g_bReadySend)//不能获取昄密码的文本框的内?<br />         { <br />             g_bReadySend = FALSE; <br />             char psw[MAXCOUNT]; <br />             ::GetWindowText(hWndFromPoint , psw , MAXCOUNT); <br />             PSWNOTIFY pswNotify; <br />             strcpy(pswNotify.psw , psw); <br />             pswNotify.pt.x = x; <br />             pswNotify.pt.y = y; <br />             pswNotify.hWnd = hWndFromPoint; </p> <p>            COPYDATASTRUCT cd; <br />             cd.lpData = &pswNotify; <br />             cd.cbData = sizeof(PSWNOTIFY); <br />             cd.dwData = DWDATA_PSW_NOTIFY; <br />             ::SendMessage(g_hWnd, <font color="#ff0000">WM_COPYDATA</font>, NULL , (LPARAM)(LPVOID)&cd); <br />         } <br />     } </p> <p>    return CallNextHookEx(g_hhk , nCode , wParam ,lParam); <br /> } </p> <p>void SetHook(HWND hWnd) <br /> { <br />     g_hWnd = hWnd; <br />     g_hhk = SetWindowsHookEx(WH_MOUSE , <br />                              MouseProc , <br />                              <strong>GetModuleHandle("PasswordViewerMouseHookDLL")</strong> , <br />                              NULL); <br /> }</p> </div> <p> </p> <p>    <font color="#ff0000">DLL要想密码消息发送到ȝ口显C,要用WM_COPYDATA消息(或其它进E间通信方式)Q否则会发送失败?/font>如果用WM_SETTEXTQ因为全局Hook发送的消息所带的字符串指针lParam可能不能被主H口讉KQ从而造成讉K异常?/p> <p>    g_bReadySend的设|是因ؓWM_COPYDATA消息不能q箋发送,必须{前一条消息取C后才能发送下一条消息?/p> <h3>2、显C密码的工程PasswordViewer</h3> <p>    创徏一个对话框工程PasswordViewer?/p> <p>使用DLL步骤:</p> <ul> <li>把PasswordViewerMouseHookDLL工程生成的PasswordViewerMouseHookDLL.dll、PasswordViewerMouseHookDLL.libQ以及PasswordViewerMouseHookDLL.h复制到PasswordViewer工程?<br /> [参考资料]: <br /> [附g]: </li> <li>在PasswordViewerDlg.cpp 中加?include "PasswordViewerMouseHookDLL.h"?pragma comment(lib , "PasswordViewerMouseHookDLL.lib") </li> </ul> <p>    如果要设|最后生成XP样式的窗口,得在PasswordViewerDlg.cpp 中加?/p> <div id="wmqeeuq" class="mycode"> <p>#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")</p> </div> <p> </p> <p> </p> <p>    PasswordViewerDlg.cpp主要代码为响应WM_COPYDATA消息Q把消息内容昄到窗口上:</p> <div id="wmqeeuq" class="mycode"> <p>BOOL CPasswordViewerDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) <br /> { <br />     if(pCopyDataStruct->dwData == DWDATA_PSW_NOTIFY && !g_bReadySend) <br />     { <br />         PPSWNOTIFY pPswNotify = (PPSWNOTIFY)pCopyDataStruct->lpData; </p> <p>        CString strMousePosition; <br />         strMousePosition.Format("(%3d,%3d)" , pPswNotify->pt.x ,pPswNotify->pt.y); <br />         m_strMousePosition = strMousePosition; <br />         CString strPsw; <br />         strPsw.Format("%s" , pPswNotify->psw); <br />         m_strPsw = strPsw; <br />         CString strHWnd; <br />         strHWnd.Format("%p" , pPswNotify->hWnd); <br />         m_strHWnd = strHWnd; <br />         UpdateData(FALSE); </p> <p>        g_bReadySend = TRUE; </p> <p>        return TRUE; <br />     } <br />     else <br />     { <br />         CString str(_T("未发现窗?)); <br />         m_strPsw = str; </p> <p>        UpdateData(FALSE); </p> <p>        return CDialog::OnCopyData(pWnd, pCopyDataStruct); <br />     }    <br /> }</p> </div> <p> </p> <p>    别忘了要在CPasswordViewerDlg::OnInitDialog()中调用DLL的SetHook(m_hWnd)Q初始化全局钩子?/p> <h3>3、运?/h3> <p>    q行l果如图:</p> <p><a href="http://www.aygfsteel.com/images/blogjava_net/wintys/WindowsLiveWriter/1_11D15/cpp_PasswordViewer_4.jpg"><img style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="cpp_PasswordViewer" alt="cpp_PasswordViewer" src="http://www.aygfsteel.com/images/blogjava_net/wintys/WindowsLiveWriter/1_11D15/cpp_PasswordViewer_thumb_1.jpg" border="0" height="350" width="470" /></a> </p> <p align="center">【cpp_PasswordViewer.jpg?/p> <p>[附g]:</p> <p> </p> <div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:F60BB8FA-6F02-4999-8F5E-9DD4E92C4DA7:3a281a8f-e72d-4343-9cec-4b8b3b1d6ac6" class="wlWriterEditableSmartContent"> <div><a href="http://www.aygfsteel.com/images/blogjava_net/wintys/WindowsLiveWriter/1_11D15/PasswordViewer.zip" target="_self">PasswordViewer.zip</a></div> </div> :  <p>PasswordViewer.exe、PasswordViewerMouseHookDLL.dll、工E源代码</p> <div class="wmqeeuq" id="mycopyright" style="border-width: 1px 0pt 0pt; border-top: 1px solid red; padding: 5px; margin-top: 5px;"> <span style="color: #ff0000;">原创作品Q{载请注明出处?br /> 作?Winty (wintys@gmail.com)<br /> 博客:http://www.aygfsteel.com/wintys</span> </div> <img src ="http://www.aygfsteel.com/wintys/aggbug/297612.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wintys/" target="_blank">天堂露珠</a> 2009-10-10 00:08 <a href="http://www.aygfsteel.com/wintys/archive/2009/10/10/cpp_passwordviewer.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[原]VC实现重启路由?/title><link>http://www.aygfsteel.com/wintys/archive/2009/05/29/cpp_basicauthorization.html</link><dc:creator>天堂露珠</dc:creator><author>天堂露珠</author><pubDate>Fri, 29 May 2009 15:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/wintys/archive/2009/05/29/cpp_basicauthorization.html</guid><wfw:comment>http://www.aygfsteel.com/wintys/comments/278962.html</wfw:comment><comments>http://www.aygfsteel.com/wintys/archive/2009/05/29/cpp_basicauthorization.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wintys/comments/commentRss/278962.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wintys/services/trackbacks/278962.html</trackback:ping><description><![CDATA[     摘要: 使用VC发送一个HTTPhl\由器,实现重启TP-LINK路由器功能?nbsp; <a href='http://www.aygfsteel.com/wintys/archive/2009/05/29/cpp_basicauthorization.html'>阅读全文</a><img src ="http://www.aygfsteel.com/wintys/aggbug/278962.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wintys/" target="_blank">天堂露珠</a> 2009-05-29 23:36 <a href="http://www.aygfsteel.com/wintys/archive/2009/05/29/cpp_basicauthorization.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[原]使用"异或"单加密的实现http://www.aygfsteel.com/wintys/archive/2009/04/19/cpp_xorencryption.html天堂露珠天堂露珠Sun, 19 Apr 2009 11:30:00 GMThttp://www.aygfsteel.com/wintys/archive/2009/04/19/cpp_xorencryption.htmlhttp://www.aygfsteel.com/wintys/comments/266446.htmlhttp://www.aygfsteel.com/wintys/archive/2009/04/19/cpp_xorencryption.html#Feedback0http://www.aygfsteel.com/wintys/comments/commentRss/266446.htmlhttp://www.aygfsteel.com/wintys/services/trackbacks/266446.html阅读全文

天堂露珠 2009-04-19 19:30 发表评论
]]>
[原]在全局鼠标钩子中模拟鼠标右键单?/title><link>http://www.aygfsteel.com/wintys/archive/2009/03/28/vc_mousehook_rightmousebutton.html</link><dc:creator>天堂露珠</dc:creator><author>天堂露珠</author><pubDate>Sat, 28 Mar 2009 07:55:00 GMT</pubDate><guid>http://www.aygfsteel.com/wintys/archive/2009/03/28/vc_mousehook_rightmousebutton.html</guid><wfw:comment>http://www.aygfsteel.com/wintys/comments/262616.html</wfw:comment><comments>http://www.aygfsteel.com/wintys/archive/2009/03/28/vc_mousehook_rightmousebutton.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wintys/comments/commentRss/262616.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wintys/services/trackbacks/262616.html</trackback:ping><description><![CDATA[     摘要: 本文分ؓ两部分,W一部分:使用SwapMouseButton()切换鼠标左右键功能。第二部?在全局鼠标钩子中模拟鼠标右键单凅R?nbsp; <a href='http://www.aygfsteel.com/wintys/archive/2009/03/28/vc_mousehook_rightmousebutton.html'>阅读全文</a><img src ="http://www.aygfsteel.com/wintys/aggbug/262616.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wintys/" target="_blank">天堂露珠</a> 2009-03-28 15:55 <a href="http://www.aygfsteel.com/wintys/archive/2009/03/28/vc_mousehook_rightmousebutton.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[导入]最单的Win32E序CZhttp://www.aygfsteel.com/wintys/archive/2009/03/18/260423.html天堂露珠天堂露珠Wed, 18 Mar 2009 04:02:00 GMThttp://www.aygfsteel.com/wintys/archive/2009/03/18/260423.htmlhttp://www.aygfsteel.com/wintys/comments/260423.htmlhttp://www.aygfsteel.com/wintys/archive/2009/03/18/260423.html#Feedback0http://www.aygfsteel.com/wintys/comments/commentRss/260423.htmlhttp://www.aygfsteel.com/wintys/services/trackbacks/260423.html最单的Win32E序CZ:
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance,
                 HINSTANCE hPrevInstance,
                 PSTR szCmdLine,
                 int iCmdShow)
{
  MessageBox(NULL, "Hello, Win32!", "问?, MB_OK) ;  
 
  return 0 ;
}

文章来源:http://wintys.blog.51cto.com/425414/92287

天堂露珠 2009-03-18 12:02 发表评论
]]>
[导入]wsprintf用法http://www.aygfsteel.com/wintys/archive/2009/03/18/260415.html天堂露珠天堂露珠Wed, 18 Mar 2009 04:02:00 GMThttp://www.aygfsteel.com/wintys/archive/2009/03/18/260415.htmlhttp://www.aygfsteel.com/wintys/comments/260415.htmlhttp://www.aygfsteel.com/wintys/archive/2009/03/18/260415.html#Feedback0http://www.aygfsteel.com/wintys/comments/commentRss/260415.htmlhttp://www.aygfsteel.com/wintys/services/trackbacks/260415.html
wsprintf(~冲?格式Q要格式化的?Q?br />W一个参数是字符~冲区,后面是格式字W串Qwsprintf不是格式化l果写到标准输出Q而是其写入~冲ZQ该函数q回该字W串的长度?br />
比如我们想通过MessageBox来输Z个整形变量的|可以用以下代码实玎ͼ
char szBuffer[100];
ing number=100;
wsprintf(szBuffer, “%d”,number);
MessgaeBox(NULL,szBrffer,TEXT(“格式化字W串”),0);
q个函数除了内Ҏ(gu)式化输出到第一个参数所提供的字W串~冲Z外,其它功能与printf函数相同

wsprintf对应的字W串是宽字符型wchar_t,即一个字W占?个字节的内存I间.
sprintf对应的字W串是字W类型ؓchar,几一个字W占?个字节的内存I间.
sprintf是用于对ASCII码的127个字W进行操?wsprintf是对UNICODE的多语言字符q行操作.
?
sprintf(buffer, "ascii");
wsprintf(buffer, L"unicode");

来源:[url]http://www.cppblog.com/liuxubin/archive/2007/08/14/29993.html[/url]

文章来源:http://wintys.blog.51cto.com/425414/111494

天堂露珠 2009-03-18 12:02 发表评论
]]>
վ֩ģ壺 ľ| Ϫ| | | | «| ɽ| ױ| | Ϫ| | | ׯ| ɽ| | | | | | ղ| | Խ| | | | ֶ| | | Ϫ| Ӻ| Ϫ| ʻ| ƽ| ¡| | | | | | | ԭ|