emu_cpu.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef HAVE_EMU_CPU_H
00029 #define HAVE_EMU_CPU_H
00030
00031 #include <inttypes.h>
00032
00033 struct emu;
00034 struct emu_cpu;
00035
00036 enum emu_reg32 {
00037 eax = 0, ecx, edx, ebx, esp, ebp, esi, edi
00038 };
00039
00040
00041 enum emu_reg16
00042 {
00043 ax = 0,
00044 cx,
00045 dx,
00046 bx,
00047 sp,
00048 bp,
00049 si,
00050 di
00051
00052 };
00053
00054
00055 enum emu_reg8
00056 {
00057 al=0,
00058 cl,
00059 dl,
00060 bl,
00061 ah,
00062 ch,
00063 dh,
00064 bh
00065
00066 };
00067
00068 struct emu_cpu *emu_cpu_new(struct emu *e);
00069
00070 uint32_t emu_cpu_reg32_get(struct emu_cpu *cpu_p, enum emu_reg32 reg);
00071 void emu_cpu_reg32_set(struct emu_cpu *cpu_p, enum emu_reg32 reg, uint32_t val);
00072
00073 uint16_t emu_cpu_reg16_get(struct emu_cpu *cpu_p, enum emu_reg16 reg);
00074 void emu_cpu_reg16_set(struct emu_cpu *cpu_p, enum emu_reg16 reg, uint16_t val);
00075
00076 uint8_t emu_cpu_reg8_get(struct emu_cpu *cpu_p, enum emu_reg8 reg);
00077 void emu_cpu_reg8_set(struct emu_cpu *cpu_p, enum emu_reg8 reg, uint8_t val);
00078
00079 uint32_t emu_cpu_eflags_get(struct emu_cpu *c);
00080 void emu_cpu_eflags_set(struct emu_cpu *c, uint32_t val);
00081
00088 void emu_cpu_eip_set(struct emu_cpu *c, uint32_t eip);
00089
00097 uint32_t emu_cpu_eip_get(struct emu_cpu *c);
00098
00099
00108 int32_t emu_cpu_parse(struct emu_cpu *c);
00109
00118 int32_t emu_cpu_step(struct emu_cpu *c);
00119
00120 int32_t emu_cpu_run(struct emu_cpu *c);
00121
00122 void emu_cpu_free(struct emu_cpu *c);
00123
00124 void emu_cpu_debug_print(struct emu_cpu *c);
00125
00126 void emu_cpu_debugflag_set(struct emu_cpu *c, uint8_t flag);
00127 void emu_cpu_debugflag_unset(struct emu_cpu *c, uint8_t flag);
00128
00129
00130 #endif