Jump to content

Recommended Posts

Posted

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]

Posted

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]

Posted

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)

♡♡♡

.

eMyvnE

Posted (edited)

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...