Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-04-2005, 02:35
lilmeanman
 
Posts: n/a
Question Quick OllyDbg Question

Hello everyone! I'm using OllyDbg 1.10 to crack "Mail Server Pro v1.5" and I have a quick question:

Code:
004B0454  /. 55             PUSH EBP
004B0455  |. 8BEC           MOV EBP,ESP
004B0457  |. 83C4 E0        ADD ESP,-20
004B045A  |. 53             PUSH EBX
004B045B  |. 33C9           XOR ECX,ECX
004B045D  |. 894D E0        MOV DWORD PTR SS:[EBP-20],ECX
004B0460  |. 894D E8        MOV DWORD PTR SS:[EBP-18],ECX
004B0463  |. 894D E4        MOV DWORD PTR SS:[EBP-1C],ECX
004B0466  |. 8955 F8        MOV DWORD PTR SS:[EBP-8],EDX
004B0469  |. 8945 FC        MOV DWORD PTR SS:[EBP-4],EAX
004B046C  |. 33C0           XOR EAX,EAX
004B046E  |. 55             PUSH EBP
004B046F  |. 68 4C054B00    PUSH SMTP_ser.004B054C
004B0474  |. 64:FF30        PUSH DWORD PTR FS:[EAX]
004B0477  |. 64:8920        MOV DWORD PTR FS:[EAX],ESP
004B047A  |. B8 60054B00    MOV EAX,SMTP_ser.004B0560                ;  ASCII "<!>"
004B047F  |. 8945 EC        MOV DWORD PTR SS:[EBP-14],EAX
004B0482  |. B8 6C054B00    MOV EAX,SMTP_ser.004B056C                ;  ASCII "CMD=Register"
The above code is called when a valid key is not found in the registry, However I cannot figure out where in the hell the code is Jumped or Returned from.
For example, after it goes through all the serial checking etc, it's either got to Jump to that code or Return to the code. Is there a way of tracing back?
Reply With Quote
  #2  
Old 06-04-2005, 03:34
gabri3l's Avatar
gabri3l gabri3l is offline
Parity Error 0x0FF2131D
 
Join Date: Aug 2003
Location: Eastern Shore
Posts: 118
Rept. Given: 0
Rept. Rcvd 5 Times in 1 Post
Thanks Given: 8
Thanks Rcvd at 21 Times in 10 Posts
gabri3l Reputation: 5
If you set a BP on
Code:
004B0454  /. 55             PUSH EBP
And run until you break, Then the address that called this function "should" be on the top of the stack.

I have also found that sometimes w32dasm can find the referenced calls or jumps to functions that sometimes Olly cannot.
__________________
-=RETIRED=--=http://cracking.accessroot.com=--=RETIRED=-
Reply With Quote
  #3  
Old 06-04-2005, 09:54
ricnar456 ricnar456 is offline
Friend
 
Join Date: May 2002
Posts: 290
Rept. Given: 1
Rept. Rcvd 28 Times in 10 Posts
Thanks Given: 0
Thanks Rcvd at 52 Times in 40 Posts
ricnar456 Reputation: 28
or mark 4b0454 and right click FIND REFERENCES TO-SELECTED COMMAND, and show you the direct references (if was called from CALL EAX o JMP EDI or similar by example, only with a method of Grabiel, putting a BP and looking in the top of the stack you can get the reference)

Ricardo Narvaja
Reply With Quote
  #4  
Old 06-04-2005, 13:26
SLV SLV is offline
Friend
 
Join Date: May 2005
Posts: 62
Rept. Given: 3
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 5
Thanks Rcvd at 2 Times in 2 Posts
SLV Reputation: 4
> sometimes w32dasm can find the referenced calls or jumps to functions
or IDA may make x-refs...
Reply With Quote
  #5  
Old 06-04-2005, 18:23
codeX codeX is offline
{RES} Cracker
 
Join Date: Dec 2004
Location: C:\WINDOWS\SYSTEM32
Posts: 162
Rept. Given: 1
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 3
Thanks Rcvd at 1 Time in 1 Post
codeX Reputation: 0
Hi lilmeanman,

I'm not sure that i've understand you well.

But put bp on 004B0454 and when it breaks change the PUSH EBP to RETN to goback to the CALL.

Regards...
Reply With Quote
  #6  
Old 06-04-2005, 18:57
Naides Naides is offline
Friend
 
Join Date: Mar 2005
Location: Planet Earth
Posts: 40
Rept. Given: 7
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 21
Thanks Rcvd at 10 Times in 7 Posts
Naides Reputation: 2
One Possibility is that the call to your code is generated dynamically at runtime, something like:

call [EAX +50]

under those circumnstances disassembly listings from WDASM or IDA cannot cross reference the caller code. You need to see it in live tracing. . .

One very useful resource is the call stack window. In SoftIce type: WS. In Olly: View -> Call Stack (Alt-K)

You will see a list of addresses with modules: A called B that Called C that Called D that called your code. The actual addresses you see in the list are the return address, which is the next instruction after the call was made.

By placing breakpoints or examining the code around each call you will be able to locate, at each deeper layer, the chain of events that resulted on calling your "bad boy" "key not found" routine.

One problem: If there is one or more Structured Exception Handlers (SEH) frames set up during the chain of calls (CALL STACK) the order of call and return may change, depending on an exception being generated and handled, so the flow of the code stack is not as linear as I described, but it "branches".

Hope I did not confuse you more.
Reply With Quote
  #7  
Old 06-04-2005, 19:24
hosiminh hosiminh is offline
Friend
 
Join Date: Aug 2004
Posts: 202
Rept. Given: 2
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 0
Thanks Rcvd at 4 Times in 4 Posts
hosiminh Reputation: 1
in CPU Window right click -> Search for -> All commands -> call 004B0454
Reply With Quote
  #8  
Old 06-04-2005, 23:48
MaRKuS-DJM's Avatar
MaRKuS-DJM MaRKuS-DJM is offline
Cracker + Unpacker
 
Join Date: Aug 2003
Location: Virtual World / Network
Posts: 553
Rept. Given: 7
Rept. Rcvd 6 Times in 4 Posts
Thanks Given: 3
Thanks Rcvd at 16 Times in 10 Posts
MaRKuS-DJM Reputation: 6
maybe it's worth to mention: a jump in the form of [XXXXXXXX*X*EAX] can't be found the way you described.
Reply With Quote
  #9  
Old 06-06-2005, 08:13
Naides Naides is offline
Friend
 
Join Date: Mar 2005
Location: Planet Earth
Posts: 40
Rept. Given: 7
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 21
Thanks Rcvd at 10 Times in 7 Posts
Naides Reputation: 2
Quote:
Originally Posted by MaRKuS-DJM
maybe it's worth to mention: a jump in the form of [XXXXXXXX*X*EAX] can't be found the way you described.
That is correct Markus, jump instructions do not leave a "trail" in the stack, so there is no simple way to backtrace them, only forward tracing will do, EXCEPT if you use a debugging tool whose link was posted by, I think Nikola. this debugger allows forward and backward LIVE tracing.
It apparently keeps a record track of the instruction path taking by the code, allowing you to backtrace to an arbitrary number of instructions.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OllyDbg + Registry question sTfN0X General Discussion 4 07-12-2004 19:18
PELOCK Question again--.w.--Ollydbg boya General Discussion 0 06-10-2004 12:38
OllyDbg question butter General Discussion 2 05-07-2004 10:30
Quick sice question mical General Discussion 3 09-16-2003 02:06


All times are GMT +8. The time now is 16:26.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )