Skip to content

Instantly share code, notes, and snippets.

@dtouch3d
Created September 2, 2016 23:44
Show Gist options
  • Save dtouch3d/56453fa123eb72974167b69161ab3623 to your computer and use it in GitHub Desktop.
Save dtouch3d/56453fa123eb72974167b69161ab3623 to your computer and use it in GitHub Desktop.
import angr
import analysis
class MemoryWrite(analysis.Analysis):
def __init__(self, option):
super(MemoryWrite, self).__init__(option)
self.mem_write_check()
def mem_write_check(self):
print("[+] Initializing memory write analysis")
def write_addr_check(state):
write_addr = state.inspect.mem_write_address
print(state.ip)
for var in write_addr.variables:
if "file_" in var:
print("Mem write @ {} using {} for dst".format(state.ip, var))
state = self.start_state
state.inspect.b('mem_write', action=write_addr_check)
path_group = self.project.factory.path_group(state)
while len(path_group.active) > 0:
path_group.step()
angr.register_analysis(MemoryWrite, "MemoryWrite")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment