Typedefs | |
typedef VOID(*) | LEVEL_PINCLIENT::SYSCALL_ENTRY_CALLBACK (THREADID threadIndex, CONTEXT *ctxt, SYSCALL_STANDARD std, VOID *v) |
typedef VOID(*) | LEVEL_PINCLIENT::SYSCALL_EXIT_CALLBACK (THREADID threadIndex, CONTEXT *ctxt, SYSCALL_STANDARD std, VOID *v) |
Functions | |
PIN_CALLBACK | LEVEL_PINCLIENT::PIN_AddSyscallEntryFunction (SYSCALL_ENTRY_CALLBACK fun, VOID *val) |
PIN_CALLBACK | LEVEL_PINCLIENT::PIN_AddSyscallExitFunction (SYSCALL_EXIT_CALLBACK fun, VOID *val) |
VOID | LEVEL_PINCLIENT::PIN_SetSyscallArgument (CONTEXT *ctxt, SYSCALL_STANDARD std, UINT32 argNum, ADDRINT val) |
ADDRINT | LEVEL_PINCLIENT::PIN_GetSyscallArgument (const CONTEXT *ctxt, SYSCALL_STANDARD std, UINT32 argNum) |
VOID | LEVEL_PINCLIENT::PIN_SetSyscallNumber (CONTEXT *ctxt, SYSCALL_STANDARD std, ADDRINT val) |
ADDRINT | LEVEL_PINCLIENT::PIN_GetSyscallNumber (const CONTEXT *ctxt, SYSCALL_STANDARD std) |
ADDRINT | LEVEL_PINCLIENT::PIN_GetSyscallReturn (const CONTEXT *ctxt, SYSCALL_STANDARD std) |
ADDRINT | LEVEL_PINCLIENT::PIN_GetSyscallErrno (const CONTEXT *ctxt, SYSCALL_STANDARD std) |
typedef VOID(*) LEVEL_PINCLIENT::SYSCALL_ENTRY_CALLBACK(THREADID threadIndex, CONTEXT *ctxt, SYSCALL_STANDARD std, VOID *v) |
Call-back function before execution of a system call.
[in] | threadIndex | The Pin thread ID of the thread that executes the system call. |
[in,out] | ctxt | Application's register state immediately before execution of the system call. The tool may change this and affect the new register state. |
[in] | std | The system calling standard. |
[in] | v | The tool's call-back value. |
typedef VOID(*) LEVEL_PINCLIENT::SYSCALL_EXIT_CALLBACK(THREADID threadIndex, CONTEXT *ctxt, SYSCALL_STANDARD std, VOID *v) |
Call-back function after execution of a system call.
[in] | threadIndex | The Pin thread ID of the thread that executed the system call. |
[in,out] | ctxt | Application's register state immediately after execution of the system call.The tool may change this and affect the new register state. |
[in] | std | The system calling standard. |
[in] | v | The tool's call-back value. |
PIN_CALLBACK LEVEL_PINCLIENT::PIN_AddSyscallEntryFunction | ( | SYSCALL_ENTRY_CALLBACK | fun, | |
VOID * | val | |||
) |
Register a notification function that is called immediately before execution of a system call.
[in] | fun | Function to be called immediately before execution of a system call. |
[in] | val | Value to pass to the function. |
PIN_CALLBACK LEVEL_PINCLIENT::PIN_AddSyscallExitFunction | ( | SYSCALL_EXIT_CALLBACK | fun, | |
VOID * | val | |||
) |
Register a notification function that is called immediately after execution of a system call.
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.
[in] | fun | Function to be called immediately after execution of a system call. |
[in] | val | Value to pass to the function. |
ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallArgument | ( | const CONTEXT * | ctxt, | |
SYSCALL_STANDARD | std, | |||
UINT32 | argNum | |||
) |
Get the value of the argument of the system call to be executed in the specified context.
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 SYSCALL_ENTRY_CALLBACK. 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.
[in] | ctxt | context before the system call execution |
[in] | std | system calling standard |
[in] | argNum | ordinal number of the argument whose value is requested. Ordinal numbers start from zero for the first argument |
ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallErrno | ( | const CONTEXT * | ctxt, | |
SYSCALL_STANDARD | std | |||
) |
Get the error code of the system call which is just returned with the specified context.
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 SYSCALL_EXIT_CALLBACK. Applying this function to an inappropriate context results in undefined behavior.
[in] | ctxt | context after the system call execution |
[in] | std | system calling standard |
ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallNumber | ( | const CONTEXT * | ctxt, | |
SYSCALL_STANDARD | std | |||
) |
Get the number (ID) of the system call to be executed in the specified context.
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 SYSCALL_ENTRY_CALLBACK, but not in a SYSCALL_EXIT_CALLBACK. Applying this function to an inappropriate context results in undefined behavior.
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 PIN_AddSyscallExitFunction ).
[in] | ctxt | context before the system call execution |
[in] | std | system calling standard |
ADDRINT LEVEL_PINCLIENT::PIN_GetSyscallReturn | ( | const CONTEXT * | ctxt, | |
SYSCALL_STANDARD | std | |||
) |
Get the return value of the system call which has just returned with the specified context.
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 SYSCALL_EXIT_CALLBACK. Applying this function to an inappropriate context results in undefined behavior.
[in] | ctxt | context after the system call execution |
[in] | std | system calling standard |
VOID LEVEL_PINCLIENT::PIN_SetSyscallArgument | ( | CONTEXT * | ctxt, | |
SYSCALL_STANDARD | std, | |||
UINT32 | argNum, | |||
ADDRINT | val | |||
) |
Set the given value for the argument of the system call to be executed in the specified context.
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 SYSCALL_ENTRY_CALLBACK. 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.
[in,out] | ctxt | context before the system call execution |
[in] | std | system calling standard |
[in] | argNum | ordinal number of the argument whose value is to be set. Ordinal numbers start from zero for the first argument |
[in] | val | new value of the argument |
VOID LEVEL_PINCLIENT::PIN_SetSyscallNumber | ( | CONTEXT * | ctxt, | |
SYSCALL_STANDARD | std, | |||
ADDRINT | val | |||
) |
Set the number (ID) of the system call to be executed in the specified context.
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 SYSCALL_ENTRY_CALLBACK. Applying this function to an inappropriate context results in undefined behavior.
[in] | ctxt | context before the system call execution |
[in] | std | system calling standard |
[in] | val | new system call number |