Permalink
Browse files

export cpu_reg32_get and cpu_step

  • Loading branch information...
1 parent 2ba98b0 commit 1ae9edfd47299c7d30a88f48ed9d2700c1a66942 @rep rep committed Apr 6, 2012
Showing with 204 additions and 2 deletions.
  1. +185 −2 src/pylibemu.c
  2. +1 −0 src/pylibemu.pxd
  3. +18 −0 src/pylibemu.pyx
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -203,6 +203,7 @@ cdef extern from "emu/emu_cpu.h":
edi = 7
void emu_cpu_reg32_set(c_emu_cpu *cpu_p, c_emu_reg32 reg, uint32_t val)
+ uint32_t emu_cpu_reg32_get(c_emu_cpu *cpu_p, c_emu_reg32 reg)
void emu_cpu_eflags_set(c_emu_cpu *c, uint32_t val)
void emu_cpu_eip_set(c_emu_cpu *c, uint32_t eip)
uint32_t emu_cpu_eip_get(c_emu_cpu *c)
View
@@ -618,5 +618,23 @@ cdef class Emulator:
emu_cpu_reg32_set(_cpu, reg, val)
return 0
+
+ def cpu_reg32_get(self, reg):
+ cdef c_emu_cpu *_cpu
+
+ if self._emu is NULL:
+ return -1
+
+ _cpu = emu_cpu_get(self._emu)
+
+ val = emu_cpu_reg32_get(_cpu, reg)
+
+ return val
+
+ def cpu_step(self):
+ if self._emu is NULL:
+ return -1
+ return emu_cpu_step(emu_cpu_get(self._emu))
+

0 comments on commit 1ae9edf

Please sign in to comment.