Log in

View Full Version : Can the TC command stop when excute a given instruction?


achan
July 21st, 2005, 06:41
It is the same word that when excute a given instruction ,
such as jmp xxxxxxxx ,
the ollydbg should stop before excution.

or some other command can implement the function?


joe
July 21st, 2005, 10:45
If I understand, You think concrete jump. There are some way how to do it:
1. Go to xxxxxxxx address, right click -> Find references to -> Address constants
2. Go to jmp xxxxxxxx instruction, right click -> Find references to -> Jump destination
3. Go to call xxxxxxxx instruction, right click -> Find references to -> Call destination
Then right click (in references window) -> Set breakpoint on every command
May be there are any other method.

blabberer
July 21st, 2005, 11:41
if you want ollydbg to stop on any and every unconditional jumps
right click search for all commands
type jmp const
click find
you will get another window full of jumps
right click
set break point on every command


btw the search for all commands all sequences are very powerfull if you use them properly

assuming you want to break on this sequence

like
jmp some where
some commands in between
then a call register

all you have to do is

right click
search for all sequences

type
jmp const
any 8
call r32
and hit find
ollydbg will get you all such sequnces in another mdi window

like this

004353F0 JMP SHORT 00435448
004353F2 PUSH ESP
004353F3 PUSH 4B6F03
004353F8 PUSH 0
004353FA CALL NEAR ESI


2

00435603 JMP 0043576D
00435608 OR EDI, FFFFFFFF
0043560B XOR EAX, EAX
0043560D MOV DWORD PTR SS:[ESP+18], EAX
00435611 XOR EBX, EBX
00435613 PUSH 2
00435615 CALL NEAR EBP

achan
July 22nd, 2005, 06:04
Thanks for your help~

I have a another question.
If one instruction executed followed by the follow 2 instructions sequence
push xxxxxxxx
|- ret ; I want to interupt here
| .......
|->push ebp ; But I just know the addresss of this instruction(The above instruction ret return to here.)

How can I implement it ?

What is the meaning of "any const"?
Const is between 1 and 8.

blabberer
July 22nd, 2005, 10:28
i did not understand you
do you mean you want to find the specific retn that comes to your push ebp ??

if yes select the line push ebp and hit ctrl+r
ollydbg will show you all the commands that leads you to this push ebp

References in ***** to 00401006
Address Disassembly Comment
00401006 PUSH 0 (Initial CPU selection)
00401275 PUSH 401006



0040126F PUSH 401275
00401274 RETN ; RET used as a jump to 00401275
00401275 PUSH 401006
0040127A RETN ; RET used as a jump to 00401006

get the help file out and read through it


To skip up to n ambiguous commands, use construct ANY n. If you expect up to 2 intermediate commands in the header of the procedure, use

PUSH EBP

ANY 2

MOV EBP,ESP,

and possible search pattern in the second case is, for example,

LEA RB,[4*RA+RA]

ANY

LEA R32,[4*RB+RB]

arjuns
July 22nd, 2005, 11:43
I think his porblem is such
how to stop or pause the running ollydbg when it is about to perform a specified instruction.
for example,
stop olly when eax contains 123456

gabri3l
July 22nd, 2005, 17:44
If that is what he is asking then he needs to use the "Set Condition" option.

Use the Debug menu ->Set condition
In there you can set many conditions for your trace.

For example:
[x] Condition is True: Eax == 123456
-Will stop when eax contains 123456

or

[x] Command is One Of:
Push Eax
-Will stop when Push Eax is being executed

and as oh me anon mentioned, if you know how to use the variables in Olly you get much more power. You can also use CONST to take the place of any constant. For example:

[x] Command is One Of:
jmp CONST
-Will break when command being executed is: JMP program.xxxxxxxx

Once you set your conditions go ahead and choose Trace Into from the Debug menu to start your trace.

achan
July 25th, 2005, 07:31
As oh me anon said,
I have tried the oparation,but I can't get the result as you give out.
I think the command of ctrl + r can't find reference by push const
so how can I find that reference ?


if yes select the line push ebp and hit ctrl+r
ollydbg will show you all the commands that leads you to this push ebp

References in ***** to 00401006
Address Disassembly Comment
00401006 PUSH 0 (Initial CPU selection)
00401275 PUSH 401006



0040126F PUSH 401275
00401274 RETN ; RET used as a jump to 00401275
00401275 PUSH 401006
0040127A RETN ; RET used as a jump to 00401006

blabberer
July 25th, 2005, 09:34
ctrl+r is a keyboard shortcut it doesnt take arguments
if you want to find all push const retn
then use search for -->all sequences
type push const
retn and hit find
if they are there they all will be shown
if you dont get it
1) they are not there
2) the code may be self modifying
3) may be stuffed into resource section and used only if some conditions are met
4) might be in some dll and may be using virtual alloc read and all other
unholy tricks
5) may be using some othere yet to be documented ingeniune freaky 0day ideas probably

and you are really not making sense yet of what your requirement is.

what result you are imagining ollydbg will show you ??
and why ollydbg is breaking your dreams ?? i am not able to understand