'Take a snapshot of current process
Warning: this is not thread safe, do not use with multithread program
Returns:
- dictionary of snapshot data'

def take_snapshot(self):

    if (not self.getpid()):
        return None
    maps = self.get_vmmap()
    if (not maps):
        return None
    snapshot = {}
    snapshot['reg'] = self.getregs()
    snapshot['mem'] = {}
    for (start, end, perm, _) in maps:
        if ('w' in perm):
            snapshot['mem'][start] = self.dumpmem(start, end)
    return snapshot
