Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Autoit从IE embed中的flash程序检索JSON_Json_Flash_Autoit - Fatal编程技术网

使用Autoit从IE embed中的flash程序检索JSON

使用Autoit从IE embed中的flash程序检索JSON,json,flash,autoit,Json,Flash,Autoit,我试图在每次加载flash程序时检索它发送的JSON 使用Charles,我能够获得JSON数据——application/JSON;charset=utf8 POST方法-来自网站,但是我希望Autoit捕获JSON数据并将其粘贴到我桌面上的文本文件中 基本上,每当我按下flash程序上的按钮时,我都希望Autoit解析JSON数据。您需要的是一个 请看示例(3):将http流量保存到pcap文件10秒…另一种方法是 #地区;***由AutoIt3Wrapper\u GUI创建的指令****

我试图在每次加载flash程序时检索它发送的JSON

使用Charles,我能够获得JSON数据——application/JSON;charset=utf8 POST方法-来自网站,但是我希望Autoit捕获JSON数据并将其粘贴到我桌面上的文本文件中

基本上,每当我按下flash程序上的按钮时,我都希望Autoit解析JSON数据。

您需要的是一个

请看示例(3):将http流量保存到pcap文件10秒…

另一种方法是

#地区;***由AutoIt3Wrapper\u GUI创建的指令****
#AutoIt3Wrapper\u outfile=proxy.exe
#AutoIt3Wrapper\u压缩=4
#EndRegion;***由AutoIt3Wrapper\u GUI创建的指令****
TCPStartup()
#包括
#包括
#包括
#包括
#包括
#包括
选项(“GUIOnEventMode”,1)
选项(“自动暂停”,0)
选项(“TrayMenuMode”,3)
选项(“TrayOnEventMode”,1)
全局$ini=@ScriptDir&“\config.ini”
全球$main阵列[30][10]
全局$proxysocket,$proxysocketssl
全局$GUISHOW=1
$mainarray[0][0]=“主机端口”
$mainarray[0][1]=“Clientsocket”
$mainarray[0][2]=“主机插座”
$mainarray[0][3]=“请求”
$mainarray[0][4]=“主机名”
$mainarray[0][5]=“Timerhandle连接”
$mainarray[0][6]=“已阻止”
$mainarray[0][7]=“状态”
$mainarray[0][8]=“连接类型”
$mainarray[0][9]=“请求计数”
全局$gui=gui创建(“ProxyServer v0.2”,700700)
$DEBUG=GUICtrlCreateEdit(“、5、30、500、670、比特($GUI\u SS\u DEFAULT\u EDIT、$ES\u READONLY))
GUICtrlSetLimit(-12000000000000000)
全局$button\u debug\u clear=GUICtrlCreateButton(“清除”,5,5,90,20)
GUICtrlSetOnEvent($button_debug_clear,“_debug_clear”)
GUICtrlCreateLabel(“侦听IP:”,515,40,70,20)
GUICtrlCreateLabel(“端口HTTP:,515,60,70,20”)
GUICtrlCreateLabel(“端口HTTPS:,515,80,70,20”)
全局$input\u proxyip=GUICtrlCreateInput(“”,59040100,20)
全局$input_proxyport=GUICtrlCreateInput(“,590,60,60,20)
全局$input_proxyportssl=GUICtrlCreateInput(“,590,80,60,20)
全局$button\u proxy\u save=GUICtrlCreateButton(“保存并重新启动”,515140180,20)
GUICtrlSetOnEvent($button\u proxy\u save,“\u mainsocket\u save”)
全局$checkbox_debug=GUICtrlCreateCheckbox(“Debugmode”,515240120)
全局$checkbox\u debug\u save=GUICtrlCreateCheckbox(“将调试保存到文件”,515260120,20)
全局$checkbox\u debug\u content=GUICtrlCreateCheckbox(“显示流量内容”,515280120,20)
全局$button_debug_content=GUICtrlCreateButton(“二进制到字符串”,515320120,19)
GUICtrlSetOnEvent($button_debug_content,“_debug_binary”)
全局$button\u debug\u array=GUICtrlCreateButton(“显示主数组”,515340120,19)
GUICtrlSetOnEvent(-1,“\u显示\u数组”)
全局$tray\u showgui=TrayCreateItem(“显示gui”)
TrayItemSetOneEvent($tray\u showgui,“\u gui\u show”)
GUISetOnEvent($GUI\u事件\u关闭,“\u退出”)
GUISetState(@SW_SHOW,$gui)
_mainsocket_create()
而1
$newclientsock=TCPAccept($proxysocket)
如果$newclientsock-1,则
_保存(“]新HTTP客户端连接:&_SocketToIP($newclientsock)&@CRLF)
_客户端连接到主阵列($newclientsock,80,“HTTP”)
恩迪夫
$newclientsockssl=TCPAccept($proxysocketssl)
如果$newclientsockssl-1,则
_保存(“]新的HTTPS客户端连接:&_SocketToIP($newclientsocksl)&@CRLF)
_客户端连接到主阵列($newclientsocksl,443,“HTTPS”,“start”)
恩迪夫
;--从客户端接收请求
对于$i=1到UBound($mainarray)-1
如果$mainarray[$i][1]”,则
$request=TCPRecv($mainarray[$i][1],100000)
如果@error那么
_保存(“]Client”和$i&“closed connection after”和Floor(TimerDiff($mainarray[$i][5])和“ms”和@CRLF)
_mainarray_deleteclient($i)
恩迪夫
如果$request“”则
_保存(“]Client”&$i&“requested”&@CRLF&@CRLF&$request&@CRLF)
$main数组[$i][9]+=1
$mainarray[$i][3]=$request
如果GUICtrlRead($checkbox\u debug\u content)=1,则保存($request&@CRLF)
恩迪夫
恩迪夫
下一个
;--连接并发送Req到主机
对于$i=1到UBound($mainarray)-1
如果$mainarray[$i][3]“”则
如果$mainarray[$i][2]=“”则
$forward=\获取\地址($mainarray[$i][3])
_保存(“]”和$i&“获得主机地址:&$forward&@CRLF)
$mainarray[$i][6]=0
$mainarray[$i][4]=$forward
如果$forward=“0”,则
_发送_响应($mainarray[$i][1],400)
_保存(“]”和$i&“主机为0,错误400”&@CRLF)
其他的
$serverip=TCPNameToIP($forward)
$serversock=TCPConnect($serverip,$mainarray[$i][0])
如果$serversock-1,则
_保存(“]”&$i&“连接到主机:&$forward&@CRLF)
$mainarray[$i][2]=$serversock
其他的
_保存(“]”和$i&“未连接到主机:&$forward&@CRLF)
_发送_响应($mainarray[$i][1],400)
_mainarray_deleteclient($i)
恩迪夫
恩迪夫
其他的
$forward=\获取\地址($mainarray[$i][3])
如果$forward$mainarray[$i][4],则
_保存(“]”&$i&“主机地址从:&$mainarray[$i][4]&”更改为:&$forward&@CRLF)
$mainarray[$i][4]=$forward
TCPCloseSocket($mainarray[$i][2])
$mainarray[$i][2]=“”
恩迪夫
恩迪夫
如果$mainarray[$i][2]“”则
$prevlen=StringLen($mainarray[$i][3])
$mainarray[$i][3]=\u请求\u修改($mainarray[$i][3],$mainarray[$i][4])
如果$mainarr
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=proxy.exe
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
TCPStartup()
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GUIEdit.au3>
#Include <Array.au3>
#Include <File.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode" , 1)
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",3)
Opt("TrayOnEventMode",1)

Global $ini = @ScriptDir & "\config.ini" 
Global $mainarray[30][10]
Global $proxysocket , $proxysocketssl
Global $GUISHOW = 1

$mainarray[0][0] = "Hostport"
$mainarray[0][1] = "Clientsocket"
$mainarray[0][2] = "Hostsocket"
$mainarray[0][3] = "Request"
$mainarray[0][4] = "Hostname"
$mainarray[0][5] = "Timerhandle connection"
$mainarray[0][6] = "Blocked"
$mainarray[0][7] = "State"
$mainarray[0][8] = "connection type"
$mainarray[0][9] = "req count"



Global $gui = GUICreate("ProxyServer v0.2",700,700)
$DEBUG=GUICtrlCreateEdit("" , 5 , 30 , 500 ,670,BitOr($GUI_SS_DEFAULT_EDIT,$ES_READONLY))
GUICtrlSetLimit(-1 , 2000000000000000)
Global $button_debug_clear = GUICtrlCreateButton("Clear",5,5,90,20)
GUICtrlSetOnEvent($button_debug_clear,"_debug_clear")
GUICtrlCreateLabel("Listening IP:",515,40,70,20)
GUICtrlCreateLabel("Port HTTP:",515,60,70,20)
GUICtrlCreateLabel("Port HTTPS:",515,80,70,20)
Global $input_proxyip =  GUICtrlCreateInput("",590, 40,100,20)
Global $input_proxyport = GUICtrlCreateInput("",590,60,60,20)
Global $input_proxyportssl = GUICtrlCreateInput("",590,80,60,20)
Global $button_proxy_save = GUICtrlCreateButton("Save and Restart",515,140,180,20)
GUICtrlSetOnEvent($button_proxy_save,"_mainsocket_save")

Global $checkbox_debug = GUICtrlCreateCheckbox("Debugmode", 515 , 240, 120, 20)
Global $checkbox_debug_save = GUICtrlCreateCheckbox("Save Debug to file", 515 , 260, 120, 20)
Global $checkbox_debug_content = GUICtrlCreateCheckbox("Show traffic content", 515 , 280, 120, 20)
Global $button_debug_content = GUICtrlCreateButton("Binary to String",515,320,120,19)
GUICtrlSetOnEvent($button_debug_content,"_debug_binary")
Global $button_debug_array = GUICtrlCreateButton("show mainarray",515,340,120,19)
GUICtrlSetOnEvent(-1,"_show_array")


Global $tray_showgui = TrayCreateItem("Show gui")
TrayItemSetOnEvent($tray_showgui,"_gui_show")

GUISetOnEvent($GUI_EVENT_CLOSE,"_quit")
GUISetState(@SW_SHOW,$gui)

_mainsocket_create()

While 1
    $newclientsock  = TCPAccept($proxysocket)
    If $newclientsock <> -1 Then
        _save("] new HTTP clientconnection :" &_SocketToIP($newclientsock) &@CRLF) 
        _clientconnection_to_mainarray($newclientsock,80,"HTTP")
    EndIf
    $newclientsockssl   = TCPAccept($proxysocketssl)
    If $newclientsockssl <> -1 Then
        _save("] new HTTPS clientconnection :" &_SocketToIP($newclientsockssl) &@CRLF) 
        _clientconnection_to_mainarray($newclientsockssl,443,"HTTPS","start")
    EndIf
    ;--Recieving Req from Client
    For $i = 1 To UBound($mainarray) -1
        If $mainarray[$i][1] <> "" Then
            $request = TCPRecv($mainarray[$i][1],100000)
            If @error Then 

                _save("] Client " & $i & " closed connection after " & Floor(TimerDiff($mainarray[$i][5])) & " ms" & @CRLF)
                _mainarray_deleteclient($i)
            EndIf

            If $request <> "" Then
                _save("] Client " & $i & " requested" & @CRLF  & @CRLF & $request & @CRLF)
                $mainarray[$i][9] += 1 
                $mainarray[$i][3] = $request
                If GUICtrlRead($checkbox_debug_content) = 1 Then _save($request & @CRLF)
            EndIf   
        EndIf
    Next

    ;--connecting and sending Req to Host
    For $i = 1 To UBound($mainarray) -1
        If $mainarray[$i][3] <> "" Then
            If $mainarray[$i][2] = "" Then
                $forward = _Get_Address($mainarray[$i][3])
                _save("]" & $i &" Got Host Address : " & $forward  & @CRLF)         
                $mainarray[$i][6] = 0
                $mainarray[$i][4] = $forward
                If $forward = "0" Then
                    _Send_Response($mainarray[$i][1],400)
                    _save("]" & $i &" Host is 0 , Error 400" & @CRLF)
                Else
                        $serverip   = TCPNameToIP($forward)
                        $serversock = TCPConnect($serverip,$mainarray[$i][0])
                        If $serversock <> -1 Then
                            _save("]" & $i &" Connected to Host: " & $forward & @CRLF)
                            $mainarray[$i][2] = $serversock

                        Else
                            _save("]" & $i &" Not Connected to Host: " & $forward & @CRLF)
                            _Send_Response($mainarray[$i][1],400)
                            _mainarray_deleteclient($i)
                        EndIf
                EndIf   
            Else
                $forward = _Get_Address($mainarray[$i][3])
                If $forward <> $mainarray[$i][4] Then
                    _save("]" & $i &" Host Address changed from: " & $mainarray[$i][4] & " to: " & $forward & @CRLF)
                    $mainarray[$i][4] = $forward
                    TCPCloseSocket($mainarray[$i][2])
                    $mainarray[$i][2] = ""
                EndIf
            EndIf
            If $mainarray[$i][2] <> "" Then
                $prevlen = StringLen($mainarray[$i][3])
                $mainarray[$i][3] = _request_modify($mainarray[$i][3],$mainarray[$i][4])
                If $mainarray[$i][7] = "" Then 
                    ;$mainarray[$i][3] = _request_modify($mainarray[$i][3],$mainarray[$i][4])
                    TCPSend($mainarray[$i][2] , $mainarray[$i][3])
                        If Not @error Then
                            _save("]" & $i &" Sending HTTP to Host " & $mainarray[$i][4] & " successfull prevlen:" & $prevlen & " now:" & StringLen($mainarray[$i][3]) & @CRLF)
                            $mainarray[$i][3] = ""
                        Else
                            _save("]" & $i &" Error Sending HTTP to Host " & @CRLF)
                        EndIf
                EndIf
            EndIf
        EndIf
    Next
    ;--Waiting for Response from Host and Sending to client
    For $i = 1 To UBound($mainarray) -1
        If $mainarray[$i][2] <> "" Then
            $serverresponse     = TCPRecv($mainarray[$i][2],400000,1)   
            If @error Then 
                _mainarray_hostkillclient($i)
            EndIf
            If $serverresponse <> Binary("") Then
                If $mainarray[$i][6] = 0 Then 
                    _save("]" & $i &" Got Host response" & @CRLF)
                    If  $mainarray[$i][1] <> "" And $mainarray[$i][7] = "" Then
                        TCPSend($mainarray[$i][1],$serverresponse)
                        If Not @error Then
                            _save("]" & $i &" Sent data to Client " & @CRLF)

                            If GUICtrlRead($checkbox_debug_content) = 1 Then _save(BinaryToString($serverresponse) & @CRLF)
                        EndIf       
                    EndIf   
                ElseIf $mainarray[$i][6] = 1 Then 
                    TCPSend($mainarray[$i][1],"HTTP/1.1 " & "403")
                    _mainarray_hostkillclient($i)
                EndIf
            EndIf
        EndIf
    Next    
    ;---only for HTTPS
    For $i = 1 To UBound($mainarray) -1
        If $mainarray[$i][1] <> "" And $mainarray[$i][3] <> "" And $mainarray[$i][8] = "HTTPS" And $mainarray[$i][7] = "start" Then
            _Send_Response($mainarray[$i][1],200) ;,$data="")
            $mainarray[$i][3] = ""
            $mainarray[$i][7] = ""
        EndIf
    Next

WEnd    

Func _show_array()
    _ArrayDisplay($mainarray)
EndFunc

Func _mainsocket_save()
    IniWrite($ini,"SYSTEM","PROXYPORT",GUICtrlRead($input_proxyport))
    IniWrite($ini,"SYSTEM","PROXYIP",GUICtrlRead($input_proxyip))
    IniWrite($ini,"SYSTEM","PROXYPORTSSL",GUICtrlRead($input_proxyportssl))
    _mainsocket_create()
EndFunc

Func _mainsocket_create()
    TCPShutdown()
    TCPStartup()
    $IP = IniRead($ini,"SYSTEM","PROXYIP","127.0.0.1")
    $PORT = IniRead($ini,"SYSTEM","PROXYPORT","8080")
    $PORTSSL = IniRead($ini,"SYSTEM","PROXYPORTSSL","8043")
    GUICtrlSetData($input_proxyip, $IP)
    GUICtrlSetData($input_proxyport,$PORT)
    GUICtrlSetData($input_proxyportssl,$PORTSSL)
    $proxysocket        = TCPListen($IP,$PORT)
    If @error Then 
        _GUICtrlEdit_AppendText($DEBUG , "] Error HTTP Proxy couldn't bind socket on IP :" & $IP & " Port :" & $PORT & @CRLF)
    Else
        _GUICtrlEdit_AppendText($DEBUG , "] HTTP Proxy listening on IP :" & $IP & " Port :" & $PORT & @CRLF)
    EndIf   
    $proxysocketssl     = TCPListen($IP,$PORTSSL)
    If @error Then 
        _GUICtrlEdit_AppendText($DEBUG , "] Error HTTPS Proxy couldn't bind socket on IP :" & $IP & " Port :" & $PORTSSL & @CRLF)
    Else
        _GUICtrlEdit_AppendText($DEBUG , "] HTTPS Proxy listening on IP :" & $IP & " Port :" & $PORTSSL & @CRLF)
    EndIf       
EndFunc


Func _Get_Address($text)
    If IsBinary($text) Then 
        $text = BinaryToString($text)
    EndIf
        $serversock=StringSplit($text , @CRLF,1)
        For $i=1 To $serversock[0]
            If StringLeft($serversock[$i],6)="Host: " Then
                Return StringTrimLeft($serversock[$i],6)
            EndIf
        Next
    Return 0        
EndFunc

Func _clientconnection_to_mainarray($sock,$port = 80,$type = "HTTP",$state = "")
    For $i = 1 To UBound($mainarray) -1
        If $mainarray[$i][1] = "" And $mainarray[$i][2] = "" Then
            $mainarray[$i][1] = $sock
            $mainarray[$i][0] = $port
            $mainarray[$i][5] = TimerInit()
            $mainarray[$i][7] = $state
            $mainarray[$i][8] = $type
            _save("] Added new client to mainarray , pos: " & $i & @CRLF)
            If $i + 5 > UBound($mainarray) Then ReDim $mainarray[UBound($mainarray)+5][10]
            Return
        EndIf   
    Next
EndFunc

Func _mainarray_deleteclient($line)
    TCPCloseSocket($mainarray[$line][1])
    $mainarray[$line][0] = ""
    $mainarray[$line][1] = ""
    $mainarray[$line][3] = ""
    $mainarray[$line][4] = ""
    $mainarray[$line][5] = ""
    $mainarray[$line][6] = ""
    $mainarray[$line][7] = ""
    $mainarray[$line][8] = ""
    $mainarray[$line][9] = ""
    If $mainarray[$line][2]<> "" Then
        TCPCloseSocket($mainarray[$line][2])
        $mainarray[$line][2] = ""
    EndIf
EndFunc

Func _mainarray_hostkillclient($line)
    _save("]" & $line &" Connection Closed by Host after " & Floor(TimerDiff($mainarray[$line][5])) & " ms" & @CRLF)
    $mainarray[$line][2] = ""
    $mainarray[$line][4] = ""
    $mainarray[$line][5] = ""
    If $mainarray[$line][1]<> "" Then
        TCPCloseSocket($mainarray[$line][1])
        _mainarray_deleteclient($line)
    EndIf   
EndFunc

Func _Send_Response($browsersock,$code,$data="")
    If $data="" Then
        $data=@CRLF & @CRLF 
    Else
        $data=@CRLF & $data & @CRLF & @CRLF 
    EndIf
    TCPSend($browsersock , "HTTP/1.0 " & $code & " Message" & $data)
EndFunc


Func _quit()
    TCPShutdown()
    Exit
EndFunc

Func _gui_show()
    If $GUISHOW = 0 Then
        Local $pw = InputBox("Enter Password","Enter Password","","*",150,130)
        If Not @error Then
            If $pw = "1234" Then 
                GUISetState(@SW_SHOW)
                $GUISHOW = 1
                Return
            EndIf   
        EndIf
    ElseIf $GUISHOW = 1 Then
        GUISetState(@SW_HIDE)
        $GUISHOW = 0
        Return      
    EndIf
EndFunc 

Func _save($text)
    If GUICtrlRead($checkbox_debug_save) = 1 Then
        $file = FileOpen(@ScriptDir & "\log\" & @Year & @MON & @MDAY & "-log.txt",9)
        FileWrite ($file,$text)
        FileClose($file)
    Endif
    If GUICtrlRead($checkbox_debug) = 1 Then _GUICtrlEdit_AppendText($DEBUG , $text)
Endfunc

Func _SocketToIP($SHOCKET)
    Local $sockaddr, $aRet
    $sockaddr = DllStructCreate("short;ushort;uint;char[8]")
    $aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _
            "ptr", DllStructGetPtr($sockaddr), "int*", DllStructGetSize($sockaddr))
    If Not @error And $aRet[0] = 0 Then
        $aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3))
        If Not @error Then $aRet = $aRet[0]
    Else
        $aRet = 0
    EndIf
    $sockaddr = 0
    Return $aRet
EndFunc   ;==>SocketToIP

Func _debug_binary()
    Local $aSel = _GUICtrlEdit_GetSel($DEBUG)
    Local $text = StringMid(GUICtrlRead($DEBUG),$aSel[0]+1,$aSel[1]-$aSel[0])
    If $text <> "" Then 

    Else    
        $text = InputBox("Binary to String","Enter Binary Data") 

    EndIf
    If StringLower(StringLeft($text,2)) <> "0x" Then $text = "0x" & $text
    $tempfile = FileOpen(@ScriptDir & "\temp.txt",2)
    FileWrite($tempfile,BinaryToString($text))
    FileClose($tempfile)
    ShellExecute(@ScriptDir & "\temp.txt")
EndFunc 

Func _debug_clear()
    GUICtrlSetData($DEBUG,"")
EndFunc 

Func _request_modify($req,$host)
Local $encoding = "Accept-Encoding: identity" ;deflate, gzip, compress, 
Local $reqsplit
Local $modified_method = 0 , $modified_connection = 0 , $modified_encoding = 0
    If $req <> "" And Not IsBinary($req) Then
        $reqsplit = StringSplit($req,@CRLF,1)       
        If IsArray($reqsplit) Then
            For $i = 1 to $reqsplit[0] - 1
                _save("] modifying :" & $i & " " & $reqsplit[$i])
                If StringLeft($reqsplit[$i],3) = "GET" Or StringLeft($reqsplit[$i],4) = "POST" Or StringLeft($reqsplit[$i],7) = "CONNECT" And $modified_method = 0 Then
                        $reqsplit[$i] = StringReplace($reqsplit[$i],$host,"")
                        $reqsplit[$i] = StringReplace($reqsplit[$i],"http://","")
                        $reqsplit[$i] = StringReplace($reqsplit[$i],":443","")
                        $modified_method = 1
                EndIf 
                If StringInStr(Stringlower($reqsplit[$i]),"proxy-connection: keep-alive") And $modified_connection = 0 Then 
                    $reqsplit[$i] = "Connection: keep-alive"
                    $modified_connection = 1
                EndIf   
                If StringInStr(Stringlower($reqsplit[$i]),"accept-encoding") And $modified_encoding = 0 Then 
                    $reqsplit[$i] = $encoding
                    $modified_encoding = 1
                EndIf   
                _save(" -> to :" & $reqsplit[$i] & @CRLF)
            Next    
            $req = _ArrayToString($reqsplit, @CRLF , 1 , Ubound($reqsplit)-1)
        EndIf
        If GUICtrlRead($checkbox_debug_content) = 1 Then
            _save("] Request modified to:" & @CRLF)
            _save($req &@CRLF)
        EndIf
    EndIf
    Return $req
EndFunc