Jump to content
Sign in to follow this  
Grayhat

Representing DllStructs in C++

Recommended Posts

Hello.

I'm trying to port an Autoit Code to c++ and  got stucked in this case:


In Au3 I have:
 

$pointer1 =  (an arbitrary memory location)
$pointer2 =  (an arbitrary memory location)
$pointer3 =  (an arbitrary memory location)

$struct1 = DllStructCreate("byte["  & $size & "]", $pointer1 + $pointer2)
$struct2 = DllStructCreate("byte["  & $size & "]", $pointer3)

DllStructSetData($struct1, 1, DllStructGetData($struct2, 1))

By doind this, AutoIt is copying the memory from address (pointer1 + pointer2) and moving it to pointer3, right?

How can I achieve the same result in C++?

I tried this:

PVOID pointer1, pointer2, pointer3;
...
memcpy(pointer1, pointer2 + pointer3, iSize);

but still no success...

I'd appreciate any help.

Thanks in advance

Edited by Grayhat

Share this post


Link to post
Share on other sites

By doind this, AutoIt is copying the memory from address (pointer1 + pointer2) and moving it to pointer3, right?

Not really ... and doubt that code would even run as it has some syntax errors.

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...