HttpWatch抓包頭信息轉換成au3書寫格式

HttpWatch抓包頭信息轉換成au3書寫格式
本帖最後由 komaau3 於 2011-6-20 15:58 編輯

感覺會蠻方便,把HttpWatch抓包頭信息轉換成au3的書寫格式
這樣的正則可能不會通用,測試下把,不能用自己修改下
1.jpg
下載 (69.4 KB)
2011-6-20 08:08

  1. #include <ButtonConstants.au3>

  2. #include <EditConstants.au3>

  3. #include <GUIConstantsEx.au3>

  4. #include <StaticConstants.au3>

  5. #include <WindowsConstants.au3>

  6. #NoTrayIcon

  7. #Region ### START Koda GUI section ### Form=

  8. $Form1 = GUICreate("HttpWatch抓包頭信息轉換", 452, 337, 276, 160)

  9. $Edit1 = GUICtrlCreateEdit("", 0, 0, 449, 137, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))

  10. GUICtrlSetData(-1, "此處粘貼HttpWatch抓包原型")

  11. $Group1 = GUICtrlCreateGroup("", 0, 288, 321, 41)

  12. $Input1 = GUICtrlCreateInput("$oHTTP", 168, 301, 49, 21)

  13. $Button1 = GUICtrlCreateButton("轉換", 24, 298, 59, 25)

  14. $Button2 = GUICtrlCreateButton("複製", 232, 298, 59, 25)

  15. $Label1 = GUICtrlCreateLabel("對象句柄:", 96, 304, 64, 17)

  16. GUICtrlCreateGroup("", -99, -99, 1, 1)

  17. $Button3 = GUICtrlCreateButton("退出", 368, 303, 59, 25)

  18. $Edit2 = GUICtrlCreateEdit("", 0, 144, 449, 145, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))

  19. GUICtrlSetData(-1, "轉換後數據自動複製到剪切板")


  20. #EndRegion ### END Koda GUI section ###

  21. Local $Header


  22.         $nMsg = GUIGetMsg()

  23.         Switch $nMsg

  24.                 Case $GUI_EVENT_CLOSE

  25.                         Exit

  26.                 Case $Button1

  27.                         $Data = GUICtrlRead($Edit1)

  28.                         $Handle = GUICtrlRead($Input1)

  29.                         $String = StringRegExp($Data, ".*?\:\h.*?\r\n", 3)

  30.                         If Not @Error Then

  31.                                 For $a = 0 To UBound($String)-1

  32.                                         $Request = StringRegExpReplace($String[$a], "\r\n", "")

  33.                                         $Request = StringRegExpReplace($Request, ":\h", "','")

  34.                                         $Header &= $Handle & ".setRequestHeader('" & $Request & "')" & @CRLF

  35.                                 Next

  36.                                 ClipPut($Header)

  37.                                 GUICtrlSetData($Edit2, $Header)

  38.                                 $Header = ""

  39.                         EndIf

  40.                 Case $Button2

  41.                         ClipPut(GUICtrlRead($Edit2))

  42.                 Case $Button3

  43.                         Exit

  44.         EndSwitch


複製代碼 高亮切換
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章