Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't have a machine to test things on, but your first issue is you don't appear to be passing <a href="http://msdn.microsoft.com/en-us/library/ms681674%28VS.85%29.aspx" rel="nofollow">the proper parameters to <code>WriteProcessMemory</code></a>:</p> <pre><code>BOOL WINAPI WriteProcessMemory( __in HANDLE hProcess, __in LPVOID lpBaseAddress, __in LPCVOID lpBuffer, __in SIZE_T nSize, __out SIZE_T *lpNumberOfBytesWritten ); </code></pre> <p>You're passing...</p> <pre><code>handle =&gt; hProcess, StructP =&gt; lpBaseAddress, // ??? StructP.size.DataPtr =&gt; lpBuffer, // ??? 4 =&gt; nSize, hnd_ptr =&gt; lpNumberOfBytesWritten </code></pre> <p>Let's start with an overview of WriteProcessMemory: It's supposed to take a chunk of data in the curent process, pointed to by lpBuffer, nSize bytes long. It copies that data into the memory space of the process indicated by hProcess and places that data at the address lpBaseAddress in that target process.</p> <p>The problems I see with your code are:</p> <ol> <li><p><code>lpBaseAddress</code> should be the address in another process which you are writing to. Since your <code>handle</code> points to the current process, I don't even know why you'd call this function to begin with. You can just use <code>StructP.WriteWORD(Offset, Data)</code> to write data to your structure. But I'll presume for now you're doing this for bare minimum demonstraction purposes &mdash; to see if you can get <code>WriteProcessMemory()</code> to work at all.</p></li> <li><p>I don't think this is even valid code. <a href="http://mpscripts.net/docs/ref-databloc-size.php" rel="nofollow"><code>StructP.size</code> exists, but it's an int, not an object</a>. It has no DataPtr member. <code>StructP.DataPtr</code> also exists. In fact, <a href="http://mpscripts.net/docs/ref-interop-call.php" rel="nofollow"><code>StructP.DataPtr</code> is what is sent if you just specify <code>StructP</code> according to the help file</a>. So are you trying to write <em>from</em> the structure right back <em>to</em> the structure, again, as a minimum test? If so, both pointers should be <code>StructP</code></p></li> </ol> <p>Following that, I don't know where the <code>ReadInt()</code> function you are using comes from. It looks to me like Databloc has several member functions for reading values, but you would call them like: <code>hnd_ptr.ReadWORD(0)</code></p> <p>I am unsurprised that the structure is empty after calling <code>Process32FirstW()</code>, as <a href="http://msdn.microsoft.com/en-us/library/ms684834%28VS.85%29.aspx" rel="nofollow">it checks the value of the <code>dwSize</code> member of the structure</a>. Since you are not successfully writing to it, I expect that value is normally 0, and hence no data is written.</p> <p>I've never fiddled with Messger Plus, so you'll have to forgive me a little for being befuddled by a lot of this. Let me know if any of this was useful.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload