Jump to content

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

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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( ͡° ͜ʖ ͡°)

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