Skip to content

Instantly share code, notes, and snippets.

@amastov
Created April 14, 2016 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amastov/97bc3aca3181174cd4731fc45a2995c6 to your computer and use it in GitHub Desktop.
Save amastov/97bc3aca3181174cd4731fc45a2995c6 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define __NR_sys_get_addr 360
struct data
{
int aval;
long address;
};
int main(int argc, char* argv[])
{
if(argc == 3)
{
struct data* pointer;
// argv[1] is the pid
// argv[2] is the virtual memory address
syscall(__NR_sys_get_addr, pointer, atoi(argv[1]), atol(argv[2]))
// Output data
if(pointer->aval == 1)
{
}
else if(pointer->aval == 2)
{
}
else
{
printf("not available\n");
}
}
else
{
printf("ERROR: Two Arguments expected! Number of Arguments:%d", (argc - 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment