Jump to content

Int64 to hex.


 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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