Add support for stdio.h, stdlib.h, and String.h

GSoC/Meterpreter_Web_Console
Wei Chen 2018-05-17 14:40:49 -05:00
parent ee805fd1ff
commit e5c763f6bf
4 changed files with 104 additions and 2 deletions

View File

@ -0,0 +1,23 @@
void *memchr(const void*, int, size_t);
int memcmp(const void*, const void*, size_t);
void *memcpy(void*, const void*, size_t);
void *memmove(void*, const void*, size_t);
void *memset(void*, int, size_t);
char *strcat(char*, const char*);
char *strncat(char*, const char*, size_t);
char *strchr(const char*, int);
int strcmp(const char*, const char*);
int strncmp(const char*, const char*, size_t);
int strcoll(const char*, const char*);
char *strcpy(char*, const char*);
char *strncpy(char*, const char*, size_t);
size_t strcspn(const char*, const char*);
char *strerror(int);
size_t strlen(const char*);
char *strpbrk(const char*, const char*);
char *strrchr(const char*, int);
size_t strspn(const char*, const char*);
char *strstr(const char*, const char*);
char *strtok(char*, const char*);
size_t strxfrm(char*, const char*, size_t);

View File

@ -0,0 +1,35 @@
FILE* popen(const char*, const char*);
int pclose(FILE*);
int fscanf(FILE*, const char*, ...);
int scanf(const char*, ...);
int sscanf(const char*, const char*, ...);
int vfscanf(FILE*, const char*, va_list);
int vsscanf(const char*, const char*, va_list);
int fclose(FILE*);
void clearerr(FILE*);
int feof(FILE*);
int ferror(FILE*);
int fflush(FILE*);
int fgetpos(FILE*, fpos_t*);
FILE *fopen(const char*, const char*);
size_t fread(void*, size_t, size_t, FILE*);
FILE *freopen(const char*, const char*, FILE*);
int fseek(FILE*, long int, int);
int fsetpos(FILE*, const fpos_t*);
long int ftell(FILE*);
size_t fwrite(const void*, size_t, size_t, FILE*);
int remove(const char*);
int rename(const char*, const char*);
void rewind(FILE*);
void setbuf(FILE*, char*);
int setvbuf(FILE*, char*, int, size_t);
FILE *tmpfile(void);
char *tmpnam(char*);
int fprintf(FILE*, const char*, ...);
int printf(const char*, ...);
int sprintf(char*, const char*, ...);
int vfprintf(FILE*, const char*, va_list);
int vsprintf(char*, const char*, va_list);
int vsnprintf(char*, size_t, const char*, va_list);
int vasprintf(char**, const char*, va_list);
int vdprintf(int, const char*, va_list);

View File

@ -0,0 +1,41 @@
typedef struct _div_t {
int quot;
int rem;
} div_t;
typedef struct _ldiv_t {
long quot;
long rem;
} ldiv_t;
typedef struct _lldiv_t {
long long quot;
long long rem;
} lldiv_t;
int rand(void);
void srand(unsigned);
void* malloc(size_t);
void* realloc(void*, size_t);
void free(void*);
double atof(const char*);
double strtod(const char*, char**);
float strtof(const char*, char**);
long int strtol(const char*, char**, int);
long double strtold(const char*, char**);
int atoi(const char*);
void abort(void);
void exit(int);
int atexit(void (*function)(void));
char* getenv(const char*);
int setenv(const char*, const char*, int);
int putenv(char*);
int unsetenv(const char*);
void *bsearch(const void*, const void*, size_t, size_t, int (*compar)(const void*, const void*));
void qsort(void*, size_t, size_t, int (*compar)(const void*, const void*));
int abs(int);
int mblen(const char*, size_t);
int system(const char*);
long int labs(long int);
div_t div(int, int);
ldiv_t ldiv(long int, long int);

View File

@ -15,8 +15,11 @@ module Metasploit
super
@headers_path = File.join(Msf::Config.install_root, 'data', 'headers', 'windows')
@lib_dep_map = {
'stddef.h' => [],
'Windows.h' => ['stddef.h']
'stddef.h' => [],
'Windows.h' => ['stddef.h'],
'stdlib.h' => ['stddef.h'],
'stdio.h' => ['stddef.h'],
'String.h' => ['stddef.h']
}
end