pylibemu icon indicating copy to clipboard operation
pylibemu copied to clipboard

method implementation request

Open cperdana opened this issue 12 years ago • 0 comments

Hi, This is requesting to add new method to class Emulator. These method will allow me execute shellcode without depending on test(steps) function.

def create_new_env(self):
    self._env = emu_env_new(self._emu)
    self._env.profile = emu_profile_new()


def env_linux_syscall_check_using_class_env(self):
    if self._env is NULL:
        print emu_strerror(self._emu)
        raise RuntimeError('Emulator environment error')

    #  hook = emu_env_linux_syscall_check(_env)
    if emu_env_linux_syscall_check(self._env) is NULL:
        return False

    return True

With above method, the shellcode can be emulate as follow:

    emu.create_new_env()

    for x in range (12):
        if emu.env_w32_hook_check_using_class_env() == True:
            print " eip is a hook function",
        else:
            emu.cpu_debugflag_set(1)
            ret = emu.cpu_parse()
            emu.cpu_debugflag_unset(1)
            if ret != -1:
                instr = emu.cpu_get_cpu_instr_string()
                print instr

                emu.cpu_step()
            else:
                x = "break"

cperdana avatar Aug 03 '12 03:08 cperdana