锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久无码人妻精品一区二区三区 ,国产精品午夜久久,久久精品国产亚洲综合色http://m.shnenglu.com/meet-dream/zh-cnThu, 03 Jul 2025 09:10:33 GMTThu, 03 Jul 2025 09:10:33 GMT60boost::graph鐨勫悕瀛楀弬鏁?/title><link>http://m.shnenglu.com/meet-dream/archive/2007/05/28/24987.html</link><dc:creator>meet-dream</dc:creator><author>meet-dream</author><pubDate>Mon, 28 May 2007 09:08:00 GMT</pubDate><guid>http://m.shnenglu.com/meet-dream/archive/2007/05/28/24987.html</guid><wfw:comment>http://m.shnenglu.com/meet-dream/comments/24987.html</wfw:comment><comments>http://m.shnenglu.com/meet-dream/archive/2007/05/28/24987.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://m.shnenglu.com/meet-dream/comments/commentRss/24987.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/meet-dream/services/trackbacks/24987.html</trackback:ping><description><![CDATA[     鎽樿: 鍒濊boost鐨勫悕瀛楀弬鏁幫紝緇欎漢涓縐嶁滄儕涓哄ぉ浜衡濈殑鎰熻錛屾病鎯沖埌....  <a href='http://m.shnenglu.com/meet-dream/archive/2007/05/28/24987.html'>闃呰鍏ㄦ枃</a><img src ="http://m.shnenglu.com/meet-dream/aggbug/24987.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/meet-dream/" target="_blank">meet-dream</a> 2007-05-28 17:08 <a href="http://m.shnenglu.com/meet-dream/archive/2007/05/28/24987.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>搴旂敤杞歡鍜屽鉤鍙拌蔣浠剁殑涓鐐規濊?/title><link>http://m.shnenglu.com/meet-dream/archive/2007/05/28/24973.html</link><dc:creator>meet-dream</dc:creator><author>meet-dream</author><pubDate>Mon, 28 May 2007 05:54:00 GMT</pubDate><guid>http://m.shnenglu.com/meet-dream/archive/2007/05/28/24973.html</guid><wfw:comment>http://m.shnenglu.com/meet-dream/comments/24973.html</wfw:comment><comments>http://m.shnenglu.com/meet-dream/archive/2007/05/28/24973.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://m.shnenglu.com/meet-dream/comments/commentRss/24973.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/meet-dream/services/trackbacks/24973.html</trackback:ping><description><![CDATA[     鎽樿:   <a href='http://m.shnenglu.com/meet-dream/archive/2007/05/28/24973.html'>闃呰鍏ㄦ枃</a><img src ="http://m.shnenglu.com/meet-dream/aggbug/24973.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/meet-dream/" target="_blank">meet-dream</a> 2007-05-28 13:54 <a href="http://m.shnenglu.com/meet-dream/archive/2007/05/28/24973.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>boost asio 2:threadinghttp://m.shnenglu.com/meet-dream/archive/2007/05/25/24822.htmlmeet-dreammeet-dreamFri, 25 May 2007 06:06:00 GMThttp://m.shnenglu.com/meet-dream/archive/2007/05/25/24822.htmlhttp://m.shnenglu.com/meet-dream/comments/24822.htmlhttp://m.shnenglu.com/meet-dream/archive/2007/05/25/24822.html#Feedback2http://m.shnenglu.com/meet-dream/comments/commentRss/24822.htmlhttp://m.shnenglu.com/meet-dream/services/trackbacks/24822.html闃呰鍏ㄦ枃

]]>
boost asio 1:how to use ithttp://m.shnenglu.com/meet-dream/archive/2007/05/25/24821.htmlmeet-dreammeet-dreamFri, 25 May 2007 06:04:00 GMThttp://m.shnenglu.com/meet-dream/archive/2007/05/25/24821.htmlhttp://m.shnenglu.com/meet-dream/comments/24821.htmlhttp://m.shnenglu.com/meet-dream/archive/2007/05/25/24821.html#Feedback2http://m.shnenglu.com/meet-dream/comments/commentRss/24821.htmlhttp://m.shnenglu.com/meet-dream/services/trackbacks/24821.html #include #include void print(const boost::asio::error& /*e*/) { std::cout << "Hello, world!\n"; } int main() { // 瀹氫箟涓涓猧o_service,瀹冪殑浣滅敤鏄敞鍐屾湇鍔★紝璋冪敤涓涓紓姝ヨ姹傚畬鎴愬悗瀵瑰簲鐨勬搷浣滐紙涓涓猦andle錛? boost::asio::io_service io; //娣誨姞涓涓畾鏃跺櫒鏈嶅姟錛? boost::asio::deadline_timer t(io, boost::posix_time::seconds(5)); //鍚姩涓涓紓姝ユ搷浣滐紝璇ユ搷浣滀細璁板綍浜巌o_service 鐨勪竴涓槦鍒椾腑 t.async_wait(print); //姣忎釜娉ㄥ唽鐨勬湇鍔″惎鍔ㄥ伐浣? io.run(); //5s鍚庯紝瀹氭椂鍣ㄦ椂闂村埌錛宲rint琚皟鐢紝鐒跺悗璇andle錛坧rint錛変粠闃熷垪涓垹闄? return 0; } 鍙互鐪嬪嚭錛屽涓涓嬌鐢ㄨ呮潵璇達紝asio鐨勫師鐞嗗緢綆鍗? 1銆傚畾涔変竴涓狪O_Service 2.鍚慖O_Service娉ㄥ唽涓涓湇鍔?璇ユ湇鍔″彲浠ユ槸io鏈嶅姟,涔熷彲浠ユ槸瀹氭椂鍣ㄦ湇鍔?褰撶劧,浣犱篃鍙互鑷繁璁㈠埗涓涓偖浠舵湇鍔? 3.鍦ㄨ鏈嶅姟涓婂惎鍔ㄤ竴涓紓姝ユ搷浣?榪欓渶瑕佷竴涓洖璋冨嚱鏁? 4.濡傛灉寮傛鎿嶄綔瀹屾垚,浣犵殑鍥炶皟鍑芥暟浼氳璋冪敤 5.鍙兘鐨勯敊璇鐞? 鐞嗚Вasio鐨勫師鐞嗗悗錛屽啓涓涓綉緇滈氫俊鐨勭▼搴忕畝鐩存槸渚濊懌鑺︾敾鐡㈢殑浜嬩簡 鎴戜滑鐪嬩竴涓椂闂存煡璇㈢殑鏈嶅姟绔細 #include #include #include #include #include #include #include using boost::asio::ip::udp; std::string make_daytime_string() { using namespace std; // For time_t, time and ctime; time_t now = time(0); return ctime(&now); } class udp_server { public: //瀵硅薄寤虹珛鏃訛紝娉ㄥ唽浜唘dp鐨剆ocket鏈嶅姟錛屾帴鐫灝卞紑濮嬩簡涓涓紓姝ョ殑鎺ユ敹鎿嶄綔 udp_server(boost::asio::io_service& io_service) : socket_(io_service, udp::endpoint(udp::v4(), 13)) { start_receive(); } private: void start_receive() { //鍚姩鐨勫紓姝ユ搷浣? socket_.async_receive_from( boost::asio::buffer(recv_buffer_), //鎺ユ敹緙撳啿鍖? remote_endpoint_, //瀛樺偍璇鋒眰鐨勫鎴峰湴鍧錛宨p+port boost::bind(&udp_server::handle_receive, this, //鏋勯犱竴涓洖璋冨嚱鏁幫紝瀹為檯璋冪敤浜嗘垚鍛樺嚱鏁癶andle_receive錛屽叿浣撹boost::bind boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred) ); } void handle_receive(const boost::asio::error& error, std::size_t /*bytes_transferred*/) { //鎺ュ埌瀹㈡埛绔殑淇℃伅錛屽拷鐣ヤ簡璇鋒眰鍐呭錛岀洿鎺ュ彂鍥炴湰鏈虹殑鏃墮棿錛屽彂閫佷篃鏄竴涓紓姝ユ搷浣? if (!error || error == boost::asio::error::message_size) { boost::shared_ptr message( new std::string(make_daytime_string())); socket_.async_send_to(boost::asio::buffer(*message), remote_endpoint_, boost::bind(&udp_server::handle_send, this, message, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); start_receive(); } } //鍙戦佸畬鎴愶紝蹇界暐 void handle_send(boost::shared_ptr /*message*/, const boost::asio::error& /*error*/, std::size_t /*bytes_transferred*/) { } udp::socket socket_; udp::endpoint remote_endpoint_; boost::array recv_buffer_; }; int main() { try { boost::asio::io_service io_service; udp_server server(io_service); io_service.run(); } catch (std::exception& e) { std::cerr << e.what() << std::endl; } return 0; } 鍙互鐪嬪埌錛岀敤asio寮鍙戜竴涓綉緇滄湇鍔$鐨勭▼搴忎竴浠跺涔堢畝鍗曠殑浜嬨傚姝ょ▼搴忕◢鍔犳敼鍔紝鎴戜滑灝卞彲浠ュ緩绔嬩竴涓敮鎸佸綰跨▼錛岄珮騫跺彂鐨勭綉緇滄湇鍔$▼搴忋? 鍚庨潰鎴戜滑灝嗙戶緇垎鏋恆sio鐨勫綰跨▼鏀寔錛屽緙撳啿錛岀綉緇滄祦絳夋洿濂界殑鍩虹鐗規с?

]]>
a simple template hook class for function and member functionshttp://m.shnenglu.com/meet-dream/archive/2007/03/05/19265.htmlmeet-dreammeet-dreamMon, 05 Mar 2007 15:51:00 GMThttp://m.shnenglu.com/meet-dream/archive/2007/03/05/19265.htmlhttp://m.shnenglu.com/meet-dream/comments/19265.htmlhttp://m.shnenglu.com/meet-dream/archive/2007/03/05/19265.html#Feedback0http://m.shnenglu.com/meet-dream/comments/commentRss/19265.htmlhttp://m.shnenglu.com/meet-dream/services/trackbacks/19265.htmlSome times,we need too hook some function to do something that's not so easy to do with normally add somecode.A solution is to hook focused functions and interface.Here is a template hook class maybe help your work easier,which complie with vs2005.It midify the jmp table to replace the function,maybe not聽properly聽 for other compliers.

class HookPfn
{
聽struct make_writeable
聽{
聽聽void* p;
聽聽MEMORY_BASIC_INFORMATION mbi_thunk;
聽聽make_writeable(void* _p):p(_p)
聽聽{
聽聽聽VirtualQuery(p, &mbi_thunk, sizeof(MEMORY_BASIC_INFORMATION));
聽聽聽VirtualProtect(mbi_thunk.BaseAddress, mbi_thunk.RegionSize, PAGE_READWRITE, &mbi_thunk.Protect);
聽聽
聽聽}
聽聽~make_writeable()
聽聽{
聽聽聽VirtualProtect(mbi_thunk.BaseAddress, mbi_thunk.RegionSize, mbi_thunk.Protect,&mbi_thunk.Protect);
聽聽}
聽};
public:
聽template<class F>
聽void restore(F pfn,unsigned long handle)
聽{
聽聽
聽聽void* p;
聽聽__asm mov eax,[pfn]
聽聽__asm mov dword ptr[p],eax
聽聽make_writeable write(p);
聽聽__asm push ecx
聽聽__asm mov eax,pfn
聽聽__asm inc eax
聽聽__asm mov ecx,handle
聽聽__asm mov dword ptr[eax],ecx
聽聽__asm pop ecx
聽}
聽template<class F1,class F2>
聽unsigned long redirect(F1 pfn1,F2 pfn2)
聽{
聽聽聽//should use restrict object prevent聽F1 and F2 's arguments and type not same
聽聽void* p;
聽聽__asm mov eax,[pfn1]
聽聽__asm mov dword ptr[p],eax
聽聽make_writeable write(p);

聽聽unsigned long bas1,bas2,of1,of2,of;
聽聽__asm push ecx
聽聽__asm mov eax,pfn1
聽聽__asm mov bas1,eax
聽聽__asm inc eax
聽聽__asm mov ecx,dword ptr[eax]
聽聽__asm mov of1,ecx

聽聽__asm mov eax,pfn2
聽聽__asm mov bas2,eax
聽聽__asm inc eax
聽聽__asm mov ecx,dword ptr[eax]
聽聽__asm mov of2,ecx

聽聽of=(bas2-bas1+of2-of1)+of1;

聽聽__asm mov eax,pfn1
聽聽__asm inc eax
聽聽__asm mov ecx,of
聽聽__asm mov dword ptr[eax],ecx
聽聽__asm pop ecx
聽聽return of1;
聽}

};

class mmt
{
public:
聽void donothing()
{
}
聽void donothing(int)
{
}
聽聽void dosomething()
{
}
};

void fastcall(int a,int b)
{
}
void askcall(int,int)
{
}


It can be used as example:
int main()
{
聽HookMemberFunction sh;
聽unsigned long hd=sh.redirect(&fastcall,&askcall);//test api
聽fastcall(0,0);//two聽function
聽askcall(0,0);
聽sh.restore(&fastcall,hd);
聽askcall(0,0);
聽fastcall(0,0);
//test overlay functions(donothing)
聽typedef void (mmt::*sp)(void);
聽sp p1=&mmt::dosomething;
聽sp p2=&mmt::donothing;
聽hd=sh.redirect(p1,p2);
聽mmt mt;//a class
聽mt.donothing();
聽mt.dosomething();
聽sh.restore(p1,hd);
聽mt.donothing();
聽mt.dosomething();

}
Although it can be work right,addtionly we may be use it not properly.Youcan add some strict class to prevent bad use of it by check if the argument and return type is strictly same.,if you need it.



]]>
久久最新精品国产| 国产精品亚洲综合专区片高清久久久| 久久久亚洲精品蜜桃臀| 日韩亚洲国产综合久久久| 久久伊人五月丁香狠狠色| 久久精品国产亚洲AV无码偷窥| 久久最近最新中文字幕大全| 久久亚洲国产精品五月天婷| 无码国产69精品久久久久网站| 伊人久久免费视频| 思思久久99热只有频精品66| 国产V亚洲V天堂无码久久久| 日韩亚洲国产综合久久久| 国产精品美女久久久m| 伊人久久一区二区三区无码| 国产精品久久久久AV福利动漫| 欧美成a人片免费看久久| 久久青青草原亚洲av无码app| 久久久无码精品亚洲日韩软件| 99久久久国产精品免费无卡顿| 色婷婷久久久SWAG精品| 久久久久久狠狠丁香| 亚洲色大成网站www久久九| 成人国内精品久久久久影院VR| 97久久精品人妻人人搡人人玩| 久久久国产视频| 久久99精品久久久久久9蜜桃| 久久夜色精品国产亚洲| 亚洲国产精品无码久久一区二区| 色婷婷综合久久久久中文字幕| 久久99精品久久久久久不卡 | 亚洲AV无码久久精品狠狠爱浪潮| 亚洲国产精品一区二区久久| 国产精品久久网| 国产精品久久久久久福利漫画| 中文字幕人妻色偷偷久久| 亚洲性久久久影院| 一本色道久久综合狠狠躁篇| 一级女性全黄久久生活片免费 | 国产精品18久久久久久vr| 亚洲国产精品无码久久久秋霞2 |