Commit e027637a authored by LE BON Camille's avatar LE BON Camille
Browse files

Modify the README accordingly

parent 33ccfd51
......@@ -24,7 +24,7 @@ use nix::sys::wait::*;
use sorry::*;
use sorry::buffer::Buffer;
use sorry::codecache::CodeCache;
use sorry::buffer::codecache::CodeCache;
use sorry::error::Error;
fn main() {
......@@ -32,16 +32,16 @@ fn main() {
let args = vec![executable.clone()];
let mut target = TargetProcess::new(executable, args);
let start_res = target.start().map( |_| () );
target.start().map( |_| () );
let set_brk_res = target.get_controller()
target.get_controller()
.set_breakpoint(0x401126, move |ctrl, _| ctrl.load_map_file() );
let resume_res = target.get_controller().resume(false);
let wait_res = target.wait(None);
let new_res = CodeCache::new(target.get_controller().clone(), 100);
target.get_controller().resume(false);
target.wait(None);
CodeCache::new(target.get_controller().clone(), 100);
let res = new_res.map( |mut cc| {
new_res.map( |mut cc| {
// mov $42, %edi
// mov $60, %rax
// syscall
......@@ -51,9 +51,9 @@ fn main() {
0x0f, 0x05
];
let write_res = cc.write(exit42, 0);
cc.write(exit42, 0);
let do_res = target.controller_do( |ctrl| {
target.controller_do( |ctrl| {
let mut regs = ctrl.get_registers()?;
regs.rax = cc.get_offset() as u64;
......@@ -67,7 +67,7 @@ fn main() {
Ok(())
});
let res = target.wait(None);
target.wait(None);
});
}
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment