Sign in to follow this  
Followers 0
zeroZshadow

for..to..next with HEX

10 posts in this topic

is there any way to make a for to next loop with hex, instead of integers

so like

For $i=00 to FF

solutions are welcome :whistle:


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites



Uhh, why?

Share this post


Link to post
Share on other sites

strange question, for running trought a memory editor that uses hex.


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites

strange question, for running trought a memory editor that uses hex.

treat the hexvalue as a string, and increment as necessary....

$hex_digits = StringSplit("0123456789ABCDEF")

for each character in the string, right to left

match position w/ index value of hex_digits

if you're at the max, zero current value, and increment next value one.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

strange question, for running trought a memory editor that uses hex.

Okay, that's fine. But why does the For loop have to iterate using Hex instead of decimal? Do you not know how to convert from Decimal to Hex?

Share this post


Link to post
Share on other sites

wait thats a little stupid of me XD thanks mate


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites

For $i = 0 To 255
    $iHex = Hex($i, 2)
    MsgBox(0, "$iHex", $iHex, 1)
Next


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

For $i = 0 To 255
    $iHex = Hex($i, 2)
    MsgBox(0, "$iHex", $iHex, 1)
Next
Think your missing Chr() in there :whistle:

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

is there any way to make a for to next loop with hex, instead of integers

so like

For $i=00 to FF

solutions are welcome :whistle:

For $i=0x00 to 0xff
Next

Share this post


Link to post
Share on other sites

great, it works.

thanks guys


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

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  
Followers 0