Need help with C++

Discussion in 'Software' started by Omega, Jul 21, 2007.

  1. Omega

    Omega

    Joined:
    Jul 21, 2007
    Messages:
    1
    Location:
    nowhere
    I am trying to use a function in my DLL called
    Code:
    BOOL ReadProcessMemory(
      HANDLE hProcess,
      LPCVOID lpBaseAddress,
      LPVOID lpBuffer,
      SIZE_T nSize,
      SIZE_T* lpNumberOfBytesRead
    );
    
    I want to convert a LPVOID variable to a cli::array<Byte^,Dimension>^
    Can anyone help, please? Btw, I am kind of a beginner, but I know how to deal with Manged code than unmanaged. I have used this function before in C#, so I know the function reads the values in memory into that variable. Thanks!

    BTW, this all written in Managed C++ 2005 in Visual Studio 2005.

    here is my existing code
    Code:
    HANDLE hProcess = OpenProcess(PROCESS_VM_READ,true,processId);
    UInt32^ dwProcessId = Convert::ToUInt32(hProcess);
    array<Byte^,1>^ buffer = gcnew array<Byte^,1>(bufferSize);
    LPVOID lBuffer;
    SIZE_T *lpNumberOfBytesRead;
    
    ReadProcessMemory(hProcess,
    (LPCVOID)IntPtr((int)memoryAddress),
    lBuffer,
    Convert::ToUInt32(buffer->Length),
    lpNumberOfBytesRead);
     
    Omega, Jul 21, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    4
    Views:
    449
    Jacky
    Feb 4, 2004
  2. nuorigin@gmail.com

    HELP - need a cam that doesn't need software install

    nuorigin@gmail.com, Nov 23, 2005, in forum: Digital Photography
    Replies:
    27
    Views:
    612
    Michael Meissner
    Nov 29, 2005
  3. hedayatniac@gmail.com

    re_---need help Network Adapters!!!! NEED HELP!!!!

    hedayatniac@gmail.com, Aug 12, 2006, in forum: Computer Support
    Replies:
    4
    Views:
    696
    hedayatniac@gmail.com
    Aug 13, 2006
  4. Piper
    Replies:
    4
    Views:
    449
    Leythos
    Jan 1, 2007
  5. sinu
    Replies:
    3
    Views:
    486
    and3w
    Jan 19, 2007
Loading...

Share This Page