emu_env_linux.h

Go to the documentation of this file.
00001 /********************************************************************************
00002  *                               libemu
00003  *
00004  *                    - x86 shellcode emulation -
00005  *
00006  *
00007  * Copyright (C) 2007  Paul Baecher & Markus Koetter
00008  * 
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License
00011  * as published by the Free Software Foundation; either version 2
00012  * of the License, or (at your option) any later version.
00013  * 
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00022  * 
00023  * 
00024  *             contact nepenthesdev@users.sourceforge.net  
00025  *
00026  *******************************************************************************/
00027 
00028 #ifndef HAVE_EMU_ENV_LINUX_H
00029 #define HAVE_EMU_ENV_LINUX_H
00030 
00031 #include <stdlib.h>
00032 #include <string.h>
00033 #include <errno.h>
00034 
00035 #include "emu/emu.h"
00036 #include "emu/emu_cpu.h"
00037 #include "emu/emu_cpu_data.h"
00038 #include "emu/emu_memory.h"
00039 #include "emu/emu_hashtable.h"
00040 
00041 struct emu_profile;
00042 struct emu_env;
00043 
00044 struct emu_env_linux
00045 {
00046         struct emu *emu;
00047         struct emu_hashtable *syscall_hooks_by_name;
00048         struct emu_env_linux_syscall *syscall_hookx;
00049         struct emu_env_hook *hooks;
00050 //      struct emu_profile *profile;
00051 };
00052 
00053 struct emu_env_linux *emu_env_linux_new(struct emu *e);
00054 void emu_env_linux_free(struct emu_env_linux *eel);
00055 
00056 struct emu_env_hook *emu_env_linux_syscall_check(struct emu_env *env);
00057 
00058 
00059 struct emu_env_linux_syscall_entry
00060 {
00061         const char *name;
00062         const char *(*fnhook)(struct emu_env_linux *env);
00063 };
00064 
00065 
00066 typedef uint32_t (*userhook)(struct emu_env_linux *env, struct emu_env_linux_syscall *syscall, ...);
00067 
00068 struct emu_env_linux_syscall
00069 {
00070         const char *name;
00071         int32_t         (*fnhook)(struct emu_env *env, struct emu_env_hook *hook);
00072         void *userdata;
00073         uint32_t (*userhook)(struct emu_env *env, struct emu_env_hook *hook, ...);
00074 };
00075 
00076 int32_t emu_env_linux_syscall_hook(struct emu_env *env, const char *syscallname,
00077                                                                    uint32_t (*userhook)(struct emu_env *env, struct emu_env_hook *hook, ...),
00078                                                                    void *userdata);
00079 
00080 const char *env_linux_socketcall(struct emu_env_linux *env);
00081 
00082 #endif

Generated on Sun Jan 9 16:47:44 2011 for libemu by  doxygen 1.6.1