You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
524 lines
31 KiB
524 lines
31 KiB
<!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>Pin: Pin System Call API</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" />
|
|
</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">Pin
|
|
</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>
|
|
</div><!-- top -->
|
|
<!-- 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 class="header">
|
|
<div class="summary">
|
|
<a href="#typedef-members">Typedefs</a> |
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Pin System Call API</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
|
|
Typedefs</h2></td></tr>
|
|
<tr class="memitem:gad6892c860f3c69e5268de0f7f7e1ce00"><td class="memItemLeft" align="right" valign="top">typedef VOID(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">LEVEL_PINCLIENT::SYSCALL_ENTRY_CALLBACK</a>) (<a class="el" href="group__PIN__THREAD__API.html#ga645289be59039349ad77ad2fa7b0e2f3">THREADID</a> threadIndex, <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, VOID *v)</td></tr>
|
|
<tr class="separator:gad6892c860f3c69e5268de0f7f7e1ce00"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gae10e44f3b57df920d650e66b487c00df"><td class="memItemLeft" align="right" valign="top">typedef VOID(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#gae10e44f3b57df920d650e66b487c00df">LEVEL_PINCLIENT::SYSCALL_EXIT_CALLBACK</a>) (<a class="el" href="group__PIN__THREAD__API.html#ga645289be59039349ad77ad2fa7b0e2f3">THREADID</a> threadIndex, <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, VOID *v)</td></tr>
|
|
<tr class="separator:gae10e44f3b57df920d650e66b487c00df"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:ga85b302054acdd2a2d1314d5c311855d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__PIN__CALLBACKS.html#ga3ba1895c602cd5b2863b7b75840187a4">PIN_CALLBACK</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#ga85b302054acdd2a2d1314d5c311855d9">LEVEL_PINCLIENT::PIN_AddSyscallEntryFunction</a> (<a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">SYSCALL_ENTRY_CALLBACK</a> fun, VOID *val)</td></tr>
|
|
<tr class="separator:ga85b302054acdd2a2d1314d5c311855d9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga435e2ea4e20a9042f471759211972ac8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__PIN__CALLBACKS.html#ga3ba1895c602cd5b2863b7b75840187a4">PIN_CALLBACK</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#ga435e2ea4e20a9042f471759211972ac8">LEVEL_PINCLIENT::PIN_AddSyscallExitFunction</a> (<a class="el" href="group__PIN__SYSCALL__API.html#gae10e44f3b57df920d650e66b487c00df">SYSCALL_EXIT_CALLBACK</a> fun, VOID *val)</td></tr>
|
|
<tr class="separator:ga435e2ea4e20a9042f471759211972ac8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaa532751f97b471692e5a4f6e47fd5e6d"><td class="memItemLeft" align="right" valign="top">VOID </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#gaa532751f97b471692e5a4f6e47fd5e6d">LEVEL_PINCLIENT::PIN_SetSyscallArgument</a> (<a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, UINT32 argNum, ADDRINT val)</td></tr>
|
|
<tr class="separator:gaa532751f97b471692e5a4f6e47fd5e6d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga09ec258651518b635b19e996f3685592"><td class="memItemLeft" align="right" valign="top">ADDRINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#ga09ec258651518b635b19e996f3685592">LEVEL_PINCLIENT::PIN_GetSyscallArgument</a> (const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, UINT32 argNum)</td></tr>
|
|
<tr class="separator:ga09ec258651518b635b19e996f3685592"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gad487e2291fab27c857f499ef620df557"><td class="memItemLeft" align="right" valign="top">VOID </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#gad487e2291fab27c857f499ef620df557">LEVEL_PINCLIENT::PIN_SetSyscallNumber</a> (<a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, ADDRINT val)</td></tr>
|
|
<tr class="separator:gad487e2291fab27c857f499ef620df557"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga7978c0470ca54f50f13c5015fce82b67"><td class="memItemLeft" align="right" valign="top">ADDRINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#ga7978c0470ca54f50f13c5015fce82b67">LEVEL_PINCLIENT::PIN_GetSyscallNumber</a> (const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std)</td></tr>
|
|
<tr class="separator:ga7978c0470ca54f50f13c5015fce82b67"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaa05b2658e8eed741ff10408f93453494"><td class="memItemLeft" align="right" valign="top">ADDRINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#gaa05b2658e8eed741ff10408f93453494">LEVEL_PINCLIENT::PIN_GetSyscallReturn</a> (const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std)</td></tr>
|
|
<tr class="separator:gaa05b2658e8eed741ff10408f93453494"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gae2a6966760a8f1d7a15fcbb0fe0a50fa"><td class="memItemLeft" align="right" valign="top">ADDRINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group__PIN__SYSCALL__API.html#gae2a6966760a8f1d7a15fcbb0fe0a50fa">LEVEL_PINCLIENT::PIN_GetSyscallErrno</a> (const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std)</td></tr>
|
|
<tr class="separator:gae2a6966760a8f1d7a15fcbb0fe0a50fa"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<p>These APIs provide Pin support for extracting information about, or modifying, system calls made by the pinned program. </p>
|
|
<h2 class="groupheader">Typedef Documentation</h2>
|
|
<a id="gad6892c860f3c69e5268de0f7f7e1ce00"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gad6892c860f3c69e5268de0f7f7e1ce00">◆ </a></span>SYSCALL_ENTRY_CALLBACK</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef VOID(* LEVEL_PINCLIENT::SYSCALL_ENTRY_CALLBACK) (<a class="el" href="group__PIN__THREAD__API.html#ga645289be59039349ad77ad2fa7b0e2f3">THREADID</a> threadIndex, <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, VOID *v)</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Call-back function before execution of a system call.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">threadIndex</td><td>The Pin thread ID of the thread that executes the system call. </td></tr>
|
|
<tr><td class="paramdir">[in,out]</td><td class="paramname">ctxt</td><td>Application's register state immediately before execution of the system call. The tool may change this and affect the new register state. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>The system calling standard. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>The tool's call-back value. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gae10e44f3b57df920d650e66b487c00df"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gae10e44f3b57df920d650e66b487c00df">◆ </a></span>SYSCALL_EXIT_CALLBACK</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef VOID(* LEVEL_PINCLIENT::SYSCALL_EXIT_CALLBACK) (<a class="el" href="group__PIN__THREAD__API.html#ga645289be59039349ad77ad2fa7b0e2f3">THREADID</a> threadIndex, <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> *ctxt, SYSCALL_STANDARD std, VOID *v)</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Call-back function after execution of a system call.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">threadIndex</td><td>The Pin thread ID of the thread that executed the system call. </td></tr>
|
|
<tr><td class="paramdir">[in,out]</td><td class="paramname">ctxt</td><td>Application's register state immediately after execution of the system call.The tool may change this and affect the new register state. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>The system calling standard. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>The tool's call-back value. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a id="ga85b302054acdd2a2d1314d5c311855d9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga85b302054acdd2a2d1314d5c311855d9">◆ </a></span>PIN_AddSyscallEntryFunction()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__PIN__CALLBACKS.html#ga3ba1895c602cd5b2863b7b75840187a4">PIN_CALLBACK</a> LEVEL_PINCLIENT::PIN_AddSyscallEntryFunction </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">SYSCALL_ENTRY_CALLBACK</a> </td>
|
|
<td class="paramname"><em>fun</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VOID * </td>
|
|
<td class="paramname"><em>val</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Register a notification function that is called immediately before execution of a system call.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">fun</td><td>Function to be called immediately before execution of a system call. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Value to pass to the function.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>PIN_CALLBACK A handle to a callback that can be used to further modify this callback's properties</dd></dl>
|
|
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API..</dd></dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows<br />
|
|
<b>CPU:</b> All<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga435e2ea4e20a9042f471759211972ac8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga435e2ea4e20a9042f471759211972ac8">◆ </a></span>PIN_AddSyscallExitFunction()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__PIN__CALLBACKS.html#ga3ba1895c602cd5b2863b7b75840187a4">PIN_CALLBACK</a> LEVEL_PINCLIENT::PIN_AddSyscallExitFunction </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__PIN__SYSCALL__API.html#gae10e44f3b57df920d650e66b487c00df">SYSCALL_EXIT_CALLBACK</a> </td>
|
|
<td class="paramname"><em>fun</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VOID * </td>
|
|
<td class="paramname"><em>val</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Register a notification function that is called immediately after execution of a system call. <br />
|
|
The notification is called for each system call when it returns to the application, even if the system call changes control flow and does not fall through to the next instruction. <br />
|
|
</p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">fun</td><td>Function to be called immediately after execution of a system call. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Value to pass to the function.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>In order to monitor all possible control transfers from the operating system to the user mode application, the tool has to register both a SYSCALL_EXIT_CALLBACK and a CONTEXT_CHANGE_CALLBACK callback functions. This can be done using the corresponding registration functions: <a class="el" href="group__PIN__SYSCALL__API.html#ga435e2ea4e20a9042f471759211972ac8">PIN_AddSyscallExitFunction()</a> and <a class="el" href="group__PIN__CONTROL.html#ga786fd61c9be3c42a1a6deefc71dffadf">PIN_AddContextChangeFunction()</a>.<br />
|
|
When a system call returns to the application, the tool receives the SYSCALL_EXIT_CALLBACK notification. Usually, this callback immediately follows the corresponding SYSCALL_ENTRY_CALLBACK notification and there is no application code executed between these two events. However, some (Windows) system calls can be interrupted by a system event (APC, Windows callback, exception) before they return to the application. If this happens, the tool receives the corresponding CONTEXT_CHANGE_CALLBACK notification just before the (user mode) handler of the system event gets executed. Eventually, when the event handler and the interrupted system call are completed, the SYSCALL_EXIT_CALLBACK notification is delivered to the tool.</dd></dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>PIN_CALLBACK A handle to a callback that can be used to further modify this callback's properties</dd></dl>
|
|
<dl class="section note"><dt>Note</dt><dd>The pin client lock is obtained during the call of this API.</dd></dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows<br />
|
|
<b>CPU:</b> All<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga09ec258651518b635b19e996f3685592"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga09ec258651518b635b19e996f3685592">◆ </a></span>PIN_GetSyscallArgument()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallArgument </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> * </td>
|
|
<td class="paramname"><em>ctxt</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">SYSCALL_STANDARD </td>
|
|
<td class="paramname"><em>std</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">UINT32 </td>
|
|
<td class="paramname"><em>argNum</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get the value of the argument of the system call to be executed in the specified context.<br />
|
|
It is a user's responsibility to make sure that the specified context and the current memory content represent the state of a system call before execution. For example, this function can be safely used in the scope of <a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">SYSCALL_ENTRY_CALLBACK</a>. Applying this function to an inappropriate context results in undefined behavior and even may cause crash on systems in which system call arguments are located in memory.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">ctxt</td><td>context before the system call execution </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>system calling standard </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">argNum</td><td>ordinal number of the argument whose value is requested. Ordinal numbers start from zero for the first argument </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>value of the argument</dd></dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows & macOS*<br />
|
|
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gae2a6966760a8f1d7a15fcbb0fe0a50fa"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gae2a6966760a8f1d7a15fcbb0fe0a50fa">◆ </a></span>PIN_GetSyscallErrno()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallErrno </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> * </td>
|
|
<td class="paramname"><em>ctxt</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">SYSCALL_STANDARD </td>
|
|
<td class="paramname"><em>std</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get the error code of the system call which is just returned with the specified context.<br />
|
|
It is a user's responsibility to make sure that the specified context represents the state of a system call after execution. For example, this function can be safely used in the scope of <a class="el" href="group__PIN__SYSCALL__API.html#gae10e44f3b57df920d650e66b487c00df">SYSCALL_EXIT_CALLBACK</a>. Applying this function to an inappropriate context results in undefined behavior.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">ctxt</td><td>context after the system call execution </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>system calling standard </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>error code, if the system call failed;<br />
|
|
zero, if the system call succeeded</dd></dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows & macOS*<br />
|
|
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga7978c0470ca54f50f13c5015fce82b67"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga7978c0470ca54f50f13c5015fce82b67">◆ </a></span>PIN_GetSyscallNumber()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallNumber </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> * </td>
|
|
<td class="paramname"><em>ctxt</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">SYSCALL_STANDARD </td>
|
|
<td class="paramname"><em>std</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get the number (ID) of the system call to be executed in the specified context.<br />
|
|
It is a user's responsibility to make sure that the specified context represents the state of a system call before execution. For example, this function can be safely used in the scope of <a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">SYSCALL_ENTRY_CALLBACK</a>, but not in a SYSCALL_EXIT_CALLBACK. Applying this function to an inappropriate context results in undefined behavior.</p>
|
|
<p>If you need the system call number in a SYSCALL_EXIT_CALLBACK, you should use a SYSCALL_ENTRY_CALLBACK to save the system call number into thread local storage so that you can get it from there in your SYSCALL_EXIT_CALLBACK. Beware, though of interruptable system calls, to handle those you will need to worry about other context changes (see the discussion in <a class="el" href="group__PIN__SYSCALL__API.html#ga435e2ea4e20a9042f471759211972ac8">PIN_AddSyscallExitFunction</a> ).</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">ctxt</td><td>context before the system call execution </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>system calling standard </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>system call number</dd></dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows & macOS*<br />
|
|
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gaa05b2658e8eed741ff10408f93453494"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gaa05b2658e8eed741ff10408f93453494">◆ </a></span>PIN_GetSyscallReturn()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallReturn </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> * </td>
|
|
<td class="paramname"><em>ctxt</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">SYSCALL_STANDARD </td>
|
|
<td class="paramname"><em>std</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Get the return value of the system call which has just returned with the specified context.<br />
|
|
It is a user's responsibility to make sure that the specified context represents the state of a system call after execution. For example, this function can be safely used in the scope of <a class="el" href="group__PIN__SYSCALL__API.html#gae10e44f3b57df920d650e66b487c00df">SYSCALL_EXIT_CALLBACK</a>. Applying this function to an inappropriate context results in undefined behavior.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">ctxt</td><td>context after the system call execution </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>system calling standard </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>return value of the system call. <br />
|
|
On Linux and macOS* the function returns -1 if the system call failed</dd></dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows & macOS*<br />
|
|
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gaa532751f97b471692e5a4f6e47fd5e6d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gaa532751f97b471692e5a4f6e47fd5e6d">◆ </a></span>PIN_SetSyscallArgument()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">VOID LEVEL_PINCLIENT::PIN_SetSyscallArgument </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> * </td>
|
|
<td class="paramname"><em>ctxt</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">SYSCALL_STANDARD </td>
|
|
<td class="paramname"><em>std</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">UINT32 </td>
|
|
<td class="paramname"><em>argNum</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">ADDRINT </td>
|
|
<td class="paramname"><em>val</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Set the given value for the argument of the system call to be executed in the specified context.<br />
|
|
It is a user's responsibility to make sure that the specified context and the current memory content represent the state of a system call before execution. For example, this function can be safely used in the scope of <a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">SYSCALL_ENTRY_CALLBACK</a>. Applying this function to an inappropriate context results in undefined behavior and even may cause crash on systems in which system call arguments are located in memory.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in,out]</td><td class="paramname">ctxt</td><td>context before the system call execution </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>system calling standard </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">argNum</td><td>ordinal number of the argument whose value is to be set. Ordinal numbers start from zero for the first argument </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>new value of the argument</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows & macOS*<br />
|
|
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gad487e2291fab27c857f499ef620df557"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gad487e2291fab27c857f499ef620df557">◆ </a></span>PIN_SetSyscallNumber()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">VOID LEVEL_PINCLIENT::PIN_SetSyscallNumber </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__CONTEXT__API.html#ga73f8f88949aaecf53a6d23f56399c676">CONTEXT</a> * </td>
|
|
<td class="paramname"><em>ctxt</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">SYSCALL_STANDARD </td>
|
|
<td class="paramname"><em>std</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">ADDRINT </td>
|
|
<td class="paramname"><em>val</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Set the number (ID) of the system call to be executed in the specified context.<br />
|
|
It is a user's responsibility to make sure that the specified context represents the state of a system call before execution. For example, this function can be safely used in the scope of <a class="el" href="group__PIN__SYSCALL__API.html#gad6892c860f3c69e5268de0f7f7e1ce00">SYSCALL_ENTRY_CALLBACK</a>. Applying this function to an inappropriate context results in undefined behavior.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">ctxt</td><td>context before the system call execution </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">std</td><td>system calling standard </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>new system call number</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br />
|
|
<b>O/S</b>: Linux, Windows & macOS*<br />
|
|
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br />
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</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>
|