Jump to content
Sign in to follow this  
Innovative

_StringEncrypt is returning ""

Recommended Posts

? What you mean by that ? so what must i do to make my stringencrypt works ?

You could try find the exact point where it fails. Something isn't going right. But no one is getting your problem? I don't know where to start. What is your OS, Service packs, keyboard language...

Can you decrypt a string?

Share this post


Link to post
Share on other sites

EDIT : I cannot decrpyt .. I tried running this

#include <string.au3>

ConsoleWrite("String returned is : -" & _StringEncrypt(0, "10249CAA2F88B4EB", "test") & "-" & @crlf)

and it returned

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\user\Desktop\singlefile.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>18:08:20 Starting AutoIt3Wrapper v.1.9.5.6 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X86)

>Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3

+>18:08:20 AU3Check ended.rc:0

>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\user\Desktop\singlefile.au3"

String returned is : --

+>18:08:20 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 2.406

Share this post


Link to post
Share on other sites

Try this:

#include <string.au3>

$sTest = "This is a test"
$sReturned = _StringEncrypt(1, $sTest, "test")
ConsoleWrite("String returned is : -" & $sReturned & "-" & @crlf)
ConsoleWrite("String returned is : -" & _StringEncrypt(0, $sReturned, "test") & "-" & @crlf)

Your output should be similar to this:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "F:\Autoit_files\test files\test4.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>04:19:04 Starting AutoIt3Wrapper v.1.9.5.6 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X86)

>Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3

+>04:19:04 AU3Check ended.rc:0

>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "F:\Autoit_files\test files\test4.au3"

String returned is : -12249CDE2882B497699695D1360C13718497BC3A2D030E2A63D0273B-

String returned is : -This is a test-

+>04:19:05 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 2.039


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Very sorry but , it returned

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\user\Desktop\singlefile.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+>19:05:23 Starting AutoIt3Wrapper v.1.9.5.6 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X86)

>Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3

+>19:05:26 AU3Check ended.rc:0

>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\user\Desktop\singlefile.au3"

String returned is : --

String returned is : --

+>19:05:32 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 11.195

Share this post


Link to post
Share on other sites

Try this:

#include <string.au3>

$sTest = "This is a test"
$sReturned = _StringEncrypt(1, $sTest, "test")
ConsoleWrite("String returned is : -" & $sReturned & "-" & @crlf)
ConsoleWrite("String returned is : -" & _StringEncrypt(0, $sReturned, "test") & "-" & @crlf)
We've been there, back at post #8. The next attempt was with the #include removed and the function locally copied into the script from a working machine (mine) in post #33. After that I started inserting debug captures of the input/output of the function in post #35. Bert then took that to the extreme in post #38.

This is not a bug, as it only fails on the OP's machine, and works for everyone else. If CrazeStar1074 is running these scripts as posted, they should work.

:D


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

This version is more "instrumented" to see some of the internal activity of the function. Run this verbatim in SciTE and post the results from the console:

$encrypt = _StringEncrypt(1, "test", "test")
ConsoleWrite("Debug: $encrypt = " & $encrypt & "  @error = " & @error & "  @extended = " & @extended & @LF & @LF)
$decrypt = _StringEncrypt(0, $encrypt, "test")
ConsoleWrite("Debug: $dencrypt = " & $decrypt & "  @error = " & @error & "  @extended = " & @extended & @LF)

;===============================================================================
; Function Name:    _StringEncrypt()
; Description:      RC4 Based string encryption
; Parameter(s):     $i_Encrypt - 1 to encrypt, 0 to decrypt
;                   $s_EncryptText - string to encrypt
;                   $s_EncryptPassword - string to use as an encryption password
;                   $i_EncryptLevel - integer to use as number of times to encrypt string
; Requirement(s):   None
; Return Value(s):  On Success - Returns the string encrypted (blank) times with (blank) password
;                   On Failure - Returns a blank string and sets @error = 1
; Author(s):        Wes Wolfe-Wolvereness <Weswolf at aol dot com>
;===============================================================================
Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $i_Encrypt = " & $i_Encrypt & @LF)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $s_EncryptText = " & $s_EncryptText & @LF)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $s_EncryptPassword = " & $s_EncryptPassword & @LF)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $i_EncryptLevel = " & $i_EncryptLevel & @LF)
    If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then
        ConsoleWrite("Debug: Bad parameter: $i_Encrypt" & @LF)
        SetError(1)
        Return ''
    ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then
        ConsoleWrite("Debug: Bad parameter: $s_EncryptText or $s_EncryptPassword" & @LF)
        SetError(1)
        Return ''
    Else
        ConsoleWrite("Debug: Good parameters" & @LF)
        If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1
        ConsoleWrite("Debug: Parameter: $i_EncryptLevel = " & $i_EncryptLevel & @LF)
        Local $v_EncryptModified
        Local $i_EncryptCountH
        Local $i_EncryptCountG
        Local $v_EncryptSwap
        Local $av_EncryptBox[256][2]
        Local $i_EncryptCountA
        Local $i_EncryptCountB
        Local $i_EncryptCountC
        Local $i_EncryptCountD
        Local $i_EncryptCountE
        Local $v_EncryptCipher
        Local $v_EncryptCipherBy
        If $i_Encrypt = 1 Then
            ConsoleWrite("Debug: Encrypting: Parameter: $i_Encrypt = 1" & @LF)
            For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1
                $i_EncryptCountG = ''
                $i_EncryptCountH = ''
                $v_EncryptModified = ''
                For $i_EncryptCountG = 1 To StringLen($s_EncryptText)
                    If $i_EncryptCountH = StringLen($s_EncryptPassword) Then
                        $i_EncryptCountH = 1
                    Else
                        $i_EncryptCountH += 1
                    EndIf
                    $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))
                Next
                ConsoleWrite("Debug: Variables: $i_EncryptCountH = " & $i_EncryptCountH & @LF)
                ConsoleWrite("Debug: Variables: $v_EncryptModified = " & StringToBinary($v_EncryptModified) & @LF)
                $s_EncryptText = $v_EncryptModified
                $i_EncryptCountA = ''
                $i_EncryptCountB = 0
                $i_EncryptCountC = ''
                $i_EncryptCountD = ''
                $i_EncryptCountE = ''
                $v_EncryptCipherBy = ''
                $v_EncryptCipher = ''
                $v_EncryptSwap = ''
                $av_EncryptBox = ''
                Local $av_EncryptBox[256][2]
                For $i_EncryptCountA = 0 To 255
                    $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))
                    $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA
                Next
                For $i_EncryptCountA = 0 To 255
                    $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)
                    $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]
                    $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]
                    $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap
                Next
                For $i_EncryptCountA = 1 To StringLen($s_EncryptText)
                    $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)
                    $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)
                    $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]
                    $v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE)
                    $v_EncryptCipher &= Hex($v_EncryptCipherBy, 2)
                Next
                $s_EncryptText = $v_EncryptCipher
                ConsoleWrite("Debug: Variables: $s_EncryptText = " & $s_EncryptText & @LF)
            Next
        Else
            ConsoleWrite("Debug: Decrypting: Parameter: $i_Encrypt = " & $i_Encrypt & @LF)
            For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1
                $i_EncryptCountB = 0
                $i_EncryptCountC = ''
                $i_EncryptCountD = ''
                $i_EncryptCountE = ''
                $v_EncryptCipherBy = ''
                $v_EncryptCipher = ''
                $v_EncryptSwap = ''
                $av_EncryptBox = ''
                Local $av_EncryptBox[256][2]
                For $i_EncryptCountA = 0 To 255
                    $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))
                    $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA
                Next
                For $i_EncryptCountA = 0 To 255
                    $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)
                    $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]
                    $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]
                    $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap
                Next
                For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2
                    $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)
                    $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)
                    $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]
                    $v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE)
                    $v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy)
                    ConsoleWrite("Debug: Variables: $v_EncryptCipher = " & StringToBinary($v_EncryptCipher) & @LF)
                Next
                $s_EncryptText = $v_EncryptCipher
                $i_EncryptCountG = ''
                $i_EncryptCountH = ''
                $v_EncryptModified = ''
                For $i_EncryptCountG = 1 To StringLen($s_EncryptText)
                    If $i_EncryptCountH = StringLen($s_EncryptPassword) Then
                        $i_EncryptCountH = 1
                    Else
                        $i_EncryptCountH += 1
                    EndIf
                    $v_EncryptModified &= Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))
                Next
                $s_EncryptText = $v_EncryptModified
            Next
        EndIf
        ConsoleWrite("Debug: _StringEncrypt() output: $s_EncryptText = " & $s_EncryptText & @LF)
        Return $s_EncryptText
    EndIf
EndFunc   ;==>_StringEncrypt

The results should look like:

>"C:\Progra~1\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Temp\Test\Test1.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams  
+>10:17:15 Starting AutoIt3Wrapper v.1.9.5.6    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 2  CPU:X86)
>Running AU3Check (1.54.10.0)  from:C:\Program Files\AutoIt3
+>10:17:15 AU3Check ended.rc:0
>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Temp\Test\Test1.au3"   
Debug: _StringEncrypt() inputs: $i_Encrypt = 1
Debug: _StringEncrypt() inputs: $s_EncryptText = test
Debug: _StringEncrypt() inputs: $s_EncryptPassword = test
Debug: _StringEncrypt() inputs: $i_EncryptLevel = 1
Debug: Good parameters
Debug: Parameter: $i_EncryptLevel = 1
Debug: Encrypting: Parameter: $i_Encrypt = 1
Debug: Variables: $i_EncryptCountH = 4
Debug: Variables: $v_EncryptModified = 0xFFFFFFFF
Debug: Variables: $s_EncryptText = 5170D8EE
Debug: Variables: $i_EncryptCountH = 4
Debug: Variables: $v_EncryptModified = 0xBEABBBBBCFA2C9CE
Debug: Variables: $s_EncryptText = 10249CAA2F88B4EB
Debug: _StringEncrypt() output: $s_EncryptText = 10249CAA2F88B4EB
Debug: $encrypt = 10249CAA2F88B4EB  @error = 0  @extended = 0

Debug: _StringEncrypt() inputs: $i_Encrypt = 0
Debug: _StringEncrypt() inputs: $s_EncryptText = 10249CAA2F88B4EB
Debug: _StringEncrypt() inputs: $s_EncryptPassword = test
Debug: _StringEncrypt() inputs: $i_EncryptLevel = 1
Debug: Good parameters
Debug: Parameter: $i_EncryptLevel = 1
Debug: Decrypting: Parameter: $i_Encrypt = 0
Debug: Variables: $v_EncryptCipher = 0xBE
Debug: Variables: $v_EncryptCipher = 0xBEAB
Debug: Variables: $v_EncryptCipher = 0xBEABBB
Debug: Variables: $v_EncryptCipher = 0xBEABBBBB
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCF
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCFA2
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCFA2C9
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCFA2C9CE
Debug: Variables: $v_EncryptCipher = 0xFF
Debug: Variables: $v_EncryptCipher = 0xFFFF
Debug: Variables: $v_EncryptCipher = 0xFFFFFF
Debug: Variables: $v_EncryptCipher = 0xFFFFFFFF
Debug: _StringEncrypt() output: $s_EncryptText = test
Debug: $dencrypt = test  @error = 0  @extended = 0
+>10:17:16 AutoIT3.exe ended.rc:0
>Exit code: 0   Time: 1.650

:D


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

In view of the fact that OP is the only 1 in this thread for whom his code doesn't work,

and since he has already reinstalled AutoIt, it would seem he needs to:

a) Check for viruses/rootkits or

:D Repair or reinstall Windows

just my 2c - whim

Share this post


Link to post
Share on other sites

In view of the fact that OP is the only 1 in this thread for whom his code doesn't work,

and since he has already reinstalled AutoIt, it would seem he needs to:

a) Check for viruses/rootkits or

:P Repair or reinstall Windows

just my 2c - whim

Very possible. But I am curious at what point this function is failing.

:D


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

This version is more "instrumented" to see some of the internal activity of the function. Run this verbatim in SciTE and post the results from the console:

$encrypt = _StringEncrypt(1, "test", "test")
ConsoleWrite("Debug: $encrypt = " & $encrypt & "  @error = " & @error & "  @extended = " & @extended & @LF & @LF)
$decrypt = _StringEncrypt(0, $encrypt, "test")
ConsoleWrite("Debug: $dencrypt = " & $decrypt & "  @error = " & @error & "  @extended = " & @extended & @LF)

;===============================================================================
; Function Name:    _StringEncrypt()
; Description:      RC4 Based string encryption
; Parameter(s):     $i_Encrypt - 1 to encrypt, 0 to decrypt
;                   $s_EncryptText - string to encrypt
;                   $s_EncryptPassword - string to use as an encryption password
;                   $i_EncryptLevel - integer to use as number of times to encrypt string
; Requirement(s):   None
; Return Value(s):  On Success - Returns the string encrypted (blank) times with (blank) password
;                   On Failure - Returns a blank string and sets @error = 1
; Author(s):        Wes Wolfe-Wolvereness <Weswolf at aol dot com>
;===============================================================================
Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $i_Encrypt = " & $i_Encrypt & @LF)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $s_EncryptText = " & $s_EncryptText & @LF)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $s_EncryptPassword = " & $s_EncryptPassword & @LF)
    ConsoleWrite("Debug: _StringEncrypt() inputs: $i_EncryptLevel = " & $i_EncryptLevel & @LF)
    If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then
        ConsoleWrite("Debug: Bad parameter: $i_Encrypt" & @LF)
        SetError(1)
        Return ''
    ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then
        ConsoleWrite("Debug: Bad parameter: $s_EncryptText or $s_EncryptPassword" & @LF)
        SetError(1)
        Return ''
    Else
        ConsoleWrite("Debug: Good parameters" & @LF)
        If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1
        ConsoleWrite("Debug: Parameter: $i_EncryptLevel = " & $i_EncryptLevel & @LF)
        Local $v_EncryptModified
        Local $i_EncryptCountH
        Local $i_EncryptCountG
        Local $v_EncryptSwap
        Local $av_EncryptBox[256][2]
        Local $i_EncryptCountA
        Local $i_EncryptCountB
        Local $i_EncryptCountC
        Local $i_EncryptCountD
        Local $i_EncryptCountE
        Local $v_EncryptCipher
        Local $v_EncryptCipherBy
        If $i_Encrypt = 1 Then
            ConsoleWrite("Debug: Encrypting: Parameter: $i_Encrypt = 1" & @LF)
            For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1
                $i_EncryptCountG = ''
                $i_EncryptCountH = ''
                $v_EncryptModified = ''
                For $i_EncryptCountG = 1 To StringLen($s_EncryptText)
                    If $i_EncryptCountH = StringLen($s_EncryptPassword) Then
                        $i_EncryptCountH = 1
                    Else
                        $i_EncryptCountH += 1
                    EndIf
                    $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))
                Next
                ConsoleWrite("Debug: Variables: $i_EncryptCountH = " & $i_EncryptCountH & @LF)
                ConsoleWrite("Debug: Variables: $v_EncryptModified = " & StringToBinary($v_EncryptModified) & @LF)
                $s_EncryptText = $v_EncryptModified
                $i_EncryptCountA = ''
                $i_EncryptCountB = 0
                $i_EncryptCountC = ''
                $i_EncryptCountD = ''
                $i_EncryptCountE = ''
                $v_EncryptCipherBy = ''
                $v_EncryptCipher = ''
                $v_EncryptSwap = ''
                $av_EncryptBox = ''
                Local $av_EncryptBox[256][2]
                For $i_EncryptCountA = 0 To 255
                    $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))
                    $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA
                Next
                For $i_EncryptCountA = 0 To 255
                    $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)
                    $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]
                    $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]
                    $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap
                Next
                For $i_EncryptCountA = 1 To StringLen($s_EncryptText)
                    $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)
                    $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)
                    $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]
                    $v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE)
                    $v_EncryptCipher &= Hex($v_EncryptCipherBy, 2)
                Next
                $s_EncryptText = $v_EncryptCipher
                ConsoleWrite("Debug: Variables: $s_EncryptText = " & $s_EncryptText & @LF)
            Next
        Else
            ConsoleWrite("Debug: Decrypting: Parameter: $i_Encrypt = " & $i_Encrypt & @LF)
            For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1
                $i_EncryptCountB = 0
                $i_EncryptCountC = ''
                $i_EncryptCountD = ''
                $i_EncryptCountE = ''
                $v_EncryptCipherBy = ''
                $v_EncryptCipher = ''
                $v_EncryptSwap = ''
                $av_EncryptBox = ''
                Local $av_EncryptBox[256][2]
                For $i_EncryptCountA = 0 To 255
                    $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))
                    $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA
                Next
                For $i_EncryptCountA = 0 To 255
                    $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)
                    $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]
                    $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]
                    $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap
                Next
                For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2
                    $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256)
                    $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)
                    $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256)][0]
                    $v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE)
                    $v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy)
                    ConsoleWrite("Debug: Variables: $v_EncryptCipher = " & StringToBinary($v_EncryptCipher) & @LF)
                Next
                $s_EncryptText = $v_EncryptCipher
                $i_EncryptCountG = ''
                $i_EncryptCountH = ''
                $v_EncryptModified = ''
                For $i_EncryptCountG = 1 To StringLen($s_EncryptText)
                    If $i_EncryptCountH = StringLen($s_EncryptPassword) Then
                        $i_EncryptCountH = 1
                    Else
                        $i_EncryptCountH += 1
                    EndIf
                    $v_EncryptModified &= Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))
                Next
                $s_EncryptText = $v_EncryptModified
            Next
        EndIf
        ConsoleWrite("Debug: _StringEncrypt() output: $s_EncryptText = " & $s_EncryptText & @LF)
        Return $s_EncryptText
    EndIf
EndFunc   ;==>_StringEncrypt

The results should look like:

>"C:\Progra~1\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Temp\Test\Test1.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams  
+>10:17:15 Starting AutoIt3Wrapper v.1.9.5.6    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 2  CPU:X86)
>Running AU3Check (1.54.10.0)  from:C:\Program Files\AutoIt3
+>10:17:15 AU3Check ended.rc:0
>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Temp\Test\Test1.au3"   
Debug: _StringEncrypt() inputs: $i_Encrypt = 1
Debug: _StringEncrypt() inputs: $s_EncryptText = test
Debug: _StringEncrypt() inputs: $s_EncryptPassword = test
Debug: _StringEncrypt() inputs: $i_EncryptLevel = 1
Debug: Good parameters
Debug: Parameter: $i_EncryptLevel = 1
Debug: Encrypting: Parameter: $i_Encrypt = 1
Debug: Variables: $i_EncryptCountH = 4
Debug: Variables: $v_EncryptModified = 0xFFFFFFFF
Debug: Variables: $s_EncryptText = 5170D8EE
Debug: Variables: $i_EncryptCountH = 4
Debug: Variables: $v_EncryptModified = 0xBEABBBBBCFA2C9CE
Debug: Variables: $s_EncryptText = 10249CAA2F88B4EB
Debug: _StringEncrypt() output: $s_EncryptText = 10249CAA2F88B4EB
Debug: $encrypt = 10249CAA2F88B4EB  @error = 0  @extended = 0

Debug: _StringEncrypt() inputs: $i_Encrypt = 0
Debug: _StringEncrypt() inputs: $s_EncryptText = 10249CAA2F88B4EB
Debug: _StringEncrypt() inputs: $s_EncryptPassword = test
Debug: _StringEncrypt() inputs: $i_EncryptLevel = 1
Debug: Good parameters
Debug: Parameter: $i_EncryptLevel = 1
Debug: Decrypting: Parameter: $i_Encrypt = 0
Debug: Variables: $v_EncryptCipher = 0xBE
Debug: Variables: $v_EncryptCipher = 0xBEAB
Debug: Variables: $v_EncryptCipher = 0xBEABBB
Debug: Variables: $v_EncryptCipher = 0xBEABBBBB
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCF
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCFA2
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCFA2C9
Debug: Variables: $v_EncryptCipher = 0xBEABBBBBCFA2C9CE
Debug: Variables: $v_EncryptCipher = 0xFF
Debug: Variables: $v_EncryptCipher = 0xFFFF
Debug: Variables: $v_EncryptCipher = 0xFFFFFF
Debug: Variables: $v_EncryptCipher = 0xFFFFFFFF
Debug: _StringEncrypt() output: $s_EncryptText = test
Debug: $dencrypt = test  @error = 0  @extended = 0
+>10:17:16 AutoIT3.exe ended.rc:0
>Exit code: 0   Time: 1.650

:D

That fails too.. Anyway, im using Avast antivirus , is there a possiblity that avast might stop the script from running or what ?

EDIT : I've tried disabling avast and try running the script.. But it still fails..

Edited by CrazeStar1074

Share this post


Link to post
Share on other sites

That fails too.. Anyway, im using Avast antivirus , is there a possiblity that avast might stop the script from running or what ?

EDIT : I've tried disabling avast and try running the script.. But it still fails..

Can we see your results please?

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  

×
×
  • Create New...