Jump to content
Sign in to follow this  
Grayhat

Representing DllStructs in C++

Recommended Posts

Grayhat

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
Jos

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.


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Grayhat

Sorry Jos... I just didn't think I would have to copy the code here... It was just to explain the situation.

Share this post


Link to post
Share on other sites
Kovacic

It sounds like you are looking for help with a C++ app..

You might get better reception going to a C++ forum and explaining to them what the AutoIT code does and how to make that happen in C++.


C0d3 is P0etry( ͡° ͜ʖ ͡°)

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  

×