Jump to content
Sign in to follow this  
malu05

Int64 to hex.

Recommended Posts

malu05

Now for some wierd reason autoIT does not support more than 8 digits for the "hex()" function.

But when i got a int64 like -1067353106670363250 i can't use that to convert it.

How can i easily convert a int64 to hex?


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites
malu05

I have tried all UDF's aorund here...

Primes for example:

http://www.autoitscript.com/forum/index.php?showtopic=83091&st=0&p=594334&#entry594334

can't convert negative int's.


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites
malu05

Ahh.. ok... i get it.. its simply not possible in autoit.

AutoIt can't do 16^16

Lame...


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites
trancexx

You mean something like this:

$iNumber = -1067353106670363250
ConsoleWrite($iNumber)

ConsoleWrite(" = ")

$tInt64 = DllStructCreate("int64")
DllStructSetData($tInt64, 1, $iNumber)

$tSubStructure = DllStructCreate("ptr;ptr", DllStructGetPtr($tInt64))
$sHexQword = Hex(DllStructGetData($tSubStructure, 2)) & Hex(DllStructGetData($tSubStructure, 1))

ConsoleWrite($sHexQword & @CRLF)
  • Like 1

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Yashied

Nice idea, trancexx.

>_<

Let me suggest another approach.

$Value = -1067353106670363250

$Hi = Int($Value / 4294967296)
If ($Hi = 0) And ($Value < 0) Then
    $Hi = 0xFFFFFFFF
EndIf
$Str = StringFormat('%016s', Hex($Hi) & Hex(BitAND($Value, 0xFFFFFFFF)))

ConsoleWrite('0x' & $Str & @CR)
Edited by Yashied

Share this post


Link to post
Share on other sites
trancexx

Nice idea, trancexx.

>_<

Let me suggest another approach.

$Value = -1067353106670363250

$Hi = Int($Value / 4294967296)
If ($Hi = 0) And ($Value < 0) Then
    $Hi = 0xFFFFFFFF
EndIf
$Str = StringFormat('%016s', Hex($Hi) & Hex(BitAND($Value, 0xFFFFFFFF)))

ConsoleWrite('0x' & $Str & @CR)

Try -1000000000000 for example :(

♡♡♡

.

eMyvnE

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  

×