SandelPerieanu Posted December 15, 2005 Posted December 15, 2005 if $file is *.txt then $BUFFER_1=$BUFFER_2,but if $file is *.exe then $BUFFER_1 <> $BUFFER_2why? $file = "TEST.EXE"$open = FileOpen($file, 0)$buffer_1 = FileRead($open, FileGetSize($file))FileClose($file)$buffer_2 = String($buffer_1)Select Case $buffer_1 = $buffer_2 MsgBox(0, "", "$BUFFER_1=$BUFFER_2") Case Else MsgBox(0, "", "$BUFFER_1<>$BUFFER_2")EndSelect
themax90 Posted December 15, 2005 Posted December 15, 2005 Excutables can be read differently each time. They are not always the exact same because they are not plain text and may be interpreted by AutoIt differently each time. [OffTopic]Still working on that send file method eh?[/OffTopic] AutoIt Smith
jpm Posted December 15, 2005 Posted December 15, 2005 I move this topic to "support forum" as it is not a scripts and scraps topic
SandelPerieanu Posted December 15, 2005 Author Posted December 15, 2005 Excutables can be read differently each time. They are not always the exact same because they are not plain text and may be interpreted by AutoIt differently each time. [OffTopic]Still working on that send file method eh?[/OffTopic] AutoIt Smith Nope! for me, send file working....i tried many times...and the same...working! i tried to send exe and avi from bucharest to brasov(another city) and working.... explain me this!
themax90 Posted December 15, 2005 Posted December 15, 2005 That is impossible unless you implement WSock or another library. AutoIt does not support that functionality because of how the strings get broken down during transfer.
SandelPerieanu Posted December 15, 2005 Author Posted December 15, 2005 That is impossible unless you implement WSock or another library. AutoIt does not support that functionality because of how the strings get broken down during transfer. Give me a break!I explained to you!i tried .....it work every time.....What it's problem?!!!?!?!?
themax90 Posted December 15, 2005 Posted December 15, 2005 The problem is that it does not work on any system I have tried using it on and none of my friends can use it. It's been tested on atleast 50 systems and worked on none. It doesn't work on a global scale so I am not accepting it as a correct method. It may work for others and that is true but it cannot run on most so It isn't correct.
LxP Posted December 15, 2005 Posted December 15, 2005 Excutables can be read differently each time. They are not always the exact same because they are not plain text and may be interpreted by AutoIt differently each time. Almost right!AutoIt is guaranteed to read the EXE file identically each time. The issue is that you are reading the executable into a binary string and then converting it into a string (why?). I believe that the string will be terminated at the first null. Compare the sizes of both variables using StringLen() -- there will be a difference.
SandelPerieanu Posted December 15, 2005 Author Posted December 15, 2005 (edited) with $buffer_2 = BinaryString ($buffer_1)allways $BUFFER_1=$BUFFER_2but with $buffer_2 = String ($buffer_2) --->>> $BUFFER_1<>$BUFFER_2$result=DllCall($dll,"str","Function","str",$input)only for String($input) ---> StringLen($result)>0$file = "TEST.EXE"$open = FileOpen($file, 0)$buffer_1 = FileRead($open, FileGetSize($file))FileClose($file)$buffer_2 = BinaryString ($buffer_1)SelectCase $buffer_1 = $buffer_2MsgBox(0, "", "$BUFFER_1=$BUFFER_2")Case ElseMsgBox(0, "", "$BUFFER_1<>$BUFFER_2")EndSelect Edited December 15, 2005 by psandu.ro
LxP Posted December 15, 2005 Posted December 15, 2005 with $buffer_2 = BinaryString ($buffer_1)allways $BUFFER_1=$BUFFER_2Correct.but with $buffer_2 = String ($buffer_2) --->>> $BUFFER_1<>$BUFFER_2Yes, also correct. $Buffer_2 is initially a BinaryString and you are then converting it to a String. They are different data types -- a String cannot hold the same data as a BinaryString.
LxP Posted December 15, 2005 Posted December 15, 2005 $result=DllCall($dll,"str","Function","str",$input) only for String($input) ---> StringLen($result)>0DLLCall() returns an array if successful -- not a string. The return value of the function can be found in $Result[0].
SandelPerieanu Posted December 15, 2005 Author Posted December 15, 2005 (edited) i know this and i tried. Only if $input=String($input) then DllCall return correctly Edited December 15, 2005 by psandu.ro
LxP Posted December 16, 2005 Posted December 16, 2005 What DLLCall() are you trying to use? It's very likely that if the function that you are calling expects strings containing nulls, there will be another way to do what you want (e.g. using DLLStructCreate() and then passing a structure pointer to DLLCall()).
LxP Posted December 19, 2005 Posted December 19, 2005 My understanding is that you want to pass a string containing nulls to/from a DLLCall(). If this is correct then you may want to watch this thread -- one of the AutoIt developers seems also to be seeking this functionality.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now