zhangyang пре 7 година
родитељ
комит
38c24bfd7d
40 измењених фајлова са 1676 додато и 95 уклоњено
  1. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/db/pos.db
  2. 255 0
      bin/Win32/Debug/zhipuzi_pay_plugin/log/pos.log
  3. 0 0
      bin/Win32/Debug/zhipuzi_pay_plugin/log/pos_error.log
  4. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/zhipuzi_pay_plugin.exe
  5. BIN
      bin/Win32/Debug/zhipuzi_pay_plugin/zpzDll.dll
  6. 1059 0
      include/Detours/detours.h
  7. 27 0
      include/Detours/detver.h
  8. 89 0
      include/Detours/syelog.h
  9. 12 0
      include/zpzDll/zpzDll.h
  10. BIN
      lib/debug/detours.lib
  11. BIN
      lib/debug/syelog.lib
  12. BIN
      lib/debug/zpzDll.lib
  13. BIN
      lib/release/detours.lib
  14. BIN
      lib/release/syelog.lib
  15. 45 48
      zhipuzi_pay_plugin/wnd/CValueWnd.cpp
  16. 2 2
      zhipuzi_pay_plugin/zhipuzi_pay_plugin.vcxproj
  17. BIN
      zpzDll/Debug/dllmain.obj
  18. BIN
      zpzDll/Debug/stdafx.obj
  19. BIN
      zpzDll/Debug/vc141.idb
  20. BIN
      zpzDll/Debug/vc141.pdb
  21. 0 18
      zpzDll/Debug/zpzDll.Build.CppClean.log
  22. 0 3
      zpzDll/Debug/zpzDll.log
  23. BIN
      zpzDll/Debug/zpzDll.obj
  24. BIN
      zpzDll/Debug/zpzDll.pch
  25. BIN
      zpzDll/Debug/zpzDll.tlog/CL.command.1.tlog
  26. BIN
      zpzDll/Debug/zpzDll.tlog/CL.read.1.tlog
  27. BIN
      zpzDll/Debug/zpzDll.tlog/CL.write.1.tlog
  28. BIN
      zpzDll/Debug/zpzDll.tlog/link.16612.delete.1.tlog
  29. BIN
      zpzDll/Debug/zpzDll.tlog/link.command.1.tlog
  30. BIN
      zpzDll/Debug/zpzDll.tlog/link.read.1.tlog
  31. BIN
      zpzDll/Debug/zpzDll.tlog/link.write.1.tlog
  32. 0 2
      zpzDll/Debug/zpzDll.tlog/zpzDll.lastbuildstate
  33. BIN
      zpzDll/Debug/zpzDll.tlog/zpzDll.write.1u.tlog
  34. 112 0
      zpzDll/Hook.cpp
  35. 5 0
      zpzDll/Hook.h
  36. 16 7
      zpzDll/dllmain.cpp
  37. 28 12
      zpzDll/zpzDll.cpp
  38. 10 2
      zpzDll/zpzDll.h
  39. 10 1
      zpzDll/zpzDll.vcxproj
  40. 6 0
      zpzDll/zpzDll.vcxproj.filters

BIN
bin/Win32/Debug/zhipuzi_pay_plugin/db/pos.db


+ 255 - 0
bin/Win32/Debug/zhipuzi_pay_plugin/log/pos.log

@@ -808,3 +808,258 @@
 2019-07-30 00:52:17[INFO] - read num:13 [d:\work\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\cserialport.cpp:135]
 2019-07-30 00:53:30[INFO] - a:QA65
s2s [d:\work\zhipuzi_pay_plugin\zhipuzi_pay_plugin\wnd\cvaluewnd.cpp:72]
 2019-07-30 00:53:37[INFO] - read num:100 [d:\work\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\cserialport.cpp:135]
+2019-08-02 13:32:44[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:32:44[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:32:44[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 13:32:44[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:32:44[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 13:32:44[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:32:44[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 13:32:44[INFO] - postString:nonce=123456&timestamp=1564723964&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 13:32:44[INFO] - sign:E6946C4367A73C61D6775D68D90AB5AF [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 13:32:44[INFO] - postString:nonce=123456&sign=E6946C4367A73C61D6775D68D90AB5AF&timestamp=1564723964&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 13:32:45[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"6o9alfn8oj8l25dvsc7bgq1au3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 13:32:45[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"6o9alfn8oj8l25dvsc7bgq1au3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 13:32:45[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 13:32:45[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:32:45[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 13:32:45[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:32:45[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 13:45:11[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:45:11[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:45:11[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 13:45:11[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:45:11[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 13:45:11[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:45:11[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 13:45:11[INFO] - postString:nonce=123456&timestamp=1564724711&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 13:45:11[INFO] - sign:4A14943C0937890A4CB81083E3EC9B14 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 13:45:11[INFO] - postString:nonce=123456&sign=4A14943C0937890A4CB81083E3EC9B14&timestamp=1564724711&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 13:45:12[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"l9j3l2hgpg69kg2v7lmnga3a04","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 13:45:12[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"l9j3l2hgpg69kg2v7lmnga3a04","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 13:45:12[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 13:45:12[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:45:12[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 13:45:12[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 13:45:12[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 14:32:48[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:32:48[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:32:48[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 14:32:48[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:32:48[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 14:32:48[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:32:48[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 14:32:48[INFO] - postString:nonce=123456&timestamp=1564727568&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 14:32:48[INFO] - sign:C7540B521BD2BB732DF4304CD0025877 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 14:32:48[INFO] - postString:nonce=123456&sign=C7540B521BD2BB732DF4304CD0025877&timestamp=1564727568&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 14:32:49[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"sa08892l3edv4bumn4u87fobi6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 14:32:49[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"sa08892l3edv4bumn4u87fobi6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 14:32:49[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 14:32:49[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:32:49[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 14:32:49[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:32:49[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 14:41:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:41:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:41:14[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 14:41:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:41:14[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 14:41:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:41:14[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 14:41:14[INFO] - postString:nonce=123456&timestamp=1564728074&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 14:41:14[INFO] - sign:99336E79C60F3DA3DF34C7C53512DDE1 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 14:41:14[INFO] - postString:nonce=123456&sign=99336E79C60F3DA3DF34C7C53512DDE1&timestamp=1564728074&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 14:41:15[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"sbv8qse2oh5l8abd6gup4m5k70","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 14:41:15[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"sbv8qse2oh5l8abd6gup4m5k70","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 14:41:15[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 14:41:15[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:41:15[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 14:41:15[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 14:41:15[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 15:27:59[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 15:27:59[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 15:27:59[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 15:27:59[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 15:27:59[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 15:27:59[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 15:27:59[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 15:27:59[INFO] - postString:nonce=123456&timestamp=1564730879&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 15:27:59[INFO] - sign:FF4C7EC2D4B68EF3493863D3E7BBE212 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 15:27:59[INFO] - postString:nonce=123456&sign=FF4C7EC2D4B68EF3493863D3E7BBE212&timestamp=1564730879&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 15:28:00[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"2k0v8en4gcnvhesqage2ih8v51","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 15:28:00[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"2k0v8en4gcnvhesqage2ih8v51","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 15:28:00[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 15:28:00[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 15:28:00[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 15:28:00[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 15:28:00[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 18:20:22[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:20:22[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:20:22[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 18:20:22[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:20:22[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 18:20:22[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:20:22[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 18:20:22[INFO] - postString:nonce=123456&timestamp=1564741222&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 18:20:22[INFO] - sign:6EF5BA00165474527BD38EEF7F0B85D0 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 18:20:22[INFO] - postString:nonce=123456&sign=6EF5BA00165474527BD38EEF7F0B85D0&timestamp=1564741222&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 18:20:23[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"d59mdhj87j9jd9l20247is1bi6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 18:20:23[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"d59mdhj87j9jd9l20247is1bi6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 18:20:23[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 18:20:23[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:20:24[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 18:20:24[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:20:24[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 18:52:52[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:52:52[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:52:52[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 18:52:52[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:52:52[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 18:52:52[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:52:52[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 18:52:52[INFO] - postString:nonce=123456&timestamp=1564743172&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 18:52:52[INFO] - sign:FE6311B73CE02E718E74AEFCDDDE584A [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 18:52:52[INFO] - postString:nonce=123456&sign=FE6311B73CE02E718E74AEFCDDDE584A&timestamp=1564743172&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 18:52:53[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"vqbepk1mclppv3i9idmc24bnh7","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 18:52:53[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"vqbepk1mclppv3i9idmc24bnh7","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 18:52:53[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 18:52:53[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:52:53[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 18:52:53[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 18:52:53[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:03:49[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:03:49[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:03:49[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:03:49[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:03:49[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:03:49[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:03:49[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:03:49[INFO] - postString:nonce=123456&timestamp=1564743829&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:03:49[INFO] - sign:E73095719A9947D434675BAEEF3C4334 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:03:49[INFO] - postString:nonce=123456&sign=E73095719A9947D434675BAEEF3C4334&timestamp=1564743829&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:03:50[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"6f1qesr66ucjoodibloshfj3i0","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:03:50[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"6f1qesr66ucjoodibloshfj3i0","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:03:50[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:03:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:03:50[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:03:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:03:50[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:07:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:07:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:07:14[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:07:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:07:14[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:07:14[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:07:14[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:07:14[INFO] - postString:nonce=123456&timestamp=1564744034&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:07:14[INFO] - sign:7ECED17BB61CE8DD310CE3AF34332F88 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:07:14[INFO] - postString:nonce=123456&sign=7ECED17BB61CE8DD310CE3AF34332F88&timestamp=1564744034&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:07:15[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"pabovl7r28rm0s3rfv49aa9tg3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:07:15[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"pabovl7r28rm0s3rfv49aa9tg3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:07:15[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:07:15[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:07:15[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:07:15[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:07:15[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:08:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:08:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:08:50[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:08:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:08:50[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:08:50[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:08:50[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:08:50[INFO] - postString:nonce=123456&timestamp=1564744130&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:08:50[INFO] - sign:95800B99AA80238AA8C00BA15769211B [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:08:50[INFO] - postString:nonce=123456&sign=95800B99AA80238AA8C00BA15769211B&timestamp=1564744130&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:08:52[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"p21kdj837ehngsuq666u7i1kn6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:08:52[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"p21kdj837ehngsuq666u7i1kn6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:08:52[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:08:52[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:08:52[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:08:52[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:08:52[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:19:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:19:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:19:08[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:19:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:19:08[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:19:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:19:08[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:19:08[INFO] - postString:nonce=123456&timestamp=1564744748&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:19:08[INFO] - sign:55B210E352B5372E1630FF231098F78E [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:19:08[INFO] - postString:nonce=123456&sign=55B210E352B5372E1630FF231098F78E&timestamp=1564744748&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:19:08[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"a60spih0fsps3riruouorbd5u5","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:19:08[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"a60spih0fsps3riruouorbd5u5","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:19:08[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:19:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:19:08[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:19:08[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:19:09[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:23:45[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:23:45[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:23:45[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:23:45[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:23:45[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:23:45[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:23:45[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:23:45[INFO] - postString:nonce=123456&timestamp=1564745025&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:23:45[INFO] - sign:B10807AA2EB89BEA982B8912BEB630C8 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:23:45[INFO] - postString:nonce=123456&sign=B10807AA2EB89BEA982B8912BEB630C8&timestamp=1564745025&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:23:46[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"kqr55m05303qpbum5rpb9dkhr2","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:23:46[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"kqr55m05303qpbum5rpb9dkhr2","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:23:46[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:23:46[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:23:46[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:23:46[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:23:46[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:33:53[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:33:53[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:33:53[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:33:53[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:33:53[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:33:53[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:33:53[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:33:53[INFO] - postString:nonce=123456&timestamp=1564745633&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:33:53[INFO] - sign:34229D317BA3ACF8B48E78F817F82ACD [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:33:53[INFO] - postString:nonce=123456&sign=34229D317BA3ACF8B48E78F817F82ACD&timestamp=1564745633&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:33:54[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"caeogkk2f65onssr8srvjk4jt6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:33:54[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"caeogkk2f65onssr8srvjk4jt6","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:33:54[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:33:54[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:33:54[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:33:54[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:33:54[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:41:54[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:41:54[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:41:54[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:41:54[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:41:54[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:41:54[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:41:54[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:41:54[INFO] - postString:nonce=123456&timestamp=1564746114&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:41:54[INFO] - sign:D34DF40F4F64D00CB81DB639355AD11B [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:41:54[INFO] - postString:nonce=123456&sign=D34DF40F4F64D00CB81DB639355AD11B&timestamp=1564746114&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:41:55[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"qb87m9q3ofn71p50dddmkblqq4","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:41:55[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"qb87m9q3ofn71p50dddmkblqq4","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:41:55[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:41:55[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:41:55[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:41:55[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:41:55[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:51:18[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:51:18[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:51:18[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:51:18[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:51:18[INFO] - save params fail [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:396]
+2019-08-02 19:51:18[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:51:18[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]
+2019-08-02 19:51:18[INFO] - postString:nonce=123456&timestamp=1564746678&url=https://pf-api.zhipuzi.com/pos/userlogin/userlogin&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:192]
+2019-08-02 19:51:18[INFO] - sign:10FEBE2084496DCB4739EFB82C52A505 [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:202]
+2019-08-02 19:51:18[INFO] - postString:nonce=123456&sign=10FEBE2084496DCB4739EFB82C52A505&timestamp=1564746678&username=zhangyang [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:222]
+2019-08-02 19:51:19[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"20q8ci33ls6849atl30shnu3m3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:227]
+2019-08-02 19:51:19[INFO] - response:{"errcode":0,"errmsg":"","data":{"lwm_sess_token":"20q8ci33ls6849atl30shnu3m3","version_type":"1"}} [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:40]
+2019-08-02 19:51:19[INFO] - login success! [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\network\czhipuzihttpclient.cpp:91]
+2019-08-02 19:51:19[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:51:19[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:392]
+2019-08-02 19:51:19[INFO] - Opened database successfully [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:35]
+2019-08-02 19:51:19[INFO] - save params success [e:\work\code\zhipuzi_pay_plugin\zhipuzi_pay_plugin\tool\csqlite3.cpp:331]

+ 0 - 0
bin/Win32/Debug/zhipuzi_pay_plugin/log/pos_error.log


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/zhipuzi_pay_plugin.exe


BIN
bin/Win32/Debug/zhipuzi_pay_plugin/zpzDll.dll


+ 1059 - 0
include/Detours/detours.h

@@ -0,0 +1,1059 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+//  Core Detours Functionality (detours.h of detours.lib)
+//
+//  Microsoft Research Detours Package, Version 3.0 Build_343.
+//
+//  Copyright (c) Microsoft Corporation.  All rights reserved.
+//
+
+#pragma once
+#ifndef _DETOURS_H_
+#define _DETOURS_H_
+
+#define DETOURS_VERSION     30001   // 3.00.01
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+#undef DETOURS_X64
+#undef DETOURS_X86
+#undef DETOURS_IA64
+#undef DETOURS_ARM
+#undef DETOURS_ARM64
+#undef DETOURS_BITS
+#undef DETOURS_32BIT
+#undef DETOURS_64BIT
+
+#if defined(_X86_)
+#define DETOURS_X86
+#define DETOURS_OPTION_BITS 64
+
+#elif defined(_AMD64_)
+#define DETOURS_X64
+#define DETOURS_OPTION_BITS 32
+
+#elif defined(_IA64_)
+#define DETOURS_IA64
+#define DETOURS_OPTION_BITS 32
+
+#elif defined(_ARM_)
+#define DETOURS_ARM
+
+#elif defined(_ARM64_)
+#define DETOURS_ARM64
+
+#else
+#error Unknown architecture (x86, amd64, ia64, arm, arm64)
+#endif
+
+#ifdef _WIN64
+#undef DETOURS_32BIT
+#define DETOURS_64BIT 1
+#define DETOURS_BITS 64
+// If all 64bit kernels can run one and only one 32bit architecture.
+//#define DETOURS_OPTION_BITS 32
+#else
+#define DETOURS_32BIT 1
+#undef DETOURS_64BIT
+#define DETOURS_BITS 32
+// If all 64bit kernels can run one and only one 32bit architecture.
+//#define DETOURS_OPTION_BITS 32
+#endif
+
+#define VER_DETOURS_BITS    DETOUR_STRINGIFY(DETOURS_BITS)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+#if (_MSC_VER < 1299)
+typedef LONG LONG_PTR;
+typedef ULONG ULONG_PTR;
+#endif
+
+///////////////////////////////////////////////// SAL 2.0 Annotations w/o SAL.
+//
+//  These definitions are include so that Detours will build even if the
+//  compiler doesn't have full SAL 2.0 support.
+//
+#ifndef DETOURS_DONT_REMOVE_SAL_20
+
+#ifdef DETOURS_TEST_REMOVE_SAL_20
+#undef _Analysis_assume_
+#undef _Benign_race_begin_
+#undef _Benign_race_end_
+#undef _Field_range_
+#undef _Field_size_
+#undef _In_
+#undef _In_bytecount_
+#undef _In_count_
+#undef _In_opt_
+#undef _In_opt_bytecount_
+#undef _In_opt_count_
+#undef _In_opt_z_
+#undef _In_range_
+#undef _In_reads_
+#undef _In_reads_bytes_
+#undef _In_reads_opt_
+#undef _In_reads_opt_bytes_
+#undef _In_reads_or_z_
+#undef _In_z_
+#undef _Inout_
+#undef _Inout_opt_
+#undef _Inout_z_count_
+#undef _Out_
+#undef _Out_opt_
+#undef _Out_writes_
+#undef _Outptr_result_maybenull_
+#undef _Readable_bytes_
+#undef _Success_
+#undef _Writable_bytes_
+#undef _Pre_notnull_
+#endif
+
+#if defined(_Deref_out_opt_z_) && !defined(_Outptr_result_maybenull_)
+#define _Outptr_result_maybenull_ _Deref_out_opt_z_
+#endif
+
+#if defined(_In_count_) && !defined(_In_reads_)
+#define _In_reads_(x) _In_count_(x)
+#endif
+
+#if defined(_In_opt_count_) && !defined(_In_reads_opt_)
+#define _In_reads_opt_(x) _In_opt_count_(x)
+#endif
+
+#if defined(_In_opt_bytecount_) && !defined(_In_reads_opt_bytes_)
+#define _In_reads_opt_bytes_(x) _In_opt_bytecount_(x)
+#endif
+
+#if defined(_In_bytecount_) && !defined(_In_reads_bytes_)
+#define _In_reads_bytes_(x) _In_bytecount_(x)
+#endif
+
+#ifndef _In_
+#define _In_
+#endif
+
+#ifndef _In_bytecount_
+#define _In_bytecount_(x)
+#endif
+
+#ifndef _In_count_
+#define _In_count_(x)
+#endif
+
+#ifndef _In_opt_
+#define _In_opt_
+#endif
+
+#ifndef _In_opt_bytecount_
+#define _In_opt_bytecount_(x)
+#endif
+
+#ifndef _In_opt_count_
+#define _In_opt_count_(x)
+#endif
+
+#ifndef _In_opt_z_
+#define _In_opt_z_
+#endif
+
+#ifndef _In_range_
+#define _In_range_(x,y)
+#endif
+
+#ifndef _In_reads_
+#define _In_reads_(x)
+#endif
+
+#ifndef _In_reads_bytes_
+#define _In_reads_bytes_(x)
+#endif
+
+#ifndef _In_reads_opt_
+#define _In_reads_opt_(x)
+#endif
+
+#ifndef _In_reads_opt_bytes_
+#define _In_reads_opt_bytes_(x)
+#endif
+
+#ifndef _In_reads_or_z_
+#define _In_reads_or_z_
+#endif
+
+#ifndef _In_z_
+#define _In_z_
+#endif
+
+#ifndef _Inout_
+#define _Inout_
+#endif
+
+#ifndef _Inout_opt_
+#define _Inout_opt_
+#endif
+
+#ifndef _Inout_z_count_
+#define _Inout_z_count_(x)
+#endif
+
+#ifndef _Out_
+#define _Out_
+#endif
+
+#ifndef _Out_opt_
+#define _Out_opt_
+#endif
+
+#ifndef _Out_writes_
+#define _Out_writes_(x)
+#endif
+
+#ifndef _Outptr_result_maybenull_
+#define _Outptr_result_maybenull_
+#endif
+
+#ifndef _Writable_bytes_
+#define _Writable_bytes_(x)
+#endif
+
+#ifndef _Readable_bytes_
+#define _Readable_bytes_(x)
+#endif
+
+#ifndef _Success_
+#define _Success_(x)
+#endif
+
+#ifndef _Pre_notnull_
+#define _Pre_notnull_
+#endif
+
+#ifdef DETOURS_INTERNAL
+
+#pragma warning(disable:4615) // unknown warning type (suppress with older compilers)
+
+#ifndef _Benign_race_begin_
+#define _Benign_race_begin_
+#endif
+
+#ifndef _Benign_race_end_
+#define _Benign_race_end_
+#endif
+
+#ifndef _Field_size_
+#define _Field_size_(x)
+#endif
+
+#ifndef _Field_range_
+#define _Field_range_(x,y)
+#endif
+
+#ifndef _Analysis_assume_
+#define _Analysis_assume_(x)
+#endif
+
+#endif // DETOURS_INTERNAL
+#endif // DETOURS_DONT_REMOVE_SAL_20
+
+//////////////////////////////////////////////////////////////////////////////
+//
+#ifndef GUID_DEFINED
+#define GUID_DEFINED
+typedef struct  _GUID
+{
+    DWORD Data1;
+    WORD Data2;
+    WORD Data3;
+    BYTE Data4[ 8 ];
+} GUID;
+
+#ifdef INITGUID
+#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+        const GUID name \
+                = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
+#else
+#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+    const GUID name
+#endif // INITGUID
+#endif // !GUID_DEFINED
+
+#if defined(__cplusplus)
+#ifndef _REFGUID_DEFINED
+#define _REFGUID_DEFINED
+#define REFGUID             const GUID &
+#endif // !_REFGUID_DEFINED
+#else // !__cplusplus
+#ifndef _REFGUID_DEFINED
+#define _REFGUID_DEFINED
+#define REFGUID             const GUID * const
+#endif // !_REFGUID_DEFINED
+#endif // !__cplusplus
+
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(x)    (sizeof(x)/sizeof(x[0]))
+#endif
+
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+/////////////////////////////////////////////////// Instruction Target Macros.
+//
+#define DETOUR_INSTRUCTION_TARGET_NONE          ((PVOID)0)
+#define DETOUR_INSTRUCTION_TARGET_DYNAMIC       ((PVOID)(LONG_PTR)-1)
+#define DETOUR_SECTION_HEADER_SIGNATURE         0x00727444   // "Dtr\0"
+
+extern const GUID DETOUR_EXE_RESTORE_GUID;
+extern const GUID DETOUR_EXE_HELPER_GUID;
+
+#define DETOUR_TRAMPOLINE_SIGNATURE             0x21727444  // Dtr!
+typedef struct _DETOUR_TRAMPOLINE DETOUR_TRAMPOLINE, *PDETOUR_TRAMPOLINE;
+
+/////////////////////////////////////////////////////////// Binary Structures.
+//
+#pragma pack(push, 8)
+typedef struct _DETOUR_SECTION_HEADER
+{
+    DWORD       cbHeaderSize;
+    DWORD       nSignature;
+    DWORD       nDataOffset;
+    DWORD       cbDataSize;
+
+    DWORD       nOriginalImportVirtualAddress;
+    DWORD       nOriginalImportSize;
+    DWORD       nOriginalBoundImportVirtualAddress;
+    DWORD       nOriginalBoundImportSize;
+
+    DWORD       nOriginalIatVirtualAddress;
+    DWORD       nOriginalIatSize;
+    DWORD       nOriginalSizeOfImage;
+    DWORD       cbPrePE;
+
+    DWORD       nOriginalClrFlags;
+    DWORD       reserved1;
+    DWORD       reserved2;
+    DWORD       reserved3;
+
+    // Followed by cbPrePE bytes of data.
+} DETOUR_SECTION_HEADER, *PDETOUR_SECTION_HEADER;
+
+typedef struct _DETOUR_SECTION_RECORD
+{
+    DWORD       cbBytes;
+    DWORD       nReserved;
+    GUID        guid;
+} DETOUR_SECTION_RECORD, *PDETOUR_SECTION_RECORD;
+
+typedef struct _DETOUR_CLR_HEADER
+{
+    // Header versioning
+    ULONG                   cb;
+    USHORT                  MajorRuntimeVersion;
+    USHORT                  MinorRuntimeVersion;
+
+    // Symbol table and startup information
+    IMAGE_DATA_DIRECTORY    MetaData;
+    ULONG                   Flags;
+
+    // Followed by the rest of the IMAGE_COR20_HEADER
+} DETOUR_CLR_HEADER, *PDETOUR_CLR_HEADER;
+
+typedef struct _DETOUR_EXE_RESTORE
+{
+    DWORD               cb;
+    DWORD               cbidh;
+    DWORD               cbinh;
+    DWORD               cbclr;
+
+    PBYTE               pidh;
+    PBYTE               pinh;
+    PBYTE               pclr;
+
+    IMAGE_DOS_HEADER    idh;
+    union {
+        IMAGE_NT_HEADERS    inh;
+        IMAGE_NT_HEADERS32  inh32;
+        IMAGE_NT_HEADERS64  inh64;
+        BYTE                raw[sizeof(IMAGE_NT_HEADERS64) +
+                                sizeof(IMAGE_SECTION_HEADER) * 32];
+    };
+    DETOUR_CLR_HEADER   clr;
+
+} DETOUR_EXE_RESTORE, *PDETOUR_EXE_RESTORE;
+
+typedef struct _DETOUR_EXE_HELPER
+{
+    DWORD               cb;
+    DWORD               pid;
+    DWORD               nDlls;
+    CHAR                rDlls[4];
+} DETOUR_EXE_HELPER, *PDETOUR_EXE_HELPER;
+
+#pragma pack(pop)
+
+#define DETOUR_SECTION_HEADER_DECLARE(cbSectionSize) \
+{ \
+      sizeof(DETOUR_SECTION_HEADER),\
+      DETOUR_SECTION_HEADER_SIGNATURE,\
+      sizeof(DETOUR_SECTION_HEADER),\
+      (cbSectionSize),\
+      \
+      0,\
+      0,\
+      0,\
+      0,\
+      \
+      0,\
+      0,\
+      0,\
+      0,\
+}
+
+/////////////////////////////////////////////////////////////// Helper Macros.
+//
+#define DETOURS_STRINGIFY(x)    DETOURS_STRINGIFY_(x)
+#define DETOURS_STRINGIFY_(x)    #x
+
+///////////////////////////////////////////////////////////// Binary Typedefs.
+//
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_BYWAY_CALLBACK)(
+    _In_opt_ PVOID pContext,
+    _In_opt_ LPCSTR pszFile,
+    _Outptr_result_maybenull_ LPCSTR *ppszOutFile);
+
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_FILE_CALLBACK)(
+    _In_opt_ PVOID pContext,
+    _In_ LPCSTR pszOrigFile,
+    _In_ LPCSTR pszFile,
+    _Outptr_result_maybenull_ LPCSTR *ppszOutFile);
+
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_SYMBOL_CALLBACK)(
+    _In_opt_ PVOID pContext,
+    _In_ ULONG nOrigOrdinal,
+    _In_ ULONG nOrdinal,
+    _Out_ ULONG *pnOutOrdinal,
+    _In_opt_ LPCSTR pszOrigSymbol,
+    _In_opt_ LPCSTR pszSymbol,
+    _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol);
+
+typedef BOOL (CALLBACK *PF_DETOUR_BINARY_COMMIT_CALLBACK)(
+    _In_opt_ PVOID pContext);
+
+typedef BOOL (CALLBACK *PF_DETOUR_ENUMERATE_EXPORT_CALLBACK)(_In_opt_ PVOID pContext,
+                                                             _In_ ULONG nOrdinal,
+                                                             _In_opt_ LPCSTR pszName,
+                                                             _In_opt_ PVOID pCode);
+
+typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FILE_CALLBACK)(_In_opt_ PVOID pContext,
+                                                        _In_opt_ HMODULE hModule,
+                                                        _In_opt_ LPCSTR pszFile);
+
+typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FUNC_CALLBACK)(_In_opt_ PVOID pContext,
+                                                        _In_ DWORD nOrdinal,
+                                                        _In_opt_ LPCSTR pszFunc,
+                                                        _In_opt_ PVOID pvFunc);
+
+// Same as PF_DETOUR_IMPORT_FUNC_CALLBACK but extra indirection on last parameter.
+typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FUNC_CALLBACK_EX)(_In_opt_ PVOID pContext,
+                                                           _In_ DWORD nOrdinal,
+                                                           _In_opt_ LPCSTR pszFunc,
+                                                           _In_opt_ PVOID* ppvFunc);
+
+typedef VOID * PDETOUR_BINARY;
+typedef VOID * PDETOUR_LOADED_BINARY;
+
+//////////////////////////////////////////////////////////// Transaction APIs.
+//
+LONG WINAPI DetourTransactionBegin(VOID);
+LONG WINAPI DetourTransactionAbort(VOID);
+LONG WINAPI DetourTransactionCommit(VOID);
+LONG WINAPI DetourTransactionCommitEx(_Out_opt_ PVOID **pppFailedPointer);
+
+LONG WINAPI DetourUpdateThread(_In_ HANDLE hThread);
+
+LONG WINAPI DetourAttach(_Inout_ PVOID *ppPointer,
+                         _In_ PVOID pDetour);
+
+LONG WINAPI DetourAttachEx(_Inout_ PVOID *ppPointer,
+                           _In_ PVOID pDetour,
+                           _Out_opt_ PDETOUR_TRAMPOLINE *ppRealTrampoline,
+                           _Out_opt_ PVOID *ppRealTarget,
+                           _Out_opt_ PVOID *ppRealDetour);
+
+LONG WINAPI DetourDetach(_Inout_ PVOID *ppPointer,
+                         _In_ PVOID pDetour);
+
+BOOL WINAPI DetourSetIgnoreTooSmall(_In_ BOOL fIgnore);
+BOOL WINAPI DetourSetRetainRegions(_In_ BOOL fRetain);
+PVOID WINAPI DetourSetSystemRegionLowerBound(_In_ PVOID pSystemRegionLowerBound);
+PVOID WINAPI DetourSetSystemRegionUpperBound(_In_ PVOID pSystemRegionUpperBound);
+
+////////////////////////////////////////////////////////////// Code Functions.
+//
+PVOID WINAPI DetourFindFunction(_In_ LPCSTR pszModule,
+                                _In_ LPCSTR pszFunction);
+PVOID WINAPI DetourCodeFromPointer(_In_ PVOID pPointer,
+                                   _Out_opt_ PVOID *ppGlobals);
+PVOID WINAPI DetourCopyInstruction(_In_opt_ PVOID pDst,
+                                   _Inout_opt_ PVOID *ppDstPool,
+                                   _In_ PVOID pSrc,
+                                   _Out_opt_ PVOID *ppTarget,
+                                   _Out_opt_ LONG *plExtra);
+BOOL WINAPI DetourSetCodeModule(_In_ HMODULE hModule,
+                                _In_ BOOL fLimitReferencesToModule);
+
+///////////////////////////////////////////////////// Loaded Binary Functions.
+//
+HMODULE WINAPI DetourGetContainingModule(_In_ PVOID pvAddr);
+HMODULE WINAPI DetourEnumerateModules(_In_opt_ HMODULE hModuleLast);
+PVOID WINAPI DetourGetEntryPoint(_In_opt_ HMODULE hModule);
+ULONG WINAPI DetourGetModuleSize(_In_opt_ HMODULE hModule);
+BOOL WINAPI DetourEnumerateExports(_In_ HMODULE hModule,
+                                   _In_opt_ PVOID pContext,
+                                   _In_ PF_DETOUR_ENUMERATE_EXPORT_CALLBACK pfExport);
+BOOL WINAPI DetourEnumerateImports(_In_opt_ HMODULE hModule,
+                                   _In_opt_ PVOID pContext,
+                                   _In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
+                                   _In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK pfImportFunc);
+
+BOOL WINAPI DetourEnumerateImportsEx(_In_opt_ HMODULE hModule,
+                                     _In_opt_ PVOID pContext,
+                                     _In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
+                                     _In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK_EX pfImportFuncEx);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourFindPayload(_In_opt_ HMODULE hModule,
+                               _In_ REFGUID rguid,
+                               _Out_ DWORD *pcbData);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourFindPayloadEx(_In_ REFGUID rguid,
+                                 _Out_ DWORD * pcbData);
+
+DWORD WINAPI DetourGetSizeOfPayloads(_In_opt_ HMODULE hModule);
+
+///////////////////////////////////////////////// Persistent Binary Functions.
+//
+
+PDETOUR_BINARY WINAPI DetourBinaryOpen(_In_ HANDLE hFile);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourBinaryEnumeratePayloads(_In_ PDETOUR_BINARY pBinary,
+                                           _Out_opt_ GUID *pGuid,
+                                           _Out_ DWORD *pcbData,
+                                           _Inout_ DWORD *pnIterator);
+
+_Writable_bytes_(*pcbData)
+_Readable_bytes_(*pcbData)
+_Success_(return != NULL)
+PVOID WINAPI DetourBinaryFindPayload(_In_ PDETOUR_BINARY pBinary,
+                                     _In_ REFGUID rguid,
+                                     _Out_ DWORD *pcbData);
+
+PVOID WINAPI DetourBinarySetPayload(_In_ PDETOUR_BINARY pBinary,
+                                    _In_ REFGUID rguid,
+                                    _In_reads_opt_(cbData) PVOID pData,
+                                    _In_ DWORD cbData);
+BOOL WINAPI DetourBinaryDeletePayload(_In_ PDETOUR_BINARY pBinary, _In_ REFGUID rguid);
+BOOL WINAPI DetourBinaryPurgePayloads(_In_ PDETOUR_BINARY pBinary);
+BOOL WINAPI DetourBinaryResetImports(_In_ PDETOUR_BINARY pBinary);
+BOOL WINAPI DetourBinaryEditImports(_In_ PDETOUR_BINARY pBinary,
+                                    _In_opt_ PVOID pContext,
+                                    _In_opt_ PF_DETOUR_BINARY_BYWAY_CALLBACK pfByway,
+                                    _In_opt_ PF_DETOUR_BINARY_FILE_CALLBACK pfFile,
+                                    _In_opt_ PF_DETOUR_BINARY_SYMBOL_CALLBACK pfSymbol,
+                                    _In_opt_ PF_DETOUR_BINARY_COMMIT_CALLBACK pfCommit);
+BOOL WINAPI DetourBinaryWrite(_In_ PDETOUR_BINARY pBinary, _In_ HANDLE hFile);
+BOOL WINAPI DetourBinaryClose(_In_ PDETOUR_BINARY pBinary);
+
+/////////////////////////////////////////////////// Create Process & Load Dll.
+//
+typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEA)(
+    _In_opt_ LPCSTR lpApplicationName,
+    _Inout_opt_ LPSTR lpCommandLine,
+    _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+    _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+    _In_ BOOL bInheritHandles,
+    _In_ DWORD dwCreationFlags,
+    _In_opt_ LPVOID lpEnvironment,
+    _In_opt_ LPCSTR lpCurrentDirectory,
+    _In_ LPSTARTUPINFOA lpStartupInfo,
+    _Out_ LPPROCESS_INFORMATION lpProcessInformation);
+
+typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEW)(
+    _In_opt_ LPCWSTR lpApplicationName,
+    _Inout_opt_ LPWSTR lpCommandLine,
+    _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+    _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+    _In_ BOOL bInheritHandles,
+    _In_ DWORD dwCreationFlags,
+    _In_opt_ LPVOID lpEnvironment,
+    _In_opt_ LPCWSTR lpCurrentDirectory,
+    _In_ LPSTARTUPINFOW lpStartupInfo,
+    _Out_ LPPROCESS_INFORMATION lpProcessInformation);
+
+BOOL WINAPI DetourCreateProcessWithDllA(_In_opt_ LPCSTR lpApplicationName,
+                                        _Inout_opt_ LPSTR lpCommandLine,
+                                        _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+                                        _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+                                        _In_ BOOL bInheritHandles,
+                                        _In_ DWORD dwCreationFlags,
+                                        _In_opt_ LPVOID lpEnvironment,
+                                        _In_opt_ LPCSTR lpCurrentDirectory,
+                                        _In_ LPSTARTUPINFOA lpStartupInfo,
+                                        _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+                                        _In_ LPCSTR lpDllName,
+                                        _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourCreateProcessWithDllW(_In_opt_ LPCWSTR lpApplicationName,
+                                        _Inout_opt_ LPWSTR lpCommandLine,
+                                        _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+                                        _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+                                        _In_ BOOL bInheritHandles,
+                                        _In_ DWORD dwCreationFlags,
+                                        _In_opt_ LPVOID lpEnvironment,
+                                        _In_opt_ LPCWSTR lpCurrentDirectory,
+                                        _In_ LPSTARTUPINFOW lpStartupInfo,
+                                        _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+                                        _In_ LPCSTR lpDllName,
+                                        _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourCreateProcessWithDll      DetourCreateProcessWithDllW
+#define PDETOUR_CREATE_PROCESS_ROUTINE  PDETOUR_CREATE_PROCESS_ROUTINEW
+#else
+#define DetourCreateProcessWithDll      DetourCreateProcessWithDllA
+#define PDETOUR_CREATE_PROCESS_ROUTINE  PDETOUR_CREATE_PROCESS_ROUTINEA
+#endif // !UNICODE
+
+BOOL WINAPI DetourCreateProcessWithDllExA(_In_opt_ LPCSTR lpApplicationName,
+                                          _Inout_opt_ LPSTR lpCommandLine,
+                                          _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+                                          _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+                                          _In_ BOOL bInheritHandles,
+                                          _In_ DWORD dwCreationFlags,
+                                          _In_opt_ LPVOID lpEnvironment,
+                                          _In_opt_ LPCSTR lpCurrentDirectory,
+                                          _In_ LPSTARTUPINFOA lpStartupInfo,
+                                          _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+                                          _In_ LPCSTR lpDllName,
+                                          _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourCreateProcessWithDllExW(_In_opt_ LPCWSTR lpApplicationName,
+                                          _Inout_opt_  LPWSTR lpCommandLine,
+                                          _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+                                          _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+                                          _In_ BOOL bInheritHandles,
+                                          _In_ DWORD dwCreationFlags,
+                                          _In_opt_ LPVOID lpEnvironment,
+                                          _In_opt_ LPCWSTR lpCurrentDirectory,
+                                          _In_ LPSTARTUPINFOW lpStartupInfo,
+                                          _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+                                          _In_ LPCSTR lpDllName,
+                                          _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourCreateProcessWithDllEx    DetourCreateProcessWithDllExW
+#else
+#define DetourCreateProcessWithDllEx    DetourCreateProcessWithDllExA
+#endif // !UNICODE
+
+BOOL WINAPI DetourCreateProcessWithDllsA(_In_opt_ LPCSTR lpApplicationName,
+                                         _Inout_opt_ LPSTR lpCommandLine,
+                                         _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+                                         _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+                                         _In_ BOOL bInheritHandles,
+                                         _In_ DWORD dwCreationFlags,
+                                         _In_opt_ LPVOID lpEnvironment,
+                                         _In_opt_ LPCSTR lpCurrentDirectory,
+                                         _In_ LPSTARTUPINFOA lpStartupInfo,
+                                         _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+                                         _In_ DWORD nDlls,
+                                         _In_reads_(nDlls) LPCSTR *rlpDlls,
+                                         _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourCreateProcessWithDllsW(_In_opt_ LPCWSTR lpApplicationName,
+                                         _Inout_opt_ LPWSTR lpCommandLine,
+                                         _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
+                                         _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
+                                         _In_ BOOL bInheritHandles,
+                                         _In_ DWORD dwCreationFlags,
+                                         _In_opt_ LPVOID lpEnvironment,
+                                         _In_opt_ LPCWSTR lpCurrentDirectory,
+                                         _In_ LPSTARTUPINFOW lpStartupInfo,
+                                         _Out_ LPPROCESS_INFORMATION lpProcessInformation,
+                                         _In_ DWORD nDlls,
+                                         _In_reads_(nDlls) LPCSTR *rlpDlls,
+                                         _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourCreateProcessWithDlls     DetourCreateProcessWithDllsW
+#else
+#define DetourCreateProcessWithDlls     DetourCreateProcessWithDllsA
+#endif // !UNICODE
+
+BOOL WINAPI DetourProcessViaHelperA(_In_ DWORD dwTargetPid,
+                                    _In_ LPCSTR lpDllName,
+                                    _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourProcessViaHelperW(_In_ DWORD dwTargetPid,
+                                    _In_ LPCSTR lpDllName,
+                                    _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourProcessViaHelper          DetourProcessViaHelperW
+#else
+#define DetourProcessViaHelper          DetourProcessViaHelperA
+#endif // !UNICODE
+
+BOOL WINAPI DetourProcessViaHelperDllsA(_In_ DWORD dwTargetPid,
+                                        _In_ DWORD nDlls,
+                                        _In_reads_(nDlls) LPCSTR *rlpDlls,
+                                        _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);
+
+BOOL WINAPI DetourProcessViaHelperDllsW(_In_ DWORD dwTargetPid,
+                                        _In_ DWORD nDlls,
+                                        _In_reads_(nDlls) LPCSTR *rlpDlls,
+                                        _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);
+
+#ifdef UNICODE
+#define DetourProcessViaHelperDlls      DetourProcessViaHelperDllsW
+#else
+#define DetourProcessViaHelperDlls      DetourProcessViaHelperDllsA
+#endif // !UNICODE
+
+BOOL WINAPI DetourUpdateProcessWithDll(_In_ HANDLE hProcess,
+                                       _In_reads_(nDlls) LPCSTR *rlpDlls,
+                                       _In_ DWORD nDlls);
+
+BOOL WINAPI DetourUpdateProcessWithDllEx(_In_ HANDLE hProcess,
+                                         _In_ HMODULE hImage,
+                                         _In_ BOOL bIs32Bit,
+                                         _In_reads_(nDlls) LPCSTR *rlpDlls,
+                                         _In_ DWORD nDlls);
+
+BOOL WINAPI DetourCopyPayloadToProcess(_In_ HANDLE hProcess,
+                                       _In_ REFGUID rguid,
+                                       _In_reads_bytes_(cbData) PVOID pvData,
+                                       _In_ DWORD cbData);
+BOOL WINAPI DetourRestoreAfterWith(VOID);
+BOOL WINAPI DetourRestoreAfterWithEx(_In_reads_bytes_(cbData) PVOID pvData,
+                                     _In_ DWORD cbData);
+BOOL WINAPI DetourIsHelperProcess(VOID);
+VOID CALLBACK DetourFinishHelperProcess(_In_ HWND,
+                                        _In_ HINSTANCE,
+                                        _In_ LPSTR,
+                                        _In_ INT);
+
+//
+//////////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+//////////////////////////////////////////////// Detours Internal Definitions.
+//
+#ifdef __cplusplus
+#ifdef DETOURS_INTERNAL
+
+#define NOTHROW
+// #define NOTHROW (nothrow)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+#if (_MSC_VER < 1299)
+#include <imagehlp.h>
+typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64;
+typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64;
+typedef IMAGEHLP_SYMBOL SYMBOL_INFO;
+typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO;
+
+static inline
+LONG InterlockedCompareExchange(_Inout_ LONG *ptr, _In_ LONG nval, _In_ LONG oval)
+{
+    return (LONG)::InterlockedCompareExchange((PVOID*)ptr, (PVOID)nval, (PVOID)oval);
+}
+#else
+#pragma warning(push)
+#pragma warning(disable:4091) // empty typedef
+#include <dbghelp.h>
+#pragma warning(pop)
+#endif
+
+#ifdef IMAGEAPI // defined by DBGHELP.H
+typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(_In_ LPAPI_VERSION AppVersion);
+
+typedef BOOL (NTAPI *PF_SymInitialize)(_In_ HANDLE hProcess,
+                                       _In_opt_ LPCSTR UserSearchPath,
+                                       _In_ BOOL fInvadeProcess);
+typedef DWORD (NTAPI *PF_SymSetOptions)(_In_ DWORD SymOptions);
+typedef DWORD (NTAPI *PF_SymGetOptions)(VOID);
+typedef DWORD64 (NTAPI *PF_SymLoadModule64)(_In_ HANDLE hProcess,
+                                            _In_opt_ HANDLE hFile,
+                                            _In_ LPSTR ImageName,
+                                            _In_opt_ LPSTR ModuleName,
+                                            _In_ DWORD64 BaseOfDll,
+                                            _In_opt_ DWORD SizeOfDll);
+typedef BOOL (NTAPI *PF_SymGetModuleInfo64)(_In_ HANDLE hProcess,
+                                            _In_ DWORD64 qwAddr,
+                                            _Out_ PIMAGEHLP_MODULE64 ModuleInfo);
+typedef BOOL (NTAPI *PF_SymFromName)(_In_ HANDLE hProcess,
+                                     _In_ LPSTR Name,
+                                     _Out_ PSYMBOL_INFO Symbol);
+
+typedef struct _DETOUR_SYM_INFO
+{
+    HANDLE                  hProcess;
+    HMODULE                 hDbgHelp;
+    PF_ImagehlpApiVersionEx pfImagehlpApiVersionEx;
+    PF_SymInitialize        pfSymInitialize;
+    PF_SymSetOptions        pfSymSetOptions;
+    PF_SymGetOptions        pfSymGetOptions;
+    PF_SymLoadModule64      pfSymLoadModule64;
+    PF_SymGetModuleInfo64   pfSymGetModuleInfo64;
+    PF_SymFromName          pfSymFromName;
+} DETOUR_SYM_INFO, *PDETOUR_SYM_INFO;
+
+PDETOUR_SYM_INFO DetourLoadImageHlp(VOID);
+
+#endif // IMAGEAPI
+
+#if defined(_INC_STDIO) && !defined(_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS)
+#error detours.h must be included before stdio.h (or at least define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS earlier)
+#endif
+#define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS 1
+
+#ifndef DETOUR_TRACE
+#if DETOUR_DEBUG
+#define DETOUR_TRACE(x) printf x
+#define DETOUR_BREAK()  __debugbreak()
+#include <stdio.h>
+#include <limits.h>
+#else
+#define DETOUR_TRACE(x)
+#define DETOUR_BREAK()
+#endif
+#endif
+
+#if 1 || defined(DETOURS_IA64)
+
+//
+// IA64 instructions are 41 bits, 3 per bundle, plus 5 bit bundle template => 128 bits per bundle.
+//
+
+#define DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE (3)
+
+#define DETOUR_IA64_TEMPLATE_OFFSET (0)
+#define DETOUR_IA64_TEMPLATE_SIZE   (5)
+
+#define DETOUR_IA64_INSTRUCTION_SIZE (41)
+#define DETOUR_IA64_INSTRUCTION0_OFFSET (DETOUR_IA64_TEMPLATE_SIZE)
+#define DETOUR_IA64_INSTRUCTION1_OFFSET (DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTION_SIZE)
+#define DETOUR_IA64_INSTRUCTION2_OFFSET (DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTION_SIZE + DETOUR_IA64_INSTRUCTION_SIZE)
+
+C_ASSERT(DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE * DETOUR_IA64_INSTRUCTION_SIZE == 128);
+
+__declspec(align(16)) struct DETOUR_IA64_BUNDLE
+{
+  public:
+    union
+    {
+        BYTE    data[16];
+        UINT64  wide[2];
+    };
+
+    enum {
+        A_UNIT  = 1u,
+        I_UNIT  = 2u,
+        M_UNIT  = 3u,
+        B_UNIT  = 4u,
+        F_UNIT  = 5u,
+        L_UNIT  = 6u,
+        X_UNIT  = 7u,
+    };
+    struct DETOUR_IA64_METADATA
+    {
+        ULONG       nTemplate       : 8;    // Instruction template.
+        ULONG       nUnit0          : 4;    // Unit for slot 0
+        ULONG       nUnit1          : 4;    // Unit for slot 1
+        ULONG       nUnit2          : 4;    // Unit for slot 2
+    };
+
+  protected:
+    static const DETOUR_IA64_METADATA s_rceCopyTable[33];
+
+    UINT RelocateBundle(_Inout_ DETOUR_IA64_BUNDLE* pDst, _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra) const;
+
+    bool RelocateInstruction(_Inout_ DETOUR_IA64_BUNDLE* pDst,
+                             _In_ BYTE slot,
+                             _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra) const;
+
+    // 120 112 104 96 88 80 72 64 56 48 40 32 24 16  8  0
+    //  f.  e.  d. c. b. a. 9. 8. 7. 6. 5. 4. 3. 2. 1. 0.
+
+    //                                      00
+    // f.e. d.c. b.a. 9.8. 7.6. 5.4. 3.2. 1.0.
+    // 0000 0000 0000 0000 0000 0000 0000 001f : Template [4..0]
+    // 0000 0000 0000 0000 0000 03ff ffff ffe0 : Zero [ 41..  5]
+    // 0000 0000 0000 0000 0000 3c00 0000 0000 : Zero [ 45.. 42]
+    // 0000 0000 0007 ffff ffff c000 0000 0000 : One  [ 82.. 46]
+    // 0000 0000 0078 0000 0000 0000 0000 0000 : One  [ 86.. 83]
+    // 0fff ffff ff80 0000 0000 0000 0000 0000 : Two  [123.. 87]
+    // f000 0000 0000 0000 0000 0000 0000 0000 : Two  [127..124]
+    BYTE    GetTemplate() const;
+    // Get 4 bit opcodes.
+    BYTE    GetInst0() const;
+    BYTE    GetInst1() const;
+    BYTE    GetInst2() const;
+    BYTE    GetUnit(BYTE slot) const;
+    BYTE    GetUnit0() const;
+    BYTE    GetUnit1() const;
+    BYTE    GetUnit2() const;
+    // Get 37 bit data.
+    UINT64  GetData0() const;
+    UINT64  GetData1() const;
+    UINT64  GetData2() const;
+
+    // Get/set the full 41 bit instructions.
+    UINT64  GetInstruction(BYTE slot) const;
+    UINT64  GetInstruction0() const;
+    UINT64  GetInstruction1() const;
+    UINT64  GetInstruction2() const;
+    void    SetInstruction(BYTE slot, UINT64 instruction);
+    void    SetInstruction0(UINT64 instruction);
+    void    SetInstruction1(UINT64 instruction);
+    void    SetInstruction2(UINT64 instruction);
+
+    // Get/set bitfields.
+    static UINT64 GetBits(UINT64 Value, UINT64 Offset, UINT64 Count);
+    static UINT64 SetBits(UINT64 Value, UINT64 Offset, UINT64 Count, UINT64 Field);
+
+    // Get specific read-only fields.
+    static UINT64 GetOpcode(UINT64 instruction); // 4bit opcode
+    static UINT64 GetX(UINT64 instruction); // 1bit opcode extension
+    static UINT64 GetX3(UINT64 instruction); // 3bit opcode extension
+    static UINT64 GetX6(UINT64 instruction); // 6bit opcode extension
+
+    // Get/set specific fields.
+    static UINT64 GetImm7a(UINT64 instruction);
+    static UINT64 SetImm7a(UINT64 instruction, UINT64 imm7a);
+    static UINT64 GetImm13c(UINT64 instruction);
+    static UINT64 SetImm13c(UINT64 instruction, UINT64 imm13c);
+    static UINT64 GetSignBit(UINT64 instruction);
+    static UINT64 SetSignBit(UINT64 instruction, UINT64 signBit);
+    static UINT64 GetImm20a(UINT64 instruction);
+    static UINT64 SetImm20a(UINT64 instruction, UINT64 imm20a);
+    static UINT64 GetImm20b(UINT64 instruction);
+    static UINT64 SetImm20b(UINT64 instruction, UINT64 imm20b);
+
+    static UINT64 SignExtend(UINT64 Value, UINT64 Offset);
+
+    BOOL    IsMovlGp() const;
+
+    VOID    SetInst(BYTE Slot, BYTE nInst);
+    VOID    SetInst0(BYTE nInst);
+    VOID    SetInst1(BYTE nInst);
+    VOID    SetInst2(BYTE nInst);
+    VOID    SetData(BYTE Slot, UINT64 nData);
+    VOID    SetData0(UINT64 nData);
+    VOID    SetData1(UINT64 nData);
+    VOID    SetData2(UINT64 nData);
+    BOOL    SetNop(BYTE Slot);
+    BOOL    SetNop0();
+    BOOL    SetNop1();
+    BOOL    SetNop2();
+
+  public:
+    BOOL    IsBrl() const;
+    VOID    SetBrl();
+    VOID    SetBrl(UINT64 target);
+    UINT64  GetBrlTarget() const;
+    VOID    SetBrlTarget(UINT64 target);
+    VOID    SetBrlImm(UINT64 imm);
+    UINT64  GetBrlImm() const;
+
+    UINT64  GetMovlGp() const;
+    VOID    SetMovlGp(UINT64 gp);
+
+    VOID    SetStop();
+
+    UINT    Copy(_Out_ DETOUR_IA64_BUNDLE *pDst, _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra = NULL) const;
+};
+#endif // DETOURS_IA64
+
+#ifdef DETOURS_ARM
+
+#define DETOURS_PFUNC_TO_PBYTE(p)  ((PBYTE)(((ULONG_PTR)(p)) & ~(ULONG_PTR)1))
+#define DETOURS_PBYTE_TO_PFUNC(p)  ((PBYTE)(((ULONG_PTR)(p)) | (ULONG_PTR)1))
+
+#endif // DETOURS_ARM
+
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#define DETOUR_OFFLINE_LIBRARY(x)                                       \
+PVOID WINAPI DetourCopyInstruction##x(_In_opt_ PVOID pDst,              \
+                                      _Inout_opt_ PVOID *ppDstPool,     \
+                                      _In_ PVOID pSrc,                  \
+                                      _Out_opt_ PVOID *ppTarget,        \
+                                      _Out_opt_ LONG *plExtra);         \
+                                                                        \
+BOOL WINAPI DetourSetCodeModule##x(_In_ HMODULE hModule,                \
+                                   _In_ BOOL fLimitReferencesToModule); \
+
+DETOUR_OFFLINE_LIBRARY(X86)
+DETOUR_OFFLINE_LIBRARY(X64)
+DETOUR_OFFLINE_LIBRARY(ARM)
+DETOUR_OFFLINE_LIBRARY(ARM64)
+DETOUR_OFFLINE_LIBRARY(IA64)
+
+#undef DETOUR_OFFLINE_LIBRARY
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Helpers for manipulating page protection.
+//
+
+_Success_(return != FALSE)
+BOOL WINAPI DetourVirtualProtectSameExecuteEx(_In_  HANDLE hProcess,
+                                              _In_  PVOID pAddress,
+                                              _In_  SIZE_T nSize,
+                                              _In_  DWORD dwNewProtect,
+                                              _Out_ PDWORD pdwOldProtect);
+
+_Success_(return != FALSE)
+BOOL WINAPI DetourVirtualProtectSameExecute(_In_  PVOID pAddress,
+                                            _In_  SIZE_T nSize,
+                                            _In_  DWORD dwNewProtect,
+                                            _Out_ PDWORD pdwOldProtect);
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+//////////////////////////////////////////////////////////////////////////////
+
+#define MM_ALLOCATION_GRANULARITY 0x10000
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // DETOURS_INTERNAL
+#endif // __cplusplus
+
+#endif // _DETOURS_H_
+//
+////////////////////////////////////////////////////////////////  End of File.

+ 27 - 0
include/Detours/detver.h

@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+//  Common version parameters.
+//
+//  Microsoft Research Detours Package, Version 3.0 Build_343.
+//
+//  Copyright (c) Microsoft Corporation.  All rights reserved.
+//
+
+#define _USING_V110_SDK71_ 1
+#include "winver.h"
+#if 0
+#include <windows.h>
+#include <detours.h>
+#else
+#ifndef DETOURS_STRINGIFY
+#define DETOURS_STRINGIFY(x)    DETOURS_STRINGIFY_(x)
+#define DETOURS_STRINGIFY_(x)    #x
+#endif
+
+#define VER_FILEFLAGSMASK   0x3fL
+#define VER_FILEFLAGS       0x0L
+#define VER_FILEOS          0x00040004L
+#define VER_FILETYPE        0x00000002L
+#define VER_FILESUBTYPE     0x00000000L
+#endif
+#define VER_DETOURS_BITS    DETOUR_STRINGIFY(DETOURS_BITS)

+ 89 - 0
include/Detours/syelog.h

@@ -0,0 +1,89 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+//  Detours Test Program (syelog.h of syelog.lib)
+//
+//  Microsoft Research Detours Package, Version 3.0.
+//
+//  Copyright (c) Microsoft Corporation.  All rights reserved.
+//
+#pragma once
+#ifndef _SYELOGD_H_
+#define _SYELOGD_H_
+#include <stdarg.h>
+
+#pragma pack(push, 1)
+#pragma warning(push)
+#pragma warning(disable: 4200)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//
+#define SYELOG_PIPE_NAMEA       "\\\\.\\pipe\\syelog"
+#define SYELOG_PIPE_NAMEW       L"\\\\.\\pipe\\syelog"
+#ifdef UNICODE
+#define SYELOG_PIPE_NAME        SYELOG_PIPE_NAMEW
+#else
+#define SYELOG_PIPE_NAME        SYELOG_PIPE_NAMEA
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+//
+#define SYELOG_MAXIMUM_MESSAGE  4086    // 4096 - sizeof(header stuff)
+
+typedef struct _SYELOG_MESSAGE
+{
+    USHORT      nBytes;
+    BYTE        nFacility;
+    BYTE        nSeverity;
+    DWORD       nProcessId;
+    FILETIME    ftOccurance;
+    BOOL        fTerminate;
+    CHAR        szMessage[SYELOG_MAXIMUM_MESSAGE];
+} SYELOG_MESSAGE, *PSYELOG_MESSAGE;
+
+
+// Facility Codes.
+//
+#define SYELOG_FACILITY_KERNEL          0x10            // OS Kernel
+#define SYELOG_FACILITY_SECURITY        0x20            // OS Security
+#define SYELOG_FACILITY_LOGGING         0x30            // OS Logging-internal
+#define SYELOG_FACILITY_SERVICE         0x40            // User-mode system daemon
+#define SYELOG_FACILITY_APPLICATION     0x50            // User-mode application
+#define SYELOG_FACILITY_USER            0x60            // User self-generated.
+#define SYELOG_FACILITY_LOCAL0          0x70            // Locally defined.
+#define SYELOG_FACILITY_LOCAL1          0x71            // Locally defined.
+#define SYELOG_FACILITY_LOCAL2          0x72            // Locally defined.
+#define SYELOG_FACILITY_LOCAL3          0x73            // Locally defined.
+#define SYELOG_FACILITY_LOCAL4          0x74            // Locally defined.
+#define SYELOG_FACILITY_LOCAL5          0x75            // Locally defined.
+#define SYELOG_FACILITY_LOCAL6          0x76            // Locally defined.
+#define SYELOG_FACILITY_LOCAL7          0x77            // Locally defined.
+#define SYELOG_FACILITY_LOCAL8          0x78            // Locally defined.
+#define SYELOG_FACILITY_LOCAL9          0x79            // Locally defined.
+
+// Severity Codes.
+//
+#define SYELOG_SEVERITY_FATAL           0x00            // System is dead.
+#define SYELOG_SEVERITY_ALERT           0x10            // Take action immediately.
+#define SYELOG_SEVERITY_CRITICAL        0x20            // Critical condition.
+#define SYELOG_SEVERITY_ERROR           0x30            // Error
+#define SYELOG_SEVERITY_WARNING         0x40            // Warning
+#define SYELOG_SEVERITY_NOTICE          0x50            // Significant condition.
+#define SYELOG_SEVERITY_INFORMATION     0x60            // Informational
+#define SYELOG_SEVERITY_AUDIT_FAIL      0x66            // Audit Failed
+#define SYELOG_SEVERITY_AUDIT_PASS      0x67            // Audit Succeeeded
+#define SYELOG_SEVERITY_DEBUG           0x70            // Debugging
+
+// Logging Functions.
+//
+VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility);
+VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...);
+VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args);
+VOID SyelogClose(BOOL fTerminate);
+
+#pragma warning(pop)
+#pragma pack(pop)
+
+#endif //  _SYELOGD_H_
+//
+///////////////////////////////////////////////////////////////// End of File.

+ 12 - 0
include/zpzDll/zpzDll.h

@@ -0,0 +1,12 @@
+#pragma once
+
+#ifdef HOOKAPI_EXPORTS
+#define HOOKAPI_API __declspec(dllexport)
+#else
+#define HOOKAPI_API __declspec(dllimport)
+#endif
+
+HOOKAPI_API BOOL InstallHook();
+HOOKAPI_API void UninstallHook();
+
+HOOKAPI_API void SetHwnd(HWND hWnd);

BIN
lib/debug/detours.lib


BIN
lib/debug/syelog.lib


BIN
lib/debug/zpzDll.lib


BIN
lib/release/detours.lib


BIN
lib/release/syelog.lib


+ 45 - 48
zhipuzi_pay_plugin/wnd/CValueWnd.cpp

@@ -5,6 +5,8 @@
 
 #include "../tool/CSerialPort.h"
 
+#include <zpzDll/zpzDll.h>
+
 void CValueWnd::Notify(TNotifyUI& msg)
 {
 	if (msg.sType == _T("click"))
@@ -25,57 +27,52 @@ void CValueWnd::Init()
 void CValueWnd::ReadValue()
 {
 	//读取串口的模式
-	CComHelper helper;
-	std::vector<std::wstring> comVector = helper.getComPort();
-
-	for (std::vector<std::wstring>::iterator it = comVector.begin(); it != comVector.end(); it++)
+	//CComHelper helper;
+	//std::vector<std::wstring> comVector = helper.getComPort();
+
+	//for (std::vector<std::wstring>::iterator it = comVector.begin(); it != comVector.end(); it++)
+	//{
+	//	std::wstring comName = *it;
+	//	LOG_INFO("comName:" << comName.c_str());
+	//}
+
+	//int nReadType = 1;
+
+	//if (nReadType == 1)
+	//{
+	//	std::wstring com_name = L"COM2";
+	//	CSerialPort serial(com_name.c_str(), 2400);
+
+	//	bool ret = serial.openComm();
+	//	if (!ret)
+	//	{
+	//		LOG_INFO("open com failed!");
+	//		return;
+	//	}
+
+	//	while (true)
+	//	{
+	//		//开始读取串口的数据			
+	//		char a[1024] = { 0 };
+	//		serial.readFromComm(a, 1024);
+
+	//		LOG_INFO("a:" << a);
+
+	//		Sleep(200);
+	//	}
+
+	//	serial.closeComm();
+	//}
+	//} 
+
+	BOOL ret = InstallHook();
+	if (ret)
 	{
-		std::wstring comName = *it;
-		LOG_INFO("comName:" << comName.c_str());
+		int a = 1;
 	}
 
-	int nReadType = 1;
-
-	if (nReadType == 1)
-	{
-		std::wstring com_name = L"COM2";
-		CSerialPort serial(com_name.c_str(), 2400);
-
-		bool ret = serial.openComm();
-		if (!ret)
-		{
-			LOG_INFO("open com failed!");
-			return;
-		}
-
-		//HANDLE m_hComm = CreateFile(L"COM1",
-		//	GENERIC_READ | GENERIC_WRITE, //允许读和写
-		//	FILE_SHARE_READ | FILE_SHARE_WRITE,		//独占方式
-		//	NULL, OPEN_EXISTING,   //打开而不是创建
-		//	0,   //同步方式
-		//	NULL
-		//);
-
-		//if (m_hComm == INVALID_HANDLE_VALUE)
-		//{
-		//	int error = GetLastError();
-		//	int a = error;
-
-		//}
-
-		while (true)
-		{
-			//开始读取串口的数据			
-			char a[1024] = { 0 };
-			serial.readFromComm(a, 1024);
-
-			LOG_INFO("a:" << a);
-
-			Sleep(200);
-		}
-
-		serial.closeComm();
-	}
+	SetHwnd(m_hWnd);
+	int b = 1;
 }
 
 LRESULT CValueWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)

+ 2 - 2
zhipuzi_pay_plugin/zhipuzi_pay_plugin.vcxproj

@@ -128,7 +128,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
       <PreprocessorDefinitions>_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x600;LOG4CPLUS_DISABLE_DLL_RUNTIME_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>false</ConformanceMode>
       <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <AdditionalIncludeDirectories>$(SolutionDir)include;$(ProjectDir)pch</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)include;</AdditionalIncludeDirectories>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
       <DisableSpecificWarnings>4099</DisableSpecificWarnings>
     </ClCompile>
@@ -136,7 +136,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <AdditionalLibraryDirectories>$(SolutionDir)lib\debug</AdditionalLibraryDirectories>
-      <AdditionalDependencies>dbghelp.lib;winmm.lib;setupapi.lib;AdvAPI32.lib;Shell32.lib;user32.lib;kernel32.lib;Gdi32.lib;libboost_date_time-vc141-mt-sgd-x32-1_70.lib;libboost_regex-vc141-mt-sgd-x32-1_70.lib;sqlite3.lib;libcurl.lib;DuiLib_ud.lib;log4cplusUD.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>dbghelp.lib;winmm.lib;setupapi.lib;AdvAPI32.lib;Shell32.lib;user32.lib;kernel32.lib;Gdi32.lib;libboost_date_time-vc141-mt-sgd-x32-1_70.lib;libboost_regex-vc141-mt-sgd-x32-1_70.lib;sqlite3.lib;libcurl.lib;DuiLib_ud.lib;log4cplusUD.lib;version.lib;zpzDll.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <IgnoreSpecificDefaultLibraries>
       </IgnoreSpecificDefaultLibraries>
       <Version>

BIN
zpzDll/Debug/dllmain.obj


BIN
zpzDll/Debug/stdafx.obj


BIN
zpzDll/Debug/vc141.idb


BIN
zpzDll/Debug/vc141.pdb


+ 0 - 18
zpzDll/Debug/zpzDll.Build.CppClean.log

@@ -1,18 +0,0 @@
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.pch
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\vc141.pdb
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\vc141.idb
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\stdafx.obj
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.obj
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\dllmain.obj
-d:\work\zhipuzi_pay_plugin\debug\zpzdll.dll
-d:\work\zhipuzi_pay_plugin\debug\zpzdll.ilk
-d:\work\zhipuzi_pay_plugin\debug\zpzdll.pdb
-d:\work\zhipuzi_pay_plugin\debug\zpzdll.lib
-d:\work\zhipuzi_pay_plugin\debug\zpzdll.exp
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\cl.command.1.tlog
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\cl.read.1.tlog
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\cl.write.1.tlog
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\link.command.1.tlog
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\link.read.1.tlog
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\link.write.1.tlog
-d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\zpzdll.write.1u.tlog

+ 0 - 3
zpzDll/Debug/zpzDll.log

@@ -1,3 +0,0 @@
-  zpzDll.cpp
-    正在创建库 D:\work\zhipuzi_pay_plugin\Debug\zpzDll.lib 和对象 D:\work\zhipuzi_pay_plugin\Debug\zpzDll.exp
-  zpzDll.vcxproj -> D:\work\zhipuzi_pay_plugin\Debug\zpzDll.dll

BIN
zpzDll/Debug/zpzDll.obj


BIN
zpzDll/Debug/zpzDll.pch


BIN
zpzDll/Debug/zpzDll.tlog/CL.command.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/CL.read.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/CL.write.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.16612.delete.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.command.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.read.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.write.1.tlog


+ 0 - 2
zpzDll/Debug/zpzDll.tlog/zpzDll.lastbuildstate

@@ -1,2 +0,0 @@
-#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
-Debug|Win32|D:\work\zhipuzi_pay_plugin\|

BIN
zpzDll/Debug/zpzDll.tlog/zpzDll.write.1u.tlog


+ 112 - 0
zpzDll/Hook.cpp

@@ -0,0 +1,112 @@
+#include "stdafx.h"
+#include "Hook.h"
+
+#include <windows.h>
+#include <stdio.h>
+
+#include "Detours/detours.h"
+#include "Detours/detver.h"
+
+#include <string>
+
+extern HWND g_hWnd;
+
+static HANDLE (WINAPI * Real_CreateFileW)(
+	__in     LPCWSTR lpFileName,
+	__in     DWORD dwDesiredAccess,
+	__in     DWORD dwShareMode,
+	__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+	__in     DWORD dwCreationDisposition,
+	__in     DWORD dwFlagsAndAttributes,
+	__in_opt HANDLE hTemplateFile
+	) = CreateFileW;
+
+static HANDLE(WINAPI * Real_CreateFileA)(
+	__in     LPCSTR lpFileName,
+	__in     DWORD dwDesiredAccess,
+	__in     DWORD dwShareMode,
+	__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+	__in     DWORD dwCreationDisposition,
+	__in     DWORD dwFlagsAndAttributes,
+	__in_opt HANDLE hTemplateFile
+	) = CreateFileA;
+
+HANDLE WINAPI Mine_CreateFileW(
+	__in     LPCWSTR lpFileName,
+	__in     DWORD dwDesiredAccess,
+	__in     DWORD dwShareMode,
+	__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+	__in     DWORD dwCreationDisposition,
+	__in     DWORD dwFlagsAndAttributes,
+	__in_opt HANDLE hTemplateFile
+)
+{
+	std::wstring wsFileName = lpFileName;
+
+	if (wsFileName == L"COM1" || wsFileName == L"com1")
+	{
+		MessageBox(NULL, L"1111111111", L"2222", MB_OK);
+	}
+
+	return Real_CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
+}
+
+HANDLE WINAPI Mine_CreateFileA(
+	__in     LPCSTR lpFileName,
+	__in     DWORD dwDesiredAccess,
+	__in     DWORD dwShareMode,
+	__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+	__in     DWORD dwCreationDisposition,
+	__in     DWORD dwFlagsAndAttributes,
+	__in_opt HANDLE hTemplateFile
+)
+{
+	std::string FileName = lpFileName;
+
+	if (FileName == "COM1" || FileName == "com1")
+	{
+		MessageBox(NULL, L"1111111111", L"2222", MB_OK);
+	}
+
+	return Real_CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
+}
+
+void Hook()
+{
+	LONG error;
+
+	DetourRestoreAfterWith();
+	DetourTransactionBegin();
+	DetourUpdateThread(GetCurrentThread());
+
+	DetourAttach(&(PVOID&)Real_CreateFileW, Mine_CreateFileW);
+	DetourAttach(&(PVOID&)Real_CreateFileA, Mine_CreateFileA);
+
+	error = DetourTransactionCommit();
+
+	if (error == NO_ERROR) {
+		printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:"
+			" Detoured Echo().\n");
+	}
+	else {
+		printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:"
+			" Error detouring Echo(): %d\n", error);
+	}
+}
+
+void UnHook()
+{
+	LONG error;
+
+	DetourTransactionBegin();
+	DetourUpdateThread(GetCurrentThread());
+
+	DetourDetach(&(PVOID&)Real_CreateFileW, Mine_CreateFileW);
+	DetourDetach(&(PVOID&)Real_CreateFileA, Mine_CreateFileA);
+
+	error = DetourTransactionCommit();
+
+	printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:"
+		" Removed Echo() (result=%d)\n", error);
+	fflush(stdout);
+}

+ 5 - 0
zpzDll/Hook.h

@@ -0,0 +1,5 @@
+#pragma once
+
+void Hook();
+void UnHook();
+

+ 16 - 7
zpzDll/dllmain.cpp

@@ -1,24 +1,33 @@
 // dllmain.cpp : 定义 DLL 应用程序的入口点。
 #include "stdafx.h"
 
+#include "Hook.h"
+
 HINSTANCE g_Inst = NULL; //DLL模块句柄
 
-BOOL APIENTRY DllMain( HMODULE hModule,
-                       DWORD  ul_reason_for_call,
-                       LPVOID lpReserved
+BOOL APIENTRY DllMain(HMODULE hModule,
+                      DWORD  ul_reason_for_call,
+                      LPVOID lpReserved
                      )
 {
-    switch (ul_reason_for_call)
+    g_Inst = (HINSTANCE)hModule;
+
+    switch(ul_reason_for_call)
     {
     case DLL_PROCESS_ATTACH:
+	{
+		//Hook();
+		break;
+	}
     case DLL_THREAD_ATTACH:
     case DLL_THREAD_DETACH:
     case DLL_PROCESS_DETACH:
-        break;
+	{
+		//UnHook();
+		break;
+	}
     }
 
-	g_Inst = (HINSTANCE)hModule;
-
     return TRUE;
 }
 

+ 28 - 12
zpzDll/zpzDll.cpp

@@ -7,7 +7,7 @@
 #include <windows.h>
 
 #pragma data_seg("shared")  
-HWND hWnd = NULL;
+HWND g_hWnd = NULL;
 HHOOK g_Hook = NULL;
 #pragma data_seg()  
 
@@ -15,25 +15,41 @@ HHOOK g_Hook = NULL;
 
 extern HINSTANCE g_Inst;
 
-//鼠标钩子过程
-LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
+/*
+ *钩子过程函数,不做任何处理,因为目的仅仅是把dll注入到进程
+ **/
+LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)
 {
-	if (nCode < 0)
+	return CallNextHookEx(g_Hook, nCode, wParam, lParam);
+}
+
+/*
+ *对所有进程安装钩子,所有新开进程都会加载这个dll
+ **/
+BOOL InstallHook()
+{
+	if (g_Hook == NULL)
 	{
-		return CallNextHookEx(g_Hook, nCode, wParam, lParam);
+		g_Hook = SetWindowsHookEx(WH_CBT, CBTProc, g_Inst, 0);
+
+		if (g_Hook != NULL)
+		{
+			return TRUE;
+		}
 	}
 
-	return 1;
+	return FALSE;
 }
 
-//安装鼠标钩子过程的函数
-void SetHook()
+void UninstallHook()
 {
-	g_Hook = SetWindowsHookEx(WH_MOUSE, MouseProc, g_Inst, 0);
+	if (UnhookWindowsHookEx(g_Hook))
+	{
+		g_Hook = NULL;
+	}
 }
 
-void SetHookOff()
+void SetHwnd(HWND hWnd)
 {
-	UnhookWindowsHookEx(g_Hook);
+	g_hWnd = hWnd;
 }
-

+ 10 - 2
zpzDll/zpzDll.h

@@ -1,4 +1,12 @@
 #pragma once
 
-__declspec(dllexport) void SetHook();
-__declspec(dllexport) void SetHookOff();
+#ifdef HOOKAPI_EXPORTS
+#define HOOKAPI_API __declspec(dllexport)
+#else
+#define HOOKAPI_API __declspec(dllimport)
+#endif
+
+HOOKAPI_API BOOL InstallHook();
+HOOKAPI_API void UninstallHook();
+
+HOOKAPI_API void SetHwnd(HWND hWnd);

+ 10 - 1
zpzDll/zpzDll.vcxproj

@@ -90,14 +90,21 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;_DEBUG;ZPZDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;_DEBUG;ZPZDLL_EXPORTS;_WINDOWS;_USRDLL;HOOKAPI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <AdditionalIncludeDirectories>$(SolutionDir)include;</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)lib\debug</AdditionalLibraryDirectories>
+      <AdditionalDependencies>detours.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>copy $(TargetPath) $(SolutionDir)bin\$(Platform)\$(Configuration)\zhipuzi_pay_plugin\
+copy $(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\zpzDll.lib $(SolutionDir)lib\debug\</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -151,12 +158,14 @@
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="Hook.h" />
     <ClInclude Include="stdafx.h" />
     <ClInclude Include="targetver.h" />
     <ClInclude Include="zpzDll.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="dllmain.cpp" />
+    <ClCompile Include="Hook.cpp" />
     <ClCompile Include="stdafx.cpp">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>

+ 6 - 0
zpzDll/zpzDll.vcxproj.filters

@@ -24,6 +24,9 @@
     <ClInclude Include="zpzDll.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="Hook.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="stdafx.cpp">
@@ -35,5 +38,8 @@
     <ClCompile Include="dllmain.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="Hook.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>