Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Functions | Variables
cfi_check.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/user.h>
#include <sys/ptrace.h>
#include <inttypes.h>
#include <signal.h>
#include <argp.h>
#include "log.h"
#include "dwdebug.h"
#include "target_api.h"
#include "target.h"
#include "probe_api.h"
#include "probe.h"
#include "alist.h"
#include "list.h"
#include "cfi.h"
Include dependency graph for cfi_check.c:

Go to the source code of this file.

Data Structures

struct  cc_argp_state
 

Functions

void cleanup_probes (void)
 
void sigh_cleanup_probes (int signo, siginfo_t *siginfo, void *x)
 
result_t cfi_handler (struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
 
void cfi_check_print_final_results (struct probe *probe)
 
error_t cc_argp_parse_opt (int key, char *arg, struct argp_state *state)
 
int main (int argc, char **argv)
 

Variables

struct targettarget = NULL
 
struct targetotarget = NULL
 
struct probecfi_probe = NULL
 
struct cc_argp_state opts
 
struct argp_option cc_argp_opts []
 
struct argp cc_argp
 

Function Documentation

error_t cc_argp_parse_opt ( int  key,
char *  arg,
struct argp_state *  state 
)

Definition at line 168 of file cfi_check.c.

void cfi_check_print_final_results ( struct probe probe)

Definition at line 102 of file cfi_check.c.

result_t cfi_handler ( struct probe probe,
tid_t  tid,
void *  data,
struct probe trigger,
struct probe base 
)

Definition at line 63 of file cfi_check.c.

void cleanup_probes ( void  )

Definition at line 50 of file cfi_check.c.

int main ( int  argc,
char **  argv 
)

Definition at line 317 of file cfi_check.c.

void sigh_cleanup_probes ( int  signo,
siginfo_t *  siginfo,
void *  x 
)

Definition at line 59 of file cfi_check.c.

Variable Documentation

struct argp cc_argp
Initial value:
= {
cc_argp_opts,cc_argp_parse_opt,NULL,NULL,NULL,NULL,NULL,
}
struct argp_option cc_argp_opts[]
Definition: cfi_check.c:156
error_t cc_argp_parse_opt(int key, char *arg, struct argp_state *state)
Definition: cfi_check.c:168

Definition at line 313 of file cfi_check.c.

struct argp_option cc_argp_opts[]
Initial value:
= {
{ "overlay",'V',"<name_or_id>:<spec_opts>",0,"Lookup name or id as an overlay target once the main target is instantiated, and try to open it. All spec_opts (normal target/dwdebug opts) then apply to the overlay target.",0 },
{ "mode",'M',"dynamic|static",0,"Set the CFI mode (only dynamic now).",-3 },
{ "no-autofollow",'N',NULL,0,
"Do not add functions to the CFI checked set.",-3 },
{ "no-singlestep-unknown",'S',NULL,0,
"Don't singlestep unknown areas in the target.",-3 },
{ "fix-stack",'f',NULL,0,
"Fix the stack before a RET that would violate CFI.",-3 },
{ 0,0,0,0,0,0 },
}

Definition at line 156 of file cfi_check.c.

struct probe* cfi_probe = NULL

Definition at line 46 of file cfi_check.c.

struct cc_argp_state opts

Definition at line 154 of file cfi_check.c.

struct target* otarget = NULL

Definition at line 45 of file cfi_check.c.

struct target* target = NULL

Definition at line 44 of file cfi_check.c.