Jump to content

read a txt file on a url


Recommended Posts

$sDatabaseRaw = FileRead("http://www.onlinefixer.com/tools/files.txt")

MsgBox(0,"",$sDatabaseRaw)

$asDatabase = StringSplit($sDatabaseRaw,@CRLF,3)

For $element In $asDatabase

If $element = "" Then ContinueLoop

$asItem = StringSplit($element,',',3)

$directory = $asItem[0]

For $thing In $asItem

If $thing = "" Or $thing = $directory Then ContinueLoop

MsgBox(0,"","Directory="&$directory)

MsgBox(0,"","Files="&$thing)

Next

Next

no output from FileRead, is there a way to do this?

Link to comment
Share on other sites

I think you're looking for this:

Global $Split = StringSplit(StringRegExpReplace(GetFile(), "[,^]", @CRLF), @CRLF, 1)



; Main loop
For $x = 1 To $Split[0] - 1
    If StringInStr($Split[$x], ".exe") Then
        MsgBox(0 + 64, "File", $Split[$x])
    Else
        MsgBox(0 + 64, "Directory", $Split[$x])
    EndIf
Next



Func GetFile()
    Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

    $oHTTP.Open("GET", "http://www.onlinefixer.com/tools/files.txt", False)
    $oHTTP.Send()

    Return $oHTTP.ResponseText()
EndFunc   ;==>GetFile

This way you won't have to download the file.

Enjoy >_<

Edited by AMp
Link to comment
Share on other sites

This should work.

Global $Split = StringSplit(StringRegExpReplace(GetFile(), "[,^]", @CRLF), @CRLF, 1), $buffer = ""



; Main loop
For $x = 1 To $Split[0] - 1
    If StringInStr($Split[$x], ".exe") Then
        $buffer &= $Split[$x] & @CRLF
    Else
        If $Split[$x] == "PROCESSES" Then
            $buffer &= "[ " & $Split[$x] & " ]" & @CRLF
        Else
            $buffer &= @CRLF & "[ " & $Split[$x] & " ]" & @CRLF
        EndIf
    EndIf
Next

MsgBox(0 + 64, "", $buffer)



Func GetFile()
    Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

    $oHTTP.Open("GET", "http://www.onlinefixer.com/tools/files.txt", False)
    $oHTTP.Send()

    Return $oHTTP.ResponseText()
EndFunc   ;==>GetFile

Seems to work. Returns;

[ PROCESSES ]
procexplorer.exe

[ MALWARE ]
drwebcureit.exe
combofix.exe
mbamsetup.exe
sdfix.exe

[ ANTIVIRUS ]
AVG_Antivirus.exe

[ INTERNET ]
lspfix.exe
hijackthis.exe

[ ANTIVIRUS_UNINSTALLERS ]
otheravremover.exe
trendmicro64remover.exe
trendmicro32remover.exe
CA2009remover.exe
nod32remover.exe
avastremover.exe
oncecareremover.exe
nortonremover.exe
mcafeeremover.exe
avg64remover.exe
bitdefender32remover.exe
kasperskiremover.exe
pandaremover.exe
CA2008remover.exe
avg32remover.exe
fsecureremover.exe
gdataremover.exe
aviraremover.exe

[ CLEANUP ]
cleanup.exe

[ CD ]
daemontools.exe

I think you were looking for something like that, not sure tho.

>_<

Edited by AMp
Link to comment
Share on other sites

You don't have to write a dump file :-)

#include <INet.au3>
$sDatabaseRaw = _INetGetSource("http://www.onlinefixer.com/tools/files.txt")
MsgBox(0, "", $sDatabaseRaw)

Forgot all about that function, update using _INetGetSource() instead of HTTPRequests;

#include <INet.au3>
Global $URL = "http://www.onlinefixer.com/tools/files.txt"
Global $Split = StringSplit(StringRegExpReplace(_INetGetSource($URL), "[,^]", @CRLF), @CRLF, 1), $buffer = ""



; Main loop
For $x = 1 To $Split[0] - 1
    If StringInStr($Split[$x], ".exe") Then
        $buffer &= $Split[$x] & @CRLF
    Else
        If $Split[$x] == "PROCESSES" Then
            $buffer &= "[ " & $Split[$x] & " ]" & @CRLF
        Else
            $buffer &= @CRLF & "[ " & $Split[$x] & " ]" & @CRLF
        EndIf
    EndIf
Next

MsgBox(0 + 64, "", $buffer)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...