emu.c File Reference

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "emu/emu.h"
#include "emu/emu_log.h"
#include "emu/emu_memory.h"
#include "emu/emu_cpu.h"
Include dependency graph for emu.c:

Classes

struct  emu

Functions

struct emuemu_new (void)
void emu_free (struct emu *e)
struct emu_memoryemu_memory_get (struct emu *e)
struct emu_loggingemu_logging_get (struct emu *e)
struct emu_cpuemu_cpu_get (struct emu *e)
void emu_errno_set (struct emu *e, int err)
int emu_errno (struct emu *c)
void emu_strerror_set (struct emu *e, const char *format,...)
const char * emu_strerror (struct emu *e)

Function Documentation

struct emu_cpu* emu_cpu_get ( struct emu e  )  [read]

Retrieve a pointer to the emu's emu_cpu

Parameters:
e the emu
Returns:
pointer to the emu's emu_cpu.

References emu::cpu.

Referenced by emu_env_linux_syscall_check(), emu_env_w32_eip_check(), emu_getpc_check(), emu_shellcode_run_and_track(), emu_shellcode_test(), emu_source_instruction_graph_create(), emu_track_instruction_check(), env_linux_hook_dup2(), env_linux_hook_execve(), env_linux_hook_exit(), env_linux_hook_fork(), env_linux_hook_socketcall(), env_linux_socketcall(), env_w32_hook__execv(), env_w32_hook__lclose(), env_w32_hook__lcreat(), env_w32_hook__lwrite(), env_w32_hook_accept(), env_w32_hook_bind(), env_w32_hook_CloseHandle(), env_w32_hook_closesocket(), env_w32_hook_connect(), env_w32_hook_CreateFileA(), env_w32_hook_CreateProcessA(), env_w32_hook_DeleteFileA(), env_w32_hook_ExitProcess(), env_w32_hook_ExitThread(), env_w32_hook_fclose(), env_w32_hook_fopen(), env_w32_hook_fwrite(), env_w32_hook_GetProcAddress(), env_w32_hook_GetSystemDirectoryA(), env_w32_hook_GetTempPathA(), env_w32_hook_GetTickCount(), env_w32_hook_GetVersion(), env_w32_hook_listen(), env_w32_hook_LoadLibrayA(), env_w32_hook_malloc(), env_w32_hook_memset(), env_w32_hook_recv(), env_w32_hook_send(), env_w32_hook_sendto(), env_w32_hook_SetUnhandledExceptionFilter(), env_w32_hook_Sleep(), env_w32_hook_socket(), env_w32_hook_URLDownloadToFileA(), env_w32_hook_VirtualProtect(), env_w32_hook_WaitForSingleObject(), env_w32_hook_WinExec(), env_w32_hook_WriteFile(), env_w32_hook_WSASocketA(), and env_w32_hook_WSAStartup().

int emu_errno ( struct emu c  ) 

Retrieve the emu's errno

Parameters:
c the emu
Returns:
the emu's errno

References emu::errno.

Referenced by emu_shellcode_run_and_track().

void emu_errno_set ( struct emu e,
int  err 
)

Set the emu's internal errno

Parameters:
e the emu
err 

References emu::errno.

Referenced by emu_cpu_parse(), emu_memory_read_block(), emu_memory_read_byte(), and page_alloc().

void emu_free ( struct emu e  ) 

Free the emu

Parameters:
e the emu to free

References emu_cpu_free(), emu_log_free(), emu_memory_free(), and logDebug.

Here is the call graph for this function:

struct emu_logging* emu_logging_get ( struct emu e  )  [read]

Retrieve a pointer to the emu's logging facility.

Parameters:
e the emu
Returns:
pointer to the emu's emu_logging.

References emu::log.

Referenced by emu_log().

struct emu_memory* emu_memory_get ( struct emu e  )  [read]
struct emu* emu_new ( void   )  [read]

Create a new emu.

Returns:
on success: the new emu on failure: NULL

References emu::cpu, emu_cpu_new(), emu_log_new(), emu_memory_new(), emu::log, logDebug, and emu::memory.

Here is the call graph for this function:

const char* emu_strerror ( struct emu e  ) 

Retrieve the emu's strerror

Parameters:
e the emu
Returns:
the strerror

References emu::errorstr.

void emu_strerror_set ( struct emu e,
const char *  format,
  ... 
)

Set the emu's strerror message.

Parameters:
e the emu
format the errormessage format

References emu::errorstr.

Referenced by emu_cpu_parse(), emu_memory_read_block(), emu_memory_read_byte(), and page_alloc().


Generated on Sun Jan 9 16:49:01 2011 for libemu by  doxygen 1.6.1