Sign in to follow this  
Followers 0
mavor

Convert Int64 into loword and hiword?

3 posts in this topic

Hi all, as the title suggests, I am seeking info on how i can split an INT64 value into a Dword Loword and Dword Hiword. This is done because i need to push the dwords onto the stack in ASM code.

Any ideas how to do it?

Share this post


Link to post
Share on other sites



$iValue = 1067353106670363250

$tInt64 = DllStructCreate('int64')
DllStructSetData($tInt64, 1, $iValue)
$tHiLo = DllStructCreate('dword;dword', DllStructGetPtr($tInt64))
ConsoleWrite('Hi DWord = 0x' & Hex(DllStructGetData($tHiLo, 2)) & @CR)
ConsoleWrite('Lo DWord = 0x' & Hex(DllStructGetData($tHiLo, 1)) & @CR)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Ah so i should create a DLL struct. Thank you so much... : D

*edit: it's really interesting how you used the dll struct pointer to directly pull into the new struct. I guess when doing this it automatically divvies up the different types? ;)

Edited by mavor

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