Created
April 14, 2016 04:59
-
-
Save amastov/97bc3aca3181174cd4731fc45a2995c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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