Innocent
August 14th, 2004, 19:19
Ok I have been studying some things in Olly and now I want to make an automated script. I know exactly what I want to do but I just don't know how to do it. I have read the entire readme list of functions but I am still stumped. This is what I want to do:
1. I arrive on a line like this: 02563E40 CMP DWORD PTR SS:[EBP-F20],2
I want to change the memory at DWORD PTR SS:[EBP-F20] to 1. In Olly I can easily just right click on the eip and select follow in dump-> memory address and change it by hand. Can I do this with a script?
2. I arrive at a line after some tracing. I want to get the address of the line I am on i.e. 02564127. Once I have this, I want to set a breakpoint so many bytes after this line: 02564127+1400 bytes. The syntax would be something like this I suppose:
declare variables:
var addr
var const
var bpline
mov const, 1400 // make the variable const equal to 1400 bytes
1. get address of eip and save it in var addr: mov addr, eip // addr = current eip
2. add address of eip to constant value.
Something like: add addr, const
3. move the result of the add into variable bpline and set a bp there:
mov bpline, addr // bpline = addr
bp bpline
EDIT: I figured out how to do number 2 but I still don't know how to change the memory in #1.
This is all I need really... Hope someone can help
1. I arrive on a line like this: 02563E40 CMP DWORD PTR SS:[EBP-F20],2
I want to change the memory at DWORD PTR SS:[EBP-F20] to 1. In Olly I can easily just right click on the eip and select follow in dump-> memory address and change it by hand. Can I do this with a script?
2. I arrive at a line after some tracing. I want to get the address of the line I am on i.e. 02564127. Once I have this, I want to set a breakpoint so many bytes after this line: 02564127+1400 bytes. The syntax would be something like this I suppose:
declare variables:
var addr
var const
var bpline
mov const, 1400 // make the variable const equal to 1400 bytes
1. get address of eip and save it in var addr: mov addr, eip // addr = current eip
2. add address of eip to constant value.
Something like: add addr, const
3. move the result of the add into variable bpline and set a bp there:
mov bpline, addr // bpline = addr
bp bpline
EDIT: I figured out how to do number 2 but I still don't know how to change the memory in #1.
This is all I need really... Hope someone can help
