Skip to content

A simple novel approach to memory only emulation

Notifications You must be signed in to change notification settings

oopsmishap/memulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memulator

memulator logo

A simple novel approach to memory only emulation, the main benifit of this approach is that it is very fast and can be used to emulate large programs with minimal overhead. However it is not a complete solution and will not work for all samples and is not intended to be a replacement for traditional emulation.

A good use case for this as can be seen in the examples is to emulate and extract xor encoded strings, this is a very common anti-analysis technique.

This is a work in progress however the current implementation is functional with surprisingly good performance.

How it works

You would first use Capstone to disassemble the binary or regions you wish to emulate as a list of instructions. Memulator will then emulate each instruction and track the memory state.

You are able to hook pre and post instructions with full Memulator context to perform additional analysis or logging.

def collect_strings(cls: Memulator, inst: CsInsn):
    global strings
    tmp = cls.get_operand_value(inst.operands[0])
    string = tmp.to_bytes(inst.operands[0].size, 'little')
    strings.append((inst.address, string))


emu.add_post_instruction_hook('pxor', collect_strings)

See the examples directory for further usage.

About

A simple novel approach to memory only emulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages