peter123 Posted July 21, 2007 Share Posted July 21, 2007 hi, i've got a problem how can i make this (vb) script in autoit3? for i = 1 to 4 a = code encoded = a xor (64h + i) done can i maybe some help,please? Link to comment Share on other sites More sharing options...
martin Posted July 22, 2007 Share Posted July 22, 2007 hi, i've got a problem how can i make this (vb) script in autoit3? for i = 1 to 4 a = code encoded = a xor (64h + i) done can i maybe some help,please?I know nothing about vb, but I think the script probably wasn't quite what you have quoted. The for i = 1 to 4 needs a next somewhere; the a=code seems unecessarry; encoded will always result in the value when i - 4; what does 'done' mean. Any way, the first problem is that I don't think that AutoIt has an exclusive or operator. (If I'm wrong someone will soon tell me I hope.) Exclusive or means one or the other but not both. 64h means, I assume, 64 in hex. In autoIt this is written 0x64. So the conversion would be for $i = 1 to 4 $a = $code $encoded = ($a OR (0x64 + $i)) AND (NOT($a AND (0x64 + $i))) next But as I said, this doen't make sense because it is the same as $encode = ($code OR 0x68) AND (NOT($code AND 0x68)) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Siao Posted July 22, 2007 Share Posted July 22, 2007 Any way, the first problem is that I don't think that AutoIt has an exclusive or operator. (If I'm wrong someone will soon tell me I hope.)BitXOR "be smart, drink your wine" Link to comment Share on other sites More sharing options...
martin Posted July 22, 2007 Share Posted July 22, 2007 BitXOR Thanks Siao, stupid of me. :"> I regularly use BitOR and BitAND. So the code would now be for $i = 1 to 4 $a = $code $encoded = BitXOR($a ,0x64 + $i) next ;which is the same as $encode = BitXOR($code , 0x68) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
peter123 Posted July 22, 2007 Author Share Posted July 22, 2007 thnx, it works but can u too make this code in au3? #pseudo bash for i in $(seq 0 $aantal); do offset = $(( $i × $sizerecord + pos)) dd if = leerling.dat skip = $offset bs = 4 count = 1 |od -tx 1 -v -An done this code is a bit of differenter... Link to comment Share on other sites More sharing options...
martin Posted July 22, 2007 Share Posted July 22, 2007 thnx, it works but can u too make this code in au3?nope. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
peter123 Posted July 30, 2007 Author Share Posted July 30, 2007 this code doesn't give the right pass :S for $i = 1 to 4 $a = $code $encoded = BitXOR($a ,0x64 + $i) next ;which is the same as $encode = BitXOR($code , 0x68) Maybe is Javascript easyer: java script:var x="W^R^",y="The code ("+x+") was decoded to: ";for(var i=0;i<4;i++)y+=(x.charCodeAt(i)^(101+i))-48;alert(y); If you try this code then you will get 2865 Can I maybe make a Autoit3 program? Link to comment Share on other sites More sharing options...
peter123 Posted July 31, 2007 Author Share Posted July 31, 2007 bump... Link to comment Share on other sites More sharing options...
peter123 Posted July 31, 2007 Author Share Posted July 31, 2007 (edited) bump... oops i posted 2 times sry Edited July 31, 2007 by peter123 Link to comment Share on other sites More sharing options...
peter123 Posted August 5, 2007 Author Share Posted August 5, 2007 Bump... Can nobody help me to make this java script: java script:var x="W^R^",y="The code ("+x+") was decoded to: ";for(var i=0;i<4;i++)y+=(x.charCodeAt(i)^(101+i))-48;alert(y); in Autoit3?? Link to comment Share on other sites More sharing options...
peter123 Posted August 6, 2007 Author Share Posted August 6, 2007 bump... Link to comment Share on other sites More sharing options...
Lazycat Posted August 6, 2007 Share Posted August 6, 2007 Assuming that your VB and JS code should give the same result: $x="W^R^" $y="The code (" & $x & ") was decoded to: " for $i = 1 To 4 $y &= Chr(BitXOR(Asc(StringMid($x, $i, 1)), 0x64+$i)) MsgBox (0, "", $y) Next Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
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