'Set known string at `addr`, which will be optionally be null-terminated
Note that this method is a bit dumb about how it handles the data.
It will null-terminate the data, but it will not stop at the first null.
Examples:
>>> l = MemLeak(lambda x: \'\')
>>> l.cache == {}
True
>>> l.sets(0, \'H\x00ello\')
>>> l.cache == {0: \'H\', 1: \'\x00\', 2: \'e\', 3: \'l\', 4: \'l\', 5: \'o\', 6: \'\x00\'}
True'

def sets(self, addr, val, null_terminate=True):

    if null_terminate:
        val += '\x00'
    for (i, b) in enumerate(val):
        self.cache[(addr + i)] = b
