<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crashpad: crashpad::ProcessMemory Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crashpad </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1ProcessMemory.html">ProcessMemory</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classcrashpad_1_1ProcessMemory-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">crashpad::ProcessMemory Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>Accesses the memory of another process. <a href="classcrashpad_1_1ProcessMemory.html#details">More...</a></p> <p><code>#include "util/linux/process_memory.h"</code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ae11b51dd187b650bf910483f0f19f634"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ProcessMemory.html#ae11b51dd187b650bf910483f0f19f634">Initialize</a> (pid_t pid)</td></tr> <tr class="memdesc:ae11b51dd187b650bf910483f0f19f634"><td class="mdescLeft"> </td><td class="mdescRight">Initializes this object to read the memory of a process whose ID is <em>pid</em>. <a href="#ae11b51dd187b650bf910483f0f19f634">More...</a><br /></td></tr> <tr class="separator:ae11b51dd187b650bf910483f0f19f634"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a9b7aad5723e72d3c6dde05b3fda44427"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ProcessMemory.html#a9b7aad5723e72d3c6dde05b3fda44427">Read</a> (<a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> address, size_t size, void *buffer) const</td></tr> <tr class="memdesc:a9b7aad5723e72d3c6dde05b3fda44427"><td class="mdescLeft"> </td><td class="mdescRight">Copies memory from the target process into a caller-provided buffer in the current process. <a href="#a9b7aad5723e72d3c6dde05b3fda44427">More...</a><br /></td></tr> <tr class="separator:a9b7aad5723e72d3c6dde05b3fda44427"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab1797e5a365cdfa1a47c453607432cf5"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ProcessMemory.html#ab1797e5a365cdfa1a47c453607432cf5">ReadCString</a> (<a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> address, std::string *string) const</td></tr> <tr class="memdesc:ab1797e5a365cdfa1a47c453607432cf5"><td class="mdescLeft"> </td><td class="mdescRight">Reads a <code>NUL</code>-terminated C string from the target process into a string in the current process. <a href="#ab1797e5a365cdfa1a47c453607432cf5">More...</a><br /></td></tr> <tr class="separator:ab1797e5a365cdfa1a47c453607432cf5"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adca21fbca39f22e04ec6ce6b7cc82281"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ProcessMemory.html#adca21fbca39f22e04ec6ce6b7cc82281">ReadCStringSizeLimited</a> (<a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> address, size_t size, std::string *string) const</td></tr> <tr class="memdesc:adca21fbca39f22e04ec6ce6b7cc82281"><td class="mdescLeft"> </td><td class="mdescRight">Reads a <code>NUL</code>-terminated C string from the target process into a string in the current process. <a href="#adca21fbca39f22e04ec6ce6b7cc82281">More...</a><br /></td></tr> <tr class="separator:adca21fbca39f22e04ec6ce6b7cc82281"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Accesses the memory of another process. </p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="ae11b51dd187b650bf910483f0f19f634"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae11b51dd187b650bf910483f0f19f634">◆ </a></span>Initialize()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool crashpad::ProcessMemory::Initialize </td> <td>(</td> <td class="paramtype">pid_t </td> <td class="paramname"><em>pid</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Initializes this object to read the memory of a process whose ID is <em>pid</em>. </p> <p>This method must be called successfully prior to calling any other method in this class.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">pid</td><td>The process ID of a target process.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>true</code> on success, <code>false</code> on failure with a message logged. </dd></dl> </div> </div> <a id="a9b7aad5723e72d3c6dde05b3fda44427"></a> <h2 class="memtitle"><span class="permalink"><a href="#a9b7aad5723e72d3c6dde05b3fda44427">◆ </a></span>Read()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool crashpad::ProcessMemory::Read </td> <td>(</td> <td class="paramtype"><a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> </td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"><em>buffer</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Copies memory from the target process into a caller-provided buffer in the current process. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>The address, in the target process' address space, of the memory region to copy. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The size, in bytes, of the memory region to copy. <em>buffer</em> must be at least this size. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>The buffer into which the contents of the other process' memory will be copied.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>true</code> on success, with <em>buffer</em> filled appropriately. <code>false</code> on failure, with a message logged. </dd></dl> </div> </div> <a id="ab1797e5a365cdfa1a47c453607432cf5"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab1797e5a365cdfa1a47c453607432cf5">◆ </a></span>ReadCString()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool crashpad::ProcessMemory::ReadCString </td> <td>(</td> <td class="paramtype"><a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> </td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::string * </td> <td class="paramname"><em>string</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Reads a <code>NUL</code>-terminated C string from the target process into a string in the current process. </p> <p>The length of the string need not be known ahead of time. This method will read contiguous memory until a <code>NUL</code> terminator is found.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>The address, in the target process’s address space, of the string to copy. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">string</td><td>The string read from the other process.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>true</code> on success, with <em>string</em> set appropriately. <code>false</code> on failure, with a message logged. Failures can occur, for example, when encountering unmapped or unreadable pages. </dd></dl> </div> </div> <a id="adca21fbca39f22e04ec6ce6b7cc82281"></a> <h2 class="memtitle"><span class="permalink"><a href="#adca21fbca39f22e04ec6ce6b7cc82281">◆ </a></span>ReadCStringSizeLimited()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool crashpad::ProcessMemory::ReadCStringSizeLimited </td> <td>(</td> <td class="paramtype"><a class="el" href="namespacecrashpad.html#acb197256391fbfca91f9a7e5c911db45">LinuxVMAddress</a> </td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::string * </td> <td class="paramname"><em>string</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Reads a <code>NUL</code>-terminated C string from the target process into a string in the current process. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>The address, in the target process’s address space, of the string to copy. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The maximum number of bytes to read. The string is required to be <code>NUL</code>-terminated within this many bytes. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">string</td><td>The string read from the other process.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>true</code> on success, with <em>string</em> set appropriately. <code>false</code> on failure, with a message logged. Failures can occur, for example, when a <code>NUL</code> terminator is not found within <em>size</em> bytes, or when encountering unmapped or unreadable pages. </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>util/linux/process_memory.h</li> <li>util/linux/process_memory.cc</li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>