Jump to content

freMea

Members
  • Posts

    11
  • Joined

  • Last visited

About freMea

  • Birthday 04/30/1982

Profile Information

  • Location
    France

Recent Profile Visitors

146 profile views

freMea's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Link and posted screenshots are dead.
  2. Thanks Yashied. I love the calculator and the skins. It's very inspiring for one who would like to build a project with a nice GUI. But I have questions and issues I have to report. It seems there are problems with the Calculator_source package that need to be fixed. ______________________________________________________________________ 1/ About your Calculator.exe provided in the binary package, although it seems to work fine on my computer, I explored its ressources and I noticed that string table section reports some autoIT errors: 101 (Paused) 102 AutoIt Error 103 AutoIt has detected the stack has become corrupt. Stack corruption typically occurs when either the wrong calling convention is used or when the function is called with the wrong number of arguments. AutoIt supports the __stdcall (WINAPI) and __cdecl calling conventions. The __stdcall (WINAPI) convention is used by default but __cdecl can be used instead. See the DllCall() documentation for details on changing the calling convention. 105 Badly formatted "Func" statement. 107 Missing right bracket ')' in expression. 108 Missing operator in expression. 109 Unbalanced brackets in expression. 110 Error in expression. 111 Error parsing function call. 112 Incorrect number of parameters in function call. 113 "ReDim" used without an array variable. 114 Illegal text at the end of statement (one statement per line). 115 "If" statement has no matching "EndIf" statement. 116 "Else" statement with no matching "If" statement. 117 "EndIf" statement with no matching "If" statement. 118 Too many "Else" statements for matching "If" statement. 119 "While" statement has no matching "Wend" statement. 120 "Wend" statement with no matching "While" statement. 121 Variable used without being declared. 122 Array variable has incorrect number of subscripts or subscript dimension range exceeded. 123 Array variable subscript badly formatted. 124 Subscript used with non-Array variable. 125 Too many subscripts used for an array. 126 Missing subscript dimensions in "Dim" statement. 127 No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement. 128 Expected a "=" operator in assignment statement. 129 Invalid keyword at the start of this line. 130 Array maximum size exceeded. 131 "Func" statement has no matching "EndFunc". 132 Duplicate function name. 133 Unknown function name. 134 Unknown macro. 136 Unable to get a list of running processes. 137 Unable to get the process token. 138 Invalid element in a DllStruct. 139 Unknown option or bad parameter specified. 140 Unable to load the internet libraries. 141 "Struct" statement has no matching "EndStruct". 142 Unable to open file, the maximum number of open files has been exceeded. 144 Invalid file filter given. 145 Expected a variable in user function call. 146 "Do" statement has no matching "Until" statement. 147 "Until" statement with no matching "Do" statement. 148 "For" statement is badly formatted. 149 "Next" statement with no matching "For" statement. 150 "ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop. 151 "For" statement has no matching "Next" statement. 152 "Case" statement with no matching "Select"or "Switch" statement. 153 "EndSelect" statement with no matching "Select" statement. 154 Recursion level has been exceeded - AutoIt will quit to prevent stack overflow. 155 Cannot make existing variables static. 156 Cannot make static variables into regular variables. 157 Badly formated Enum statement 159 This keyword cannot be used after a "Then" keyword. 160 "Select" statement is missing "EndSelect" or "Case" statement. 161 "If" statements must have a "Then" keyword. 162 Badly formated Struct statement. 163 Cannot assign values to constants. 164 Cannot make existing variables into constants. 165 Only Object-type variables allowed in a "With" statement. 166 "long_ptr", "int_ptr" and "short_ptr" DllCall() types have been deprecated. Use "long*", "int*" and "short*" instead. 167 Object referenced outside a "With" statement. 168 Nested "With" statements are not allowed. 169 Variable must be of type "Object". 170 The requested action with this object has failed. 171 Variable appears more than once in function declaration. 172 ReDim array can not be initialized in this manner. 173 An array variable can not be used in this manner. 174 Can not redeclare a constant. 175 Can not redeclare a parameter inside a user function. 176 Can pass constants by reference only to parameters with "Const" keyword. 177 Can not initialize a variable with itself. 178 Incorrect way to use this parameter. 179 "EndSwitch" statement with no matching "Switch" statement. 180 "Switch" statement is missing "EndSwitch" or "Case" statement. 181 "ContinueCase" statement with no matching "Select"or "Switch" statement. 182 Assert Failed! 184 Obsolete function/parameter. 185 Invalid Exitcode (reserved for AutoIt internal use).and 5000 Unable to parse line. 5001 Unable to open the script file. 5002 String missing closing quote. 5003 Badly formated variable or macro. 5004 Missing separator character after keyword. Can it be solved? Is it important? ______________________________________________________________________ 2/ The Calculator.exe compiled with compile.cmd is slightly different from your Calculator.exe and it doesn't work: Calculator.exe = 966 791 bytes Calculator.exe = 975 025 bytes (without UPX compression) Updating WinAPIEx.au3 doesn't solve the problem. ______________________________________________________________________ 3/ AutoIt3Wrapper.exe provided in Utilities package is version 2.0.1.24. If I use the last 2.1.0.8 version, the compile.cmd fails: no compile window displays, nothing happens and no binary is output. Why the compilation fails with the last AutoIt3Wrapper? ______________________________________________________________________ 4/ If I used the Scite SyntaxCheck Prod (CTRL+F5) on Calculator.au3, it reports errors: +>22:59:21 Starting AutoIt3Wrapper v.2.1.0.8 Environment(Language:040C Keyboard:0000040C OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86) >Running AU3Check (1.54.22.0) from:D:\Mes Programmes\Outils\AutoIt D:\AutoIT\Yashied calculator with skins\Calculator_source\UDFs\WinAPIEx.au3(1752,38) : ERROR: $TMPF_FIXED_PITCH previously declared as a 'Const'. Global Const $TMPF_FIXED_PITCH = 0x01 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIT\Yashied calculator with skins\Calculator_source\UDFs\WinAPIEx.au3(1753,33) : ERROR: $TMPF_VECTOR previously declared as a 'Const'. Global Const $TMPF_VECTOR = 0x02 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIT\Yashied calculator with skins\Calculator_source\UDFs\WinAPIEx.au3(1754,35) : ERROR: $TMPF_TRUETYPE previously declared as a 'Const'. Global Const $TMPF_TRUETYPE = 0x04 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIT\Yashied calculator with skins\Calculator_source\UDFs\WinAPIEx.au3(1755,33) : ERROR: $TMPF_DEVICE previously declared as a 'Const'. Global Const $TMPF_DEVICE = 0x08 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIT\Yashied calculator with skins\Calculator_source\UDFs\WinAPIEx.au3(11217,34) : ERROR: _WinAPI_GetTextMetrics() already defined. Func _WinAPI_GetTextMetrics($hDC) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\AutoIT\Yashied calculator with skins\Calculator_source\Calculator.au3 - 5 error(s), 0 warning(s) !>22:59:22 AU3Check ended.rc:2 >Exit code: 0 Time: 1.484
  3. Links in first post are all dead !
  4. It's an idea. But I'll have to use the console to send commands anyway. It's not incompatible but I'm afraid that method might take a little much time in the process than just watching server response in openssl console output. And I have currently no idea how to route server responses to a file without using StdoutRead I'm still newby in autoIT and in programming mostly. Doesn't someone suspect StdoutRead to be buggy in that specific case? It seems not to be able to read some strings if there is - as suffix.
  5. Yes, I did that just for test purpose (trying to solve the mystery). Originally, only $temp = StdoutRead($_POP_RunPID) was here but the problem is still there when it's alone.
  6. Hi, I am testing this script that I'd like to plan to use in a project. But it needs to improve the way it deals with errors (wrong username or password). In fact, for a beyond understanding reason, StdoutRead seems to fail to retrieve the error line printed by openssl. Script Object: connect to yahoo via ssl connexion, retrieve number of messages (and later the headers) This script works but there are mysteries that need to be solved so that I could sleep Here is the difference between the command line results retrieved in windows cmd and scite error console. in windows CMD: in scite console: As you can see, the red strings doesn't display in scite console and can't be properly handled by the script. I spend the day at searching why and test everything I found on the web with no success: StringStripCR, StringStripWS, binary option/conversion, page code conversion, etc. The weird thing is that the udf can read the green line but can't read the red ones after a - with the exactly same method. I suspect the char - to be the cause but can't confirm. Here is the udf: #include <Constants.au3> #include <Array.au3> #include <Process.au3> Global Const $NO_ACTIVATION_LINK = 301 Global $_POP_RunPID = 0 Global $_POP_Log = @CRLF Global $_POP_Debug = False Global $_POP_Counter = 0 Global $SleepTime = 50 Global $FixGUIBug = True Global $SSL_Exe_loc Func _POP_Connect($POP_Server, $POP_Port, $SSL_Exe_loc, $Debug) $_POP_Debug = $Debug ;Connect To Server Using OpenSSL $_POP_RunPID = Run($SSL_Exe_loc & " s_client -connect " & $POP_Server & ":" & $POP_Port & " -quiet", "", @SW_HIDE, $STDOUT_CHILD + $STDIN_CHILD + $STDERR_CHILD + $STDERR_MERGED) ;Hide Command Prompt WinWait($SSL_Exe_loc) WinActivate($SSL_Exe_loc) WinWaitActive($SSL_Exe_loc) ;Read Buffer & Check buffer for reply code ;Sleep(2000) $Buffer = _OpenSSL_ReadBuffer_Until("+OK ", 50) $_POP_Log &= $Buffer If @error Then SetError(1) ;Connection Failed Return False EndIf Return _OpenSSL_IsRunning() EndFunc ;==>_POP_Connect Func _POP_Login($Username, $Password) ;flush buffer Sleep(250) _OpenSSL_ReadBuffer() ;Send Username $temp = _POP_Send_User($Username) If $temp == False Then $temp = _POP_Send_User($Username) If $temp == False Then Return $temp EndIf EndIf ;Send Password $temp = _POP_Send_Pass($Password) If $temp == False Then Return $temp EndIf Return _OpenSSL_IsRunning() EndFunc ;==>_POP_Login Func _POP_Send_User($Username) ;Send Username $User = "USER " & $Username & @CRLF _OpenSSL_WriteBuffer($User) $_POP_Log &= $User ;Get Responce $Buffer = _OpenSSL_ReadBuffer_Lock(20) $_POP_Log &= $Buffer If _OpenSSL_ChkForCode($Buffer, "+OK ") == 0 Then SetError(3) ;Wrong Username _OpenSSL_DebugToConsole("Wrong Username" & @CRLF) Return False EndIf EndFunc ;==>_POP_Send_User Func _POP_Send_Pass($Password) ;Send Password $Pass = "PASS " & $Password & @CRLF _OpenSSL_WriteBuffer($Pass) $_POP_Log &= $Pass ;Get Responce $Buffer = _OpenSSL_ReadBuffer_Lock(20) $_POP_Log &= $Buffer If _OpenSSL_ChkForCode($Buffer, "+OK ") == 0 Then SetError(4) ;Sent in a bad username/password _OpenSSL_DebugToConsole("Sent in a bad username/password" & @CRLF) Return False EndIf EndFunc ;==>_POP_Send_Pass ;Support Functions (private) Func _OpenSSL_ReadBuffer() $Buffer = "" $MoreToRead = 1 While $MoreToRead > 0 $_POP_Counter += 1 Sleep($SleepTime) $temp = StdoutRead($_POP_RunPID) ;$temp &= StderrRead($_POP_RunPID) ;$temp = BinaryToString (stringreplace($temp,chr(0),chr(0x20))) ;$temp = _ChangePageCode($temp,1) ;$temp = _OEMToAnsi($temp) $Buffer &= $temp $MoreToRead = @extended ;_OpenSSL_DebugToConsole(@CRLF & "+++" & @CRLF & $temp & @CRLF & "+++" & @CRLF) WEnd Return $Buffer EndFunc ;==>_OpenSSL_ReadBuffer Func _OpenSSL_ReadBuffer_Lock($num = 250) $Buffer = "" $BlockAttempts = 0 For $x = 0 To $num Step +1 $BlockAttempts += 1 $Buffer = _OpenSSL_ReadBuffer() ;$Buffer = stringreplace($Buffer,chr(0),chr(0x20)) _OpenSSL_DebugToConsole("Read debug : " & $BlockAttempts & " = " & $Buffer & @CRLF ) Sleep(150) If StringLen($Buffer) > 0 Then ExitLoop EndIf Next _OpenSSL_DebugToConsole(StringStripCR ("Read : " & $Buffer) & @CRLF) _OpenSSL_DebugToConsole("================================ " & "Block Attempts : " & $x & " =================================" & @CRLF & @CRLF) Return $Buffer EndFunc ;==>_OpenSSL_ReadBuffer_Lock Func _OpenSSL_ReadBuffer_Until($code, $num = 500) $Buffer = "" ;Wait up to 25 seconds For $x = 0 To $num Step +1 $Buffer &= _OpenSSL_ReadBuffer() $chk = _OpenSSL_ChkForCode($Buffer, $code) If $chk > 0 Then _OpenSSL_DebugToConsole(@CRLF & "====================== Found <" & $code & "> at char " & $chk & ": CONNEXION OK =======================" & @CRLF & _ $Buffer) ExitLoop EndIf Sleep($SleepTime) Next _OpenSSL_DebugToConsole("=============================== " & "Finding Attempts : " & $x & " ================================" & @CRLF & @CRLF) If $chk <= 0 Then SetError(1) Return $Buffer EndFunc ;==>_OpenSSL_ReadBuffer_Until Func _OpenSSL_ChkForCode($Buffer, $code) Return StringInStr($Buffer, $code) EndFunc ;==>_OpenSSL_ChkForCode Func _OpenSSL_WriteBuffer_GUI() ;~ WinSetState($SSL_Exe_loc, "", @SW_SHOW) BlockInput(1) WinActivate($SSL_Exe_loc) WinWaitActive($SSL_Exe_loc) Send("FixGUIBug{ENTER}") BlockInput(0) ;WinSetState($SSL_Exe_loc, "", @SW_HIDE) _OpenSSL_DebugToConsole("Write-GUI: FixGUIBug" & @CRLF) $Buffer = "FixGUIBug" Sleep($SleepTime) EndFunc ;==>_OpenSSL_WriteBuffer_GUI Func _OpenSSL_WriteBuffer($Msg) If $FixGUIBug = False Then StdinWrite($_POP_RunPID, $Msg) _OpenSSL_DebugToConsole("Write: " & $Msg) Sleep($SleepTime) Else _OpenSSL_WriteBuffer_GUI() $FixGUIBug = False _OpenSSL_WriteBuffer($Msg) EndIf EndFunc ;==>_OpenSSL_WriteBuffer Func _OpenSSL_Kill() StdioClose($_POP_RunPID) Sleep(1000) If ProcessExists("openssl.exe") Then ProcessClose("cmd.exe") ProcessExists("openssl.exe") While ProcessExists("openssl.exe") ProcessClose("cmd.exe") ProcessClose("openssl.exe") WEnd EndIf EndFunc ;==>_OpenSSL_Kill Func _OpenSSL_DebugToConsole($string) If $_POP_Debug Then ;~ ConsoleWrite(StringStripWS($string, 4)) ConsoleWrite($string) EndIf EndFunc ;==>_OpenSSL_DebugToConsole Func _OpenSSL_IsRunning() _ProcessGetName($_POP_RunPID) If @error Then If ProcessExists("openssl.exe") Then $_POP_RunPID = ProcessExists("openssl.exe") Return True Else _OpenSSL_DebugToConsole("OpenSSL Closed Unexpectedly" & @CRLF) $_POP_Log &= "OpenSSL Closed Unexpectedly" & @CRLF _OpenSSL_Kill() Return False EndIf Else Return True EndIf EndFunc ;==>_OpenSSL_IsRunning Here is an example script for testing: #include <Array.au3> #include "POP_ssl_V3.2.1.au3" ;~ Opt("OnExitFunc", "endscript") Opt("SendKeyDelay", 0) Opt("TrayIconDebug", 1) ;kill previous run While ProcessExists("openssl.exe") ProcessClose("cmd.exe") ProcessClose("openssl.exe") WEnd ;###FILL IN THIS INFO### ;~ $User = InputBox("Gmail", "Enter Username", "") ;~ $Pass = InputBox("Gmail", "Enter Password", "", "*") $User = "anyone" $Pass = "anything" ;set server info $SSL_Exe_loc = @ScriptDir&"OpenSSLopenssl.exe" $POP_Server = "pop.mail.yahoo.fr" $POP_Port = "995" ;~ $error = "" $msg = _POP_Connect($POP_Server, $POP_Port, $SSL_Exe_loc, True) ;~ MsgBox(0, $msg & " : " & @error, $_POP_Log) ;~ $error &= $msg & " : " & @error & @CRLF ;~ If $msg == False Then EndReport($error) $msg = _POP_Login($User, $Pass) ;~ MsgBox(0, $msg & " : " & @error, $_POP_Log) ;~ $error &= $msg & " : " & @error & @CRLF exit You can download a tiny package with everything needed for testing here: UDFSCRIPT EXAMPLEOpenssl needed filesBATCH with the same command run by autoitHelp to solve this output mystery is welcome Cheers.
  7. Thanks for your reply. It partially works. I tried to copy: source folder=C:\Program Files\Fichiers communs target folder=D:\Téléchargement\Téléchargement Internet\Temp All the files and subdirectories are copied but the target folder is altered to D:\Téléchargement\Téléchargement Internet\Temp\1
  8. Yes, you're right: I'm so much a noob! I'll be back when I'm ready. See you.
  9. Sorry, I'm a noob and I don't know yet what I can say more about it. But, it would be helpful if I was just told the script I mention above works for someone or not. Cheers
  10. You're example doesn't work at home (XP PRO SP3, AutoIt v3.3.6.1) "No files were copied". The source folder contains 5 files and the target folder is empty. What did I miss?
×
×
  • Create New...