Jump to content

I DON'T UNDERSTAND!


Recommended Posts

if $file is *.txt then $BUFFER_1=$BUFFER_2,

but if $file is *.exe then $BUFFER_1 <> $BUFFER_2

why?

$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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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

Link to comment
Share on other sites

with $buffer_2 = BinaryString ($buffer_1)

allways $BUFFER_1=$BUFFER_2

but 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)

Select

Case $buffer_1 = $buffer_2

MsgBox(0, "", "$BUFFER_1=$BUFFER_2")

Case Else

MsgBox(0, "", "$BUFFER_1<>$BUFFER_2")

EndSelect

Edited by psandu.ro
Link to comment
Share on other sites

with $buffer_2 = BinaryString ($buffer_1)

allways $BUFFER_1=$BUFFER_2

Correct.

but with $buffer_2 = String ($buffer_2) --->>> $BUFFER_1<>$BUFFER_2

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

$result=DllCall($dll,"str","Function","str",$input)

only for String($input) ---> StringLen($result)>0

DLLCall() returns an array if successful -- not a string. The return value of the function can be found in $Result[0].
Link to comment
Share on other sites

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

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