Jump to content
Sign in to follow this  
zeroZshadow

for..to..next with HEX

Recommended Posts

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

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

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

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  

×
×
  • Create New...