Skip to content

Commit

Permalink
emudbg: make sections editable
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyg committed Sep 21, 2020
1 parent 27dc126 commit b4ed001
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metasm/os/emulator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ def attach(disassembler)
@breakpoint = {}
@breakpoint_memory = {}
@breakpoint_thread = {}
make_sections_editable
@cpu.initialize_emudbg(self) if @cpu.respond_to?(:initialize_emudbg)
end

def make_sections_editable
# load dasm sections content as strings to allow nonpersistant modifications (would raise with a readonly VirtualFile object)
@disassembler.sections.each_value { |edata| edata.data = edata.data.to_str if edata.data.length < 1024*1024 }
end

def detach
end

Expand Down

0 comments on commit b4ed001

Please sign in to comment.