#include <inttypes.h>
Go to the source code of this file.
Enumerations | |
| enum | emu_reg32 { eax = 0, ecx, edx, ebx, esp, ebp, esi, edi } |
| enum | emu_reg16 { ax = 0, cx, dx, bx, sp, bp, si, di } |
| enum | emu_reg8 { al = 0, cl, dl, bl, ah, ch, dh, bh } |
Functions | |
| struct emu_cpu * | emu_cpu_new (struct emu *e) |
| uint32_t | emu_cpu_reg32_get (struct emu_cpu *cpu_p, enum emu_reg32 reg) |
| void | emu_cpu_reg32_set (struct emu_cpu *cpu_p, enum emu_reg32 reg, uint32_t val) |
| uint16_t | emu_cpu_reg16_get (struct emu_cpu *cpu_p, enum emu_reg16 reg) |
| void | emu_cpu_reg16_set (struct emu_cpu *cpu_p, enum emu_reg16 reg, uint16_t val) |
| uint8_t | emu_cpu_reg8_get (struct emu_cpu *cpu_p, enum emu_reg8 reg) |
| void | emu_cpu_reg8_set (struct emu_cpu *cpu_p, enum emu_reg8 reg, uint8_t val) |
| uint32_t | emu_cpu_eflags_get (struct emu_cpu *c) |
| void | emu_cpu_eflags_set (struct emu_cpu *c, uint32_t val) |
| void | emu_cpu_eip_set (struct emu_cpu *c, uint32_t eip) |
| uint32_t | emu_cpu_eip_get (struct emu_cpu *c) |
| int32_t | emu_cpu_parse (struct emu_cpu *c) |
| int32_t | emu_cpu_step (struct emu_cpu *c) |
| int32_t | emu_cpu_run (struct emu_cpu *c) |
| void | emu_cpu_free (struct emu_cpu *c) |
| void | emu_cpu_debug_print (struct emu_cpu *c) |
| void | emu_cpu_debugflag_set (struct emu_cpu *c, uint8_t flag) |
| void | emu_cpu_debugflag_unset (struct emu_cpu *c, uint8_t flag) |
| enum emu_reg16 |
| enum emu_reg32 |
| enum emu_reg8 |
| void emu_cpu_debug_print | ( | struct emu_cpu * | c | ) |
References CPU_FLAG_ISSET, eax, ebp, ebx, ecx, edi, edx, eflagm, emu_cpu::eip, emu_cpu::emu, emu_memory_read_dword(), esi, esp, logDebug, emu_cpu::mem, and emu_cpu::reg.

| void emu_cpu_debugflag_set | ( | struct emu_cpu * | c, | |
| uint8_t | flag | |||
| ) |
References CPU_DEBUG_FLAG_SET.
| void emu_cpu_debugflag_unset | ( | struct emu_cpu * | c, | |
| uint8_t | flag | |||
| ) |
References CPU_DEBUG_FLAG_UNSET.
| uint32_t emu_cpu_eflags_get | ( | struct emu_cpu * | c | ) |
References emu_cpu::eflags.
| void emu_cpu_eflags_set | ( | struct emu_cpu * | c, | |
| uint32_t | val | |||
| ) |
References emu_cpu::eflags.
Referenced by emu_shellcode_run_and_track(), and emu_shellcode_test().
| uint32_t emu_cpu_eip_get | ( | struct emu_cpu * | c | ) |
get the cpu's EIP
| c | the cpu |
References emu_cpu::eip.
Referenced by emu_env_w32_eip_check(), and emu_shellcode_run_and_track().
| void emu_cpu_eip_set | ( | struct emu_cpu * | c, | |
| uint32_t | eip | |||
| ) |
Set the cpu's EIP
| c | the cpu | |
| eip | eip |
References emu_cpu::eip, and emu_cpu::repeat_current_instr.
Referenced by emu_getpc_check(), emu_shellcode_run_and_track(), emu_shellcode_test(), emu_source_instruction_graph_create(), 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().
| void emu_cpu_free | ( | struct emu_cpu * | c | ) |
References emu_cpu::instr_string.
Referenced by emu_free().
References emu_memory_get(), init_prefix_map(), and logDebug.
Referenced by emu_new().

| int32_t emu_cpu_parse | ( | struct emu_cpu * | c | ) |
parse a instruction at EIP
| c | the cpu |
References emu_instruction::cpu, CPU_DEBUG_FLAG_ISSET, emu_cpu::cpu_instr_info, dasm_print_instruction(), emu_cpu_instruction::disp, emu_cpu_instruction_info::disp_data, emu_fpu_instruction::ea, emu_cpu_instruction::ea, ebp, emu_tracking_info::eflags, emu_cpu::eip, emu_cpu::emu, emu_errno_set(), emu_memory_read_block(), emu_memory_read_byte(), emu_memory_read_dword(), emu_memory_read_word(), emu_strerror_set(), emu_cpu_instruction_info::format, emu_instruction::fpu, emu_tracking_info::fpu, emu_fpu_instruction::fpu_data, emu_cpu_instruction_info::fpu_info, FPU_MOD, FPU_RM, emu_cpu_instruction_info::function, emu_instruction::has_cond_pos, II_DISP16, II_DISP32, II_DISP8, II_DISPF, II_IMM, II_IMM16, II_IMM32, II_IMM8, II_MOD_REG_RM, II_MOD_YYY_RM, ii_onebyte, ii_twobyte, II_XX_REG1_REG2, emu_cpu_instruction::imm, emu_cpu_instruction::imm16, emu_cpu_instruction::imm8, emu_cpu_instruction_info::imm_data, emu_instruction::init, emu_cpu::instr, emu_cpu::instr_string, instruction_size, instruction_string, emu_instruction::is_fpu, emu_cpu::last_fpu_instr, logDebug, emu_cpu::mem, emu_cpu_instruction::mod, emu_cpu_instruction::modrm, emu_cpu_instruction_info::modrm_byte, MODRM_MOD, MODRM_REGOPC, MODRM_RM, emu_instruction::need, emu_cpu_instruction::opc, emu_instruction::opc, emu_cpu_instruction::opc_2nd, emu_cpu_instruction::operand_size, OPSIZE_16, OPSIZE_32, OPSIZE_8, prefix_fn(), prefix_map, PREFIX_OPSIZE, emu_fpu_instruction::prefixes, emu_cpu_instruction::prefixes, emu_instruction::prefixes, emu_cpu::reg, emu_tracking_info::reg, emu_cpu::repeat_current_instr, emu_cpu_instruction::rm, emu_cpu_instruction::s_bit, scalem, emu_cpu_instruction::sib, SIB_BASE, SIB_INDEX, SIB_SCALE, emu_instruction::source, SOURCE_NORM_POS, emu_instruction::track, TRACK_NEED_REG32, emu_cpu_instruction_info::type, emu_cpu_instruction_info::w_bit, and emu_cpu_instruction::w_bit.
Referenced by emu_cpu_run(), emu_getpc_check(), emu_shellcode_run_and_track(), and emu_source_instruction_graph_create().

References emu_cpu::reg16.
References emu_cpu::reg16.
References emu_cpu::reg.
Referenced by emu_getpc_check().
References emu_cpu::reg.
Referenced by emu_getpc_check(), emu_shellcode_run_and_track(), emu_shellcode_test(), env_linux_hook_dup2(), env_linux_hook_exit(), env_linux_hook_fork(), env_linux_hook_socketcall(), 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_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().
References emu_cpu::reg8.
References emu_cpu::reg8.
| int32_t emu_cpu_run | ( | struct emu_cpu * | c | ) |
| int32_t emu_cpu_step | ( | struct emu_cpu * | c | ) |
step the last instruction
| c | the cpu |
References emu_instruction::cpu, emu_cpu::cpu_instr_info, debug_instruction(), emu_fpu_instruction::ea, emu_memory_segment_select(), emu_instruction::fpu, emu_fpu_instruction::fpu_data, emu_cpu_instruction_info::function, emu_cpu::instr, emu_instruction::is_fpu, emu_cpu::last_fpu_instr, emu_cpu::mem, MEM_DWORD_WRITE, PREFIX_FS_OVR, emu_cpu_instruction::prefixes, s_cs, s_fs, TRACK_FPU_LAST_INSTRUCTION, TRACK_INIT_FPU, and TRACK_NEED_FPU.
Referenced by emu_cpu_run(), emu_getpc_check(), emu_shellcode_run_and_track(), and emu_source_instruction_graph_create().

1.6.1